Skip to content

Commit 332245c

Browse files
authored
Merge pull request RooVetGit#445 from punkpeye/feature-metadata-2
fix: correct X-Glama-Metadata placement
2 parents 439fc58 + d995a6a commit 332245c

File tree

1 file changed

+21
-15
lines changed

1 file changed

+21
-15
lines changed

src/api/providers/glama.ts

+21-15
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,27 @@ export class GlamaHandler implements ApiHandler, SingleCompletionHandler {
7373
}
7474

7575
const { data: completion, response } = await this.client.chat.completions
76-
.create({
77-
model: this.getModel().id,
78-
max_tokens: maxTokens,
79-
temperature: 0,
80-
messages: openAiMessages,
81-
stream: true,
82-
})
76+
.create(
77+
{
78+
model: this.getModel().id,
79+
max_tokens: maxTokens,
80+
temperature: 0,
81+
messages: openAiMessages,
82+
stream: true,
83+
},
84+
{
85+
headers: {
86+
"X-Glama-Metadata": JSON.stringify({
87+
labels: [
88+
{
89+
key: "app",
90+
value: "vscode.rooveterinaryinc.roo-cline",
91+
},
92+
],
93+
}),
94+
},
95+
},
96+
)
8397
.withResponse()
8498

8599
const completionRequestId = response.headers.get("x-completion-request-id")
@@ -101,14 +115,6 @@ export class GlamaHandler implements ApiHandler, SingleCompletionHandler {
101115
{
102116
headers: {
103117
Authorization: `Bearer ${this.options.glamaApiKey}`,
104-
"X-Glama-Metadata": JSON.stringify({
105-
labels: [
106-
{
107-
key: "app",
108-
value: "vscode.rooveterinaryinc.roo-cline",
109-
},
110-
],
111-
}),
112118
},
113119
},
114120
)

0 commit comments

Comments
 (0)