SingleStoreDBSemanticCache(
self,
embedding: Embeddings,
*,
cache_table_prefix: str = 'cache_',
search_threshold: float| Name | Type | Description |
|---|---|---|
embedding* | Embeddings | A text embedding model. |
cache_table_prefix | str | Default: 'cache_'Prefix for the cache table name. Defaults to "cache_". |
search_threshold | float | Default: 0.2The minimum similarity score for a search result to be considered a match. Defaults to 0.2. |
Following arguments pertrain to the SingleStoreDB vector store* | unknown | |
distance_strategy* | DistanceStrategy | |
content_field* | str | |
metadata_field* | str | |
vector_field* | str | |
id_field* | str | |
use_vector_index* | bool | |
vector_index_name* | str | |
vector_index_options* | dict | |
vector_size* | int | |
Following arguments pertain to the connection pool* | unknown | |
pool_size* | int | |
max_overflow* | int | |
timeout* | float | |
Following arguments pertain to the database connection* | unknown | |
host* | str | |
user* | str | |
password* | str | |
port* | int | |
database* | str | |
database connection* | unknown | |
pure_python* | bool | |
local_infile* | bool | |
charset* | str | |
ssl_key* | str | |
ssl_cert* | str | |
ssl_ca* | str | |
ssl_cipher* | str | |
ssl_disabled* | bool | |
ssl_verify_cert* | bool | |
ssl_verify_identity* | bool | |
conv* | dict[int, Callable] | |
credential_type* | str | |
autocommit* | bool | |
results_type* | str | |
results_format* | str |
| Name | Type |
|---|---|
| embedding | Embeddings |
| cache_table_prefix | str |
| search_threshold | float |
Cache that uses SingleStore DB as a backend
Determines the strategy employed for calculating the distance between vectors in the embedding space. Defaults to DOT_PRODUCT. Available options are:
Specifies the field to store the content. Defaults to "content".
Specifies the field to store metadata. Defaults to "metadata".
Specifies the field to store the vector. Defaults to "vector".
Specifies the field to store the id. Defaults to "id".
Toggles the use of a vector index. Works only with SingleStoreDB 8.5 or later. Defaults to False. If set to True, vector_size parameter is required to be set to a proper value.
Specifies the name of the vector index. Defaults to empty. Will be ignored if use_vector_index is set to False.
Specifies the options for the vector index. Defaults to {}. Will be ignored if use_vector_index is set to False. The options are: index_type (str, optional): Specifies the type of the index. Defaults to IVF_PQFS. For more options, please refer to the SingleStoreDB documentation: https://docs.singlestore.com/cloud/reference/sql-reference/vector-functions/vector-indexing/
Specifies the size of the vector. Defaults to 1536. Required if use_vector_index is set to True. Should be set to the same value as the size of the vectors stored in the vector_field.
Determines the number of active connections in the pool. Defaults to 5.
Determines the maximum number of connections allowed beyond the pool_size. Defaults to 10.
Specifies the maximum wait time in seconds for establishing a connection. Defaults to 30.
Specifies the hostname, IP address, or URL for the database connection. The default scheme is "mysql".
Database username.
Database password.
Database port. Defaults to 3306 for non-HTTP connections, 80 for HTTP connections, and 443 for HTTPS connections.
Database name.
Toggles the connector mode. If True, operates in pure Python mode.
Allows local file uploads.
Specifies the character set for string values.
Specifies the path of the file containing the SSL key.
Specifies the path of the file containing the SSL certificate.
Specifies the path of the file containing the SSL certificate authority.
Sets the SSL cipher list.
Disables SSL usage.
Verifies the server's certificate.
Automatically enabled if ssl_ca is specified.
Verifies the server's identity.
A dictionary of data conversion functions.
Specifies the type of authentication to use: auth.PASSWORD, auth.JWT, or auth.BROWSER_SSO.
Enables autocommits.
Determines the structure of the query results: tuples, namedtuples, dicts.
Deprecated. This option has been renamed to results_type.