jxnl/instructor: openai function calls for humans
github.com · 717 words · saved by 1 readers
openai function calls for humans
Get reliable JSON from any LLM. Built on Pydantic for validation, type safety, and IDE support. import instructor from pydantic import BaseModel # Define what you want class User(BaseModel): name: str age: int # Extract it from natural language client = instructor.from_provider("openai/gpt-4o-mini") user = client.chat.completions.create( response_model=User, messages=[{"role": "user", "content": "John is 25 years old"}], ) print(user) # User(name='John', age=25) That's it. No JSON parsing, no error handling, no retries. Just define a model and get structured data. Use Instructor for…
saved by
related reading
- GPT-4o doesn't consistently respect JSON schema on tool usecommunity.openai.com
- Unstructured Data Platform for GenAI | Unstructuredunstructured.io
- PromptLayer — Prompt Management, Evals & Observabilitypromptlayer.com
- Advanced AI Workflow Automation Software & Tools - n8nn8n.io
- OpenAI | Research & Deploymentopenai.com
- Cookbookcookbook.openai.com
- Parsed | Custom, interpretable AI systems that continuously learnparsed.com
- Prompt generation | OpenAI APIplatform.openai.com
- The Shape of AI | UX Patterns for Artificial Intelligence Designshapeof.ai
- LangChain: the open agent platform to own your intelligencelangchain.com
- BAMLboundaryml.com
- GitHub - brexhq/prompt-engineering: Tips and tricks for working with Large Language Models like OpenAI's GPT-4.github.com