Spaces:
Running
Running
Update agent.py
Browse files
agent.py
CHANGED
@@ -402,7 +402,7 @@ response.raise_for_status() # Ensure that the request was successful
|
|
402 |
docs = json.loads(response.text)
|
403 |
|
404 |
# Assuming the JSON structure has a 'text' field for each document
|
405 |
-
texts = [doc
|
406 |
|
407 |
# Initialize the embedding model
|
408 |
embedding_model = BERTEmbeddings()
|
|
|
402 |
docs = json.loads(response.text)
|
403 |
|
404 |
# Assuming the JSON structure has a 'text' field for each document
|
405 |
+
texts = [doc.get('text', '') for doc in docs if 'text' in doc] # Extract text from JSON
|
406 |
|
407 |
# Initialize the embedding model
|
408 |
embedding_model = BERTEmbeddings()
|