Comments (2)
maybe you can try this, described here
When a request to your llm app fails, reliableGPT handles it by:
Retrying with an alternate model - GPT-4, GPT3.5, GPT3.5 16k, text-davinci-003
Retrying with a larger context window model for Context Window Errors
Sending a Cached Response (using semantic similarity)
Retry with a fallback API key for Invalid API Key errors
from streamlit-agent.
Hi @askintution , minimally you can do try/catch on the agent.run call to handle the error (such as printing a friendly st.error()
or having the assistant respond with a useful message)
try:
response = agent.run(user_input, callbacks=[st_callback])
except: # or filter to certain errors you know about like openai.AuthenticationError
st.error("Encountered an error, try again later")
LangChain also has some throttling and automatic retry support for the case where rate limit is due to frequent requests. It's outside the scope of reference implementations in this repository but you can find ideas in LangChain documentation and user issues 😄
from streamlit-agent.
Related Issues (20)
- Use of Extra Libraries HOT 6
- Not sure how to initialize `st.session_state['messages']` in my chat code HOT 2
- Over resource limits on Streamlit Cloud
- Is there a way to prompt the user with the "human" tool? HOT 5
- Error message in console when running chat_with_documents.py HOT 1
- Hosted version build is failing HOT 1
- ImportError: Could not import docarray python package. Please install it with `pip install "langchain[docarray]"`. HOT 6
- trouble working with simple requests HOT 4
- mportError: Could not import docarray python package. Please install it with pip install "langchain[docarray]" HOT 2
- why pyproject.toml version compatibility issues HOT 1
- Hello, I modified pyproject.toml according to the method you provided and reconfigured the corresponding version of the package, but the error may be a version compatibility issue. HOT 1
- Is there a way to prevent thoughts from disappearing? HOT 1
- How to hold all the status containers generated during retrieving?
- ChatBot misbehaves with AzureChatOpenAI
- LangChain: Chat with search is not working HOT 4
- langchain-chat-search.streamlit.app not working HOT 1
- this streamlit agent (https://langchain-document-chat.streamlit.app/) doesn't work
- mrkl and search-and-chat examples not working HOT 2
- Clang: error - Poetry install on Apple-M1 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from streamlit-agent.