vector_str
(Union[str, Any]
): The string or object representation of a vector.List[float]
: A list of floats representing the vector.
route_name
(str
): The original route name.str
: The cleaned and formatted route name.
data
(dict
): Field values for the record.Dict
: A dictionary representation of the record.
connection_string
(Optional[str]
): The connection string for the PostgreSQL database.index_prefix
(str
): The prefix for the index table name.index_name
(str
): The name of the index table.dimensions
(int
): The number of dimensions for the vectors.metric
(Metric
): The metric used for vector comparisons.Optional[str]
0 (Optional[str]
): An optional namespace for the index.Optional[str]
2 (Optional[str]
3): Whether to initialize the index asynchronously.ValueError
: If the existing table’s vector dimensions do not match the expected dimensions.TypeError
: If the database connection is not established.embeddings
(List[List[float]]
): A list of vector embeddings to add.routes
(List[str]
): A list of route names corresponding to the embeddings.utterances
(List[Any]
): A list of utterances corresponding to the embeddings.function_schemas
(Optional[List[Dict[str, Any]]]
): A list of function schemas corresponding to the embeddings.metadata_list
(List[Dict[str, Any]]
): A list of metadata corresponding to the embeddings.List[List[float]]
0: If the vector embeddings being added do not match the expected dimensions.List[List[float]]
1: If the database connection is not established.embeddings
: A list of vector embeddings to add.routes
: A list of route names corresponding to the embeddings.utterances
: A list of utterances corresponding to the embeddings.function_schemas
: (Optional) List of function schemas.metadata_list
: (Optional) List of metadata dictionaries.batch_size
: Number of records per batch insert.ValueError
: If the vector embeddings don’t match expected dimensions.TypeError
: If connection is not an async Postgres connection.route_name
(str
): The name of the route to delete records for.TypeError
: If the database connection is not established.route_name
(str
): Name of the route to delete.list[str]
: List of IDs of the vectors deleted.
IndexConfig
: An IndexConfig object containing the index’s type, dimensions, and total vector count.
bool
: True if the index is ready, False otherwise.
bool
: True if the index is ready, False otherwise.
vector
(np.ndarray
): The query vector.top_k
(int
): The number of top results to return.route_filter
(Optional[List[str]]
): Optional list of routes to filter the results by.sparse_vector
(dict[int, float] | SparseEmbedding | None
): Optional sparse vector to filter the results by.TypeError
: If the database connection is not established.Tuple[np.ndarray, List[str]]
: A tuple containing the scores and routes of the top_k results.
vector
(np.ndarray
): The query vector to search for.top_k
(int, optional
): The number of top results to return, defaults to 5.route_filter
(Optional[List[str]], optional
): A list of route names to filter the search results, defaults to None.sparse_vector
(dict[int, float] | SparseEmbedding | None
): An optional sparse vector to include in the query.TypeError
: If the database connection is not established.Tuple[np.ndarray, List[str]]
: A tuple containing an array of scores and a list of route names.
TypeError
: If the database connection is not established.TypeError
: If the database connection is not established.TypeError
: If the async database connection is not established.TypeError
: If the database connection is not established.List[Tuple]
: A list of (route_name, utterance) objects.
int
: The total number of vectors.