Hk-Gosuto / ChatGPT-Next-Web-LangChain

一键拥有你自己的 ChatGPT 网页服务。 One-Click to deploy your own ChatGPT web UI.(基于 langchain 实现的插件版本 Plugin version implemented based on langchain)
https://n3xt.chat
MIT License
1.08k stars 397 forks source link

[Feature Request]: 请问这个项目里边怎么做一个单独的插件出来,插件代码在哪里 #254

Open Dekadenc opened 3 months ago

Dekadenc commented 3 months ago

Problem Description

请问这个项目里边怎么做一个单独的插件出来,插件代码在哪里

Solution Description

请问这个项目里边怎么做一个单独的插件出来,插件代码在哪里

Alternatives Considered

请问这个项目里边怎么做一个单独的插件出来,插件代码在哪里

Additional Context

No response

Issues-translate-bot commented 3 months ago

Bot detected the issue body's language is not English, translate it automatically.


Title: [Feature Request]: How to create a separate plug-in in this project and where is the plug-in code?

Problem Description

Please tell me how to create a separate plug-in in this project and where is the plug-in code?

Solution Description

Please tell me how to create a separate plug-in in this project and where is the plug-in code?

Alternatives Considered

Please tell me how to create a separate plug-in in this project and where is the plug-in code?

Additional Context

No response

Hk-Gosuto commented 3 months ago

大部分插件都在 app/api/langchain-tools 根据你插件需要的运行时选择初始化的位置 app/api/langchain/tool/agent/nodejs/route.tsapp/api/langchain/tool/agent/edge/route.ts 修改 app/plugins/cn.tsapp/plugins/en.ts 来创建插件信息 里面的 toolName 要跟你的插件名对应

Issues-translate-bot commented 3 months ago

Bot detected the issue body's language is not English, translate it automatically.


Most plugins are in app/api/langchain-tools Choose the initialization location based on the runtime your plug-in needs. app/api/langchain/tool/agent/nodejs/route.ts or app/api/langchain/tool/agent/edge/route.ts Modify app/plugins/cn.ts and app/plugins/en.ts to create plugin information The toolName inside should correspond to your plug-in name.

Dekadenc commented 3 months ago

大多数插件都app/api/langchain-tools 根据您的插件需要的运行时初始化的位置 app/api/langchain/tool/agent/nodejs/route.tsapp/api/langchain/tool/agent/edge/route.ts 修改app/plugins/cn.tsapp/plugins/en.ts创建插件信息 内要的toolName插件名对应

mmexport1713953247546

再问下可以把调openai的接口换成调本地模型吗,还是不支持?

Issues-translate-bot commented 3 months ago

Bot detected the issue body's language is not English, translate it automatically.


Most plugins are in app/api/langchain-tools or app/api/langchain/ depending on where your plugin requires runtime initialization tool/agent/edge/route.ts Modify app/plugins/cn.ts and app/plugins/en.ts to create the corresponding toolName plugin name in the plugin information

mmexport1713953247546

I would like to ask again, can I change the openai interface to adjust the local model? Or is it not supported?

Hk-Gosuto commented 3 months ago

如果你的模型支持 openai 的函数调用接口形式,估计把模型名改成 openai 的几个模型也可以。 没测试过,毕竟支持函数调用的开源模型就不多。

Issues-translate-bot commented 3 months ago

Bot detected the issue body's language is not English, translate it automatically.


If your model supports the function calling interface form of openai, it is estimated that you can change the model name to several models of openai. I haven't tested it. After all, there are not many open source models that support function calling.

Dekadenc commented 2 months ago

你的模型支持 openai 的函数调用接口形式,估计把模型名改成 openai 的几个模型也可以。 这个做法试过了不行。 如果要改成通过ollama起的qwen模型调langchain插件,可以针对性的改哪些文件呢

Issues-translate-bot commented 2 months ago

Bot detected the issue body's language is not English, translate it automatically.


Your model supports the function calling interface form of openai. It is estimated that you can change the model name to several models of openai. I've tried this method but it doesn't work. If you want to change to adjust the langchain plug-in through the qwen model from ollama, which files can be modified specifically?

Hk-Gosuto commented 2 months ago

ollama 还没支持 openai 模拟接口的 Function calling 功能,或者你可以试试 groq 他们官方实现了 openai 兼容的 Function calling。

https://github.com/ollama/ollama/blob/main/docs/openai.md#v1chatcompletions

Dekadenc commented 2 months ago

ollama 还没支持 openai 模拟接口的 Function calling 功能,或者你可以试试 groq 他们官方实现了 openai 兼容的 Function calling。

https://github.com/ollama/ollama/blob/main/docs/openai.md#v1chatcompletions 您好,不是要ollama支持funcion call---这个是目前已知不支持的,这个项目能否改成ollama直调langchain,通过ollama直调langchain。

Hk-Gosuto commented 2 months ago

建议参考一下 langchainjs 的相关文档:https://js.langchain.com/docs/integrations/chat/ollama_functions

Issues-translate-bot commented 2 months ago

Bot detected the issue body's language is not English, translate it automatically.


It is recommended to refer to the relevant documentation of langchainjs: https://js.langchain.com/docs/integrations/chat/ollama_functions

Dekadenc commented 2 months ago

建议参考一下 langchainjs 的相关文档:https://js.langchain.com/docs/integrations/chat/ollama_functions

可以参考改工程里的哪些文件吗?

Issues-translate-bot commented 2 months ago

Bot detected the issue body's language is not English, translate it automatically.


It is recommended to refer to the relevant documentation of langchainjs: https://js.langchain.com/docs/integrations/chat/ollama_functions

Which files in the project can I refer to for modification?

Hk-Gosuto commented 2 months ago

langchian 相关业务的代码都在这里:app/api/langchain/tool/agent