
    Ng1y                     V   U d dl Z d dlZd dlmZ d dlmZmZmZmZm	Z	m
Z
mZmZmZmZ d dlZd dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d d	lmZ d d
lmZ d dl m!Z! 	 d dl"m#Z#m$Z$ d dl%m&Z& n# e'$ r	 dZ$dZ#dZ&Y nw xY we$rd  e$j(                    D             ni Z)ee*ee+ej,        f         f         e-d<   e#rd  e#j(                    D             ni Z.ee*ee+ej,        f         f         e-d<   e#rd  e#j(                    D             n	 e/            Z0ee*         e-d<    G d de          Z1dS )    N)tee)
AnyDictIterableListOptionalSequenceTupleUnionget_argsSet)grpc)AsyncQdrantBase)common_types)
GrpcToRest)Document)QueryResponse)modelsreciprocal_rank_fusionSparseTextEmbeddingTextEmbedding)OnnxProviderc                 N    i | ]"}|d          |d         t           j        j        f#S )modeldim)r   DistanceCOSINE.0r   s     `/var/www/html/ai-engine/env/lib/python3.11/site-packages/qdrant_client/async_qdrant_fastembed.py
<dictcomp>r#   "   s<        	guv'=>      SUPPORTED_EMBEDDING_MODELSc                      i | ]}|d          |S )r    r    s     r"   r#   r#   *   s    TTTuU7^UTTTr$   !SUPPORTED_SPARSE_EMBEDDING_MODELSc                 J    h | ] }|                     d d          |d         !S )requires_idfNr   )get)r!   model_configs     r"   	<setcomp>r-   /   sC       ND11W  r$   IDF_EMBEDDING_MODELSc                   D    e Zd ZU dZi Zeedf         ed<   i Zeedf         ed<   e	ed<   de
f fdZed	efd
            Zed	ee         fd            Z	 	 	 	 dAdedee         dee         dee         deed                  de
d	dfdZ	 	 	 dBdee         dee         dee         deed                  de
d	dfdZedCd            Zeded	eeej        f         fd            Ze	 	 	 dBdedee         dee         deed                  de
d	dfd            Ze	 	 	 dBdedee         dee         deed                  de
d	dfd            Zedddfdee         dedededee         d	eeeee         f                  fd Zeddfdee         dededee         d	ee j!                 f
d!Z"d	efd"Z#d	ee         fd#Z$d$ee j%                 d	ee&         fd%Z'	 dDd&eeej(                          d'eeeee
f                           d(eeeee         f                  d)e)d*eee j!                          d	eej*                 fd+Z+d,ej,        d	dfd-Z-	 	 	 dBd.ee	         d/eej.                 d0eej/                 d	eeej0        f         fd1Z1	 dEd.ee	         d2eej2                 d	eeeej3        f                  fd3Z4	 	 	 	 dFd4edee         d'eeeee
f                           d&eeej(                          dedee         de
d	ee5eef                  fd5Z6	 dDd6e5e j7        ee         eee                  e j!        e j8        e j9        e:df         d7e5ej;        eej;                 df         d	eeej8                 eej;                 f         fd8Z<d6e5e j7        ee         eee                  e j!        e j8        e j9        e:df         d	eej8                 fd9Z=	 	 dGd4ed;ed<eej>                 d=ede
d	ee&         fd>Z?	 	 dGd4ed?ee         d<eej>                 d=ede
d	eee&                  fd@Z@ xZAS )HAsyncQdrantFastembedMixinzBAAI/bge-small-enr   embedding_modelsr   sparse_embedding_models_FASTEMBED_INSTALLEDkwargsc                 B   d | _         d | _        	 ddlm}m} t           |j                              dk    sJ t           |j                              dk    sJ d| j        _        n# t          $ r d| j        _        Y nw xY w t                      j        di | d S )Nr   r   TFr'   )_embedding_model_name_sparse_embedding_model_name	fastembedr   r   lenlist_supported_models	__class__r3   ImportErrorsuper__init__)selfr4   r   r   r;   s       r"   r>   z"AsyncQdrantFastembedMixin.__init__?   s    48";?)	8DDDDDDDD@*@BBCCaGGGG:}:<<==AAAA26DN// 	8 	8 	827DN///	8""6"""""s   AA* *BBreturnc                 6    | j         | j        | _         | j         S N)r6   DEFAULT_EMBEDDING_MODELr?   s    r"   embedding_model_namez.AsyncQdrantFastembedMixin.embedding_model_nameL   s    %-)-)ED&))r$   c                     | j         S rB   )r7   rD   s    r"   sparse_embedding_model_namez5AsyncQdrantFastembedMixin.sparse_embedding_model_nameR   s    00r$   NrE   
max_length	cache_dirthreads	providersr   c                 t    |t          j        dt          d            | j        d||||d| || _        dS )a  
        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.
            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:
                https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html#configuration-options
        Raises:
            ValueError: If embedding model is not supported.
            ImportError: If fastembed is not installed.

        Returns:
            None
        Nzhmax_length parameter is deprecated and will be removed in the future. It's not used by fastembed models.   )
stacklevel
model_namerI   rJ   rK   r'   )warningswarnDeprecationWarning_get_or_init_modelr6   )r?   rE   rH   rI   rJ   rK   r4   s          r"   	set_modelz#AsyncQdrantFastembedMixin.set_modelV   su    : !Mz"   
 	  	
+		
 	

 	
 	
 	
 &:"""r$   c                 <    | | j         d||||d| || _        dS )ay  
        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.
            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.
            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:
                https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html#configuration-options
        Raises:
            ValueError: If embedding model is not supported.
            ImportError: If fastembed is not installed.

        Returns:
            None
        NrO   r'   )_get_or_init_sparse_modelr7   )r?   rE   rI   rJ   rK   r4   s         r"   set_sparse_modelz*AsyncQdrantFastembedMixin.set_sparse_model   sR    8  +*D* /##	 
    -A)))r$   c                 2    | j         rd S t          d          )Nzjfastembed is not installed. Please install it to enable fast vector indexing with `pip install fastembed`.)r3   r<   )clss    r"   _import_fastembedz+AsyncQdrantFastembedMixin._import_fastembed   s'    # 	Fx
 
 	
r$   rP   c                     |                                   |t          vrt          d| dt                     t          |         S )NUnsupported embedding model: . Supported models: )r[   r%   
ValueError)rZ   rP   s     r"   _get_model_paramsz+AsyncQdrantFastembedMixin._get_model_params   sS    777l
llPjll   **55r$   c                     || j         v r| j         |         S |                                  |t          vrt          d| dt                     t	          d||||d|| j         |<   | j         |         S Nr]   r^   rO   r'   )r1   r[   r%   r_   r   rZ   rP   rI   rJ   rK   r4   s         r"   rT   z,AsyncQdrantFastembedMixin._get_or_init_model   s     ---'
33777l
llPjll   ,9 ,
!	,
 ,

 ,
 ,
Z( #J//r$   c                     || j         v r| j         |         S |                                  |t          vrt          d| dt                     t	          d||||d|| j         |<   | j         |         S rb   )r2   r[   r(   r_   r   rc   s         r"   rW   z3AsyncQdrantFastembedMixin._get_or_init_sparse_model   s     444.z::>>>s
ssPqss   3F 3
!	3
 3

 3
 3
#J/ *:66r$       default	documents
batch_size
embed_typeparallelc              #     K   |                      |          t          |d          \  }}|dk    r                    |||          }nF|dk    rfd|D             }n1|dk    r                    |||          }nt	          d|           t          ||          D ]\  }	}
|
|	                                fV  d S )	NrP   rM   passagerh   rj   queryc              3   j   K   | ]-}t                              |                     d         V  .dS )ro   r   N)listquery_embed)r!   ro   embedding_models     r"   	<genexpr>z=AsyncQdrantFastembedMixin._embed_documents.<locals>.<genexpr>   sR        FK_00u0==>>qA     r$   rf   zUnknown embed type: )rT   r   passage_embedembedr_   ziptolist)r?   rg   rE   rh   ri   rj   documents_adocuments_bvectors_itervectordocrt   s              @r"   _embed_documentsz*AsyncQdrantFastembedMixin._embed_documents   s%      11=Q1RR%(A%6%6"k""*88
X 9  LL 7""   OZ  LL 9$$*00
X 1  LL @J@@AAA|[99 	) 	)KFC(((((	) 	)r$   c              #      K   |                      |          }|                    |||          }|D ]H}t          j        |j                                        |j                                                  V  Id S )Nrl   rn   indicesvalues)rW   rw   typesSparseVectorr   ry   r   )r?   rg   rE   rh   rj   sparse_embedding_modelr|   sparse_vectors           r"   _sparse_embed_documentsz1AsyncQdrantFastembedMixin._sparse_embed_documents  s       "&!?!?K_!?!`!`-33*x 4 
 
 * 	 	M$%-4466}?S?Z?Z?\?\      	 	r$   c                 p    | j                             d          d                                         }d| S )
        Returns name of the vector field in qdrant collection, used by current fastembed model.
        Returns:
            Name of the vector field.
        /zfast-)rE   splitlowerr?   rP   s     r"   get_vector_field_namez/AsyncQdrantFastembedMixin.get_vector_field_name  s9     .44S99"=CCEE
#z###r$   c                     | j         7| j                             d          d                                         }d| S dS )r   Nr   r   zfast-sparse-)rG   r   r   r   s     r"   get_sparse_vector_field_namez6AsyncQdrantFastembedMixin.get_sparse_vector_field_name  sG     +79??DDRHNNPPJ.*...tr$   scored_pointsc                    g }|                                  }|                                 }|D ]}t          |j        t                    r|j                            |d           nd }d }|7t          |j        t                    r|j                            |d           nd }|                    t          |j        |||j	        |j	                            dd          |j
                             |S )Ndocument )id	embeddingsparse_embeddingmetadatar   score)r   r   
isinstancer}   r   r+   appendr   r   payloadr   )r?   r   responsevector_field_namesparse_vector_field_namescored_pointr   r   s           r"   !_scored_points_to_query_responsesz;AsyncQdrantFastembedMixin._scored_points_to_query_responses*  s     6688#'#D#D#F#F ) 	 	L l1488#''(94@@@ 
  $'3 ","5t<<L'++,DdKKK !
 OO#'%5)1)155j"EE&,  	 	 	 	 r$   idsr   encoded_docsids_accumulatorsparse_vectorsc              #     K   |t          d d           }|t          d d           }|t          d d          }|                                 }|                                 }t          ||||          D ]K\  }}	\  }
}}|                    |           d|
i|	}||i}|||||<   t          j        |||          V  Ld S )Nc                  2    t          j                    j        S rB   )uuiduuid4hexr'   r$   r"   <lambda>z<AsyncQdrantFastembedMixin._points_iterator.<locals>.<lambda>R  s    tz||/ r$   c                      i S rB   r'   r'   r$   r"   r   z<AsyncQdrantFastembedMixin._points_iterator.<locals>.<lambda>T  s    B r$   c                      d S rB   r'   r'   r$   r"   r   z<AsyncQdrantFastembedMixin._points_iterator.<locals>.<lambda>V  s    $ r$   Tr   )r   r   r}   )iterr   r   rx   r   r   PointStruct)r?   r   r   r   r   r   vector_namesparse_vector_nameidxmetar~   r}   r   r   point_vectors                  r"   _points_iteratorz*AsyncQdrantFastembedMixin._points_iteratorI  s      ;//66CJJ--H!!,,55N0022!>>@@7:<8
 8
 	S 	S3C}Vm ""3'''!3/$/G6A65JL!--2K3@/0$W\RRRRRRR	S 	Sr$   collection_infoc                 4   |                      | j                  \  }}|                                 }t          |j        j        j        t                    sJ d|j        j        j                     ||j        j        j        v sJ d|j        j        j         d|             |j        j        j        |         }||j        k    sJ d| d|j                     ||j	        k    sJ d| d|j	                     | 
                                }|||j        j        j        v sJ d|j        j        j                     | j        t          v rG|j        j        j        |         j        }|t          j        j        k    sJ | j         d|             d S d S d S )Nrl   z,Collection have incompatible vector params: z, expected zEmbedding size mismatch: z != zDistance mismatch: z, requires modifier IDF, current modifier is )r`   rE   r   r   configparamsvectorsdictsizedistancer   r   rG   r.   modifierr   ModifierIDF)r?   r   embeddings_sizer   r   vector_paramsr   r   s           r"   _validate_collection_infoz3AsyncQdrantFastembedMixin._validate_collection_infoc  s   &*&<&<Ha&<&b&b#( 6688")14
 
 	b 	ba/:P:W:_aa	b 	b 	b !7!>!FFFF/:P:W:_l} GFF'.5=>OP}1111PPPM<NPP 211 ....GGG}/EGG /..#'#D#D#F#F #/(O,B,I,XXXXeo>T>[>cee YXX/3GGG*18G,   33336nndlnn 433 0/ HG
 43r$   on_diskquantization_confighnsw_configc                     |                                  }|                     | j                  \  }}|t          j        |||||          iS )a  
        Generates vector configuration, compatible with fastembed models.

        Args:
            on_disk: if True, vectors will be stored on disk. If None, default value will be used.
            quantization_config: Quantization configuration. If None, quantization will be disabled.
            hnsw_config: HNSW configuration. If None, default configuration will be used.

        Returns:
            Configuration for `vectors_config` argument in `create_collection` method.
        rl   )r   r   r   r   r   )r   r`   rE   r   VectorParams)r?   r   r   r   r   r   r   s          r"   get_fastembed_vector_paramsz5AsyncQdrantFastembedMixin.get_fastembed_vector_params  sd    " !6688&*&<&<Ha&<&b&b#(v2$!$7'     
 	
r$   r   c                     |                                  }| j        t          v r|t          j        j        n|}|dS |t          j        t          j        |          |          iS )a  
        Generates vector configuration, compatible with fastembed sparse models.

        Args:
            on_disk: if True, vectors will be stored on disk. If None, default value will be used.
            modifier: Sparse vector queries modifier. E.g. Modifier.IDF for idf-based rescoring. Default: None.
        Returns:
            Configuration for `vectors_config` argument in `create_collection` method.
        N)r   )indexr   )r   rG   r.   r   r   r   SparseVectorParamsSparseIndexParams)r?   r   r   r   s       r"   "get_fastembed_sparse_vector_paramsz<AsyncQdrantFastembedMixin.get_fastembed_sparse_vector_params  sx     !==??+/CCC.6.>v**HH$4v8.w???(     
 	
r$   collection_namec           	      :  K   |                      || j        |d|          }d}	| j        |                     || j        ||          }		 |                     |           d{V }
nn# t
          $ ra |                     ||                                 |                                            d{V  |                     |           d{V }
Y nw xY w| 	                    |
           g }| 
                    |||||	          } | j        d||d|pd	|d
| |S )a  
        Adds text documents into qdrant collection.
        If collection does not exist, it will be created with default parameters.
        Metadata in combination with documents will be added as payload.
        Documents will be embedded using the specified embedding model.

        If you want to use your own vectors, use `upsert` method instead.

        Args:
            collection_name (str):
                Name of the collection to add documents to.
            documents (Iterable[str]):
                List of documents to embed and add to the collection.
            metadata (Iterable[Dict[str, Any]], optional):
                List of metadata dicts. Defaults to None.
            ids (Iterable[models.ExtendedPointId], optional):
                List of ids to assign to documents.
                If not specified, UUIDs will be generated. Defaults to None.
            batch_size (int, optional):
                How many documents to embed and upload in single request. Defaults to 32.
            parallel (Optional[int], optional):
                How many parallel workers to use for embedding. Defaults to None.
                If number is specified, data-parallel process will be used.

        Raises:
            ImportError: If fastembed is not installed.

        Returns:
            List of IDs of added documents. If no ids provided, UUIDs will be randomly generated on client side.

        rm   )rg   rE   rh   ri   rj   N)rg   rE   rh   rj   )r   )r   vectors_configsparse_vectors_config)r   r   r   r   r   T   )r   pointswaitrj   rh   r'   )r   rE   rG   r   get_collection	Exceptioncreate_collectionr   r   r   r   upload_points)r?   r   rg   r   r   rh   rj   r4   r   encoded_sparse_docsr   inserted_idsr   s                r"   addzAsyncQdrantFastembedMixin.add  s     R ,,!%!:!  - 
 
 #+7"&">">#%)%E%!	 #? # #	Y$($7$7$7$X$XXXXXXXOO 	Y 	Y 	Y(( /#??AA&*&M&M&O&O )         
 %)$7$7$7$X$XXXXXXXOOO	Y 	&&777&&%(. ' 
 
 	 	
+]!	
 	
 	
 	
 	
 s   
A' 'A(CCro   prefetchc                 n    |                      |          }|g }t          |t                    s|g}||fS )Nrq   )&_resolve_query_to_embedding_embeddingsr   rr   )r?   ro   r   s      r"   3_resolve_query_to_embedding_embeddings_and_prefetchzMAsyncQdrantFastembedMixin._resolve_query_to_embedding_embeddings_and_prefetch  sI     ;;%;HHH(D)) 	" zHx  r$   c                    t          |t          t          j                            st          |t          j                  r|S t          |t          j                  rt          j        |          S t          |t          j	                  r't          j        |
                                          S t          |t                    rt          j        |          S t          |t          t          j                            rEt          |t          j                  rt          j        |          n|}t          j        |          S |d S t          |t                    r]|j        }|t#          d          |t$          v rm|                     |           |                     |          }t          |                    |j        g                    d         
                                }n|t.          v r|                     |           |                     |          }t          |                    |j        g                    d         }t          j        |j        
                                |j        
                                          }nt#          | d          t          j        |          S t#          dt9          |                     )	N)nearestzH`query_points` requires explicit model name specification for `Document`rl   rg   r   r   z is not among supported modelszUnsupported query type: )r   r   r   Queryr   r   r   NearestQuerynpndarrayry   rr   PointIdr   convert_point_idr   r   r_   r%   rU   rT   rw   textr(   rX   rW   r   r   type)r?   ro   rP   embedding_model_instr   sparse_embedding_model_insts         r"   r   z@AsyncQdrantFastembedMixin._resolve_query_to_embedding_embeddings  s    eXek2233 	z%7T7T 	LeU/00 	6&u5555eRZ(( 	?&u||~~>>>>eT"" 	6&u5555eXem4455 	66@6U6U`
+E222[`  &u5555=4eX&& 	:J! ^   777z***'+'>'>*'>'U'U$ !5!;!;uzl!;!S!STTUVW^^``		@@@%%j111.2.L.LXb.L.c.c+ !<!B!Bej\!B!Z!Z[[\]^	"/%-4466y?O?V?V?X?X  		 !J!N!N!NOOO&y9999ADKKAABBBr$   
   
query_textquery_filterlimitc                   K   |                      | j                  }t          |                    |                    }|d                                         }| j        R|                      | j        d|t          j	        | 
                                |          ||dd| d{V           S |                     | j                  }	t          |	                    |                    d         }
t          j        |
j                                        |
j                                                  }t          j        dt          j	        | 
                                |          ||dd	|}t          j        dt          j        |                                 |          ||dd	|}|                     |||g
           d{V \  }}|                     t'          ||g|                    S )aO  
        Search for documents in a collection.
        This method automatically embeds the query text using the specified embedding model.
        If you want to use your own query vector, use `search` method instead.

        Args:
            collection_name: Collection to search in
            query_text:
                Text to search for. This text will be embedded using the specified embedding model.
                And then used as a query vector.
            query_filter:
                - Exclude vectors which doesn't fit given conditions.
                - If `None` - search among all vectors
            limit: How many results return
            **kwargs: Additional search parameters. See `qdrant_client.models.SearchRequest` for details.

        Returns:
            List[types.ScoredPoint]: List of scored points.

        rl   rq   r   Nnamer}   T)r   query_vectorr   r   with_payloadr   r}   filterr   r   r   requestsr   r'   )rT   rE   rr   rs   ry   rG   r   searchr   NamedVectorr   rW   r   r   r   SearchRequestNamedSparseVectorr   search_batchr   )r?   r   r   r   r   r4   r   
embeddingsr   r   r   sparse_query_vectordense_requestsparse_requestdense_request_responsesparse_request_responses                   r"   ro   zAsyncQdrantFastembedMixin.queryO  s     8  $66$B[6\\.:::LLMM
!!}++--+399!dk 	$3!'!3!7799," " " ".!%	 	 	 	 	 	 	 	 	 	   '+&D&D7 'E '
 '
# 8DD:DVVWWXYZ$1!)0022=;O;V;V;X;X
 
 
 , 
%4+E+E+G+GP\]]]	
 

 
 
  - 
+6688AT    
 
 
 
 CGBSBS+}n6U CT C
 C
 =
 =
 =
 =
 =
 =
9	!8 55"$:<S#T\abbb
 
 	
r$   query_textsc           	         K                          j                  }t          |                    |                    }g }|D ]e}	t	          j        dt	          j                                         |	                                          |dd|}
|	                    |
           f j
        +                     ||           d{V } fd|D             S                       j
                  }d	 |                    |
          D             }|D ]S}t	          j        dt	          j                                         |          |dd|}
|	                    |
           T                     ||           d{V }|dt!          |                   }|t!          |          d         }fdt#          ||          D             } fd|D             S )a  
        Search for documents in a collection with batched query.
        This method automatically embeds the query text using the specified embedding model.

        Args:
            collection_name: Collection to search in
            query_texts:
                A list of texts to search for. Each text will be embedded using the specified embedding model.
                And then used as a query vector for a separate search requests.
            query_filter:
                - Exclude vectors which doesn't fit given conditions.
                - If `None` - search among all vectors
                This filter will be applied to all search requests.
            limit: How many results return
            **kwargs: Additional search parameters. See `qdrant_client.models.SearchRequest` for details.

        Returns:
            List[List[QueryResponse]]: List of lists of responses for each query text.

        rl   rq   r   Tr   Nr   c                 :    g | ]}                     |          S r'   r   r!   r   r?   s     r"   
<listcomp>z9AsyncQdrantFastembedMixin.query_batch.<locals>.<listcomp>  s'    ___D::8DD___r$   c                     g | ]F}t          j        |j                                        |j                                                   GS )r   )r   r   r   ry   r   )r!   r   s     r"   r  z9AsyncQdrantFastembedMixin.query_batch.<locals>.<listcomp>  s_      
  
  
  %-4466}?S?Z?Z?\?\   
  
  
r$   r   c                 <    g | ]\  }}t          ||g           S )r   r   )r!   dense_responsesparse_responser   s      r"   r  z9AsyncQdrantFastembedMixin.query_batch.<locals>.<listcomp>  s?     
 
 
1 #NO#DERRR
 
 
r$   c                 :    g | ]}                     |          S r'   r  r  s     r"   r  z9AsyncQdrantFastembedMixin.query_batch.<locals>.<listcomp>  s'    [[[X66x@@[[[r$   r'   )rT   rE   rr   rs   r   r   r   r   ry   r   rG   r  rW   rw   r  r   r9   rx   )r?   r   r	  r   r   r4   r   query_vectorsr   r}   request	responsesr   sparse_query_vectorsr   dense_responsessparse_responsess   `   `            r"   query_batchz%AsyncQdrantFastembedMixin.query_batch  s     8  $66$B[6\\1==K=PPQQ# 
	% 
	%F* )3355fmmoo   $!   G OOG$$$$+3"//Zb/ccccccccI____U^____&*&D&D7 'E '
 '
# 
  
 "=!B!B[!B!Y!Y	 
  
  
 2 
	% 
	%M* /::<<]   $!   G OOG$$$$++OV^+________	#$6c+&6&6$67$S%5%5%7%78
 
 
 
58JZ5[5[
 
 
	 \[[[QZ[[[[r$   )NNNN)NNN)r@   NrB   )NN)NNre   N)Nr   )B__name__
__module____qualname__rC   r1   r   str__annotations__r2   boolr   r>   propertyrE   r   rG   intr	   rU   rX   classmethodr[   r
   r   r   r`   rT   rW   r   r   floatr   r   r   r   r   r   ScoredPointr   r   ExtendedPointIdrr   r   r   CollectionInfor   QuantizationConfigHnswConfigDiffr   r   r   r   r   r   r   r   r   
NumpyArrayr   Prefetchr   r   Filterro   r  __classcell__)r;   s   @r"   r0   r0   9   s        135d3/0555@BT#'<"<=BBB# # # # # # # *c * * * X*
 1Xc] 1 1 1 X1 %)#'!%8<*: *:!*: SM*: C=	*:
 #*: H^45*: *: 
*: *: *: *:^ $(!%8<$A $A&sm$A C=$A #	$A
 H^45$A $A 
$A $A $A $AL 
 
 
 [
 63 65fo9M3N 6 6 6 [6  $(!%8<0 00 C=0 #	0
 H^450 0 
0 0 0 [00  $(!%8<7 77 C=7 #	7
 H^457 7 
7 7 7 [76 %<#"&) )C=) ") 	)
 ) 3-) 
%T%[()	*) ) ) )< %<"& C= " 	
 3- 
%$	%    $s $ $ $ $	hsm 	 	 	 	!%"34	m	   J BFS Shv567S 8DcN34S uS$u+%567	S
 S !%*<!=>S 
&$	%S S S S4o9N oSW o o o o> #'CG7;	
 
$
 &f&?@
 f34	

 
c6&&	'
 
 
 
< UY
 
~
8@8Q
	$sF556	7
 
 
 
6 8<:>"&R RR C=R 8DcN34	R
 hv567R R 3-R R 
eCHo	R R R R@ IM! !MKeK	
! fo)>DE! 
x%tFO'<<	=! ! ! !*0CMKeK	
0C 
&,	0C 0C 0C 0Cl 15H
 H
H
 H
 v}-	H

 H
 H
 
m	H
 H
 H
 H
\ 15H\ H\H\ #YH\ v}-	H\
 H\ H\ 
d=!	"H\ H\ H\ H\ H\ H\ H\ H\r$   r0   )2r   rQ   	itertoolsr   typingr   r   r   r   r   r	   r
   r   r   r   numpyr   qdrant_clientr   qdrant_client.async_client_baser   qdrant_client.conversionsr   r   $qdrant_client.conversions.conversionr   qdrant_client.embed.modelsr   qdrant_client.fastembed_commonr   qdrant_client.httpr   qdrant_client.hybrid.fusionr   r8   r   r   fastembed.commonr   r<   r:   r%   r  r"  r   r  r(   setr.   r0   r'   r$   r"   <module>r;     s           ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ]           ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; / / / / / / 8 8 8 8 8 8 % % % % % % > > > > > ><<<<<<<<-------   MLLL 	  8]8::   
 
 DeC,@&A!AB    TT(Q(;(Q(S(STTTT	 "4U33G-H(H#I      E/EGG    
 c#h   h
\ h
\ h
\ h
\ h
\ h
\ h
\ h
\ h
\ h
\s   A, ,A:9A: