GithubHelp home page GithubHelp logo

上传文件后对话正常,返回知识库时报错:Bad message format Tried to use SessionInfo before it was initialized about langchain-chatchat HOT 1 OPEN

LiHaojin1 avatar LiHaojin1 commented on June 7, 2024
上传文件后对话正常,返回知识库时报错:Bad message format Tried to use SessionInfo before it was initialized

from langchain-chatchat.

Comments (1)

dosubot avatar dosubot commented on June 7, 2024 3

The errors you're encountering, "Bad message format Tried to use SessionInfo before it was initialized" and WebSocketClosedError, suggest issues with session state management and WebSocket connections, respectively.

For the "Bad message format" error, it's crucial to ensure all session state variables in your Streamlit app are initialized before they're accessed. This can be done by checking if a session state variable exists and setting a default value if it doesn't:

if 'selected_kb_name' not in st.session_state:
    st.session_state['selected_kb_name'] = None  # or a default value
if 'selected_kb_info' not in st.session_state:
    st.session_state['selected_kb_info'] = ""

Make sure to update these session state variables appropriately based on user interactions or other events in your application.

Regarding the WebSocketClosedError, this error occurs when there's an attempt to send or receive data over a WebSocket connection that has been closed. This could be due to network issues, client disconnects, or server-side problems. Since the error is related to WebSocket connections, which are managed by your server framework (like Uvicorn with FastAPI), you might not have direct control over this unless you're explicitly handling WebSocket connections in your code. If your application does use WebSockets, ensure you have proper error handling for closed connections.

If these errors persist, adding detailed logging around session state updates and WebSocket communication can help identify the exact points of failure.

Details

Sources


About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

To continue the conversation, mention @dosu.

from langchain-chatchat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.