studio.create_agent() with customizable LLM providers, roles, and features.
Quick Start
Function Signature
Parameters
Required Parameters
| Parameter | Type | Description |
|---|---|---|
name | str | Agent name (1-200 characters) |
Core Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
provider | str | None | LLM provider and model. Examples: "gpt-4o", "claude-sonnet-4.5", "openai/gpt-4o" |
role | str | None | Agent’s role or persona (e.g., “Customer support agent”) |
goal | str | None | Agent’s primary objective (e.g., “Help users resolve issues”) |
instructions | str | None | Detailed instructions for agent behavior |
description | str | None | Agent description (max 1000 characters) |
Model Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
temperature | float | 0.7 | Creativity/randomness (0.0-2.0). Lower = more focused, higher = more creative |
top_p | float | 0.9 | Nucleus sampling (0.0-1.0). Controls diversity of responses |
additional_model_params | dict | None | Additional provider-specific model parameters |
Feature Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
response_model | BaseModel | None | Pydantic model for structured outputs |
memory | int | None | Number of messages to remember (1-50) |
contexts | List[Context] | None | Background information contexts |
rai_policy | RAIPolicy | None | Responsible AI policy for guardrails |
file_output | bool | False | Enable file generation (PDF, DOCX, etc.) |
image_model | ImageModelConfig | None | Image generation model configuration |
Evaluation Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
reflection | bool | False | Enable self-reflection to reduce hallucinations |
bias_check | bool | False | Enable bias detection in responses |
llm_judge | bool | False | Enable third-party LLM to evaluate responses |
groundedness_facts | List[str] | None | Facts for response validation |
Advanced Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
llm_credential_id | str | Auto | Custom credential ID for LLM (from Studio UI) |
Examples
Basic Agent
Agent with Custom Temperature
Agent with Structured Output
Agent with Memory
Agent with Contexts
Agent with RAI Policy
Agent with File Output
Agent with Image Generation
Agent with Reflection
Agent with Groundedness
Agent with Custom Credentials
Provider Formats
You can specify providers in two formats:Short Format
The ADK auto-resolves the provider:Full Format
Explicitly specify the provider:Return Value
Returns anAgent object with methods like:
run()- Execute the agentupdate()- Update configurationdelete()- Delete the agentclone()- Clone the agentadd_tool()- Add a local tooladd_memory()- Add memoryadd_context()- Add contextadd_rai_policy()- Add RAI policy