Spaces:
Sleeping
Sleeping
Zeggai Abdellah commited on
Commit ·
11ba922
1
Parent(s): c0e5c04
add cach message for max iterations
Browse files321 unmodified lines322323324325326327328321 unmodified lines# Get the response from the agentresponse = agent.chat(question)response_text = response.response# Extract source IDs from the response (preserving order)unique_ids = extract_source_ids(response_text)321 unmodified lines322323324325326327328329330331321 unmodified lines# Get the response from the agentresponse = agent.chat(question)response_text = response.response# Check if the response indicates max iterations was reachedif "max iterations" in response_text.lower() or len(response_text.strip()) == 0:# Provide a more helpful fallback responseresponse_text = ("I apologize, but I encountered difficulties processing your comparative question ")# Extract source IDs from the response (preserving order)unique_ids = extract_source_ids(response_text)
rag_pipeline.py+4-1