Repository navigation
feat(agent): route visualization through OpenRouter's Jev for shared server keys - #151
Open
tbrandenburg wants to merge 1 commit into
Open
tbrandenburg wants to merge 1 commit into
tbrandenburg wants to merge 1 commit into
Conversation
…server keys JEV_PROVIDER=openrouter selects OpenRouter's Decisions API with OPENROUTER_API_KEY and typesafe/jev-1.14 by default. TypeSafe remains the default; visitor keys always use TypeSafe; an unsupported value fails at startup with no fallback. Closes CopilotKit#147
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an explicit
JEV_PROVIDERsetting so shared-server visualization routing can use OpenRouter's Jev instead of a separate TypeSafe account. TypeSafe stays the default; nothing changes unlessJEV_PROVIDER=openrouteris set.Closes #147
Changes
visualization_router.py: a smallJEV_PROVIDERStable (key variable, endpoint, default model) andjev_provider()/jev_url();request_options,routeandarouteread from it.openrouter:OPENROUTER_API_KEY,https://openrouter.ai/api/alpha/decisions,typesafe/jev-1.14.JEV_MODELstill overrides.credentials.py:server_credentials_available()checks the key for the selected provider.main.py: validatesJEV_PROVIDERat startup, like an unsupportedLLM_MODEL. No fallback between providers..env.example,docs/visualization-routing.md,docs/deployment.mddocument the setting.Testing
apps/agent/tests/test_jev_provider.py(6 tests): default unchanged, OpenRouter endpoint/key/model andJEV_MODELoverride, missing-key error names the right variable, unknown provider rejected, BYOK stays on TypeSafe,server_credentials_availablefollows the provider.uv run --directory apps/agent pytest: 117 passed.JEV_PROVIDER=openrouter,route(...)returned{'visualization': 'bar_chart', 'renderer': 'open_generative_ui', ...}from the real OpenRouter API.JEV_PROVIDER=bogusmakesimport mainfail withJEV_PROVIDER must be typesafe or openrouter.Notes for reviewers
/api/alpha/, so the path may change; it lives in one constant.visualization_router.pylike fix(agent): preserve string blocks in visualization routing context #120-fix(agent): reroute presentation after editing a user message #122 but in different functions, so it should merge cleanly.