Issue: Optimization Suggestions for Input Parameter Design #22

Open
opened 2026-02-15 21:15:20 -05:00 by yindo · 0 comments
Owner

Originally created by @yjc980121 on GitHub (Mar 24, 2025).

Description:
In the current API design, the following input parameters are missing or need optimization:
Missing user parameter:
The current API design does not include the user parameter. The user parameter is an essential identifier for defining the end-user's identity, which is useful for retrieval and statistics. According to the OpenAI API format, the user parameter can be passed in, so it is recommended to explicitly add this parameter to the API.
Parameter encapsulation optimization:
The current API includes auto_generate_name and files parameters. Although the OpenAI API itself does not have files or inputs parameters, to facilitate developers in passing additional information, it is suggested to encapsulate these parameters reasonably to maintain the simplicity and compatibility of the API.
Suggestions:
Add user parameter:
Explicitly add the user parameter to the API input parameters.
Parameter type: string
Parameter description: User identifier, used to define the identity of the end-user for retrieval and statistics. Defined by the developer, and it must be unique within the application.
Optimize parameter encapsulation:
Encapsulate the auto_generate_name and files parameters into a unified inputs parameter. The inputs parameter can contain multiple key-value pairs, with each key corresponding to a specific variable and each value being the specific value of that variable.
Parameter type: object
Parameter description: Allows passing in various variable values defined by the app. For example:
auto_generate_name: Boolean value, indicating whether to automatically generate a title. The default value is true.
files: Array, containing information about uploaded files. Supported types include images (image). Transfer methods include:
remote_url: URL of the image.
local_file: Uploaded file.
url: URL of the image (only when the transfer method is remote_url).
upload_file_id: ID of the uploaded file (only when the transfer method is local_file).
Example:

{
  "query": "User input/question content",
  "inputs": {
    "auto_generate_name": true,
    "files": [
      {
        "type": "image",
        "transfer_method": "remote_url",
        "url": "http://example.com/image.jpg"
      }
    ]
  },
  "response_mode": "streaming",
  "user": "user12345",
  "conversation_id": "1234567890"
}

Applicable Scope:
chat.py
workflow.py
completion.py
Expected Outcome:
By implementing the above optimizations, the API design can be made more complete and flexible while maintaining compatibility with the OpenAI API, making it easier for developers to pass additional information.
Priority:
Medium

Originally created by @yjc980121 on GitHub (Mar 24, 2025). Description: In the current API design, the following input parameters are missing or need optimization: Missing user parameter: The current API design does not include the user parameter. The user parameter is an essential identifier for defining the end-user's identity, which is useful for retrieval and statistics. According to the OpenAI API format, the user parameter can be passed in, so it is recommended to explicitly add this parameter to the API. Parameter encapsulation optimization: The current API includes auto_generate_name and files parameters. Although the OpenAI API itself does not have files or inputs parameters, to facilitate developers in passing additional information, it is suggested to encapsulate these parameters reasonably to maintain the simplicity and compatibility of the API. Suggestions: Add user parameter: Explicitly add the user parameter to the API input parameters. Parameter type: string Parameter description: User identifier, used to define the identity of the end-user for retrieval and statistics. Defined by the developer, and it must be unique within the application. Optimize parameter encapsulation: Encapsulate the auto_generate_name and files parameters into a unified inputs parameter. The inputs parameter can contain multiple key-value pairs, with each key corresponding to a specific variable and each value being the specific value of that variable. Parameter type: object Parameter description: Allows passing in various variable values defined by the app. For example: auto_generate_name: Boolean value, indicating whether to automatically generate a title. The default value is true. files: Array, containing information about uploaded files. Supported types include images (image). Transfer methods include: remote_url: URL of the image. local_file: Uploaded file. url: URL of the image (only when the transfer method is remote_url). upload_file_id: ID of the uploaded file (only when the transfer method is local_file). Example: ```json { "query": "User input/question content", "inputs": { "auto_generate_name": true, "files": [ { "type": "image", "transfer_method": "remote_url", "url": "http://example.com/image.jpg" } ] }, "response_mode": "streaming", "user": "user12345", "conversation_id": "1234567890" } ``` Applicable Scope: [chat.py](https://github.com/langgenius/dify-plugin-sdks/blob/main/python/dify_plugin/invocations/app/chat.py) [workflow.py](https://github.com/langgenius/dify-plugin-sdks/blob/main/python/dify_plugin/invocations/app/workflow.py) [completion.py](https://github.com/langgenius/dify-plugin-sdks/blob/main/python/dify_plugin/invocations/app/completion.py) Expected Outcome: By implementing the above optimizations, the API design can be made more complete and flexible while maintaining compatibility with the OpenAI API, making it easier for developers to pass additional information. Priority: Medium
yindo added the enhancement label 2026-02-15 21:15:20 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-plugin-sdks#22