# README
title: "Redis" lang: "en-US" draft: false description: "Learn about how to set up a VDP Redis component https://github.com/instill-ai/instill-core"
The Redis component is a data component that allows users to manage data in NoSQL Redis databases. It can carry out the following tasks:
Release Stage
Alpha
Configuration
The component definition and tasks are defined in the definition.json and tasks.json files respectively.
Setup
In order to communicate with Redis Labs, the following connection details need to be
provided. You may specify them directly in a pipeline recipe as key-value pairs
within the component's setup
block, or you can create a Connection from
the Integration Settings
page and reference the whole setup
as setup: ${connection.<my-connection-id>}
.
Field | Field ID | Type | Note |
---|---|---|---|
Host (required) | host | string | Redis host to connect to |
Port (required) | port | integer | Port of Redis |
Username | username | string | Username associated with Redis |
Password | password | string | Password associated with Redis |
SSL Connection | ssl | boolean | Indicates whether SSL encryption protocol will be used to connect to Redis. It is recommended to use SSL connection if possible. |
Supported Tasks
Retrieve Chat History
Retrieve chat history from Redis.
Input | ID | Type | Description |
---|---|---|---|
Task ID (required) | task | string | TASK_RETRIEVE_CHAT_HISTORY |
Session ID (required) | session-id | string | A unique identifier for the chat session |
Latest K | latest-k | integer | The number of latest conversation turns to retrieve. A conversation turn typically includes one participant speaking or sending a message, and the other participant(s) responding to it. |
Include System Message If Exists | include-system-message | boolean | Include system message in the retrieved conversation turns if exists |
Output | ID | Type | Description |
---|---|---|---|
Chat Message | messages | array[object] | Messages |
Output Objects in Retrieve Chat History
Chat Message
Field | Field ID | Type | Note |
---|---|---|---|
Content | content | array | The message content |
Metadata | metadata | object | The message metadata |
Role | role | string | The message role, i.e. 'system', 'user' or 'assistant' |
Content
Field | Field ID | Type | Note |
---|---|---|---|
Image URL | image-url | object | The image URL |
Text | text | string | The text content. |
Type | type | string | The type of the content part. |
Image URL
Field | Field ID | Type | Note |
---|---|---|---|
URL | url | string | Either a URL of the image or the base64 encoded image data. |
Write Chat Message
Write chat message into Redis.
Input | ID | Type | Description |
---|---|---|---|
Task ID (required) | task | string | TASK_WRITE_CHAT_MESSAGE |
Session ID (required) | session-id | string | A unique identifier for the chat session |
Role (required) | role | string | The message role, i.e. 'system', 'user' or 'assistant' |
Content (required) | content | string | The message content |
Metadata | metadata | object | The message metadata |
Output | ID | Type | Description |
---|---|---|---|
Status | status | boolean | The status of the write operation |
Write Multi Modal Chat Message
Write multi-modal chat message into Redis.
Input | ID | Type | Description |
---|---|---|---|
Task ID (required) | task | string | TASK_WRITE_MULTI_MODAL_CHAT_MESSAGE |
Session ID (required) | session-id | string | A unique identifier for the chat session |
Role (required) | role | string | The message role, i.e. 'system', 'user' or 'assistant' |
Content (required) | content | string | The multi-modal message content |
Metadata | metadata | object | The message metadata |
Output | ID | Type | Description |
---|---|---|---|
Status | status | boolean | The status of the write operation |
# Functions
No description provided by the author
NewClient creates a new redis client.
RetrieveSessionMessages retrieves the latest K conversation turns from the Redis list for the given session ID.
RetrieveSystemMessage gets system message based on a given session ID.
No description provided by the author
No description provided by the author
No description provided by the author
WriteSystemMessage writes system message for a given session ID.
# Variables
DefaultLatestK is the default number of latest conversation turns to retrieve.
# Structs
No description provided by the author
ChatHistoryReadOutput is a wrapper struct for the messages associated with a session ID.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author