File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed
Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -4,26 +4,22 @@ import { Anthropic } from "@anthropic-ai/sdk"
44import { ApiHandler } from "../index"
55
66export 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 } )
You can’t perform that action at this time.
0 commit comments