mirror of
https://github.com/microsoft/autogen.git
synced 2026-04-20 03:02:16 -04:00
Agent factory can be async (#247)
This commit is contained in:
@@ -130,7 +130,7 @@ async def main() -> None:
|
||||
)
|
||||
]
|
||||
# Register agents.
|
||||
tool_agent = runtime.register_and_get(
|
||||
tool_agent = await runtime.register_and_get(
|
||||
"tool_enabled_agent",
|
||||
lambda: ToolEnabledAgent(
|
||||
description="Tool Use Agent",
|
||||
|
||||
@@ -191,8 +191,8 @@ async def main() -> None:
|
||||
)
|
||||
]
|
||||
# Register agents.
|
||||
runtime.register("tool_executor", lambda: ToolExecutorAgent("Tool Executor", tools))
|
||||
runtime.register(
|
||||
await runtime.register("tool_executor", lambda: ToolExecutorAgent("Tool Executor", tools))
|
||||
await runtime.register(
|
||||
"tool_use_agent",
|
||||
lambda: ToolUseAgent(
|
||||
description="Tool Use Agent",
|
||||
|
||||
@@ -32,7 +32,7 @@ async def main() -> None:
|
||||
# Create the runtime.
|
||||
runtime = SingleThreadedAgentRuntime()
|
||||
# Register agents.
|
||||
tool_agent = runtime.register_and_get(
|
||||
tool_agent = await runtime.register_and_get(
|
||||
"tool_enabled_agent",
|
||||
lambda: ToolEnabledAgent(
|
||||
description="Tool Use Agent",
|
||||
|
||||
Reference in New Issue
Block a user