Skip to content

Commit bf92e8b

Browse files
committed
Cleanup
1 parent 85ef3ad commit bf92e8b

File tree

10 files changed

+1259
-1395
lines changed

10 files changed

+1259
-1395
lines changed

src/api/index.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { AnthropicHandler } from "./providers/anthropic"
88
import { AwsBedrockHandler } from "./providers/bedrock"
99
import { OpenRouterHandler } from "./providers/openrouter"
1010
import { VertexHandler } from "./providers/vertex"
11+
import { AnthropicVertexHandler } from "./providers/anthropic-vertex"
1112
import { OpenAiHandler } from "./providers/openai"
1213
import { OllamaHandler } from "./providers/ollama"
1314
import { LmStudioHandler } from "./providers/lmstudio"
@@ -45,6 +46,7 @@ export interface ApiHandler {
4546

4647
export function buildApiHandler(configuration: ApiConfiguration): ApiHandler {
4748
const { apiProvider, ...options } = configuration
49+
4850
switch (apiProvider) {
4951
case "anthropic":
5052
return new AnthropicHandler(options)
@@ -55,7 +57,11 @@ export function buildApiHandler(configuration: ApiConfiguration): ApiHandler {
5557
case "bedrock":
5658
return new AwsBedrockHandler(options)
5759
case "vertex":
58-
return new VertexHandler(options)
60+
if (options.apiModelId?.startsWith("claude")) {
61+
return new AnthropicVertexHandler(options)
62+
} else {
63+
return new VertexHandler(options)
64+
}
5965
case "openai":
6066
return new OpenAiHandler(options)
6167
case "ollama":

0 commit comments

Comments
 (0)