feat: add Requesty provider preset - #82
Thibaultjaigu wants to merge 1 commit into
Conversation
Add Requesty as an OpenAI compatible preset under Aggregators with its router endpoint prefilled, a brand icon, OpenRouter style reasoning handling, and model discovery that lists the managed models before the full catalog.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (12)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThis change registers Requesty as a provider with its default endpoint and model. It adds managed-model discovery, Requesty capability handling, visible reasoning trace support, an icon mapping, and tests for provider setup and model retrieval. ChangesRequesty provider support
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant SharedProviderModelCatalogClient
participant ManagedModelsEndpoint as Requesty /managed endpoint
participant CatalogModelsEndpoint as Requesty /models endpoint
SharedProviderModelCatalogClient->>ManagedModelsEndpoint: Fetch managed models
ManagedModelsEndpoint-->>SharedProviderModelCatalogClient: Return managed models
SharedProviderModelCatalogClient->>CatalogModelsEndpoint: Fetch full catalog
CatalogModelsEndpoint-->>SharedProviderModelCatalogClient: Return catalog models
SharedProviderModelCatalogClient->>SharedProviderModelCatalogClient: Merge and deduplicate model IDs
Suggested reviewers: Merge Risk: ⚪ Minimal · up to Requesty model discovery preserves the intended fallback behavior; no actionable merge-blocking risk is established after normal checks. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 6.90% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 29 functions across 11 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Adds Requesty (https://docs.requesty.ai) as a provider preset. Requesty is an OpenAI compatible router with one key for OpenAI, Anthropic, Google, DeepSeek and others. pi-ai has no Requesty built in, so this goes through the existing custom
openai-completionspath, the same way the OpenAI compatible preset does, and it is wired at each place OpenRouter is special cased.Changes
PiProviderCatalog.kt: newrequestypreset (not a built in) under theAggregatorscategory, with base URLhttps://router.requesty.ai/v1prefilled and editable, and default modelopenai/gpt-5.4. Thecustom()helper gained optionaldefaultBaseUrl,defaultModelIdandcategoryparameters. Requesty is not inRecommendedand is never a default provider.ProviderBrandIcon.ktpluscomposeResources/drawable/provider_requesty.xml: brand icon, next to the OpenRouter one.ModelCapabilities.kt:Requestycompatibility family, detected by host, using the same reasoning disable style as OpenRouter.SessionExecutionManager.ktandIosComposeApp.kt: Requesty base URLs show the visible reasoning trace, same as OpenRouter.ProviderModelCatalogClient.kton Android,SharedProviderModelCatalogClient.ktin shared): for Requesty it readsGET /models/managedfirst (curated ids such asclaude-sonnet-4-5), then the normalGET /models(vendor/modelids), and drops duplicates. If one endpoint fails the other is still used. The error only shows when both fail, and then the existing models.dev fallback applies (models.dev already has arequestyprovider id).Not touched: the lobehub icon copy map in
app/build.gradle.kts(lobehub has no Requesty icon), and the legacy host migration inbuiltInProviderIdForHost, which only covers pi-ai built ins.Tests:
ProviderConfigFormTest: provider count 36 to 37, custom presets areopenai-compatibleandrequesty, and Requesty prefills its base URL.PiProviderMapperTest: Requesty maps tocustom/openai-completionswith anaether-provider id, base URL, model and key.ProviderModelCatalogClientTest(MockWebServer) andSharedProviderModelCatalogClientTest(MockEngine): managed list requested first, then the catalog, merged in order with the Bearer key sent.How to test
REQUESTY_API_KEY).https://router.requesty.ai/v1. EU users can change it tohttps://router.eu.requesty.ai/v1.vendor/modelids.openai/gpt-4o-mini(oranthropic/claude-sonnet-4-5) and send a message.Checks
./gradlew :shared:testDebugUnitTest :app:testDebugUnitTest(JDK 17): BUILD SUCCESSFUL, app 243 tests and shared 143 tests, 0 failures.pi-bridge:npm run checkpasses.npm testgives 45 of 47 passing. The two failing tests (accepts steer and follow-up messages on a live persistent harnessandaborts an active harness by session id) are timing tests. They failed in my local run on Node 22 (CI uses Node 24), and this PR does not touch the bridge.ProviderModelCatalogClientreturned 920 ids, managed ids first, includingopenai/gpt-4o-mini.run_turnthrough the pi bridge using the model config produced bytoPiModelConfig()(custom, openai-completions,openai/gpt-4o-mini) returned "pong". The response model wasgpt-4o-mini-2024-07-18and the stop reason wasstop.Disclosure: I work at Requesty. Happy to adjust anything to match project conventions.
Summary by CodeRabbit