Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/api/providers/__tests__/chutes.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ describe("ChutesHandler", () => {
stream: true,
stream_options: { include_usage: true },
}),
undefined,
)
})

Expand Down
1 change: 1 addition & 0 deletions src/api/providers/__tests__/fireworks.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ describe("FireworksHandler", () => {
stream: true,
stream_options: { include_usage: true },
}),
undefined,
)
})

Expand Down
3 changes: 3 additions & 0 deletions src/api/providers/__tests__/groq.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ describe("GroqHandler", () => {
stream: true,
stream_options: { include_usage: true },
}),
undefined,
)
})

Expand Down Expand Up @@ -178,6 +179,7 @@ describe("GroqHandler", () => {
messages: expect.arrayContaining([{ role: "system", content: systemPrompt }]),
stream: true,
}),
undefined,
)

// Verify temperature is NOT included
Expand Down Expand Up @@ -216,6 +218,7 @@ describe("GroqHandler", () => {
messages: expect.arrayContaining([{ role: "system", content: systemPrompt }]),
stream: true,
}),
undefined,
)
})
})
3 changes: 3 additions & 0 deletions src/api/providers/__tests__/roo.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ describe("RooHandler", () => {
expect.objectContaining({ role: "user", content: "Second message" }),
]),
}),
undefined,
)
})
})
Expand Down Expand Up @@ -365,6 +366,7 @@ describe("RooHandler", () => {
expect.not.objectContaining({
temperature: expect.anything(),
}),
undefined,
)
})

Expand All @@ -382,6 +384,7 @@ describe("RooHandler", () => {
expect.objectContaining({
temperature: 0.9,
}),
undefined,
)
})

Expand Down
1 change: 1 addition & 0 deletions src/api/providers/__tests__/sambanova.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ describe("SambaNovaHandler", () => {
stream: true,
stream_options: { include_usage: true },
}),
undefined,
)
})
})
1 change: 1 addition & 0 deletions src/api/providers/__tests__/zai.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ describe("ZAiHandler", () => {
stream: true,
stream_options: { include_usage: true },
}),
undefined,
)
})
})
Expand Down
3 changes: 2 additions & 1 deletion src/api/providers/base-openai-compatible-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export abstract class BaseOpenAiCompatibleProvider<ModelName extends string>
systemPrompt: string,
messages: Anthropic.Messages.MessageParam[],
metadata?: ApiHandlerCreateMessageMetadata,
requestOptions?: OpenAI.RequestOptions,
) {
const {
id: model,
Expand All @@ -85,7 +86,7 @@ export abstract class BaseOpenAiCompatibleProvider<ModelName extends string>
params.temperature = this.options.modelTemperature
}

return this.client.chat.completions.create(params)
return this.client.chat.completions.create(params, requestOptions)
}

override async *createMessage(
Expand Down
7 changes: 6 additions & 1 deletion src/api/providers/roo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ export class RooHandler extends BaseOpenAiCompatibleProvider<RooModelId> {
messages: Anthropic.Messages.MessageParam[],
metadata?: ApiHandlerCreateMessageMetadata,
): ApiStream {
const stream = await this.createStream(systemPrompt, messages, metadata)
const stream = await this.createStream(
systemPrompt,
messages,
metadata,
metadata?.taskId ? { headers: { "X-Roo-Task-ID": metadata.taskId } } : undefined,
)

for await (const chunk of stream) {
const delta = chunk.choices[0]?.delta
Expand Down
Loading