Skip to content

Commit 02ccd77

Browse files
pugazhendhi-mvigneshsubbiah16
authored andcommitted
Fixed model mismatch
1 parent 62dcfbe commit 02ccd77

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/api/providers/unbound.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,22 @@ import { Anthropic } from "@anthropic-ai/sdk"
44
import { ApiHandler } from "../index"
55

66
export class UnboundHandler implements ApiHandler {
7-
private unboundApiKey: string
8-
private unboundModelId: string
97
private unboundBaseUrl: string = "https://ai-gateway-43843357113.us-west1.run.app/v1"
108
private options: ApiHandlerOptions
119

1210
constructor(options: ApiHandlerOptions) {
1311
this.options = options
14-
this.unboundApiKey = options.unboundApiKey || ""
15-
this.unboundModelId = options.unboundModelId || ""
1612
}
1713

1814
async *createMessage(systemPrompt: string, messages: Anthropic.Messages.MessageParam[]): ApiStream {
1915
const response = await fetch(`${this.unboundBaseUrl}/chat/completions`, {
2016
method: "POST",
2117
headers: {
22-
Authorization: `Bearer ${this.unboundApiKey}`,
18+
Authorization: `Bearer ${this.options.unboundApiKey}`,
2319
"Content-Type": "application/json",
2420
},
2521
body: JSON.stringify({
26-
model: this.unboundModelId,
22+
model: this.getModel().id,
2723
messages: [{ role: "system", content: systemPrompt }, ...messages],
2824
}),
2925
})

0 commit comments

Comments
 (0)