add_points api endpoint
This commit is contained in:
parent
a217eb05f2
commit
6dda8ac74c
12
src/app.py
12
src/app.py
@ -63,10 +63,8 @@ def add_points():
|
||||
|
||||
try:
|
||||
clause_vectors=Embedding.call(line_item)
|
||||
logger.info("clause_vectors STAR %s" % (clause_vectors))
|
||||
logger.info(f"type of clause_vectors: {type(clause_vectors)}")
|
||||
logger.info(f"LENGTH JOUNR of clause_vectors: {len(clause_vectors)}")
|
||||
logger.info("TEST +++++")
|
||||
|
||||
|
||||
except Exception as e:
|
||||
return jsonify({"error": f"Embedding failed: {str(e)}"}), 500
|
||||
|
||||
@ -76,7 +74,7 @@ def add_points():
|
||||
"line_item": line_item,
|
||||
"line_number": line_number
|
||||
}
|
||||
logger.info(f"length of clause_vectors: {len(clause_vectors)}")
|
||||
|
||||
for vector in clause_vectors:
|
||||
point = PointStruct(
|
||||
id=str(uuid.uuid7()),
|
||||
@ -84,7 +82,7 @@ def add_points():
|
||||
payload=payload
|
||||
)
|
||||
vector_points.append(point)
|
||||
logger.info(f"length of vector_points: {len(vector_points)}")
|
||||
|
||||
try:
|
||||
result = Qdrant.get_client().upsert(
|
||||
points= vector_points
|
||||
@ -123,7 +121,7 @@ def add():
|
||||
payload["user_meta"] = user_meta if isinstance(user_meta, dict) else json.loads(user_meta)
|
||||
|
||||
clause_vectors = Embedding.call(clause_text)
|
||||
logger.info(f"clause vectors line 126: {clause_vectors}")
|
||||
|
||||
result = Qdrant.get_client().upsert(
|
||||
points=[
|
||||
PointStruct(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user