The function of the 'inputs' parameter in the robot configuration embedded in the web page, and what scenarios it is mainly used for. #5321

Closed
opened 2026-02-21 18:10:24 -05:00 by yindo · 2 comments
Owner

Originally created by @PlatonaBoy on GitHub (Aug 30, 2024).

Self Checks

  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Provide a description of requested docs changes

window.difyChatbotConfig = {
    // Required, automatically generated by Dify
    token: 'YOUR_TOKEN',
    // Optional, default is false
    isDev: false,
    // Optional, when isDev is true, default is 'https://dev.udify.app', otherwise default is 'https://udify.app'
    baseUrl: 'YOUR_BASE_URL',
    // Optional, It can accept any valid HTMLElement attribute other than `id`, such as `style`, `className`, etc
    containerProps: {},
    // Optional, If or not the button is allowed to be dragged, default is `false`
    draggable: false,
    // Optional, The axis along which the button is allowed to be dragged, default is `both`, can be `x`, `y`, `both`
    dragAxis: 'both',
    // Optional, An object of inputs that set in the dify chatbot
    inputs: {
        // key is the variable name
        // e.g.
        // name: "NAME"
    }
}

What is the function of the 'inputs' parameter in the robot configuration embedded in the web page, and what scenarios is it mainly used for? I want to select text with the mouse and talk to the robot directly. Is it feasible?

Originally created by @PlatonaBoy on GitHub (Aug 30, 2024). ### Self Checks - [X] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [X] I confirm that I am using English to submit report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [X] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [X] Please do not modify this template :) and fill in all the required fields. ### Provide a description of requested docs changes ``` window.difyChatbotConfig = { // Required, automatically generated by Dify token: 'YOUR_TOKEN', // Optional, default is false isDev: false, // Optional, when isDev is true, default is 'https://dev.udify.app', otherwise default is 'https://udify.app' baseUrl: 'YOUR_BASE_URL', // Optional, It can accept any valid HTMLElement attribute other than `id`, such as `style`, `className`, etc containerProps: {}, // Optional, If or not the button is allowed to be dragged, default is `false` draggable: false, // Optional, The axis along which the button is allowed to be dragged, default is `both`, can be `x`, `y`, `both` dragAxis: 'both', // Optional, An object of inputs that set in the dify chatbot inputs: { // key is the variable name // e.g. // name: "NAME" } } ``` What is the function of the 'inputs' parameter in the robot configuration embedded in the web page, and what scenarios is it mainly used for? I want to select text with the mouse and talk to the robot directly. Is it feasible?
yindo closed this issue 2026-02-21 18:10:24 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Aug 30, 2024):

@PlatonaBoy Hello there! I'm Dosu, a bot designed to help you solve bugs, answer questions, and become a contributor. I'm here to assist you while waiting for a human maintainer. How can I assist you today?

The inputs parameter in the robot configuration embedded in the web page is an object that allows you to set predefined input values for the Dify chatbot. These inputs can be of four types: text-input, paragraph, number, and options. Each input is processed—compressed using GZIP and encoded in base64—before being appended to the URL.

This parameter is mainly used for scenarios where you need to pass specific data to the chatbot when it is initialized. For example, you might want to pre-fill certain fields or provide context-specific information to the chatbot.

Example configuration:

window.difyChatbotConfig = {
    // Other configuration settings...
    inputs: {
        name: 'apple',
    },
}

In this example, the name input is set to 'apple'.

Supported input types:

  1. text-input: Accepts any value. If the input string exceeds the maximum allowed length, it will be truncated.
  2. paragraph: Similar to text-input, accepts any value and truncates if it exceeds the maximum length.
  3. number: Accepts a numeric value or a string that can be converted to a number.
  4. options: Accepts a value that matches one of the pre-defined options.

Additionally, the inputs parameter is processed and initialized from URL parameters when the chatbot is embedded. This allows for dynamic initialization based on URL parameters, making it flexible for various use cases such as personalized user experiences or context-specific interactions [1][2][3].

Regarding your question about selecting text with the mouse and talking to the robot directly, I wasn't able to find specific information within the repository about built-in support or additional configuration required to enable this feature. The answer may be available elsewhere or I could have missed it.

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Aug 30, 2024): <!-- Greeting --> @PlatonaBoy Hello there! I'm Dosu, a bot designed to help you solve bugs, answer questions, and become a contributor. I'm here to assist you while waiting for a human maintainer. How can I assist you today? <!-- Answer --> The `inputs` parameter in the robot configuration embedded in the web page is an object that allows you to set predefined input values for the Dify chatbot. These inputs can be of four types: `text-input`, `paragraph`, `number`, and `options`. Each input is processed—compressed using GZIP and encoded in base64—before being appended to the URL. This parameter is mainly used for scenarios where you need to pass specific data to the chatbot when it is initialized. For example, you might want to pre-fill certain fields or provide context-specific information to the chatbot. Example configuration: ```javascript window.difyChatbotConfig = { // Other configuration settings... inputs: { name: 'apple', }, } ``` In this example, the `name` input is set to 'apple'. Supported input types: 1. **`text-input`**: Accepts any value. If the input string exceeds the maximum allowed length, it will be truncated. 2. **`paragraph`**: Similar to `text-input`, accepts any value and truncates if it exceeds the maximum length. 3. **`number`**: Accepts a numeric value or a string that can be converted to a number. 4. **`options`**: Accepts a value that matches one of the pre-defined options. Additionally, the `inputs` parameter is processed and initialized from URL parameters when the chatbot is embedded. This allows for dynamic initialization based on URL parameters, making it flexible for various use cases such as personalized user experiences or context-specific interactions <sup>[[1]](https://github.com/langgenius/dify-docs/blob/main/en/guides/application-publishing/embedding-in-websites.md)</sup><sup>[[2]](https://github.com/langgenius/dify-docs/blob/main/jp/guides/application-publishing/embedding-in-websites.md)</sup><sup>[[3]](https://github.com/langgenius/dify/blob/main/web/app/components/base/chat/embedded-chatbot/hooks.tsx)</sup>. Regarding your question about selecting text with the mouse and talking to the robot directly, I wasn't able to find specific information within the repository about built-in support or additional configuration required to enable this feature. The answer may be available elsewhere or I could have missed it. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@crazywoola commented on GitHub (Aug 30, 2024):

See this PR https://github.com/langgenius/dify/pull/6376

I want to select text with the mouse and talk to the robot directly. Is it feasible?

This is another question, yes it is, you can see kimi's chrome extension. But it's not available in dify yet.

@crazywoola commented on GitHub (Aug 30, 2024): See this PR https://github.com/langgenius/dify/pull/6376 > I want to select text with the mouse and talk to the robot directly. Is it feasible? This is another question, yes it is, you can see kimi's chrome extension. But it's not available in dify yet.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#5321