alemonjs-aichat 1.0.19 → 1.0.20

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,7 +1,7 @@
1
1
  import { API } from '@alemonjs/onebot';
2
2
  import { emojiMap } from '../../emoji.js';
3
3
  import { uploadImageToR2 } from '../../s3.js';
4
- import { useMessage, Mention, Text, getConfigValue, ImageFile, ImageURL, useClient } from 'alemonjs';
4
+ import { useMessage, Text, Mention, getConfigValue, ImageFile, ImageURL, useClient } from 'alemonjs';
5
5
  import { log } from 'console';
6
6
  import OpenAi from 'openai';
7
7
  import { TTSClient } from '../../api/tts.js';
@@ -330,6 +330,10 @@ ${e.ClientError ? `当前错误信息:${e.ClientError}` : ""}
330
330
  messages.push(responseMessage);
331
331
  await redisClient.addAIChatHistory(e.guid, responseMessage);
332
332
  console.log("模型决定调用工具:", responseMessage.tool_calls);
333
+ const useToolsMessage = responseMessage.tool_calls.map((toolCall) => {
334
+ return `工具调用: ${toolCall.function.name}(${toolCall.function.arguments})`;
335
+ });
336
+ message.send(format(Text(useToolsMessage.join("\n"))));
333
337
  for (const toolCall of responseMessage.tool_calls) {
334
338
  const functionName = toolCall.function.name;
335
339
  const functionArgs = JSON.parse(toolCall.function.arguments);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "alemonjs-aichat",
3
- "version": "1.0.19",
3
+ "version": "1.0.20",
4
4
  "description": "alemonjs-aichat",
5
5
  "author": "suancaixianyu",
6
6
  "license": "MIT",