diff --git a/.env.example b/.env.example index e570b8b..8ffac3f 100644 --- a/.env.example +++ b/.env.example @@ -1 +1,3 @@ OPENAI_API_KEY= +MODEL_NAME="gpt-3.5-turbo-1106" +AI_SERVICE_URL="https://api.openai.com/v1" \ No newline at end of file diff --git a/packages/ai/.env.example b/packages/ai/.env.example index e570b8b..8ffac3f 100644 --- a/packages/ai/.env.example +++ b/packages/ai/.env.example @@ -1 +1,3 @@ OPENAI_API_KEY= +MODEL_NAME="gpt-3.5-turbo-1106" +AI_SERVICE_URL="https://api.openai.com/v1" \ No newline at end of file diff --git a/packages/ai/src/config.ts b/packages/ai/src/config.ts index a3606bd..48579f2 100644 --- a/packages/ai/src/config.ts +++ b/packages/ai/src/config.ts @@ -4,12 +4,14 @@ import OpenAI from 'openai' const deepseekApiUrl = 'https://api.deepseek.com/v1' +const aiServiceUrl = process.env.AI_SERVICE_URL || deepseekApiUrl + export const openai = new OpenAI({ - baseURL: deepseekApiUrl, + baseURL: aiServiceUrl, apiKey: process.env.OPENAI_API_KEY, // This is the default and can be omitted }) -export const baseModel = 'deepseek-chat' +export const baseModel = process.env.MODEL_NAME || 'deepseek-chat' export const baseChatCompletionCreateParams: Partial = { max_tokens: 300,