Key guides
Build an agent– install the package and craft your first generation.Tools & tool loop– declare tools and control the orchestration loop.Structured outputs– validate responses withstructuredOutputand theOutputhelpers.Real-time streaming– consume tokens on the fly and supervise live generations.Shared runtime– store binary resources and expose them to your tools.
Best practices
- Override
systemper call to adapt instructions without reinstantiating the agent. - Tune
maxOutputTokens,temperature,topP, and more directly ingenerateorstream. - Compose specialised agents (drafting, validation, summarisation) to cover an entire flow.
- Combine agents with workflows to orchestrate richer decision loops.