From 8abfd0e6cd1dde551f2b448f8075c4db03cd075b Mon Sep 17 00:00:00 2001 From: George Date: Fri, 18 Oct 2024 10:55:50 +0400 Subject: [PATCH] fix: fix docstrings to make sphinx happy (#814) * fix: fix docstrings to make sphinx happy * debug: downgrade poetry version * fix: update virtualenv * debug: remove debug line --- qdrant_client/async_qdrant_client.py | 202 +++++++++++------------ qdrant_client/async_qdrant_fastembed.py | 6 +- qdrant_client/qdrant_client.py | 205 ++++++++++++------------ qdrant_client/qdrant_fastembed.py | 6 +- tools/generate_docs_netlify.sh | 4 +- 5 files changed, 208 insertions(+), 215 deletions(-) diff --git a/qdrant_client/async_qdrant_client.py b/qdrant_client/async_qdrant_client.py index de91e143..7402b546 100644 --- a/qdrant_client/async_qdrant_client.py +++ b/qdrant_client/async_qdrant_client.py @@ -431,8 +431,7 @@ async def query_points( - If `SparseVector` - use as a sparse vector for nearest search. - If `Query` - use as a query for specific search type. - If `NumpyArray` - use as a dense vector for nearest search. - - If `Document` - infer vector from the document text and use - it for nearest search (requires `fastembed` package installed). + - If `Document` - infer vector from the document text and use it for nearest search (requires `fastembed` package installed). - If `None` - return first `limit` points from the collection. prefetch: prefetch queries to make a selection of the data to be used with the main query query_filter: @@ -569,8 +568,7 @@ async def query_points_groups( - If `SparseVector` - use as a sparse vector for nearest search. - If `Query` - use as a query for specific search type. - If `NumpyArray` - use as a dense vector for nearest search. - - If `Document` - infer vector from the document text and use - it for nearest search (requires `fastembed` package installed). + - If `Document` - infer vector from the document text and use it for nearest search (requires `fastembed` package installed). - If `None` - return first `limit` points from the collection. prefetch: prefetch queries to make a selection of the data to be used with the main query query_filter: @@ -579,8 +577,7 @@ async def query_points_groups( search_params: Additional search params limit: How many results return group_size: How many results return for each group - group_by: Name of the payload field to group by. - Field must be of type "keyword" or "integer". + group_by: Name of the payload field to group by. Field must be of type "keyword" or "integer". Nested fields are specified using dot notation, e.g. "nested_field.subfield". with_payload: - Specify which stored payload should be attached to the result. @@ -924,26 +921,26 @@ async def search_matrix_pairs( shard_key_selector: Optional[types.ShardKeySelector] = None, **kwargs: Any, ) -> types.SearchMatrixPairsResponse: - """Compute distance matrix for sampled points with a pair-based output format. + """ + Compute distance matrix for sampled points with a pair-based output format. + Args: - collection_name: Name of the collection - query_filter: Filter to apply - limit: How many neighbours per sample to find - sample: How many points to select and search within - using: Name of the vectors to use for search. - If `None` - use default vectors. - consistency: - Read consistency of the search. Defines how many replicas should be queried before returning the result. Values: - - int - number of replicas to query, values should present in all queried replicas - - 'majority' - query all replicas, but return values present in the majority of replicas - - 'quorum' - query the majority of replicas, return values present in all of them - - 'all' - query all replicas, and return values present in all replicas + collection_name: Name of the collection. + query_filter: Filter to apply. + limit: How many neighbors per sample to find. + sample: How many points to select and search within. + using: Name of the vectors to use for search. If `None`, use default vectors. + consistency: Read consistency of the search. Defines how many replicas should be queried before returning the result. Values: + - int: Number of replicas to query, values should be present in all queried replicas. + - 'majority': Query all replicas, but return values present in the majority of replicas. + - 'quorum': Query the majority of replicas, return values present in all of them. + - 'all': Query all replicas, and return values present in all replicas. timeout: Overrides global timeout for this search. Unit is seconds. - shard_key_selector: - This parameter allows to specify which shards should be queried. - If `None` - query all shards. Only works for collections with `custom` sharding method. + shard_key_selector: This parameter allows specifying which shards should be queried. + If `None`, query all shards. Only works for collections with the `custom` sharding method. + Returns: - Return distance matrix using a pair-based encoding. + Distance matrix using a pair-based encoding. """ assert len(kwargs) == 0, f"Unknown arguments: {list(kwargs.keys())}" return await self._client.search_matrix_pairs( @@ -970,26 +967,26 @@ async def search_matrix_offsets( shard_key_selector: Optional[types.ShardKeySelector] = None, **kwargs: Any, ) -> types.SearchMatrixOffsetsResponse: - """Compute distance matrix for sampled points with an offset-based output format. + """ + Compute distance matrix for sampled points with an offset-based output format. + Args: - collection_name: Name of the collection - query_filter: Filter to apply - limit: How many neighbours per sample to find - sample: How many points to select and search within - using: Name of the vectors to use for search. - If `None` - use default vectors. - consistency: - Read consistency of the search. Defines how many replicas should be queried before returning the result. Values: - - int - number of replicas to query, values should present in all queried replicas - - 'majority' - query all replicas, but return values present in the majority of replicas - - 'quorum' - query the majority of replicas, return values present in all of them - - 'all' - query all replicas, and return values present in all replicas + collection_name: Name of the collection. + query_filter: Filter to apply. + limit: How many neighbors per sample to find. + sample: How many points to select and search within. + using: Name of the vectors to use for search. If `None`, use default vectors. + consistency: Read consistency of the search. Defines how many replicas should be queried before returning the result. Values: + - int: Number of replicas to query, values should present in all queried replicas. + - 'majority': Query all replicas, but return values present in the majority of replicas. + - 'quorum': Query the majority of replicas, return values present in all of them. + - 'all': Query all replicas and return values present in all replicas. timeout: Overrides global timeout for this search. Unit is seconds. - shard_key_selector: - This parameter allows to specify which shards should be queried. - If `None` - query all shards. Only works for collections with `custom` sharding method. + shard_key_selector: This parameter allows specifying which shards should be queried. + If `None`, query all shards. Only works for collections with the `custom` sharding method. + Returns: - Return distance matrix using an offset-based encoding. + Distance matrix using an offset-based encoding. """ assert len(kwargs) == 0, f"Unknown arguments: {list(kwargs.keys())}" return await self._client.search_matrix_offsets( @@ -1513,7 +1510,7 @@ async def delete_vectors( collection_name (str): Name of the collection to delete vector from vectors: List of names of the vectors to delete. Use `""` to delete the default vector. At least one vector should be specified. points (Point): Selects points based on list of IDs or filter - Examples + Examples: - `points=[1, 2, 3, "cd3b53f0-11a7-449f-bc50-d06310e7ed90"]` - `points=Filter(must=[FieldCondition(key='rand_number', range=Range(gte=0.7))])` @@ -1620,7 +1617,7 @@ async def delete( - If `true`, result will be returned only when all changes are applied - If `false`, result will be returned immediately after the confirmation of receiving. points_selector: Selects points based on list of IDs or filter. - Examples + Examples: - `points=[1, 2, 3, "cd3b53f0-11a7-449f-bc50-d06310e7ed90"]` - `points=Filter(must=[FieldCondition(key='rand_number', range=Range(gte=0.7))])` @@ -1659,81 +1656,76 @@ async def set_payload( shard_key_selector: Optional[types.ShardKeySelector] = None, **kwargs: Any, ) -> types.UpdateResult: - """Modifies payload of the specified points + """ + Modifies payload of the specified points. Examples: - `Set payload`:: + `Set payload`:: - # Assign payload value with key `"key"` to points 1, 2, 3. - # If payload value with specified key already exists - it will be overwritten - qdrant_client.set_payload( - collection_name="test_collection", - wait=True, - payload={ - "key": "value" - }, - points=[1,2,3] - ) + # Assign payload value with key `"key"` to points 1, 2, 3. + # If payload value with specified key already exists - it will be overwritten + qdrant_client.set_payload( + collection_name="test_collection", + wait=True, + payload={ + "key": "value" + }, + points=[1, 2, 3] + ) Args: - collection_name: Name of the collection + collection_name: Name of the collection. wait: Await for the results to be processed. - - - If `true`, result will be returned only when all changes are applied - - If `false`, result will be returned immediately after the confirmation of receiving. - payload: Key-value pairs of payload to assign - points: List of affected points, filter or points selector - Example - + - If `true`, the result will be returned only when all changes are applied. + - If `false`, the result will be returned immediately after confirmation of receipt. + payload: Key-value pairs of payload to assign. + points: List of affected points, filter, or points selector. + Example: - `points=[1, 2, 3, "cd3b53f0-11a7-449f-bc50-d06310e7ed90"]` - `points=Filter(must=[FieldCondition(key='rand_number', range=Range(gte=0.7))])` ordering (Optional[WriteOrdering]): Define strategy for ordering of the points. Possible values: - - - `weak` (default) - write operations may be reordered, works faster - - `medium` - write operations go through dynamically selected leader, may be inconsistent for a short period of time in case of leader change - - `strong` - Write operations go through the permanent leader, consistent, but may be unavailable if leader is down - - shard_key_selector: - Defines the shard groups that should be used to write updates into. - If multiple shard_keys are provided, the update will be written to each of them. - Only works for collections with `custom` sharding method. - - key: Path to the nested field in the payload to modify. If not specified - modify the root of the - payload. E.g.: - - PointStruct( - id=42, - vector=[...], - payload={ - "recipe": { - "fruits": {"apple": "100g"} + - `weak` (default): Write operations may be reordered, works faster. + - `medium`: Write operations go through a dynamically selected leader, may be inconsistent for a short period of time in case of leader change. + - `strong`: Write operations go through the permanent leader, consistent, but may be unavailable if the leader is down. + shard_key_selector: Defines the shard groups that should be used to write updates into. + If multiple shard keys are provided, the update will be written to each of them. + Only works for collections with the `custom` sharding method. + key: Path to the nested field in the payload to modify. If not specified, modifies the root of the payload. + E.g.:: + + PointStruct( + id=42, + vector=[...], + payload={ + "recipe": { + "fruits": {"apple": "100g"} + } } - } - ) - - qdrant_client.set_payload( - ..., - payload = {"cinnamon": "2g"}, - key = "recipe.fruits", - points=[42] - ) - - PointStruct( - id=42, - vector=[...], - payload={ - "recipe": { - "fruits": { - "apple": "100g", - "cinnamon": "2g" + ) + + qdrant_client.set_payload( + ..., + payload={"cinnamon": "2g"}, + key="recipe.fruits", + points=[42] + ) + + PointStruct( + id=42, + vector=[...], + payload={ + "recipe": { + "fruits": { + "apple": "100g", + "cinnamon": "2g" + } } } - } - ) + ) Returns: - Operation result + Operation result. """ assert len(kwargs) == 0, f"Unknown arguments: {list(kwargs.keys())}" return await self._client.set_payload( @@ -1784,7 +1776,7 @@ async def overwrite_payload( - If `false`, result will be returned immediately after the confirmation of receiving. payload: Key-value pairs of payload to assign points: List of affected points, filter or points selector. - Example + Example: - `points=[1, 2, 3, "cd3b53f0-11a7-449f-bc50-d06310e7ed90"]` - `points=Filter(must=[FieldCondition(key='rand_number', range=Range(gte=0.7))])` @@ -1833,7 +1825,7 @@ async def delete_payload( - If `false`, result will be returned immediately after the confirmation of receiving. keys: List of payload keys to remove points: List of affected points, filter or points selector. - Example + Example: - `points=[1, 2, 3, "cd3b53f0-11a7-449f-bc50-d06310e7ed90"]` - `points=Filter(must=[FieldCondition(key='rand_number', range=Range(gte=0.7))])` ordering (Optional[WriteOrdering]): Define strategy for ordering of the points. Possible values: @@ -1877,7 +1869,7 @@ async def clear_payload( wait: Await for the results to be processed. - If `true`, result will be returned only when all changes are applied - If `false`, result will be returned immediately after the confirmation of receiving. - points_selector: List of affected points, filter or points selector. Example + points_selector: List of affected points, filter or points selector. Example: - `points=[1, 2, 3, "cd3b53f0-11a7-449f-bc50-d06310e7ed90"]` - `points=Filter(must=[FieldCondition(key='rand_number', range=Range(gte=0.7))])` ordering (Optional[WriteOrdering]): Define strategy for ordering of the points. Possible values: diff --git a/qdrant_client/async_qdrant_fastembed.py b/qdrant_client/async_qdrant_fastembed.py index 429d6212..f3472cf5 100644 --- a/qdrant_client/async_qdrant_fastembed.py +++ b/qdrant_client/async_qdrant_fastembed.py @@ -94,12 +94,13 @@ def set_model( ) -> None: """ Set embedding model to use for encoding documents and queries. + Args: embedding_model_name: One of the supported embedding models. See `SUPPORTED_EMBEDDING_MODELS` for details. max_length (int, optional): Deprecated. Defaults to None. cache_dir (str, optional): The path to the cache directory. - Can be set using the `FASTEMBED_CACHE_PATH` env variable. - Defaults to `fastembed_cache` in the system's temp directory. + Can be set using the `FASTEMBED_CACHE_PATH` env variable. + Defaults to `fastembed_cache` in the system's temp directory. threads (int, optional): The number of threads single onnxruntime session can use. Defaults to None. providers: The list of onnx providers (with or without options) to use. Defaults to None. Example configuration: @@ -136,6 +137,7 @@ def set_sparse_model( ) -> None: """ Set sparse embedding model to use for hybrid search over documents in combination with dense embeddings. + Args: embedding_model_name: One of the supported sparse embedding models. See `SUPPORTED_SPARSE_EMBEDDING_MODELS` for details. If None, sparse embeddings will not be used. diff --git a/qdrant_client/qdrant_client.py b/qdrant_client/qdrant_client.py index 75568350..1e52ac48 100644 --- a/qdrant_client/qdrant_client.py +++ b/qdrant_client/qdrant_client.py @@ -478,8 +478,7 @@ def query_points( - If `SparseVector` - use as a sparse vector for nearest search. - If `Query` - use as a query for specific search type. - If `NumpyArray` - use as a dense vector for nearest search. - - If `Document` - infer vector from the document text and use - it for nearest search (requires `fastembed` package installed). + - If `Document` - infer vector from the document text and use it for nearest search (requires `fastembed` package installed). - If `None` - return first `limit` points from the collection. prefetch: prefetch queries to make a selection of the data to be used with the main query query_filter: @@ -619,8 +618,7 @@ def query_points_groups( - If `SparseVector` - use as a sparse vector for nearest search. - If `Query` - use as a query for specific search type. - If `NumpyArray` - use as a dense vector for nearest search. - - If `Document` - infer vector from the document text and use - it for nearest search (requires `fastembed` package installed). + - If `Document` - infer vector from the document text and use it for nearest search (requires `fastembed` package installed). - If `None` - return first `limit` points from the collection. prefetch: prefetch queries to make a selection of the data to be used with the main query query_filter: @@ -629,8 +627,7 @@ def query_points_groups( search_params: Additional search params limit: How many results return group_size: How many results return for each group - group_by: Name of the payload field to group by. - Field must be of type "keyword" or "integer". + group_by: Name of the payload field to group by. Field must be of type "keyword" or "integer". Nested fields are specified using dot notation, e.g. "nested_field.subfield". with_payload: - Specify which stored payload should be attached to the result. @@ -983,27 +980,28 @@ def search_matrix_pairs( shard_key_selector: Optional[types.ShardKeySelector] = None, **kwargs: Any, ) -> types.SearchMatrixPairsResponse: - """Compute distance matrix for sampled points with a pair-based output format. + """ + Compute distance matrix for sampled points with a pair-based output format. + Args: - collection_name: Name of the collection - query_filter: Filter to apply - limit: How many neighbours per sample to find - sample: How many points to select and search within - using: Name of the vectors to use for search. - If `None` - use default vectors. - consistency: - Read consistency of the search. Defines how many replicas should be queried before returning the result. Values: - - int - number of replicas to query, values should present in all queried replicas - - 'majority' - query all replicas, but return values present in the majority of replicas - - 'quorum' - query the majority of replicas, return values present in all of them - - 'all' - query all replicas, and return values present in all replicas + collection_name: Name of the collection. + query_filter: Filter to apply. + limit: How many neighbors per sample to find. + sample: How many points to select and search within. + using: Name of the vectors to use for search. If `None`, use default vectors. + consistency: Read consistency of the search. Defines how many replicas should be queried before returning the result. Values: + - int: Number of replicas to query, values should be present in all queried replicas. + - 'majority': Query all replicas, but return values present in the majority of replicas. + - 'quorum': Query the majority of replicas, return values present in all of them. + - 'all': Query all replicas, and return values present in all replicas. timeout: Overrides global timeout for this search. Unit is seconds. - shard_key_selector: - This parameter allows to specify which shards should be queried. - If `None` - query all shards. Only works for collections with `custom` sharding method. + shard_key_selector: This parameter allows specifying which shards should be queried. + If `None`, query all shards. Only works for collections with the `custom` sharding method. + Returns: - Return distance matrix using a pair-based encoding. + Distance matrix using a pair-based encoding. """ + assert len(kwargs) == 0, f"Unknown arguments: {list(kwargs.keys())}" return self._client.search_matrix_pairs( @@ -1030,27 +1028,28 @@ def search_matrix_offsets( shard_key_selector: Optional[types.ShardKeySelector] = None, **kwargs: Any, ) -> types.SearchMatrixOffsetsResponse: - """Compute distance matrix for sampled points with an offset-based output format. + """ + Compute distance matrix for sampled points with an offset-based output format. + Args: - collection_name: Name of the collection - query_filter: Filter to apply - limit: How many neighbours per sample to find - sample: How many points to select and search within - using: Name of the vectors to use for search. - If `None` - use default vectors. - consistency: - Read consistency of the search. Defines how many replicas should be queried before returning the result. Values: - - int - number of replicas to query, values should present in all queried replicas - - 'majority' - query all replicas, but return values present in the majority of replicas - - 'quorum' - query the majority of replicas, return values present in all of them - - 'all' - query all replicas, and return values present in all replicas + collection_name: Name of the collection. + query_filter: Filter to apply. + limit: How many neighbors per sample to find. + sample: How many points to select and search within. + using: Name of the vectors to use for search. If `None`, use default vectors. + consistency: Read consistency of the search. Defines how many replicas should be queried before returning the result. Values: + - int: Number of replicas to query, values should present in all queried replicas. + - 'majority': Query all replicas, but return values present in the majority of replicas. + - 'quorum': Query the majority of replicas, return values present in all of them. + - 'all': Query all replicas and return values present in all replicas. timeout: Overrides global timeout for this search. Unit is seconds. - shard_key_selector: - This parameter allows to specify which shards should be queried. - If `None` - query all shards. Only works for collections with `custom` sharding method. + shard_key_selector: This parameter allows specifying which shards should be queried. + If `None`, query all shards. Only works for collections with the `custom` sharding method. + Returns: - Return distance matrix using an offset-based encoding. + Distance matrix using an offset-based encoding. """ + assert len(kwargs) == 0, f"Unknown arguments: {list(kwargs.keys())}" return self._client.search_matrix_offsets( @@ -1580,7 +1579,7 @@ def delete_vectors( collection_name (str): Name of the collection to delete vector from vectors: List of names of the vectors to delete. Use `""` to delete the default vector. At least one vector should be specified. points (Point): Selects points based on list of IDs or filter - Examples + Examples: - `points=[1, 2, 3, "cd3b53f0-11a7-449f-bc50-d06310e7ed90"]` - `points=Filter(must=[FieldCondition(key='rand_number', range=Range(gte=0.7))])` @@ -1689,7 +1688,7 @@ def delete( - If `true`, result will be returned only when all changes are applied - If `false`, result will be returned immediately after the confirmation of receiving. points_selector: Selects points based on list of IDs or filter. - Examples + Examples: - `points=[1, 2, 3, "cd3b53f0-11a7-449f-bc50-d06310e7ed90"]` - `points=Filter(must=[FieldCondition(key='rand_number', range=Range(gte=0.7))])` @@ -1729,82 +1728,78 @@ def set_payload( shard_key_selector: Optional[types.ShardKeySelector] = None, **kwargs: Any, ) -> types.UpdateResult: - """Modifies payload of the specified points + """ + Modifies payload of the specified points. Examples: - `Set payload`:: + `Set payload`:: - # Assign payload value with key `"key"` to points 1, 2, 3. - # If payload value with specified key already exists - it will be overwritten - qdrant_client.set_payload( - collection_name="test_collection", - wait=True, - payload={ - "key": "value" - }, - points=[1,2,3] - ) + # Assign payload value with key `"key"` to points 1, 2, 3. + # If payload value with specified key already exists - it will be overwritten + qdrant_client.set_payload( + collection_name="test_collection", + wait=True, + payload={ + "key": "value" + }, + points=[1, 2, 3] + ) Args: - collection_name: Name of the collection + collection_name: Name of the collection. wait: Await for the results to be processed. - - - If `true`, result will be returned only when all changes are applied - - If `false`, result will be returned immediately after the confirmation of receiving. - payload: Key-value pairs of payload to assign - points: List of affected points, filter or points selector - Example - + - If `true`, the result will be returned only when all changes are applied. + - If `false`, the result will be returned immediately after confirmation of receipt. + payload: Key-value pairs of payload to assign. + points: List of affected points, filter, or points selector. + Example: - `points=[1, 2, 3, "cd3b53f0-11a7-449f-bc50-d06310e7ed90"]` - `points=Filter(must=[FieldCondition(key='rand_number', range=Range(gte=0.7))])` ordering (Optional[WriteOrdering]): Define strategy for ordering of the points. Possible values: - - - `weak` (default) - write operations may be reordered, works faster - - `medium` - write operations go through dynamically selected leader, may be inconsistent for a short period of time in case of leader change - - `strong` - Write operations go through the permanent leader, consistent, but may be unavailable if leader is down - - shard_key_selector: - Defines the shard groups that should be used to write updates into. - If multiple shard_keys are provided, the update will be written to each of them. - Only works for collections with `custom` sharding method. - - key: Path to the nested field in the payload to modify. If not specified - modify the root of the - payload. E.g.: - - PointStruct( - id=42, - vector=[...], - payload={ - "recipe": { - "fruits": {"apple": "100g"} + - `weak` (default): Write operations may be reordered, works faster. + - `medium`: Write operations go through a dynamically selected leader, may be inconsistent for a short period of time in case of leader change. + - `strong`: Write operations go through the permanent leader, consistent, but may be unavailable if the leader is down. + shard_key_selector: Defines the shard groups that should be used to write updates into. + If multiple shard keys are provided, the update will be written to each of them. + Only works for collections with the `custom` sharding method. + key: Path to the nested field in the payload to modify. If not specified, modifies the root of the payload. + E.g.:: + + PointStruct( + id=42, + vector=[...], + payload={ + "recipe": { + "fruits": {"apple": "100g"} + } } - } - ) - - qdrant_client.set_payload( - ..., - payload = {"cinnamon": "2g"}, - key = "recipe.fruits", - points=[42] - ) - - PointStruct( - id=42, - vector=[...], - payload={ - "recipe": { - "fruits": { - "apple": "100g", - "cinnamon": "2g" + ) + + qdrant_client.set_payload( + ..., + payload={"cinnamon": "2g"}, + key="recipe.fruits", + points=[42] + ) + + PointStruct( + id=42, + vector=[...], + payload={ + "recipe": { + "fruits": { + "apple": "100g", + "cinnamon": "2g" + } } } - } - ) + ) Returns: - Operation result + Operation result. """ + assert len(kwargs) == 0, f"Unknown arguments: {list(kwargs.keys())}" return self._client.set_payload( @@ -1855,7 +1850,7 @@ def overwrite_payload( - If `false`, result will be returned immediately after the confirmation of receiving. payload: Key-value pairs of payload to assign points: List of affected points, filter or points selector. - Example + Example: - `points=[1, 2, 3, "cd3b53f0-11a7-449f-bc50-d06310e7ed90"]` - `points=Filter(must=[FieldCondition(key='rand_number', range=Range(gte=0.7))])` @@ -1905,7 +1900,7 @@ def delete_payload( - If `false`, result will be returned immediately after the confirmation of receiving. keys: List of payload keys to remove points: List of affected points, filter or points selector. - Example + Example: - `points=[1, 2, 3, "cd3b53f0-11a7-449f-bc50-d06310e7ed90"]` - `points=Filter(must=[FieldCondition(key='rand_number', range=Range(gte=0.7))])` ordering (Optional[WriteOrdering]): Define strategy for ordering of the points. Possible values: @@ -1950,7 +1945,7 @@ def clear_payload( wait: Await for the results to be processed. - If `true`, result will be returned only when all changes are applied - If `false`, result will be returned immediately after the confirmation of receiving. - points_selector: List of affected points, filter or points selector. Example + points_selector: List of affected points, filter or points selector. Example: - `points=[1, 2, 3, "cd3b53f0-11a7-449f-bc50-d06310e7ed90"]` - `points=Filter(must=[FieldCondition(key='rand_number', range=Range(gte=0.7))])` ordering (Optional[WriteOrdering]): Define strategy for ordering of the points. Possible values: diff --git a/qdrant_client/qdrant_fastembed.py b/qdrant_client/qdrant_fastembed.py index c8ae2b79..a2c8665c 100644 --- a/qdrant_client/qdrant_fastembed.py +++ b/qdrant_client/qdrant_fastembed.py @@ -93,12 +93,13 @@ def set_model( ) -> None: """ Set embedding model to use for encoding documents and queries. + Args: embedding_model_name: One of the supported embedding models. See `SUPPORTED_EMBEDDING_MODELS` for details. max_length (int, optional): Deprecated. Defaults to None. cache_dir (str, optional): The path to the cache directory. - Can be set using the `FASTEMBED_CACHE_PATH` env variable. - Defaults to `fastembed_cache` in the system's temp directory. + Can be set using the `FASTEMBED_CACHE_PATH` env variable. + Defaults to `fastembed_cache` in the system's temp directory. threads (int, optional): The number of threads single onnxruntime session can use. Defaults to None. providers: The list of onnx providers (with or without options) to use. Defaults to None. Example configuration: @@ -138,6 +139,7 @@ def set_sparse_model( ) -> None: """ Set sparse embedding model to use for hybrid search over documents in combination with dense embeddings. + Args: embedding_model_name: One of the supported sparse embedding models. See `SUPPORTED_SPARSE_EMBEDDING_MODELS` for details. If None, sparse embeddings will not be used. diff --git a/tools/generate_docs_netlify.sh b/tools/generate_docs_netlify.sh index 203d34cd..ef2dfa82 100755 --- a/tools/generate_docs_netlify.sh +++ b/tools/generate_docs_netlify.sh @@ -7,8 +7,10 @@ cd "$(dirname "$0")/../" brew install pandoc +pip install --upgrade "virtualenv>=20.26.6" + curl -sSL https://install.python-poetry.org | python3 - export PATH="/opt/buildhome/.local/bin:$PATH" poetry install -sphinx-build docs/source docs/html \ No newline at end of file +sphinx-build docs/source docs/html