Skip to content

Implement embeddings for the OpenRouter provider - #720

Merged
TonsOfFun merged 1 commit into
activeagents:mainfrom
pcbeingused333:fix/open-router-embed-execute
Nov 19, 2026
Merged

TonsOfFun merged 1 commit into
activeagents:mainfrom
pcbeingused333:fix/open-router-embed-execute

Conversation

@pcbeingused333

Copy link
Copy Markdown
Contributor

OpenRouterProvider inherits from OpenAI::ChatProvider, which does not define embed_request_type, and it never defines api_embed_execute. embed therefore raises NotImplementedError (not a StandardError, so it also bypasses the provider's exception handling) even though OpenRouter serves an OpenAI-compatible /embeddings endpoint.

This adds embed_request_type (OpenAI embedding request type) and api_embed_execute (client.embeddings.create), the same way RequestyProvider does.

Test: test/providers/open_router/embed_test.rb stubs https://openrouter.ai/api/v1/embeddings and checks the vectors and the bearer header. It fails on main with NotImplementedError and passes with the change. test/providers/open_router/*: 28 runs, 0 failures.

This change was made with Claude Code; the tests above were run on the branch.

🤖 Generated with Claude Code

OpenRouterProvider inherits ChatProvider, which defines neither
embed_request_type nor api_embed_execute, so embed raised
NotImplementedError. Add both, mirroring RequestyProvider.
@TonsOfFun TonsOfFun added this to the 1.9.10 milestone Nov 19, 2026
@TonsOfFun
TonsOfFun merged commit ea58963 into activeagents:main Nov 19, 2026
18 checks passed
yorzi pushed a commit to yorzi/activeagent that referenced this pull request Nov 19, 2026
…tool-choice-required

CHANGELOG: the 1.9.9 section is released, so the entries from activeagents#721 and activeagents#722
move to a new Unreleased section, with entries added for activeagents#712 and activeagents#720.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PCEJHngWphRQ7ArmDnYMmf
yorzi pushed a commit to yorzi/activeagent that referenced this pull request Nov 19, 2026
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.

2 participants