-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat: add Poe provider support #9513
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
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,205 @@ | ||
| import type { ModelInfo } from "../model.js" | ||
|
|
||
| // https://creator.poe.com/docs/external-applications/openai-compatible-api | ||
| export type PoeModelId = | ||
| | "gpt-4o" | ||
| | "gpt-4o-mini" | ||
| | "gpt-4-turbo" | ||
| | "gpt-3.5-turbo" | ||
| | "claude-3-5-sonnet" | ||
| | "claude-3-5-haiku" | ||
| | "claude-3-opus" | ||
| | "claude-3-sonnet" | ||
| | "claude-3-haiku" | ||
| | "claude-instant" | ||
| | "gemini-1.5-pro" | ||
| | "gemini-1.5-flash" | ||
| | "llama-3.1-405b" | ||
| | "llama-3.1-70b" | ||
| | "llama-3.1-8b" | ||
| | "mistral-large" | ||
| | "mixtral-8x7b" | ||
| | "qwen-2.5-72b" | ||
| | "solar-mini" | ||
|
|
||
| export const poeDefaultModelId: PoeModelId = "claude-3-5-sonnet" | ||
|
|
||
| export const poeModels = { | ||
| // GPT Models | ||
| "gpt-4o": { | ||
| maxTokens: 16384, | ||
| contextWindow: 128000, | ||
| supportsImages: true, | ||
| supportsPromptCache: false, | ||
| inputPrice: 2.5, | ||
| outputPrice: 10, | ||
| description: "OpenAI's most advanced model with vision capabilities", | ||
| }, | ||
| "gpt-4o-mini": { | ||
| maxTokens: 16384, | ||
| contextWindow: 128000, | ||
| supportsImages: true, | ||
| supportsPromptCache: false, | ||
| inputPrice: 0.15, | ||
| outputPrice: 0.6, | ||
| description: "Affordable and intelligent small model for fast, lightweight tasks", | ||
| }, | ||
| "gpt-4-turbo": { | ||
| maxTokens: 4096, | ||
| contextWindow: 128000, | ||
| supportsImages: true, | ||
| supportsPromptCache: false, | ||
| inputPrice: 10, | ||
| outputPrice: 30, | ||
| description: "GPT-4 Turbo with vision capabilities", | ||
| }, | ||
| "gpt-3.5-turbo": { | ||
| maxTokens: 4096, | ||
| contextWindow: 16385, | ||
| supportsImages: false, | ||
| supportsPromptCache: false, | ||
| inputPrice: 0.5, | ||
| outputPrice: 1.5, | ||
| description: "Fast and efficient model for most tasks", | ||
| }, | ||
| // Claude Models | ||
| "claude-3-5-sonnet": { | ||
| maxTokens: 8192, | ||
| contextWindow: 200000, | ||
| supportsImages: true, | ||
| supportsPromptCache: false, | ||
| inputPrice: 3, | ||
| outputPrice: 15, | ||
| description: "Most intelligent Claude model with vision capabilities", | ||
| }, | ||
| "claude-3-5-haiku": { | ||
| maxTokens: 4096, | ||
| contextWindow: 200000, | ||
| supportsImages: false, | ||
| supportsPromptCache: false, | ||
| inputPrice: 0.25, | ||
| outputPrice: 1.25, | ||
| description: "Fast and efficient Claude model", | ||
| }, | ||
| "claude-3-opus": { | ||
| maxTokens: 4096, | ||
| contextWindow: 200000, | ||
| supportsImages: true, | ||
| supportsPromptCache: false, | ||
| inputPrice: 15, | ||
| outputPrice: 75, | ||
| description: "Most powerful Claude 3 model with vision capabilities", | ||
| }, | ||
| "claude-3-sonnet": { | ||
| maxTokens: 4096, | ||
| contextWindow: 200000, | ||
| supportsImages: true, | ||
| supportsPromptCache: false, | ||
| inputPrice: 3, | ||
| outputPrice: 15, | ||
| description: "Balanced Claude 3 model with vision capabilities", | ||
| }, | ||
| "claude-3-haiku": { | ||
| maxTokens: 4096, | ||
| contextWindow: 200000, | ||
| supportsImages: true, | ||
| supportsPromptCache: false, | ||
| inputPrice: 0.25, | ||
| outputPrice: 1.25, | ||
| description: "Fast and lightweight Claude 3 model with vision capabilities", | ||
| }, | ||
| "claude-instant": { | ||
| maxTokens: 4096, | ||
| contextWindow: 100000, | ||
| supportsImages: false, | ||
| supportsPromptCache: false, | ||
| inputPrice: 0.8, | ||
| outputPrice: 2.4, | ||
| description: "Fast Claude model for simple tasks", | ||
| }, | ||
| // Gemini Models | ||
| "gemini-1.5-pro": { | ||
| maxTokens: 8192, | ||
| contextWindow: 2000000, | ||
| supportsImages: true, | ||
| supportsPromptCache: false, | ||
| inputPrice: 3.5, | ||
| outputPrice: 10.5, | ||
| description: "Google's most capable model with 2M context window", | ||
| }, | ||
| "gemini-1.5-flash": { | ||
| maxTokens: 8192, | ||
| contextWindow: 1000000, | ||
| supportsImages: true, | ||
| supportsPromptCache: false, | ||
| inputPrice: 0.075, | ||
| outputPrice: 0.3, | ||
| description: "Fast and efficient Gemini model with 1M context window", | ||
| }, | ||
| // Llama Models | ||
| "llama-3.1-405b": { | ||
| maxTokens: 4096, | ||
| contextWindow: 128000, | ||
| supportsImages: false, | ||
| supportsPromptCache: false, | ||
| inputPrice: 2.7, | ||
| outputPrice: 2.7, | ||
| description: "Meta's largest open model with 405B parameters", | ||
| }, | ||
| "llama-3.1-70b": { | ||
| maxTokens: 4096, | ||
| contextWindow: 128000, | ||
| supportsImages: false, | ||
| supportsPromptCache: false, | ||
| inputPrice: 0.59, | ||
| outputPrice: 0.79, | ||
| description: "Powerful open model with 70B parameters", | ||
| }, | ||
| "llama-3.1-8b": { | ||
| maxTokens: 4096, | ||
| contextWindow: 128000, | ||
| supportsImages: false, | ||
| supportsPromptCache: false, | ||
| inputPrice: 0.05, | ||
| outputPrice: 0.08, | ||
| description: "Efficient open model with 8B parameters", | ||
| }, | ||
| // Mistral Models | ||
| "mistral-large": { | ||
| maxTokens: 4096, | ||
| contextWindow: 32000, | ||
| supportsImages: false, | ||
| supportsPromptCache: false, | ||
| inputPrice: 2, | ||
| outputPrice: 6, | ||
| description: "Mistral's flagship model", | ||
| }, | ||
| "mixtral-8x7b": { | ||
| maxTokens: 4096, | ||
| contextWindow: 32000, | ||
| supportsImages: false, | ||
| supportsPromptCache: false, | ||
| inputPrice: 0.24, | ||
| outputPrice: 0.24, | ||
| description: "Mixture of experts model with 8x7B parameters", | ||
| }, | ||
| // Other Models | ||
| "qwen-2.5-72b": { | ||
| maxTokens: 4096, | ||
| contextWindow: 32000, | ||
| supportsImages: false, | ||
| supportsPromptCache: false, | ||
| inputPrice: 0.35, | ||
| outputPrice: 0.4, | ||
| description: "Alibaba's Qwen 2.5 model with 72B parameters", | ||
| }, | ||
| "solar-mini": { | ||
| maxTokens: 4096, | ||
| contextWindow: 32000, | ||
| supportsImages: false, | ||
| supportsPromptCache: false, | ||
| inputPrice: 0.06, | ||
| outputPrice: 0.06, | ||
| description: "Small and efficient model", | ||
| }, | ||
| } as const satisfies Record<string, ModelInfo> | ||
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| import { type PoeModelId, poeDefaultModelId, poeModels } from "@roo-code/types" | ||
|
|
||
| import type { ApiHandlerOptions } from "../../shared/api" | ||
|
|
||
| import { BaseOpenAiCompatibleProvider } from "./base-openai-compatible-provider" | ||
|
|
||
| export class PoeHandler extends BaseOpenAiCompatibleProvider<PoeModelId> { | ||
| constructor(options: ApiHandlerOptions) { | ||
| super({ | ||
| ...options, | ||
| providerName: "Poe", | ||
| baseURL: "https://api.poe.com/v1", | ||
| apiKey: options.poeApiKey, | ||
| defaultProviderModelId: poeDefaultModelId, | ||
| providerModels: poeModels, | ||
| defaultTemperature: 0.7, | ||
| }) | ||
| } | ||
| } |
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
Oops, something went wrong.
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.
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.
Claude 3.5 Haiku supports vision capabilities according to Anthropic's documentation. This should be
supportsImages: trueto match the capability and be consistent withclaude-3-haikuwhich correctly has vision support enabled.Fix it with Roo Code or mention @roomote and request a fix.