mirror of
https://github.com/microsoft/autogen.git
synced 2025-07-25 18:01:03 +00:00

* More improvements for component config * clean output * working dir * fix fstring * key error * remove mv
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()) |