File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import { createStreamingExecution } from '@/providers/streaming-execution'
1919import { isAbortError , parseToolArguments } from '@/providers/streaming-tool-loop-shared'
2020import { adaptOpenAIChatToolSchema } from '@/providers/tool-schema-adapter'
2121import { enrichLastModelSegmentFromChatCompletions } from '@/providers/trace-enrichment'
22+ import { openAICompatTransport } from '@/providers/transport'
2223import type {
2324 FunctionCallResponse ,
2425 Message ,
@@ -86,6 +87,7 @@ export const basetenProvider: ProviderConfig = {
8687 }
8788
8889 const client = new OpenAI ( {
90+ ...openAICompatTransport ( ) ,
8991 apiKey : request . apiKey ,
9092 baseURL : 'https://inference.baseten.co/v1' ,
9193 } )
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import { createStreamingExecution } from '@/providers/streaming-execution'
1515import { isAbortError , parseToolArguments } from '@/providers/streaming-tool-loop-shared'
1616import { adaptOpenAIChatToolSchema } from '@/providers/tool-schema-adapter'
1717import { enrichLastModelSegmentFromChatCompletions } from '@/providers/trace-enrichment'
18+ import { openAICompatTransport } from '@/providers/transport'
1819import type {
1920 ProviderConfig ,
2021 ProviderRequest ,
@@ -54,6 +55,7 @@ export const cerebrasProvider: ProviderConfig = {
5455 try {
5556 const client = new Cerebras ( {
5657 apiKey : request . apiKey ,
58+ ...openAICompatTransport ( ) ,
5759 } )
5860
5961 const allMessages = [ ]
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import { createStreamingExecution } from '@/providers/streaming-execution'
1313import { isAbortError , parseToolArguments } from '@/providers/streaming-tool-loop-shared'
1414import { adaptOpenAIChatToolSchema } from '@/providers/tool-schema-adapter'
1515import { enrichLastModelSegmentFromChatCompletions } from '@/providers/trace-enrichment'
16+ import { openAICompatTransport } from '@/providers/transport'
1617import type {
1718 ProviderConfig ,
1819 ProviderRequest ,
@@ -50,6 +51,7 @@ export const deepseekProvider: ProviderConfig = {
5051
5152 try {
5253 const deepseek = new OpenAI ( {
54+ ...openAICompatTransport ( ) ,
5355 apiKey : request . apiKey ,
5456 baseURL : 'https://api.deepseek.com' ,
5557 } )
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ import { createStreamingExecution } from '@/providers/streaming-execution'
2020import { isAbortError , parseToolArguments } from '@/providers/streaming-tool-loop-shared'
2121import { adaptOpenAIChatToolSchema } from '@/providers/tool-schema-adapter'
2222import { enrichLastModelSegmentFromChatCompletions } from '@/providers/trace-enrichment'
23+ import { openAICompatTransport } from '@/providers/transport'
2324import type {
2425 FunctionCallResponse ,
2526 Message ,
@@ -87,6 +88,7 @@ export const fireworksProvider: ProviderConfig = {
8788 }
8889
8990 const client = new OpenAI ( {
91+ ...openAICompatTransport ( ) ,
9092 apiKey : request . apiKey ,
9193 baseURL : 'https://api.fireworks.ai/inference/v1' ,
9294 } )
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ import { createStreamingExecution } from '@/providers/streaming-execution'
1818import { isAbortError , parseToolArguments } from '@/providers/streaming-tool-loop-shared'
1919import { adaptOpenAIChatToolSchema } from '@/providers/tool-schema-adapter'
2020import { enrichLastModelSegmentFromChatCompletions } from '@/providers/trace-enrichment'
21+ import { openAICompatTransport } from '@/providers/transport'
2122import type {
2223 ProviderConfig ,
2324 ProviderRequest ,
@@ -50,7 +51,7 @@ export const groqProvider: ProviderConfig = {
5051 throw new Error ( 'API key is required for Groq' )
5152 }
5253
53- const groq = new Groq ( { apiKey : request . apiKey } )
54+ const groq = new Groq ( { apiKey : request . apiKey , ... openAICompatTransport ( ) } )
5455
5556 const allMessages = [ ]
5657
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import { createStreamingExecution } from '@/providers/streaming-execution'
1919import { isAbortError , parseToolArguments } from '@/providers/streaming-tool-loop-shared'
2020import { adaptOpenAIChatToolSchema } from '@/providers/tool-schema-adapter'
2121import { enrichLastModelSegmentFromChatCompletions } from '@/providers/trace-enrichment'
22+ import { openAICompatTransport } from '@/providers/transport'
2223import type {
2324 ProviderConfig ,
2425 ProviderRequest ,
@@ -100,6 +101,7 @@ export const kimiProvider: ProviderConfig = {
100101
101102 try {
102103 const kimi = new OpenAI ( {
104+ ...openAICompatTransport ( ) ,
103105 apiKey : request . apiKey ,
104106 baseURL : KIMI_BASE_URL ,
105107 } )
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import { createStreamingExecution } from '@/providers/streaming-execution'
1616import { isAbortError , parseToolArguments } from '@/providers/streaming-tool-loop-shared'
1717import { adaptOpenAIChatToolSchema } from '@/providers/tool-schema-adapter'
1818import { enrichLastModelSegmentFromChatCompletions } from '@/providers/trace-enrichment'
19+ import { openAICompatTransport } from '@/providers/transport'
1920import type {
2021 Message ,
2122 ProviderConfig ,
@@ -110,6 +111,7 @@ export const litellmProvider: ProviderConfig = {
110111
111112 const apiKey = request . apiKey || env . LITELLM_API_KEY || 'empty'
112113 const litellm = new OpenAI ( {
114+ ...openAICompatTransport ( ) ,
113115 apiKey,
114116 baseURL : `${ baseUrl } /v1` ,
115117 } )
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import { createStreamingExecution } from '@/providers/streaming-execution'
1414import { isAbortError , parseToolArguments } from '@/providers/streaming-tool-loop-shared'
1515import { adaptOpenAIChatToolSchema } from '@/providers/tool-schema-adapter'
1616import { enrichLastModelSegmentFromChatCompletions } from '@/providers/trace-enrichment'
17+ import { openAICompatTransport } from '@/providers/transport'
1718import type {
1819 ProviderConfig ,
1920 ProviderRequest ,
@@ -53,6 +54,7 @@ export const metaProvider: ProviderConfig = {
5354
5455 try {
5556 const meta = new OpenAI ( {
57+ ...openAICompatTransport ( ) ,
5658 apiKey : request . apiKey ,
5759 baseURL : META_BASE_URL ,
5860 } )
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import { createStreamingExecution } from '@/providers/streaming-execution'
1414import { isAbortError , parseToolArguments } from '@/providers/streaming-tool-loop-shared'
1515import { adaptOpenAIChatToolSchema } from '@/providers/tool-schema-adapter'
1616import { enrichLastModelSegmentFromChatCompletions } from '@/providers/trace-enrichment'
17+ import { openAICompatTransport } from '@/providers/transport'
1718import type {
1819 ProviderConfig ,
1920 ProviderRequest ,
@@ -61,6 +62,7 @@ export const mistralProvider: ProviderConfig = {
6162 }
6263
6364 const mistral = new OpenAI ( {
65+ ...openAICompatTransport ( ) ,
6466 apiKey : request . apiKey ,
6567 baseURL : 'https://api.mistral.ai/v1' ,
6668 } )
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import { createStreamingExecution } from '@/providers/streaming-execution'
1515import { isAbortError , parseToolArguments } from '@/providers/streaming-tool-loop-shared'
1616import { adaptOpenAIChatToolSchema } from '@/providers/tool-schema-adapter'
1717import { enrichLastModelSegmentFromChatCompletions } from '@/providers/trace-enrichment'
18+ import { openAICompatTransport } from '@/providers/transport'
1819import type {
1920 ProviderConfig ,
2021 ProviderRequest ,
@@ -60,6 +61,7 @@ export const nvidiaProvider: ProviderConfig = {
6061
6162 try {
6263 const nvidia = new OpenAI ( {
64+ ...openAICompatTransport ( ) ,
6365 apiKey : request . apiKey ,
6466 baseURL : NVIDIA_BASE_URL ,
6567 } )
You can’t perform that action at this time.
0 commit comments