dify icon indicating copy to clipboard operation
dify copied to clipboard

Request to support a feature that can add Text Generator type applications as tools for other types of applications, thereby unlocking the powerful combinatorial capabilities of dify.

Open TheChildWang opened this issue 1 year ago • 2 comments

Self Checks

1. Is this request related to a challenge you're experiencing?

I'd like to use the existing apps as tools in the agent, but now that I need to configure specs one by one, I hope there are easier ways to do this.

2. Describe the feature you'd like to see

Currently tools has Built-in and Custom categories, and I'd like to add an apps (or other name) category to support adding text-generation types to apps as tools.

3. How will this feature improve your workflow or experience?

unlocking the powerful combinatorial capabilities of dify.

4. Additional context or comments

No response

5. Can you help us with this feature?

  • [ ] I am interested in contributing to this feature.

TheChildWang avatar Jan 24 '24 06:01 TheChildWang

🤖

Hey @doucheng! Great to see you back here again. Hope you're doing well.

Thank you for your feature request. It's a great idea to enhance the combinatorial capabilities of dify by allowing Text Generator type applications to be added as tools for other types of applications.

Based on the current structure of the Tools component in the dify codebase, it is indeed possible to add this feature. The Tools component manages a list of external data tools, which can be added, edited, and removed dynamically.

To add a Text Generator type application as a tool, you can use the handleOpenExternalDataToolModal function to open a modal for adding a new tool, and then use the handleSaveExternalDataToolModal function to save the new tool to the list of external data tools. The handleValidateBeforeSaveExternalDataToolModal function can be used to ensure that the new tool does not conflict with existing tools.

Here is an example of how to add a Text Generator type application as a tool:

const textGeneratorTool: ExternalDataTool = {
  type: 'TextGenerator',
  label: 'My Text Generator',
  variable: 'my_text_generator',
  // other properties...
};

handleOpenExternalDataToolModal(textGeneratorTool, -1);

This will open the modal for adding a new tool with the properties of the Text Generator type application. After the user has configured the tool in the modal and clicked the save button, the handleSaveExternalDataToolModal function will be called to save the new tool to the list of external data tools.

You can find more details about the Tools component and how it manages the list of external data tools in the web/app/components/app/configuration/tools/index.tsx file.

Please let me know if you need further clarification or have any other questions.

Sources


This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

dosubot[bot] avatar Jan 24 '24 06:01 dosubot[bot]

This feature is already scheduled, the Text Generation App will be upgraded to the Workflow App soon. And the Workflow App can also be used as an Agent Tool or a Workflow Component.

takatost avatar Jan 24 '24 11:01 takatost

Close due to it's no longer active, if you have any questions, you can reopen it.

github-actions[bot] avatar Feb 09 '24 03:02 github-actions[bot]