You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support Anthropic Client in AutoGen v0.4
Expected behaviour below
fromdotenvimportload_dotenvimportosload_dotenv()
fromautogen_agentchat.agentsimportAssistantAgentfromautogen_agentchat.uiimportConsolefromautogen_ext.models.openaiimportOpenAIChatCompletionClientfromautogen_ext.models.anthropicimportAnthropicChatCompletionClientmodel_client=AnthropicChatCompletionClient(
model="claude-3-7-sonnet-20250219"
)
asyncdefget_weather(city: str) ->str:
"""Get the weather for a given city."""returnf"The weather in {city} is 73 degrees and Sunny."agent=AssistantAgent(
name="weather_agent",
model_client=model_client,
tools=[get_weather],
system_message="You are a helpful assistant.",
# model_client_stream=True,
)
# Run the agent and stream the messages to the console.asyncdefmain() ->None:
awaitConsole(agent.run_stream(task="What is the weather in New York?"))
awaitmain()
The text was updated successfully, but these errors were encountered:
Support Anthropic Client in AutoGen v0.4
Expected behaviour below
The text was updated successfully, but these errors were encountered: