lobehub / lobe-chat

🤯 Lobe Chat - an open-source, modern-design AI chat framework. Supports Multi AI Providers( OpenAI / Claude 3 / Gemini / Ollama / Azure / DeepSeek), Knowledge Base (file upload / knowledge management / RAG ), Multi-Modals (Vision/TTS) and plugin system. One-click FREE deployment of your private ChatGPT/ Claude application.
https://chat-preview.lobehub.com
Other
44.3k stars 9.93k forks source link

[Bug] deepseek模型调用插件未按预期返回结果,只返回了json值 #3913

Closed exqmjmz closed 3 weeks ago

exqmjmz commented 1 month ago

📦 部署环境

Docker

📌 软件版本

v1.16.7

💻 系统环境

macOS

🌐 浏览器

Edge

🐛 问题描述

模型为deepseek,插件为lobehub文档中所提到的插件模板 https://lobehub.com/zh/docs/usage/plugins/development 发送对话消息,在返回需要返回的结果时,直接是只返回了json值 image

{"name": "plugin-identifier____recommendClothes", "parameters": {"mood": "sad", "gender": "woman"}}

本地启动调试服务后的截图 image

deepseek的文档中是提到支持function_calling https://platform.deepseek.com/api-docs/guides/function_calling

📷 复现步骤

No response

🚦 期望结果

No response

📝 补充信息

No response

lobehubbot commented 1 month ago

👀 @exqmjmz

Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible. Please make sure you have given us as much context as possible.\ 非常感谢您提交 issue。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。

dosubot[bot] commented 1 month ago

Hey, @exqmjmz! I'm here to help you with any bugs, questions, or contributions you have. Let's tackle this issue together!

I found some similar discussions that might be relevant to your issue:

  1. [Q&A] 使用 coplilot-gpt4-service 时,调用插件没有后续对话? - This discussion mentions that the copilot-gpt4-service does not support function calling [1].
  2. [Q&A] 使用 API 中转服务,无法使用插件 - This discussion suggests that the issue might be due to the API service not following the OpenAI standard for function calling [2].
  3. [Q&A] 使用第三方模型,为什么插件没有生效? - This discussion highlights that function calling is a feature specific to OpenAI models and may not be supported by third-party models [3].

For integrating plugins with the DeepSeek model in LobeChat, ensure you follow these steps:

  1. Obtain DeepSeek API Key:

    • Register and log in to the DeepSeek open platform.
    • Create and securely store an API key.
  2. Configure DeepSeek in LobeChat:

    • Access the App Settings interface in LobeChat.
    • Enter the obtained API key under the DeepSeek settings.
    • Choose a DeepSeek model for your assistant to start the conversation.

Refer to the detailed steps in the DeepSeek integration documentation [4].

For debugging, you can enable logging for DeepSeek by setting the environment variable DEBUG_DEEPSEEK_CHAT_COMPLETION to '1' [5].

If the issue persists, it might be related to the specific implementation of the function_calling feature in the DeepSeek model. Ensure that the plugin's API interfaces are correctly defined in the plugin manifest and that the JSON responses are handled as expected by the LobeChat framework [6][7].

To continue talking to Dosu, mention @dosu.

exqmjmz commented 1 month ago

image

智谱的GLM-4-PLUS也存在这样的问题

lobehubbot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


image

Zhipu’s GLM-4-PLUS also has this problem

BiFangKNT commented 1 month ago

你出问题的插件到底是哪个插件呢,是你的自定义插件吗?

lobehubbot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Which plug-in is your problem with? Is it your custom plug-in?

BiFangKNT commented 1 month ago

哦哦没认真看参数,下面的看起来是插件商店里的这个插件 image 上面的找衣服的插件是哪个呢?

lobehubbot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Oh, I didn’t look at the parameters carefully. The following looks like the plug-in in the plug-in store. image Which plug-in is the above for finding clothes?

exqmjmz commented 1 month ago

哦哦没认真看参数,下面的看起来是插件商店里的这个插件 image 上面的找衣服的插件是哪个呢?

lobehub文档里的,lobe-chat-plugin-template https://lobehub.com/zh/docs/usage/plugins/custom-plugin

lobehubbot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Oh, I didn’t look at the parameters carefully. The following looks like the plug-in in the plug-in store! [image](https://private-user-images.githubusercontent.com/93891533/366824221-49de7adb-adc4-4ad8-9aa2- 74b3e02104c4.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..3g37j6HXoHcZRtjTX7EiBB5NkcgWzb2BJeIUmCns9J0) Which plug-in is the above for finding clothes?

In the lobehub documentation, lobe-chat-plugin-template https://lobehub.com/zh/docs/usage/plugins/custom-plugin

arvinxx commented 3 weeks ago

发送对话消息,在返回需要返回的结果时,直接是只返回了json值

这个大概率是模型本身 Tools Calling 能力的问题。换 OpenAI 的试下呢?

lobehubbot commented 3 weeks ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


When sending a conversation message, when returning the results that need to be returned, only the json value is returned.

This is most likely a problem with the Tools Calling capability of the model itself. How about trying OpenAI instead?