Closed MathiasSpanhove closed 1 year ago
@MathiasSpanhove It might not be the most elegant solution to that, but could you please verify if that works?
document_store._client._rest_headers = {"Authorization": f"Bearer {get_user_token()}"}
It seems to be an ugly workaround, but I can't see a different way.
Thank you for your answer @kacperlukawski
I also tried something like what you suggested. However since the QdrantDocumentStore
uses the client when initializing, that call doesn't yet have the headers resulting in an unauthorized exception.
The reason why is the following:
# Make sure the collection is properly set up
self._set_up_collection(index, embedding_dim, recreate_index, similarity)
Are you open to a PR that adds additional_headers: Optional[dict] = None
to the QdrantDocumentStore __init__
?
I could also create a PR with something like the following:
@classmethod
def from_qdrant_client(cls, client: qdrant_client.QdrantClient, **kwargs):
cls.client = client
return cls(**kwargs)
And add a check in the __init__
to make sure that the client hasn't already been provided?
This way all current implementations would keep working.
Let me know what you think and if you would like a PR!
I think we can expose the metadata
parameter, as long as it doesn't break the YAML pipelines. Would you like to contribute?
I think we can expose the
metadata
parameter, as long as it doesn't break the YAML pipelines. Would you like to contribute?
I've made a PR that exposes the metadata parameter and doesn't break the YAML pipeline.
I see that due to #19 and #20 that **kwargs has been removed from the QdrantDocumentStore
__init__
. Is there a workaround to pass metadata to the QdrantClient?Currently the following code doesn't work: