You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fetch_k (int): Number of Documents to fetch to pass to MMR algorithm.
114
117
lambda_mult (float): Number between 0 and 1 that determines the degree of diversity among the results with 0 corresponding to maximum diversity and 1 to minimum diversity. Defaults to 0.5.
115
118
index_query_options (QueryOptions): Index query option.
119
+
hybrid_search_config (HybridSearchConfig): Hybrid search configuration. Defaults to None.
120
+
hybrid_search_column_exists (bool): Defines whether the existing table has the hybrid search column.
fetch_k (int): Number of Documents to fetch to pass to MMR algorithm.
176
184
lambda_mult (float): Number between 0 and 1 that determines the degree of diversity among the results with 0 corresponding to maximum diversity and 1 to minimum diversity. Defaults to 0.5.
177
185
index_query_options (QueryOptions): Index query option.
186
+
hybrid_search_config (HybridSearchConfig): Hybrid search configuration. Defaults to None.
187
+
hybrid_search_column_exists (bool): Defines whether the existing table has the hybrid search column.
178
188
179
189
Returns:
180
190
AsyncAlloyDBVectorStore
@@ -203,6 +213,15 @@ async def create(
203
213
raiseValueError(
204
214
f"Content column, {content_column}, is type, {content_type}. It must be a type of character string."
insert_stmt=f'INSERT INTO "{self.schema_name}"."{self.table_name}"("{self.id_column}", "{self.content_column}", "{self.embedding_column}"{metadata_col_names}'
insert_stmt=f'INSERT INTO "{self.schema_name}"."{self.table_name}"("{self.id_column}", "{self.content_column}", "{self.embedding_column}"{hybrid_search_column}{metadata_col_names}'
upsert_stmt=f' ON CONFLICT ("{self.id_column}") DO UPDATE SET "{self.content_column}" = EXCLUDED."{self.content_column}", "{self.embedding_column}" = EXCLUDED."{self.embedding_column}"'
fetch_k (int): Number of Documents to fetch to pass to MMR algorithm.
487
521
lambda_mult (float): Number between 0 and 1 that determines the degree of diversity among the results with 0 corresponding to maximum diversity and 1 to minimum diversity. Defaults to 0.5.
488
522
index_query_options (QueryOptions): Index query option.
523
+
hybrid_search_column_exists (bool): Defines whether the existing table has the hybrid search column.
489
524
490
525
Raises:
491
526
:class:`InvalidTextRepresentationError <asyncpg.exceptions.InvalidTextRepresentationError>`: if the `ids` data type does not match that of the `id_column`.
fetch_k (int): Number of Documents to fetch to pass to MMR algorithm.
556
593
lambda_mult (float): Number between 0 and 1 that determines the degree of diversity among the results with 0 corresponding to maximum diversity and 1 to minimum diversity. Defaults to 0.5.
557
594
index_query_options (QueryOptions): Index query option.
595
+
hybrid_search_column_exists (bool): Defines whether the existing table has the hybrid search column.
558
596
559
597
Raises:
560
598
:class:`InvalidTextRepresentationError <asyncpg.exceptions.InvalidTextRepresentationError>`: if the `ids` data type does not match that of the `id_column`.
stmt=f'SELECT {column_names}, {search_function}({self.embedding_column}, {query_embedding}) as distance FROM "{self.schema_name}"."{self.table_name}" {filter} ORDER BY {self.embedding_column}{operator}{query_embedding} LIMIT {k};'
673
+
dense_query_stmt=f'SELECT {column_names}, {search_function}({self.embedding_column}, {query_embedding}) as distance FROM "{self.schema_name}"."{self.table_name}" {where_filters} ORDER BY {self.embedding_column}{operator}{query_embedding} LIMIT {k};'
sparse_query_stmt=f'SELECT {column_names}, ts_rank_cd({content_tsv}, {query_tsv}) as distance FROM "{self.schema_name}"."{self.table_name}" WHERE {content_tsv} @@ {query_tsv}{and_filters} ORDER BY distance desc LIMIT {hybrid_search_config.secondary_top_k};'
stmt=f"CREATE INDEX {'CONCURRENTLY'ifconcurrentlyelse''}{name} ON \"{self.schema_name}\".\"{self.table_name}\" USING {index.index_type} ({self.embedding_column}{function}) {params}{filter};"
1004
+
tsv_index_query= (
1005
+
f'CREATE INDEX IF NOT EXISTS {self.hybrid_search_config.index_name} ON table_name USING {self.hybrid_search_config.index_type}("{self.content_column}");'
0 commit comments