Add I/O components documentation
This commit is contained in:
parent
f57af2da52
commit
6b286b02e5
2 changed files with 104 additions and 0 deletions
103
docs/docs/components/io.mdx
Normal file
103
docs/docs/components/io.mdx
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
import Admonition from '@theme/Admonition';
|
||||
|
||||
# I/O
|
||||
|
||||
## ChatInput
|
||||
|
||||
This component is designed to get user input from the chat.
|
||||
|
||||
**Params**
|
||||
|
||||
- **sender:** specifies the sender type. Defaults to _`"User"`_. Options are _`"Machine"`_ and _`"User"`_.
|
||||
|
||||
- **sender_name:** specifies the name of the sender. Defaults to _`"User"`_.
|
||||
|
||||
- **message:** specifies the message text. It is a multiline text input.
|
||||
|
||||
- **session_id:** specifies the session ID of the chat history.
|
||||
|
||||
- **as_record:** if true, the message will be returned as a _`Record`_. Defaults to _`false`_.
|
||||
|
||||
<Admonition type="note" title="Note">
|
||||
<p>
|
||||
If _`as_record`_ is _`true`_ and the _`message`_ is a _`Record`_, the data of the _`Record`_ will be updated with the _`sender`_, _`sender_name`_, and _`session_id`_.
|
||||
</p>
|
||||
</Admonition>
|
||||
|
||||
## ChatOutput
|
||||
|
||||
This component is designed to send a message to the chat.
|
||||
|
||||
**Params**
|
||||
|
||||
- **sender:** specifies the sender type. Defaults to _`"Machine"`_. Options are _`"Machine"`_ and _`"User"`_.
|
||||
|
||||
- **sender_name:** specifies the name of the sender. Defaults to _`"AI"`_.
|
||||
|
||||
- **session_id:** specifies the session ID of the chat history.
|
||||
|
||||
- **message:** specifies the message text.
|
||||
|
||||
- **as_record:** if true, the message will be returned as a _`Record`_. Defaults to _`false`_.
|
||||
|
||||
<Admonition type="note" title="Note">
|
||||
<p>
|
||||
If _`as_record`_ is _`true`_ and the _`message`_ is a _`Record`_, the data of the _`Record`_ will be updated with the _`sender`_, _`sender_name`_, and _`session_id`_.
|
||||
</p>
|
||||
</Admonition>
|
||||
## StoreMessages
|
||||
|
||||
This component is designed to store messages in a structured format. It can store messages provided directly as records or construct records from provided texts and metadata.
|
||||
|
||||
**Params**
|
||||
|
||||
- **records:** (Optional) Specifies the list of records to store. Each `Record` should contain the keys `'sender'`, `'sender_name'`, and `'session_id'`. If not provided, `texts` must be used along with `session_id`, `sender`, and `sender_name` to construct the records.
|
||||
|
||||
- **texts:** (Optional) Specifies the list of text messages to store. If `records` is not provided, `texts` must be provided along with `session_id`, `sender`, and `sender_name`.
|
||||
|
||||
- **session_id:** (Optional) Specifies the session ID associated with the messages. Required if `records` is not provided and `texts` are used.
|
||||
|
||||
- **sender:** (Optional) Specifies the identifier of the sender. Required if `records` is not provided and `texts` are used.
|
||||
|
||||
- **sender_name:** (Optional) Specifies the name of the sender. Required if `records` is not provided and `texts` are used.
|
||||
|
||||
<Admonition type="note" title="Note">
|
||||
<p>
|
||||
The component prioritizes the use of `records` for storing messages. If `records` are not provided, it requires `texts`, `session_id`, `sender`, and `sender_name` to construct and store records. Ensure that either `records` or the combination of `texts`, `session_id`, `sender`, and `sender_name` is provided.
|
||||
</p>
|
||||
</Admonition>
|
||||
|
||||
## MessageHistory
|
||||
|
||||
This component is designed to retrieve stored messages based on various filters such as sender type, sender name, and session ID. It allows for a flexible retrieval of chat history, providing insights into past interactions.
|
||||
|
||||
**Params**
|
||||
|
||||
- **sender:** (Optional) Specifies the type of the sender. Options are _`"Machine"`_ or _`"User"`_. Filters the messages by the type of sender.
|
||||
|
||||
- **sender_name:** (Optional) Specifies the name of the sender. Filters the messages by the name of the sender.
|
||||
|
||||
- **session_id:** (Optional) Specifies the session ID of the chat history. Filters the messages belonging to a specific session.
|
||||
|
||||
- **n_messages:** Specifies the number of messages to retrieve. Defaults to _`5`_. Determines how many recent messages from the chat history to fetch.
|
||||
|
||||
<Admonition type="note" title="Note">
|
||||
<p>
|
||||
The component retrieves messages based on the provided criteria. If no specific criteria are provided, it will return the most recent messages up to the specified limit. This component can be used to review past interactions and analyze the flow of conversations.
|
||||
</p>
|
||||
</Admonition>
|
||||
|
||||
|
||||
## TextInput
|
||||
|
||||
This component is designed for simple text input, allowing users to pass textual data to subsequent components in the workflow. It's particularly useful for scenarios where a brief user input is required to initiate or influence the process flow.
|
||||
|
||||
**Params**
|
||||
|
||||
- **value:** Specifies the text input value. This is where the user can input the text data that will be passed to the next component in the sequence. If no value is provided, it defaults to an empty string.
|
||||
|
||||
<Admonition type="note" title="Note">
|
||||
<p>
|
||||
The `TextInput` component serves as a straightforward means for capturing user input. It ensures that textual data can be seamlessly integrated into the Langflow's component-based processing pipeline, fostering interactivity within automated workflows.
|
||||
</p>
|
||||
</Admonition>
|
||||
|
|
@ -37,6 +37,7 @@ module.exports = {
|
|||
"components/chains",
|
||||
"components/custom",
|
||||
"components/embeddings",
|
||||
"components/io",
|
||||
"components/llms",
|
||||
"components/loaders",
|
||||
"components/memories",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue