Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Azure and Ollama APIs, let open for more APIs #330

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

YunQiAI
Copy link

@YunQiAI YunQiAI commented Mar 25, 2025

Overview

This PR extends the OpenAI Agents SDK to support multiple model providers, including Azure OpenAI and local Ollama models. It marks a key step toward making the platform truly "open" and adaptable for different environments.

What's New

Azure OpenAI Support

  • Full integration with Azure API
  • Most examples work as expected
  • Limitation: Azure’s Responses API is not yet supported
  • Configuration supports endpoint, API key, version, and deployment name

Example:

azure_settings = ModelSettings(
    provider="azure_openai",
    azure_endpoint="https://your-resource-name.openai.azure.com",
    azure_api_key="your-azure-api-key",
    azure_api_version="2024-02-15-preview",
    azure_deployment="your-deployment-name"
)

agent = Agent(
    name="AzureAssistant",
    instructions="You are a helpful assistant running on Azure.",
    model_settings=azure_settings
)

response = agent.run("What's the weather like in Tokyo today?")
print(response)

Ollama Local Model Support

  • Basic support for local model inference
  • Works with agent creation, simple tool calls, and streaming
  • Includes example scripts and error handling

Framework Enhancements

  • ModelSettings extended for provider-specific options
  • ModelProviderFactory enables dynamic backend selection
  • Adapter layer added for unified API response handling

Limitations

  • Azure: No Responses API yet
  • Ollama:
    • Handoff not fully implemented
    • Limited complex tool support
    • Streaming could be more stable

Future Plans

  • Add support for AWS Bedrock, Anthropic, Google Vertex AI, etc.
  • Improve cross-provider tool compatibility
  • Extend streaming support and examples

Community Collaboration

This project openAPI-agents-python is also being developed independently. Community contributions are welcome—let’s work together to support more APIs and make the platform more versatile and robust.

Copy link

github-actions bot commented Apr 5, 2025

This PR is stale because it has been open for 10 days with no activity.

@github-actions github-actions bot added the stale label Apr 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant