Overview
Defining an Agent
from djangosdk.agents.base import Agent
from djangosdk.providers.schemas import ReasoningConfig
class MyAgent(Agent):
provider = "openai" # From AI_SDK.PROVIDERS
model = "gpt-4.1"
system_prompt = "You are a helpful assistant."
temperature = 0.7 # Default: 0.7
max_tokens = 2048 # Default: 2048
enable_cache = True # Enable prompt caching
max_tool_iterations = 10 # Max tool-call rounds per turn
tools = [] # List of @tool functions or BaseTool instances
reasoning = None # ReasoningConfig for reasoning models
mcp_servers = [] # MCP server configs (Phase 2)Calling an Agent
Synchronous
Asynchronous
Streaming
Agent Response
Mixin Composition
Mixin
Adds
Default Provider / Model
Using Multiple Agents Together
Last updated
Was this helpful?