Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -6,7 +6,7 @@ from langchain_openai import ChatOpenAI
|
|
6 |
from langchain_core.pydantic_v1 import BaseModel, Field
|
7 |
from langgraph.graph import MessageGraph, END
|
8 |
from langgraph.checkpoint.sqlite import SqliteSaver
|
9 |
-
from langchain_core.messages import HumanMessage
|
10 |
from typing import List
|
11 |
import os
|
12 |
import uuid
|
@@ -127,7 +127,7 @@ with container:
|
|
127 |
submit_button = st.form_submit_button(label='Send')
|
128 |
|
129 |
if submit_button and user_input:
|
130 |
-
for output in graph.stream([HumanMessage(content=user_input), st.session_state['past']], config=config):
|
131 |
if "__end__" in output:
|
132 |
continue
|
133 |
# stream() yields dictionaries with output keyed by node name
|
|
|
6 |
from langchain_core.pydantic_v1 import BaseModel, Field
|
7 |
from langgraph.graph import MessageGraph, END
|
8 |
from langgraph.checkpoint.sqlite import SqliteSaver
|
9 |
+
from langchain_core.messages import HumanMessage, AIMessage
|
10 |
from typing import List
|
11 |
import os
|
12 |
import uuid
|
|
|
127 |
submit_button = st.form_submit_button(label='Send')
|
128 |
|
129 |
if submit_button and user_input:
|
130 |
+
for output in graph.stream([HumanMessage(content=user_input), AIMessage(content=st.session_state['past'])], config=config):
|
131 |
if "__end__" in output:
|
132 |
continue
|
133 |
# stream() yields dictionaries with output keyed by node name
|