Topic
Function Calling in Python
13 posts on function calling in python — part of api integration on the n4n AI blog.
Testing function calling logic in Python with pytest
Learn how to build reliable tests for LLM tool-use code with pytest, isolating function-calling logic from model responses in Python step by step.
Streaming function calls with the Python OpenAI SDK
Learn how to implement streaming function calls with the Python OpenAI SDK: accumulate tool call deltas, execute functions, and stream multi-turn agent responses.
Python function calling with instructor and Pydantic
Hands-on tutorial for python instructor pydantic function calling: build structured LLM tool calls with Pydantic models and dispatch to real functions.
Python function calling with Claude via the Messages API
Step-by-step tutorial for implementing python claude messages api function calling with the Anthropic SDK, from tool schema to multi-turn tool result loops.
Parsing function call arguments safely in Python
Step-by-step approach to parsing function call arguments python safely: validate JSON, handle errors, and bind LLM outputs to typed functions.
Multi-tool function calling in Python with GPT-4o
Hands-on Python tutorial for multi-tool function calling with GPT-4o: define schemas, run parallel tool calls, and merge results correctly.
Function calling with LangChain and Python: a walkthrough
Hands-on langchain python function calling walkthrough: define tools, bind them to ChatOpenAI, execute calls, and return results with runnable code.
Error handling for OpenAI function calls in Python
Practical patterns for error handling OpenAI function calls Python: catch API failures, validate arguments, retry safely, and recover from model mistakes.
Building a weather tool with OpenAI function calling
Step-by-step Python tutorial for a weather tool using OpenAI function calling: define schema, call API, execute function, and stream responses.
Using Pydantic to define OpenAI function calling schemas
Define OpenAI tool schemas from Python types using Pydantic to avoid JSON Schema drift, with runnable steps for generation, calling, and validation.
Python function calling with n4n.ai's chat completions API
Hands-on Python tutorial for function calling with the n4n.ai API: define tools, parse model responses, execute local functions, and handle errors.
Function calling with the OpenAI Python SDK: a tutorial
Hands-on openai python sdk function calling tutorial: define tools, parse model emissions, execute local functions, and handle errors in Python.
Async function calling in Python with openai-python
Learn how to implement async function calling in Python with openai-python: define tools, run concurrent tool calls, and verify the loop end to end.
More topics in api integration
- Function Calling Fundamentals27
- Structured Outputs & JSON Mode19
- cURL LLM API Cookbook15
- Integrating GPT-5, Claude Opus 4.8, Gemini 3, Llama 4 & More via One API15
- Next.js AI Chat Integration (App Router + Vercel AI SDK)15
- FastAPI LLM Backend Integration14
- Go net/http LLM API Client14
- LangChain + OpenAI-Compatible Gateway Integration14
- Node.js OpenAI-Compatible SDK Integration14
- Python + OpenAI-Compatible SDK Integration14
- Rate Limits, Retries & Backoff Strategies14
- React Streaming Chat UI Patterns14