test(api): Add extended agent stream tests and fix type annotations
This commit is contained in:
@@ -14,6 +14,8 @@ import base64
|
||||
from langchain_core.runnables.config import RunnableConfig
|
||||
from langchain_core.messages import BaseMessage
|
||||
|
||||
from ea_chatbot.graph.state import AgentState
|
||||
|
||||
router = APIRouter(prefix="/chat", tags=["agent"])
|
||||
|
||||
async def stream_agent_events(
|
||||
@@ -27,7 +29,7 @@ async def stream_agent_events(
|
||||
Generator that invokes the LangGraph agent and yields SSE formatted events.
|
||||
Persists assistant responses and plots to the database.
|
||||
"""
|
||||
initial_state = {
|
||||
initial_state: AgentState = {
|
||||
"messages": messages,
|
||||
"question": message,
|
||||
"summary": summary,
|
||||
@@ -38,7 +40,8 @@ async def stream_agent_events(
|
||||
"code_output": None,
|
||||
"error": None,
|
||||
"plots": [],
|
||||
"dfs": {}
|
||||
"dfs": {},
|
||||
"iterations": 0
|
||||
}
|
||||
|
||||
config: RunnableConfig = {"configurable": {"thread_id": thread_id}}
|
||||
|
||||
Reference in New Issue
Block a user