Daemontatox commited on
Commit
54935ff
·
verified ·
1 Parent(s): 4a3d0de

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -1,3 +1,4 @@
 
1
  import subprocess
2
  import os
3
  import torch
@@ -132,12 +133,15 @@ def log_to_qdrant(question: str, answer: str):
132
  # Convert the log entry to a vector (using embeddings)
133
  log_vector = embeddings.embed_documents([str(log_entry)])[0]
134
 
 
 
 
135
  # Insert the log into the Qdrant collection
136
  client.upsert(
137
  collection_name=logs_collection_name,
138
  points=[
139
  models.PointStruct(
140
- id=hash(timestamp), # Use timestamp hash as ID
141
  vector=log_vector,
142
  payload=log_entry
143
  )
 
1
+ import uuid
2
  import subprocess
3
  import os
4
  import torch
 
133
  # Convert the log entry to a vector (using embeddings)
134
  log_vector = embeddings.embed_documents([str(log_entry)])[0]
135
 
136
+ # Generate a valid 64-bit unsigned integer ID
137
+ valid_id = uuid.uuid4().int & (1 << 64) - 1 # Ensure it's a 64-bit unsigned integer
138
+
139
  # Insert the log into the Qdrant collection
140
  client.upsert(
141
  collection_name=logs_collection_name,
142
  points=[
143
  models.PointStruct(
144
+ id=valid_id, # Use a valid 64-bit unsigned integer ID
145
  vector=log_vector,
146
  payload=log_entry
147
  )