Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Dekadenc opened this issue Apr 24, 2024 · 16 comments
Labels
enhancement New feature or request

Comments

@Dekadenc
Copy link

Problem Description

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

Solution Description

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

Alternatives Considered

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

Additional Context

No response

@Dekadenc Dekadenc added the enhancement New feature or request label Apr 24, 2024
@Issues-translate-bot
Copy link

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
Copy link
Owner

大部分插件都在 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
Copy link

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
Copy link
Author

大多数插件都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
Copy link

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
Copy link
Owner

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

@Issues-translate-bot
Copy link

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
Copy link
Author

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

@Issues-translate-bot
Copy link

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
Copy link
Owner

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

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

@Dekadenc
Copy link
Author

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
Copy link
Owner

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

@Issues-translate-bot
Copy link

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
Copy link
Author

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

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

@Issues-translate-bot
Copy link

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
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants