Рет қаралды 367
StrictJSON is a python package I created last year in order to parse LLM outputs in a structured format (JSON), with optional type checking!
How to use?
Simply type in a system prompt (what the LLM should do), user prompt (the input to the LLM), and the output_format (the JSON format which you want the output to be in).
It is configurable to use your own LLMs with the llm parameter, be it other APIs like Claude 3 Haiku, or local LLMs like Llama 3 70B. So far, performance has been reliable even for non-OpenAI LLMs.
Here, I show how to use StrictJSON for:
- Simple entity extraction, classification, summarisation
- Knowledge graph parsing and displaying
- Code generation and error correction
- Changing code based on user intent
- Type Checking
- Using your own LLM
- Chain of Thought
- Reflection
- Evaluate Math with Code
- Extract rule-based filters from user text
- Conditional Flow using Multiple Chains of StrictJSON
~~
Repo: github.com/tanchongmin/strict...
Companion Notebook: github.com/tanchongmin/strict...
~~
0:00 Introduction
2:17 Basic Stuff: Classification, Poem Extender
4:35 List/Array Output
5:47 Entity Extraction
12:40 Knowledge Graph Parser
13:52 Knowledge Graph Code Display
15:44 Code Error Correction
25:07 Changing Code Based on User Intent
28:53 Type Checking
37:36 Using your own LLM
47:07 Chain of Thought
52:17 TaskGen Agent Teaser
56:36 Paragraph Extractor
1:03:38 Reflection
1:12:27 Evaluate Math with Code
1:18:29 Extract rule-based filters from user text
1:21:25 Conditional Flow using Multiple Chains of StrictJSON
~~
AI and ML enthusiast. Likes to think about the essences behind breakthroughs of AI and explain it in a simple and relatable way. Also, I am an avid game creator.
Discord: / discord
LinkedIn: / chong-min-tan-94652288
Online AI blog: delvingintotech.wordpress.com/
Twitter: / johntanchongmin
Try out my games here: simmer.io/@chongmin