create_agent_sync#
Understand request ownership, phases, and runtime limits. See the guide.
- zett_agent.sync.create_agent_sync(model, *, config=None, system_prompt='You are a helpful assistant.', tools=(), extensions=None, reasoning_effort=ReasoningEffort.MEDIUM, parallel_tool_call=True, max_iterations=36, max_internal_messages=8, event_dispatcher=None, runtime=None)[源代码]#
Create a synchronous Agent with the same options as create_agent.
示例
No asyncio.run() or await is needed:
with create_agent_sync(model) as agent: print(agent.run("Hello").content)
- 参数:
model (AgentModel)
config (AgentRunConfig | None)
system_prompt (str)
tools (Sequence[AgentTool])
extensions (Sequence[AgentExtension] | None)
reasoning_effort (ReasoningEffort)
parallel_tool_call (bool)
max_iterations (int)
max_internal_messages (int)
event_dispatcher (AgentEventDispatcher | None)
runtime (SyncRuntime | None)
- 返回类型: