SDK Tutorials
A collection of step-by-step guides designed to take you from basic usage to advanced agentic patterns. Each lesson introduces one new concept.
1. Basic Usage
Initialize the client and make a basic streaming request.
2. System Messages
Guide the AI's personality and behavior with system prompts.
3. Model Selection
Switch between different models (Google, OpenAI, etc.).
4. Media Messages
Send images to multimodal (vision) models.
5. Multi-turn Chat
Build an interactive chat by maintaining conversation history.
6. Parameter Control
Control creativity and output with parameters like `temperature`.
7. Guaranteed JSON Output
Force guaranteed, parsable JSON output from the model.
8. Basic Tool Usage
Enable models to use tools with the high-level `.run()` agent.
9. Advanced Parallel Tools
Make multiple, concurrent tool calls for complex queries.
10. Structured Extraction
Use a tool's schema to extract structured data from text.
11. Multi-Turn Clarification
Build an agent that asks clarifying questions before using a tool.
12. Parallel Extraction
A powerful pattern for extracting multiple items in a single pass.
13. Automated Token Management
Persist refreshed authentication tokens automatically for seamless long-term operation.
14. Observability & Error Handling
Build resilient apps with event listeners and structured error handling.
15. The Manual Tool-Use Loop
Deconstruct the `.run()` agent to gain full control over the tool-use flow.
16. Forcing Tool Usage
Make agent behavior more reliable by forcing the model to use a tool.
17. Multimodal Agents
Build agents that can see and act by combining vision with tool use.
18. Dynamic Tool Selection
Create efficient agents by selecting relevant tools based on the prompt.
19. Using the Task API
Use the specialized Task API for non-chat interactions.
20. Advanced Code Generation
Use prefix and suffix to generate code in the middle of a file.
21. Task API Observability
Listen to streaming events to observe task execution.
22. Chaining Task and Chat APIs
Combine Task and Chat APIs for complex workflows.