simplified using other oai models

This commit is contained in:
David Zhang
2025-02-08 19:38:21 -08:00
parent 933f4df7fb
commit 2ef450a43c

View File

@@ -13,20 +13,14 @@ const openai = createOpenAI({
baseURL: process.env.OPENAI_ENDPOINT || 'https://api.openai.com/v1', baseURL: process.env.OPENAI_ENDPOINT || 'https://api.openai.com/v1',
} as CustomOpenAIProviderSettings); } as CustomOpenAIProviderSettings);
const isCustomEndpoint = const customModel = process.env.OPENAI_MODEL || 'o3-mini';
process.env.OPENAI_ENDPOINT &&
process.env.OPENAI_ENDPOINT !== 'https://api.openai.com/v1';
const customModel = process.env.OPENAI_MODEL;
// Models // Models
export const o3MiniModel = openai( export const o3MiniModel = openai(customModel, {
isCustomEndpoint && customModel ? customModel : 'o3-mini', reasoningEffort: customModel.startsWith('o') ? 'medium' : undefined,
{ structuredOutputs: true,
reasoningEffort: 'medium', });
structuredOutputs: true,
},
);
const MinChunkSize = 140; const MinChunkSize = 140;
const encoder = getEncoding('o200k_base'); const encoder = getEncoding('o200k_base');