Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

begin.mdx 3.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. ### Mode
  14. Mode defines how the workflow is triggered.
  15. - Conversational: The agent is triggered from a conversation.
  16. - Task: The agent starts without a conversation.
  17. ### Opening greeting
  18. **Conversational mode only.**
  19. An agent in conversational mode begins with an opening greeting. It is the agent's first message to the user in conversational mode, which can be a welcoming remark or an instruction to guide the user forward.
  20. ### Global variables
  21. You can define global variables within the **Begin** component, which can be either mandatory or optional. Once set, users will need to provide values for these variables when engaging with the agent. Click **+ Add variable** to add a global variable, each with the following attributes:
  22. - **Name**: _Required_
  23. A descriptive name providing additional details about the variable.
  24. - **Type**: _Required_
  25. The type of the variable:
  26. - **Single-line text**: Accepts a single line of text without line breaks.
  27. - **Paragraph text**: Accepts multiple lines of text, including line breaks.
  28. - **Dropdown 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.
  29. - **file upload**: Requires the user to upload one or multiple files.
  30. - **Number**: Accepts a number as input.
  31. - **Boolean**: Requires the user to toggle between on and off.
  32. - **Key**: _Required_
  33. The unique variable name.
  34. - **Optional**: A toggle indicating whether the variable is optional.
  35. :::tip NOTE
  36. To pass in parameters from a client, call:
  37. - HTTP method [Converse with agent](../../../references/http_api_reference.md#converse-with-agent), or
  38. - Python method [Converse with agent](../../../references/python_api_reference.md#converse-with-agent).
  39. :::
  40. :::danger IMPORTANT
  41. If you set the key type as **file**, ensure the token count of the uploaded file does not exceed your model provider's maximum token limit; otherwise, the plain text in your file will be truncated and incomplete.
  42. :::
  43. :::note
  44. You can tune document parsing and embedding efficiency by setting the environment variables `DOC_BULK_SIZE` and `EMBEDDING_BATCH_SIZE`.
  45. :::
  46. ## Frequently asked questions
  47. ### Is the uploaded file in a knowledge base?
  48. No. Files uploaded to an agent as input are not stored in a knowledge base and hence will not be processed using RAGFlow's built-in OCR, DLR or TSR models, or chunked using RAGFlow's built-in chunking methods.
  49. ### File size limit for an uploaded file
  50. There is no _specific_ file size limit for a file uploaded to an agent. However, note that model providers typically have a default or explicit maximum token setting, which can range from 8196 to 128k: The plain text part of the uploaded file will be passed in as the key value, but if the file's token count exceeds this limit, the string will be truncated and incomplete.
  51. :::tip NOTE
  52. The variables `MAX_CONTENT_LENGTH` in `/docker/.env` and `client_max_body_size` in `/docker/nginx/nginx.conf` set the file size limit for each upload to a knowledge base or **File Management**. These settings DO NOT apply in this scenario.
  53. :::