Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

begin.mdx 3.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. ---
  2. sidebar_position: 1
  3. slug: /begin_component
  4. ---
  5. # Begin component
  6. The starting component in a workflow.
  7. ---
  8. The **Begin** component sets an opening greeting or accepts inputs from the user. It is automatically populated onto the canvas when you create an agent, whether from a template or from scratch (from a blank template). There should be only one **Begin** component in the workflow.
  9. ## Scenarios
  10. A **Begin** component is essential in all cases. Every agent includes a **Begin** component, which cannot be deleted.
  11. ## Configurations
  12. Click the component to display its **Configuration** window. Here, you can set an opening greeting and the input parameters (global variables) for the agent.
  13. ### ID
  14. The ID is the unique identifier for the component within the workflow. Unlike the IDs of other components, the ID of the **Begin** component *cannot* be changed.
  15. ### Opening greeting
  16. An opening greeting is the agent's first message to the user. It can be a welcoming remark or an instruction to guide the user forward.
  17. ### Global variables
  18. You can set global variables within the **Begin** component, which can be either required or optional. Once established, users will need to provide values for these variables when interacting or chatting with the agent. Click **+ Add variable** to add a global variable, each with the following attributes:
  19. :::caution WARNING
  20. If your agent's **Begin** component takes a variable, you *cannot* embed it into a webpage.
  21. :::
  22. - **Key**: *Required*
  23. The unique variable name.
  24. - **Name**: *Required*
  25. A descriptive name providing additional details about the variable.
  26. For example, if **Key** is set to `lang`, you can set its **Name** to `Target language`.
  27. - **Type**: *Required*
  28. The type of the variable:
  29. - **line**: Accepts a single line of text without line breaks.
  30. - **paragraph**: Accepts multiple lines of text, including line breaks.
  31. - **options**: Requires the user to select a value for this variable from a dropdown menu. And you are required to set *at least* one option for the dropdown menu.
  32. - **file**: Requires the user to upload one or multiple files.
  33. - **integer**: Accepts an integer as input.
  34. - **boolean**: Requires the user to toggle between on and off.
  35. - **Optional**: A toggle indicating whether the variable is optional.
  36. ## Examples
  37. As mentioned earlier, the **Begin** component is indispensable for an agent. Still, you can take a look at our three-step interpreter agent template, where the **Begin** component takes two global variables:
  38. 1. Click the **Agent** tab at the top center of the page to access the **Agent** page.
  39. 2. Click **+ Create agent** on the top right of the page to open the **agent template** page.
  40. 3. On the **agent template** page, hover over the **Interpreter** card and click **Use this template**.
  41. 4. Name your new agent and click **OK** to enter the workflow editor.
  42. 5. Click on the **Begin** component to display its **Configuration** window.
  43. ## Frequently asked questions
  44. ### Is the uploaded file in a knowledge base?
  45. No. Files uploaded to an agent as input are not stored in a knowledge base and will not be chunked using RAGFlow's built-in chunk methods. However, RAGFlow's built-in OSR, DLR, and TSR models will still be applied to process the document.
  46. ### How to upload a webpage or file from a URL?
  47. If you set the type of a variable as **file**, your users will be able to upload a file either from their local device or from an accessible URL. For example:
  48. ![upload_file](https://github.com/user-attachments/assets/7ad2a352-0807-4b74-b8d1-d09e5cd37997)
  49. ### File size limit for an uploaded file
  50. The maximum file size for each uploaded file is determined by the variable `MAX_CONTENT_LENGTH` in `/docker/.env`. It defaults to 128 MB. If you change the default file size, ensure you also update the value of `client_max_body_size` in `/docker/nginx/nginx.conf` accordingly.