wt002 commited on
Commit
c8cf2f0
·
verified ·
1 Parent(s): 375129c

Update agent.py

Browse files
Files changed (1) hide show
  1. agent.py +1 -1
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['text'] for doc in docs] # Extract text from JSON
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()