xiaozuoassistant 0.2.27 → 0.2.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,10 @@
1
1
  import OpenAI from 'openai';
2
2
  export function resolveBaseURL(config) {
3
+ // 优先使用配置文件中显式指定的 baseURL,除非它是空字符串或未定义
4
+ if (config.baseURL && config.baseURL.trim() !== '') {
5
+ return config.baseURL;
6
+ }
7
+ // 如果没有配置 baseURL,则根据 provider 提供默认的官方地址
3
8
  switch (config.provider) {
4
9
  case 'deepseek':
5
10
  return 'https://api.deepseek.com';
@@ -12,7 +17,7 @@ export function resolveBaseURL(config) {
12
17
  case 'custom':
13
18
  case 'openai':
14
19
  default:
15
- return config.baseURL;
20
+ return undefined; // 留空则使用 OpenAI 官方默认地址
16
21
  }
17
22
  }
18
23
  export function createOpenAIClient(config) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xiaozuoassistant",
3
- "version": "0.2.27",
3
+ "version": "0.2.28",
4
4
  "description": "A local-first personal AI assistant with multi-channel support and enhanced memory.",
5
5
  "author": "mantle.lau",
6
6
  "license": "MIT",