mirror of
https://github.com/microsoft/autogen.git
synced 2025-07-31 21:02:33 +00:00

* logprobs openai support * remove print statement * Update _types.py * Update _openai_client.py * empty commit to run checks * fix teamone examples subscription * update sample usage --------- Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com> Co-authored-by: Jack Gerrits <jackgerrits@users.noreply.github.com> Co-authored-by: Jack Gerrits <jack@jackgerrits.com>
35 lines
1.1 KiB
Python
35 lines
1.1 KiB
Python
import os
|
|
|
|
from agnext.components import DefaultSubscription
|
|
from agnext.components.models import AzureOpenAIChatCompletionClient
|
|
from agnext.core import AgentRuntime
|
|
from auditor import AuditAgent
|
|
from graphic_designer import GraphicDesignerAgent
|
|
from openai import AsyncAzureOpenAI
|
|
|
|
|
|
async def build_app(runtime: AgentRuntime) -> None:
|
|
chat_client = AzureOpenAIChatCompletionClient(
|
|
model="gpt-4-32",
|
|
azure_endpoint=os.environ["CHAT_ENDPOINT"],
|
|
api_version="2024-02-01",
|
|
model_capabilities={
|
|
"vision": True,
|
|
"function_calling": True,
|
|
"json_output": True,
|
|
},
|
|
api_key=os.environ["CHAT_ENDPOINT_KEY"],
|
|
)
|
|
|
|
image_client = AsyncAzureOpenAI(
|
|
azure_endpoint=os.environ["IMAGE_ENDPOINT"],
|
|
azure_deployment="dall-e-3",
|
|
api_key=os.environ["IMAGE_ENDPOINT_KEY"],
|
|
api_version="2024-02-01",
|
|
)
|
|
|
|
await runtime.register(
|
|
"GraphicDesigner", lambda: GraphicDesignerAgent(client=image_client), lambda: [DefaultSubscription()]
|
|
)
|
|
await runtime.register("Auditor", lambda: AuditAgent(model_client=chat_client), lambda: [DefaultSubscription()])
|