mirror of
https://github.com/microsoft/autogen.git
synced 2025-08-23 08:02:05 +00:00
22 lines
517 B
Python
22 lines
517 B
Python
from autogen_core.components.models import LLMMessage
|
|
from autogen_core.models import ChatCompletionClient
|
|
from autogen_core.models import UserMessage
|
|
|
|
client = ChatCompletionClient.load_component(
|
|
{
|
|
"provider": "openai_chat_completion_client",
|
|
"config": {
|
|
"model": "gpt-4o"
|
|
}
|
|
}
|
|
)
|
|
|
|
# async def main():
|
|
# print(await client.create([UserMessage(source="user", content="Hello")]))
|
|
|
|
# import asyncio
|
|
|
|
# asyncio.run(main())
|
|
|
|
print(client.dump_component().model_dump_json())
|