qdrant icon indicating copy to clipboard operation
qdrant copied to clipboard

Qdrant giving pydantic exceptions when pushging data to points

Open vatsal-kavida opened this issue 2 years ago • 1 comments

Upgraded the qddrant to 0.8.1 version for helm chart and then tried deploying it , everything seems fine but when tried uploading data to my

Here is the full error that I got ->

/home/slayer/.cache/pypoetry/virtualenvs/chatux-NdUes9Ue-py3.11/lib/python3.11/site-packages/langchain_core/_api/deprecation.py:189: LangChainDeprecationWarning: The class `OpenAIEmbeddings` was deprecated in LangChain 0.1.0 and will be removed in 0.2.0. Use langchain_openai.OpenAIEmbeddings instead.
  warn_deprecated(
Traceback (most recent call last):
  File "/home/slayer/.cache/pypoetry/virtualenvs/chatux-NdUes9Ue-py3.11/lib/python3.11/site-packages/qdrant_client/http/api_client.py", line 94, in send
    return parse_as_type(response.json(), type_)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/slayer/.cache/pypoetry/virtualenvs/chatux-NdUes9Ue-py3.11/lib/python3.11/site-packages/qdrant_client/http/api_client.py", line 213, in parse_as_type
    return model_type(obj=obj).obj
           ^^^^^^^^^^^^^^^^^^^
  File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 1 validation error for ParsingModel[InlineResponse2005] (for parse_as_type)
obj -> result -> config -> optimizer_config -> max_optimization_threads
  none is not an allowed value (type=type_error.none.not_allowed)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/slayer/chatUX/copilot/utilities/qdrant.py", line 142, in <module>
    Qdrant.from_documents(
  File "/home/slayer/.cache/pypoetry/virtualenvs/chatux-NdUes9Ue-py3.11/lib/python3.11/site-packages/langchain_core/vectorstores.py", line 508, in from_documents
    return cls.from_texts(texts, embedding, metadatas=metadatas, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/slayer/.cache/pypoetry/virtualenvs/chatux-NdUes9Ue-py3.11/lib/python3.11/site-packages/langchain_community/vectorstores/qdrant.py", line 1292, in from_texts
    qdrant = cls.construct_instance(
             ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/slayer/.cache/pypoetry/virtualenvs/chatux-NdUes9Ue-py3.11/lib/python3.11/site-packages/langchain_community/vectorstores/qdrant.py", line 1575, in construct_instance
    collection_info = client.get_collection(collection_name=collection_name)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/slayer/.cache/pypoetry/virtualenvs/chatux-NdUes9Ue-py3.11/lib/python3.11/site-packages/qdrant_client/qdrant_client.py", line 1527, in get_collection
    return self._client.get_collection(collection_name=collection_name, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/slayer/.cache/pypoetry/virtualenvs/chatux-NdUes9Ue-py3.11/lib/python3.11/site-packages/qdrant_client/qdrant_remote.py", line 1956, in get_collection
    result: Optional[types.CollectionInfo] = self.http.collections_api.get_collection(
                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/slayer/.cache/pypoetry/virtualenvs/chatux-NdUes9Ue-py3.11/lib/python3.11/site-packages/qdrant_client/http/api/collections_api.py", line 1262, in get_collection
    return self._build_for_get_collection(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/slayer/.cache/pypoetry/virtualenvs/chatux-NdUes9Ue-py3.11/lib/python3.11/site-packages/qdrant_client/http/api/collections_api.py", line 377, in _build_for_get_collection
    return self.api_client.request(
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/slayer/.cache/pypoetry/virtualenvs/chatux-NdUes9Ue-py3.11/lib/python3.11/site-packages/qdrant_client/http/api_client.py", line 74, in request
    return self.send(request, type_)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/slayer/.cache/pypoetry/virtualenvs/chatux-NdUes9Ue-py3.11/lib/python3.11/site-packages/qdrant_client/http/api_client.py", line 96, in send
    raise ResponseHandlingException(e)
qdrant_client.http.exceptions.ResponseHandlingException: 1 validation error for ParsingModel[InlineResponse2005] (for parse_as_type)
obj -> result -> config -> optimizer_config -> max_optimization_threads
  none is not an allowed value (type=type_error.none.not_allowed)
```
## Expected Behavior
<!--- Tell us what should happen -->

## Possible Solution
<!--- Not obligatory, but suggest a fix/reason for the bug, -->

## Context (Environment)
<!--- How has this issue affected you? What are you trying to accomplish? -->
<!--- Providing context helps us come up with a solution that is most useful in the real world -->

<!--- Provide a general summary of the issue in the Title above -->

## Detailed Description
<!--- Provide a detailed description of the change or addition you are proposing -->

## Possible Implementation
<!--- Not obligatory, but suggest an idea for implementing addition or change -->

vatsal-kavida avatar Mar 14 '24 12:03 vatsal-kavida

If you are running the server in version 1.8.1, you should be updating the client as well. https://github.com/qdrant/qdrant-client/releases/tag/v1.8.0

agourlay avatar Mar 14 '24 15:03 agourlay