-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat: add Poe.com as an LLM provider #6596
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Add Poe provider type definitions with support for multiple models - Implement PoeHandler extending BaseOpenAiCompatibleProvider - Add Poe to provider settings schema and API handler - Include comprehensive tests for Poe provider functionality - Support custom bots with default model info Closes #6594
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reviewed my own code and found it suspiciously adequate.
|
|
||
| const poeSchema = apiModelIdProviderModelSchema.extend({ | ||
| poeApiKey: z.string().optional(), | ||
| poeBaseUrl: z.string().optional(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I notice that other recent providers have i18n entries for their API keys (e.g., groqApiKey), but this PR doesn't add translations for poeApiKey and poeBaseUrl. Is this intentional, or should we add i18n entries for consistency?
I see that the English common.json doesn't have a providers section, so perhaps this is following a different pattern?
|
|
||
| const poeSchema = apiModelIdProviderModelSchema.extend({ | ||
| poeApiKey: z.string().optional(), | ||
| poeBaseUrl: z.string().optional(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding URL validation for poeBaseUrl similar to other providers. Currently it accepts any string, but validating it as a proper URL could prevent configuration errors:
| poeBaseUrl: z.string().optional(), | |
| poeBaseUrl: z.string().url().optional(), |
| contextWindow: 128000, | ||
| supportsImages: true, | ||
| supportsPromptCache: false, | ||
| inputPrice: 2.5, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pricing information looks comprehensive! Is this pricing data current and accurate? It might be helpful to add a comment indicating the source of this pricing information and when it was last updated, to help with future maintenance.
| }), | ||
| ) | ||
| }) | ||
| }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great test coverage! Consider adding a few edge case tests:
- Invalid API key handling (401/403 responses)
- Network timeout scenarios
- Malformed response handling from the Poe API
These would help ensure robust error handling in production.
|
|
||
| import { BaseOpenAiCompatibleProvider } from "./base-openai-compatible-provider" | ||
|
|
||
| export class PoeHandler extends BaseOpenAiCompatibleProvider<PoeModelId> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider making the API documentation link more prominent with a JSDoc comment:
| export class PoeHandler extends BaseOpenAiCompatibleProvider<PoeModelId> { | |
| /** | |
| * Poe API Handler - Provides access to multiple LLM models through Poe's OpenAI-compatible API | |
| * | |
| * API Documentation: https://creator.poe.com/docs/external-applications/openai-compatible-api | |
| * | |
| * Supports both predefined models (GPT, Claude, Gemini, etc.) and custom Poe bots. | |
| */ | |
| export class PoeHandler extends BaseOpenAiCompatibleProvider<PoeModelId> { |
Summary
This PR adds support for Poe.com as an LLM provider in Roo-Code. Poe provides an API that is fully compatible with the OpenAI Chat Completions format, allowing users to access a wide variety of models including GPT, Claude, Gemini, Llama, Mistral, and more through a single API.
Changes
PoeHandlerextendingBaseOpenAiCompatibleProviderBenefits
Testing
Closes #6594
Important
Adds Poe.com as an LLM provider, integrating it into the existing infrastructure with support for multiple models and custom bots.
PoeHandlerinsrc/api/providers/poe.tsextendingBaseOpenAiCompatibleProviderto handle Poe API interactions.buildApiHandler()insrc/api/index.tsto includePoeHandlerfor "poe" provider.providerNamesandproviderSettingsSchemainprovider-settings.ts.poeSchemafor Poe-specific settings.useSelectedModel()inuseSelectedModel.tsto handle Poe provider selection.poe.spec.tsfor testingPoeHandlerfunctionality, including model selection and API interactions.This description was created by
for 7d13177. You can customize this summary. It will automatically update as commits are pushed.