Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -143,6 +143,12 @@ def reasoning_node(state: AgentState) -> AgentState:
|
|
143 |
if not token:
|
144 |
raise ValueError("Hugging Face API token not found in environment variables")
|
145 |
|
|
|
|
|
|
|
|
|
|
|
|
|
146 |
# Create the underlying LLM model
|
147 |
llm = HuggingFaceHub(
|
148 |
repo_id="HuggingFaceH4/zephyr-7b-beta",
|
|
|
143 |
if not token:
|
144 |
raise ValueError("Hugging Face API token not found in environment variables")
|
145 |
|
146 |
+
history = state["history"]
|
147 |
+
|
148 |
+
# FIX: Add a HumanMessage if the last message is not one
|
149 |
+
if not isinstance(history[-1], HumanMessage):
|
150 |
+
raise ValueError("Last message in history must be a HumanMessage")
|
151 |
+
|
152 |
# Create the underlying LLM model
|
153 |
llm = HuggingFaceHub(
|
154 |
repo_id="HuggingFaceH4/zephyr-7b-beta",
|