update anthropic prompt and variables

This commit is contained in:
Dax Raad
2025-08-11 21:01:20 -04:00
parent 3946a08f40
commit dac1506680
3 changed files with 31 additions and 30 deletions

View File

@@ -28,7 +28,16 @@ export namespace Provider {
const CUSTOM_LOADERS: Record<string, CustomLoader> = {
async anthropic(provider) {
const access = await AuthAnthropic.access()
if (!access) return { autoload: false }
if (!access)
return {
autoload: false,
options: {
headers: {
"anthropic-beta":
"claude-code-20250219,interleaved-thinking-2025-05-14,fine-grained-tool-streaming-2025-05-14",
},
},
}
for (const model of Object.values(provider.models)) {
model.cost = {
input: 0,
@@ -44,7 +53,8 @@ export namespace Provider {
const headers = {
...init.headers,
authorization: `Bearer ${access}`,
"anthropic-beta": "oauth-2025-04-20",
"anthropic-beta":
"oauth-2025-04-20,claude-code-20250219,interleaved-thinking-2025-05-14,fine-grained-tool-streaming-2025-05-14",
}
delete headers["x-api-key"]
return fetch(input, {

View File

@@ -74,6 +74,7 @@ export namespace ProviderTransform {
export function temperature(_providerID: string, modelID: string) {
if (modelID.toLowerCase().includes("qwen")) return 0.55
if (modelID.toLowerCase().includes("claude")) return 1
return 0
}