mirror of
https://github.com/microsoft/autogen.git
synced 2025-07-27 10:50:06 +00:00
21 lines
506 B
Python
21 lines
506 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_model_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())
|