ModelConfig type parameter. Its structure can be referenced in the General Specifications Definition, and this structure will have slight differences for different types of models.
For example, for LLM type models, it also needs to include completion_params and mode parameters. You can manually construct this structure or use model-selector type parameters or configurations.
Invoke LLM
Entry Point
Endpoint
tool_call capability, the tools passed here will not take effect.
Use Case
If you want to invoke OpenAI’sgpt-4o-mini model within a Tool, please refer to the following example code:
query parameter from tool_parameters is passed in the code.
Best Practice
It is not recommended to manually constructLLMModelConfig. Instead, allow users to select the model they want to use on the UI. In this case, you can modify the tool’s parameter list by adding a model parameter as follows:
scope of model is specified as llm. This means the user can only select llm type parameters. Thus, the code from the previous use case can be modified as follows:
Invoke Summary
You can request this endpoint to summarize a piece of text. It will use the system model within your current workspace to summarize the text. Entry Pointtextis the text to be summarized.instructionis the additional instruction you want to add, allowing you to summarize the text stylistically.
Invoke TextEmbedding
Entry PointInvoke Rerank
Entry PointInvoke TTS
Entry Pointbytes stream returned by the tts endpoint is an mp3 audio byte stream. Each iteration returns a complete audio segment. If you want to perform more in-depth processing tasks, please choose an appropriate library.
Invoke Speech2Text
Entry Pointfile is an audio file encoded in mp3 format.
Invoke Moderation
Entry Pointtrue, it indicates that the text contains sensitive content.
Related Resources
- Reverse Invocation of Dify Services - Understand the fundamental concepts of reverse invocation
- Reverse Invocation of App - Learn how to invoke Apps within the platform
- Reverse Invocation of Tool - Learn how to invoke other plugins
- Model Plugin Development Guide - Learn how to develop custom model plugins
- Model Designing Rules - Understand the design principles of model plugins
Edit this page | Report an issue