NEW PROJ: autogen agent with magneticOne
This commit is contained in:
parent
fc02a7f3dd
commit
431bb6fc48
3 changed files with 19 additions and 0 deletions
16
ai_agent_tutorials/ai_magenticag2_agent/main.py
Normal file
16
ai_agent_tutorials/ai_magenticag2_agent/main.py
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import asyncio
|
||||
from autogen_ext.models.openai import OpenAIChatCompletionClient
|
||||
from autogen_ext.teams.magentic_one import MagenticOne
|
||||
from autogen_agentchat.ui import Console
|
||||
|
||||
|
||||
async def example_usage():
|
||||
client = OpenAIChatCompletionClient(model="gpt-4o", api_key="")
|
||||
m1 = MagenticOne(client=client)
|
||||
task = "Write a Python script to fetch data from an API."
|
||||
result = await Console(m1.run_stream(task=task))
|
||||
print(result)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(example_usage())
|
||||
3
ai_agent_tutorials/ai_magenticag2_agent/requirements.txt
Normal file
3
ai_agent_tutorials/ai_magenticag2_agent/requirements.txt
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
autogen-agentchat
|
||||
autogen-ext
|
||||
playwright install --with-deps chromium
|
||||
0
ai_agent_tutorials/ai_magenticag2_agent/test.py
Normal file
0
ai_agent_tutorials/ai_magenticag2_agent/test.py
Normal file
Loading…
Reference in a new issue