Skip to content

Conversation

@DavertMik
Copy link

@DavertMik DavertMik commented Nov 2, 2025

Hi, thanks for intelligence gem!

I use it on our production system and this is the best LLM framework for Ruby
Good to see intelligence is evolving!

I would like to share the pieces I made for my fork

For our enterprise customer I added Azure OpenAI integration
Unfortunately, I don't have access to Azure OpenAI myself but I pair-tested it with client and it worked.

Added:

Enterprise Authentication Support

  • OAuth 2.0 client credentials flow using tenant ID, client ID, and client secret
  • Automatic access token fetching and renewal
  • Bearer token authentication for Azure OpenAI endpoints

Proper Azure OpenAI Endpoint Implementation

  • Correct URL structure: https://{endpoint}/openai/deployments/{model}/chat/completions?api-version={version}
  • Model name moved from request body to URL path (Azure OpenAI requirement)
  • Enhanced schema with Azure-specific properties

Dual Authentication Methods

  • Primary: Enterprise OAuth 2.0 (recommended for production)
  • Fallback: API key authentication (preserves existing functionality)

DavertMik added 3 commits November 2, 2025 16:59
Add OAuth 2.0 client credentials flow for Azure AD authentication while maintaining backward compatibility with API key authentication.

Key changes:
- Add tenant_id, client_id, client_secret schema properties
- Implement fetch_azure_access_token for OAuth 2.0 flow
- Update endpoint format to proper Azure OpenAI deployment structure
- Dual authentication: enterprise OAuth (primary) + API key (fallback)
- Model name moved from request body to URL path per Azure requirements

This enables enterprise-grade authentication for production environments while preserving existing API key functionality.
- Update default API version to 2024-10-21 (latest GA release)
- Update example model from gpt-4o to gpt-5
@DavertMik DavertMik mentioned this pull request Nov 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant