Spaces:
Runtime error

luigi-liu-tw commited on
Commit
acda3f1
·
1 Parent(s): 12731c2

Improve responsiveness by asynchronously retrieving web search context

Browse files

- Run web search lookup in a background thread to decouple it from prompt construction.
- Add a 2-second timeout using thread.join(timeout=2) to prevent delaying response generation.
- Fallback to using only the system prompt and user query if web search results aren't retrieved in time.
- Update sidebar UI to show the fetched context or a "No context found" message.
- Retain current streaming and chat history functionalities for model inference.

1 file changed +12 -2
app.py+12-2