Skip to content

Commit 87644d4

Browse files
committed
Only set header for Roo provider
1 parent 24c9450 commit 87644d4

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/api/providers/base-openai-compatible-provider.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ export abstract class BaseOpenAiCompatibleProvider<ModelName extends string>
6666
systemPrompt: string,
6767
messages: Anthropic.Messages.MessageParam[],
6868
metadata?: ApiHandlerCreateMessageMetadata,
69+
requestOptions?: OpenAI.RequestOptions,
6970
) {
7071
const {
7172
id: model,
@@ -85,10 +86,7 @@ export abstract class BaseOpenAiCompatibleProvider<ModelName extends string>
8586
params.temperature = this.options.modelTemperature
8687
}
8788

88-
return this.client.chat.completions.create(
89-
params,
90-
metadata?.taskId ? { headers: { "X-Roo-Task-ID": metadata.taskId } } : undefined,
91-
)
89+
return this.client.chat.completions.create(params, requestOptions)
9290
}
9391

9492
override async *createMessage(

src/api/providers/roo.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,12 @@ export class RooHandler extends BaseOpenAiCompatibleProvider<RooModelId> {
3838
messages: Anthropic.Messages.MessageParam[],
3939
metadata?: ApiHandlerCreateMessageMetadata,
4040
): ApiStream {
41-
const stream = await this.createStream(systemPrompt, messages, metadata)
41+
const stream = await this.createStream(
42+
systemPrompt,
43+
messages,
44+
metadata,
45+
metadata?.taskId ? { headers: { "X-Roo-Task-ID": metadata.taskId } } : undefined,
46+
)
4247

4348
for await (const chunk of stream) {
4449
const delta = chunk.choices[0]?.delta

0 commit comments

Comments
 (0)