StrictJSON (LLM Output Parser) Ask Me Anything #1

Поділитися
Вставка
  • Опубліковано 15 січ 2025

КОМЕНТАРІ • 14

  • @Karl-Asger
    @Karl-Asger 8 місяців тому +1

    Amazing work John, I hope I can be part of future meetings, I love the points that you are most focused on in these developments.

  • @ginisksam
    @ginisksam 8 місяців тому +1

    Hi John. Thanks for this package. Can be very powerful and flexible by adding more 'stuff' within the output_format like 'Thoughts', 'Reflection', etc. Will explore further, its so refreshing. BTW I have hooked up to Ollama API running local. Keep up the good work.

    • @johntanchongmin
      @johntanchongmin  8 місяців тому

      Hope you like it :)

    • @ginisksam
      @ginisksam 8 місяців тому

      Hi @@johntanchongmin
      Having this error
      ...
      An exception occurred: "Broad Trip Plan" not in json string output. You must use "###{key}###" to enclose the {key}.
      Current invalid json format: {...
      When using local llm. What is the likely cause. Look fwd to your kind guidance. Cheers

    • @johntanchongmin
      @johntanchongmin  8 місяців тому

      @@ginisksam Local LLMs are likely not as good at instruction following. I'll be releasing a patch in a few days. Meanwhile you can add this line to your system prompt:
      "Begin your response with {{ and end with }}"

    • @johntanchongmin
      @johntanchongmin  8 місяців тому

      @@ginisksam Could you also show me the invalid json format?

    • @ginisksam
      @ginisksam 8 місяців тому

      @@johntanchongmin Here is snippet running cell below from strictjson_AMA...ipynb
      res2 = strict_json(system_prompt = '''Given the triplet list, write some code to display this as a Knowledge Graph''',
      user_prompt = triplet_list,
      output_format = {'Code': 'Code in Python to display knowledge graph from triplet list'},
      llm=llm)
      Error:
      An exception occurred: list index out of range
      Current invalid json format: {
      "'###Code###': "
      "import networkx as nx
      "
      "from networkx.drawing.nx_agraph import write_dot
      "
      "from itertools import permutations
      "
      "
      "
      "triplets = [{
      "
      "'obj1': 'LLM', 'relationship': 'provides', 'obj2': 'Base Functionalities'},
      "
      "'obj1': 'Tutorial.ipynb', 'relationship': 'refers to', 'obj2': 'Base Functionalities'},
      "
      "'obj1': 'int, float, str, dict, list', 'relationship': 'supports', 'obj2': 'Base Functionalities'},
      "
      "'obj1': 'Dict[], List[], Enum[]', 'relationship': 'supported by', 'obj2': 'Base Functionalities'},
      "
      "'obj1': 'bool type forcing', 'relationship': 'handled by', 'obj2': 'Base Functionalities'},
      "
      "'obj1': 'LLM-based error correction', 'relationship': 'used for', 'obj2': 'Base Functionalities'},
      "
      "'obj1': 'Function (renamed from strict_function)', 'relationship': 'available in', 'obj2': 'Base Functionalities'},
      "
      "'obj1': 'OpenAI JSON Mode', 'relationship': 'enabled by', 'obj2': 'Base Functionalities'},
      "
      "'obj1': 'llm variable', 'relationship': 'exposed for', 'obj2': 'strict_json, Function'}
      "
      "]
      "
      "
      "
      "# Create a graph
      "
      "G = nx.DiGraph()
      "
      "
      "
      "# Add nodes and edges from triplets
      "
      "for obj1, rel, obj2 in triplets:
      "
      " G.add_edge(obj1, obj2, relationship=rel)
      "
      ...
      Thanks for your continous guidance.

  • @johntanchongmin
    @johntanchongmin  8 місяців тому +1

    Companion Notebook for this Tutorial: github.com/tanchongmin/strictjson/blob/main/strictjson_AMA_30Apr2024.ipynb

  • @johntanchongmin
    @johntanchongmin  8 місяців тому +1

    Repo Link: github.com/tanchongmin/strictjson

  • @snehotoshbanerjee1938
    @snehotoshbanerjee1938 6 місяців тому

    Cool!

  • @tharunbhaskar6795
    @tharunbhaskar6795 3 місяці тому

    Where are these live streams conducted?

    • @johntanchongmin
      @johntanchongmin  3 місяці тому +1

      Usually on zoom. For details, go to my discord.

    • @tharunbhaskar6795
      @tharunbhaskar6795 3 місяці тому

      @@johntanchongmin thanks. joined the discord channel