Skip to content

Commit b4d9c83

Browse files
committed
增加多套api配置
1 parent 75aa553 commit b4d9c83

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/deepseekApi.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@ function getDeepSeekApiKey(): string | null {
1515
return apiKey;
1616
}
1717

18+
19+
const model_name = "deepseek-chat";
20+
const apiBaseURL = "https://api.deepseek.com";
21+
22+
// const model_name = "deepseek-reasoner";
23+
// const apiBaseURL = "https://api.deepseek.com";
24+
25+
// const model_name = "deepseek-coder-v2";
26+
// const apiBaseURL = "http://10.11.39.58:31084";
27+
1828
/**
1929
* 调用 DeepSeek API
2030
* @param userContent 用户输入内容
@@ -39,7 +49,7 @@ async function callDeepSeekApi(
3949
try {
4050
const openai = new OpenAI({
4151
apiKey: apiKey,
42-
baseURL: 'https://api.deepseek.com',
52+
baseURL: apiBaseURL,
4353
});
4454

4555
if (outputChannel) {
@@ -58,7 +68,7 @@ async function callDeepSeekApi(
5868
while (attempts < maxAttempts) {
5969
attempts++;
6070
const response = await openai.chat.completions.create({
61-
model: 'deepseek-chat',
71+
model: model_name,
6272
messages: messages_body,
6373
stream: streamMode,
6474
max_tokens: 8192,

0 commit comments

Comments
 (0)