microsoft / autogen

A programming framework for agentic AI 🤖
https://microsoft.github.io/autogen/
Creative Commons Attribution 4.0 International
34.65k stars 5.01k forks source link

If anyone is trying to use Azure via Github Models #4292

Closed curiosityz closed 21 hours ago

curiosityz commented 1 day ago

This is what worked for me:

async def main() -> None:

Define an agent

weather_agent = AssistantAgent(
    name="weather_agent",
    model_client=AzureOpenAIChatCompletionClient(
model="gpt-4o",
api_version="2024-02-01",
azure_endpoint="https://models.inference.ai.azure.com",
model_capabilities={
    "vision":True,
    "function_calling":True,
    "json_output":True,
}

), tools=[get_weather], )Image

jackgerrits commented 21 hours ago

Good callout! OpenAI models on the models marketplace on GitHub support the OpenAI api, so it seems like the azure openai client also works.