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
- GitHub - guidance-ai/guidance: A guidance language for controlling large language models.github.com
- GitHub - deepset-ai/haystack: Open-source AI orchestration framework for building context-engineered, production-ready LLM applications. Design modular pipelines and agent workflows with explicit control over retrieval, routing, memory, and generation. Built for scalable agents, RAG, multimodal applications, semantic search, and conversational systems.github.com
- LLM Evaluation doesn't need to be complicatedphilschmid.de
- GitHub - brexhq/prompt-engineering: Tips and tricks for working with Large Language Models like OpenAI's GPT-4.github.com
- Cookbookcookbook.openai.com
- GitHub - rasbt/LLMs-from-scratch: Implement a ChatGPT-like LLM in PyTorch from scratch, step by stepgithub.com
- Building Effective AI Agents \ Anthropicanthropic.com
- Prompt engineering | OpenAI APIplatform.openai.com
- LangChain Tutorial in Python - Crash Course - Python Engineerpython-engineer.com
- Introductions - Jason Liujxnl.co
- The Problem With LangChain | Max Woolf's Blogminimaxir.com
- Text Classification with OpenAI and Pydantic - Instructorpython.useinstructor.com