xiaozuoassistant 0.1.84 → 0.1.85

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.
@@ -5,7 +5,7 @@
5
5
  <link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>🍇</text></svg>" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <title>xiaozuoAssistant</title>
8
- <script type="module" crossorigin src="/assets/index-CHqwpkIC.js"></script>
8
+ <script type="module" crossorigin src="/assets/index-D8n5WPwn.js"></script>
9
9
  <link rel="stylesheet" crossorigin href="/assets/index-Be5IGwUA.css">
10
10
  </head>
11
11
  <body>
@@ -24,6 +24,7 @@ try {
24
24
  apiKey: '',
25
25
  baseURL: 'https://dashscope-intl.aliyuncs.com/compatible-mode/v1',
26
26
  model: 'qwen-plus',
27
+ embeddingModel: 'text-embedding-v1', // Qwen compatible
27
28
  temperature: 0.7,
28
29
  requestTimeoutMs: 600000,
29
30
  maxRetries: 2,
@@ -56,10 +56,9 @@ export class VectorMemory {
56
56
  // Use OpenAI compatible embedding endpoint
57
57
  // Note: Some compatible providers might use different models/dimensions.
58
58
  // Default to text-embedding-ada-002 or similar standard.
59
- // For DashScope/Qwen, we might need 'text-embedding-v1' or similar if 'text-embedding-v3-small' fails.
60
- // We'll try to use a more standard one or catch the error.
59
+ const model = config.llm.embeddingModel || 'text-embedding-ada-002';
61
60
  const response = await this.openai.embeddings.create({
62
- model: 'text-embedding-v1', // Common alias in compatible APIs, or use config if available
61
+ model: model,
63
62
  input: text,
64
63
  });
65
64
  return response.data[0].embedding;
@@ -231,6 +231,7 @@ app.get('/api/config', async (req, res) => {
231
231
  apiKey: config.llm.apiKey,
232
232
  baseURL: config.llm.baseURL,
233
233
  model: config.llm.model,
234
+ embeddingModel: config.llm.embeddingModel,
234
235
  temperature: config.llm.temperature,
235
236
  maxHistoryMessages: config.llm.maxHistoryMessages,
236
237
  maxToolIterations: config.llm.maxToolIterations,
@@ -243,7 +244,7 @@ app.get('/api/config', async (req, res) => {
243
244
  // 更新配置并写入 config.json
244
245
  app.post('/api/config', async (req, res) => {
245
246
  try {
246
- const { userId, apiKey, baseURL, model, temperature, systemPrompt, memoryMaintenanceCron, sessionRetentionDays, workspace, maxHistoryMessages, maxToolIterations } = req.body;
247
+ const { userId, apiKey, baseURL, model, embeddingModel, temperature, systemPrompt, memoryMaintenanceCron, sessionRetentionDays, workspace, maxHistoryMessages, maxToolIterations } = req.body;
247
248
  // 更新配置对象
248
249
  const newConfig = { ...config };
249
250
  if (userId !== undefined)
@@ -254,6 +255,8 @@ app.post('/api/config', async (req, res) => {
254
255
  newConfig.llm.baseURL = baseURL;
255
256
  if (model !== undefined)
256
257
  newConfig.llm.model = model;
258
+ if (embeddingModel !== undefined)
259
+ newConfig.llm.embeddingModel = embeddingModel;
257
260
  if (temperature !== undefined)
258
261
  newConfig.llm.temperature = parseFloat(temperature);
259
262
  if (maxHistoryMessages !== undefined)
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "xiaozuoassistant",
3
3
  "private": false,
4
4
  "description": "Your personal, locally-hosted AI assistant for office productivity.",
5
- "version": "0.1.84",
5
+ "version": "0.1.85",
6
6
  "author": "mantle.lau",
7
7
  "license": "MIT",
8
8
  "repository": {