|
@@ -147,6 +147,7 @@ export class UnboundHandler extends BaseProvider implements SingleCompletionHand
|
|
|
|
|
|
|
|
async completePrompt(prompt: string): Promise<string> {
|
|
async completePrompt(prompt: string): Promise<string> {
|
|
|
try {
|
|
try {
|
|
|
|
|
+ console.log("completePrompt running in Unbound: ", prompt)
|
|
|
const requestOptions: OpenAI.Chat.Completions.ChatCompletionCreateParamsNonStreaming = {
|
|
const requestOptions: OpenAI.Chat.Completions.ChatCompletionCreateParamsNonStreaming = {
|
|
|
model: this.getModel().id.split("/")[1],
|
|
model: this.getModel().id.split("/")[1],
|
|
|
messages: [{ role: "user", content: prompt }],
|
|
messages: [{ role: "user", content: prompt }],
|
|
@@ -157,7 +158,18 @@ export class UnboundHandler extends BaseProvider implements SingleCompletionHand
|
|
|
requestOptions.max_tokens = this.getModel().info.maxTokens
|
|
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 || ""
|
|
return response.choices[0]?.message.content || ""
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
if (error instanceof Error) {
|
|
if (error instanceof Error) {
|