Send processed data from Unstructured to Redis.

The requirements are as follows.

To create or change a Redis destination connector, see the following examples.

# ...
from unstructured_client.models.shared import <Create|Update>DestinationConnector
# ...
destination_connector = <Create|Update>DestinationConnector(
    name="<name>", # Create only.
    type="redis", # Create only.
    config={
        "database": "<database>",
        "ssl": "<true|false>",
        "batch_size": <batch-size>,

        # For URI authentication:
        "uri": "<uri>"
      
        # For password authentication:
        "host": "<host>",
        "port": <port>,
        "username": "<username>",
        "password": "<password>"   
    }
)
# ...

Replace the preceding placeholders as follows:

  • <name> (required) - A unique name for this connector.
  • <uri> For URI authentication, the connection URI for the target database user and password, hostname, and port number. Use the format of redis://<username>:<password>@<hostname>:<port-number>. If SSL encryption is enabled for the database, use rediss:// instead of redis://.
  • <host> (required for password authentication): The target database’s hostname.
  • <port>: For password authentication, the database’s port number. The default is 6379 unless otherwise specified.
  • <username> (required for password authentication): The name of the database user (not the logged in user).
  • <password> (required for password authentication): The database user’s password.
  • <database>: The number (index) for the target database. The default is 0 unless otherwise specified.
  • For ssl, true to enable SSL encryption for the connection. Set to true only if SSL is already set up and enabled for the target database. The default is true unless otherwise specified.
  • <batch-size>: The maximum number of records to upload in a single batch. The default is 100 unless otherwise specified.

To change a connector, replace <connector-id> with the destination connector’s unique ID. To get this ID, see List destination connectors.