mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
Adds unbound metadata to non streaming requests
This commit is contained in:
parent
fd60c9466b
commit
10dd931eb7
1 changed files with 13 additions and 1 deletions
|
|
@ -147,6 +147,7 @@ export class UnboundHandler extends BaseProvider implements SingleCompletionHand
|
|||
|
||||
async completePrompt(prompt: string): Promise<string> {
|
||||
try {
|
||||
console.log("completePrompt running in Unbound: ", prompt)
|
||||
const requestOptions: OpenAI.Chat.Completions.ChatCompletionCreateParamsNonStreaming = {
|
||||
model: this.getModel().id.split("/")[1],
|
||||
messages: [{ role: "user", content: prompt }],
|
||||
|
|
@ -157,7 +158,18 @@ export class UnboundHandler extends BaseProvider implements SingleCompletionHand
|
|||
requestOptions.max_tokens = this.getModel().info.maxTokens
|
||||
}
|
||||
|
||||
const response = await this.client.chat.completions.create(requestOptions)
|
||||
const response = await this.client.chat.completions.create(requestOptions, {
|
||||
headers: {
|
||||
"X-Unbound-Metadata": JSON.stringify({
|
||||
labels: [
|
||||
{
|
||||
key: "app",
|
||||
value: "roo-code",
|
||||
},
|
||||
],
|
||||
}),
|
||||
},
|
||||
})
|
||||
return response.choices[0]?.message.content || ""
|
||||
} catch (error) {
|
||||
if (error instanceof Error) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue