Repository navigation
🚢 docs: Correct the Deployment and Development Guides #866
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,6 +10,10 @@ description: This doc shows you how to create custom plugins for LibreChat by ex | |
|
|
||
| # Making your own Tools/Plugins | ||
|
|
||
| <Callout type="warning" title="This walkthrough predates the current code"> | ||
| The steps below were written for an older version of the codebase. Tools now live in `api/app/clients/tools/structured/` and are registered in `api/app/clients/tools/util/handleTools.js`, so file names and function shapes in the examples may differ from the current tree. For new integrations, use [MCP servers](/docs/features/agents#model-context-protocol-mcp) or [Agents tools and actions](/docs/features/agents) instead. | ||
| </Callout> | ||
|
|
||
| <Callout type="warning" title="Warning"> | ||
| Please refer to the most recents tools used with assistants in `api/app/clients/tools/structured/` | ||
| since plugins will be deprecated in favor of tools in the near future | ||
|
|
@@ -49,15 +53,15 @@ Here are the key takeaways for creating your own plugin: | |
|
|
||
| Remember, the key to creating a custom plugin is to extend the `Tool` class and implement the `_call` method. The `_call` method is where you define what your plugin does. You can also define helper methods and properties in your class to support the functionality of your plugin. | ||
|
|
||
| **Note: You can find all the files mentioned in this guide in the `.\api\app\langchain\tools` folder.** | ||
| **Note: You can find all the files mentioned in this guide in the `api/app/clients/tools` folder.** | ||
|
|
||
| --- | ||
|
|
||
| ## StructuredTools | ||
|
|
||
| **Multi-Input Plugins** | ||
|
|
||
| If you would like to make a plugin that would benefit from multiple inputs from the LLM, instead of a singular input string as we will review, you need to make a LangChain **[StructuredTool](https://blog.langchain.dev/structured-tools/)** instead. A detailed guide for this is in progress, but for now, you can look at how I've made StructuredTools in this directory: `api\app\clients\tools\structured\`. This guide is foundational to understanding StructuredTools, and it's recommended you continue reading to better understand LangChain tools first. The blog linked above is also helpful once you've read through this guide. | ||
| If you would like to make a plugin that would benefit from multiple inputs from the LLM, instead of a singular input string as we will review, you need to make a LangChain **[StructuredTool](https://blog.langchain.dev/structured-tools/)** instead. A detailed guide for this is in progress, but for now, you can look at how I've made StructuredTools in this directory: `api/app/clients/tools/structured/`. This guide is foundational to understanding StructuredTools, and it's recommended you continue reading to better understand LangChain tools first. The blog linked above is also helpful once you've read through this guide. | ||
|
|
||
| --- | ||
|
|
||
|
|
@@ -160,16 +164,16 @@ class StableDiffusionAPI extends Tool { | |
|
|
||
| ## Step 5: Export Your Plugin and import into handleTools.js | ||
|
|
||
| **This process will be somewhat automated in the future, as long as you have your plugin/tool in `api\app\langchain\tools`** | ||
| **This process will be somewhat automated in the future, as long as you have your plugin/tool in `api/app/clients/tools`** | ||
|
|
||
| ```javascript | ||
| // Export | ||
| module.exports = StableDiffusionAPI | ||
| ``` | ||
|
|
||
| ```js | ||
| /* api\app\langchain\tools\handleTools.js */ | ||
| const StableDiffusionAPI = require('./StableDiffusion'); | ||
| /* api/app/clients/tools/util/handleTools.js */ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
After changing the documented file to Useful? React with 👍 / 👎.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in 7d0432e: the import is require('../StableDiffusion') from tools/util. |
||
| const StableDiffusionAPI = require('../StableDiffusion'); | ||
| ... | ||
| ``` | ||
|
|
||
|
|
@@ -233,7 +237,7 @@ module.exports = { | |
|
|
||
| ## Step 7: Add your Plugin to manifest.json | ||
|
|
||
| **This process will be somehwat automated in the future along with step 5, as long as you have your plugin/tool in `api\app\langchain\tools`, and your plugin can be initialized with the default method** | ||
| **This process will be somehwat automated in the future along with step 5, as long as you have your plugin/tool in `api/app/clients/tools`, and your plugin can be initialized with the default method** | ||
|
|
||
| ```json | ||
| { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.