File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed
Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -192,6 +192,11 @@ describe("UnboundHandler", () => {
192192 temperature : 0 ,
193193 max_tokens : 8192 ,
194194 } ) ,
195+ expect . objectContaining ( {
196+ headers : expect . objectContaining ( {
197+ "X-Unbound-Metadata" : expect . stringContaining ( "roo-code" ) ,
198+ } ) ,
199+ } ) ,
195200 )
196201 } )
197202
@@ -233,6 +238,11 @@ describe("UnboundHandler", () => {
233238 messages : [ { role : "user" , content : "Test prompt" } ] ,
234239 temperature : 0 ,
235240 } ) ,
241+ expect . objectContaining ( {
242+ headers : expect . objectContaining ( {
243+ "X-Unbound-Metadata" : expect . stringContaining ( "roo-code" ) ,
244+ } ) ,
245+ } ) ,
236246 )
237247 expect ( mockCreate . mock . calls [ 0 ] [ 0 ] ) . not . toHaveProperty ( "max_tokens" )
238248 } )
Original file line number Diff line number Diff line change @@ -157,7 +157,18 @@ export class UnboundHandler extends BaseProvider implements SingleCompletionHand
157157 requestOptions . max_tokens = this . getModel ( ) . info . maxTokens
158158 }
159159
160- const response = await this . client . chat . completions . create ( requestOptions )
160+ const response = await this . client . chat . completions . create ( requestOptions , {
161+ headers : {
162+ "X-Unbound-Metadata" : JSON . stringify ( {
163+ labels : [
164+ {
165+ key : "app" ,
166+ value : "roo-code" ,
167+ } ,
168+ ] ,
169+ } ) ,
170+ } ,
171+ } )
161172 return response . choices [ 0 ] ?. message . content || ""
162173 } catch ( error ) {
163174 if ( error instanceof Error ) {
You can’t perform that action at this time.
0 commit comments