mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-20 20:31:37 -05:00
Add openai compatible provider
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
import { Anthropic } from "@anthropic-ai/sdk"
|
||||
import { ApiConfiguration, ApiModelId, ModelInfo } from "../shared/api"
|
||||
import { ApiConfiguration, ModelInfo } from "../shared/api"
|
||||
import { AnthropicHandler } from "./anthropic"
|
||||
import { AwsBedrockHandler } from "./bedrock"
|
||||
import { OpenRouterHandler } from "./openrouter"
|
||||
import { VertexHandler } from "./vertex"
|
||||
import { OpenAiHandler } from "./openai"
|
||||
|
||||
export interface ApiHandlerMessageResponse {
|
||||
message: Anthropic.Messages.Message
|
||||
@@ -26,7 +27,7 @@ export interface ApiHandler {
|
||||
>
|
||||
): any
|
||||
|
||||
getModel(): { id: ApiModelId; info: ModelInfo }
|
||||
getModel(): { id: string; info: ModelInfo }
|
||||
}
|
||||
|
||||
export function buildApiHandler(configuration: ApiConfiguration): ApiHandler {
|
||||
@@ -40,6 +41,8 @@ export function buildApiHandler(configuration: ApiConfiguration): ApiHandler {
|
||||
return new AwsBedrockHandler(options)
|
||||
case "vertex":
|
||||
return new VertexHandler(options)
|
||||
case "openai":
|
||||
return new OpenAiHandler(options)
|
||||
default:
|
||||
return new AnthropicHandler(options)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user