Spaces:
Sleeping
Sleeping
Rashid Ali
commited on
Commit
·
a2dd353
1
Parent(s):
9c0758e
chatstate fix
Browse files- src/chatbot_backend.py +2 -2
src/chatbot_backend.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
# chatbot_backend.py
|
| 2 |
from langgraph.graph import StateGraph, START
|
| 3 |
-
from typing import TypedDict, Annotated
|
| 4 |
from langchain_core.messages import BaseMessage, HumanMessage, SystemMessage
|
| 5 |
from langgraph.checkpoint.sqlite import SqliteSaver
|
| 6 |
from langgraph.graph.message import add_messages
|
|
@@ -24,7 +24,7 @@ tools = [search_tool]
|
|
| 24 |
# -------------------
|
| 25 |
class ChatState(TypedDict):
|
| 26 |
messages: Annotated[list[BaseMessage], add_messages]
|
| 27 |
-
doc_content: str
|
| 28 |
search_enabled: bool # Whether to use external search
|
| 29 |
model_choice: str # Model selected ("OpenAI (Paid)" or "LLaMA (Open Source)")
|
| 30 |
doc_source: str | None # Document source ("Upload Your Documents" or "Use Sample Documents")
|
|
|
|
| 1 |
# chatbot_backend.py
|
| 2 |
from langgraph.graph import StateGraph, START
|
| 3 |
+
from typing import TypedDict, Annotated, Optional
|
| 4 |
from langchain_core.messages import BaseMessage, HumanMessage, SystemMessage
|
| 5 |
from langgraph.checkpoint.sqlite import SqliteSaver
|
| 6 |
from langgraph.graph.message import add_messages
|
|
|
|
| 24 |
# -------------------
|
| 25 |
class ChatState(TypedDict):
|
| 26 |
messages: Annotated[list[BaseMessage], add_messages]
|
| 27 |
+
doc_content: Optional[str] # User's uploaded document content
|
| 28 |
search_enabled: bool # Whether to use external search
|
| 29 |
model_choice: str # Model selected ("OpenAI (Paid)" or "LLaMA (Open Source)")
|
| 30 |
doc_source: str | None # Document source ("Upload Your Documents" or "Use Sample Documents")
|