修复
This commit is contained in:
@@ -489,20 +489,20 @@ class CustomQdrant_VectorStore(Qdrant_VectorStore):
|
|||||||
return str(e)
|
return str(e)
|
||||||
return "Unknown error"
|
return "Unknown error"
|
||||||
|
|
||||||
# request_body = {
|
|
||||||
# "model": self.embedding_model_name,
|
|
||||||
# "encoding_format": "float",
|
|
||||||
# "input": [data],
|
|
||||||
# }
|
|
||||||
request_body = {
|
request_body = {
|
||||||
"model": self.embedding_model_name,
|
"model": self.embedding_model_name,
|
||||||
"encoding_format": "float",
|
"encoding_format": "float",
|
||||||
"input": [{"type":"text","text":data}],
|
"input": [data],
|
||||||
}
|
}
|
||||||
|
# request_body = {
|
||||||
|
# "model": self.embedding_model_name,
|
||||||
|
# "encoding_format": "float",
|
||||||
|
# "input": [{"type":"text","text":data}],
|
||||||
|
# }
|
||||||
request_body.update(kwargs)
|
request_body.update(kwargs)
|
||||||
|
|
||||||
response = requests.post(
|
response = requests.post(
|
||||||
url=f"{self.embedding_api_base}",
|
url=f"{self.embedding_api_base}/v1/embeddings",
|
||||||
json=request_body,
|
json=request_body,
|
||||||
headers={"Authorization": f"Bearer {self.embedding_api_key}", 'Content-Type': 'application/json'},
|
headers={"Authorization": f"Bearer {self.embedding_api_key}", 'Content-Type': 'application/json'},
|
||||||
)
|
)
|
||||||
@@ -512,7 +512,7 @@ class CustomQdrant_VectorStore(Qdrant_VectorStore):
|
|||||||
)
|
)
|
||||||
result = response.json()
|
result = response.json()
|
||||||
# embeddings = result['embeddings']
|
# embeddings = result['embeddings']
|
||||||
embeddings = result['data']['embedding']
|
embeddings = result['data'][0]['embedding']
|
||||||
# return embeddings[0]
|
# return embeddings[0]
|
||||||
return embeddings
|
return embeddings
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user