Skip to content

Implement embeddings for the Azure OpenAI provider - #725

Open
pcbeingused333 wants to merge 1 commit into
activeagents:mainfrom
pcbeingused333:fix/azure-embed-execute
Open

pcbeingused333 wants to merge 1 commit into
activeagents:mainfrom
pcbeingused333:fix/azure-embed-execute

Conversation

@pcbeingused333

Copy link
Copy Markdown
Contributor

AzureProvider declares embed_request_type, so embed builds the request, but it never defines api_embed_execute. The base implementation raises NotImplementedError, which is not a StandardError, so it also escapes the provider's exception handling and callers get no vectors. OpenAI, Requesty, Opper, Gemini and CheaperInference all implement the method.

This adds api_embed_execute to AzureProvider, calling client.embeddings.create on the Azure client, so the request goes to the deployment's /embeddings endpoint with the api-key header and api-version query.

Test: test/providers/azure/embed_test.rb stubs the deployment embeddings endpoint and checks the vectors and the api-key/api-version. It exercises the new method (on main the call raises NotImplementedError).

This change was made with Claude Code.

🤖 Generated with Claude Code

AzureProvider declares embed_request_type but never defined api_embed_execute, so embed raised NotImplementedError. Call the Azure client's embeddings endpoint like the other OpenAI-compatible providers.

This branch has not been deployed

No deployments
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