Skip to content

Commit fada5e2

Browse files
committed
Added working anthropic server
1 parent eba3d14 commit fada5e2

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/api/providers/anthropic.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,10 @@ export class AnthropicHandler implements ApiHandler, SingleCompletionHandler {
8383
case "claude-3-opus-20240229":
8484
case "claude-3-haiku-20240307":
8585
return {
86-
headers: { "anthropic-beta": "prompt-caching-2024-07-31" },
86+
headers: {
87+
"anthropic-beta": "prompt-caching-2024-07-31",
88+
"authorization": `Bearer ${this.options.apiKey}`,
89+
},
8790
}
8891
default:
8992
return undefined

src/api/providers/pearai.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@ export class PearAiHandler extends AnthropicHandler {
99
}
1010
super({
1111
...options,
12-
// Map PearAI specific options to OpenAI options for compatibility
13-
openAiApiKey: options.pearaiApiKey,
14-
openAiBaseUrl: PEARAI_URL,
15-
openAiStreamingEnabled: true,
12+
apiKey: options.pearaiApiKey,
13+
anthropicBaseUrl: PEARAI_URL,
1614
})
1715
}
1816
}

0 commit comments

Comments
 (0)