langgenius / dify

Dify is an open-source LLM app development platform. Dify's intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production.
https://dify.ai
Other
50.5k stars 7.24k forks source link

Stronger Parameter Exactor needed #7000

Closed cherry0411 closed 1 month ago

cherry0411 commented 2 months ago

Self Checks

1. Is this request related to a challenge you're experiencing? Tell me about your story.

Hello everyone, I would like to dynamically parse parameters from text, such as product model, brand, and size. Different products have different parameters, which may be passed in from the starting node or obtained through the HTTP node. Current parameter extractor can only support fixed parameters and cannot meet my needs. For example, I can pass in the following parameters at the start node: {"product_fields": [{"key": "field_1", "name": "brand", "description": "brand of the product", "type": "enum", "range": ["Nike", "Adidas", "Puma"]}, {"key": "field_2", "name": "size", "description": "size of the shoes of clothes", "type": "number"}}, and then use these parameters directly in the parameter extractor

2. Additional context or comments

No response

3. Can you help us with this feature?

crazywoola commented 2 months ago

I guess you want to parse some json string in the start node? If so, you can use text type which supports long context. Then you can use a code node to parse these parameters to meet your requirements. Does this solves your problem?

cherry0411 commented 2 months ago

No, it doesn't. Sorry for the confusion. I need function calling to extract parameters and values from text through LLM, which exactly Parameter Extractor node does. but currently parameters are fixed values we can only setup in the workflow editor, that's my problem, I need to dynamically setup parameters to be extract, on the runtime.

crazywoola commented 2 months ago

So this problem should be you need an agent during the workflow and it can call third-party services by it's own decision?

cherry0411 commented 2 months ago

Emmm... I don't think agent in workflow can solve this problem' cos tools in agent still have fixed parameters.

Simplest way, I think, is supporting variables in Parameter Extractor's parameter.

Weixin Screenshot_20240806161945