Fix frontend and api state handling (#11)

* Fix frontend and api state handling

* Increase timeout to 6 mins

* Fix test
This commit is contained in:
Daniel Wiesmann
2025-12-04 15:33:47 +00:00
committed by GitHub
parent a87b64b71e
commit 16f39f908f
3 changed files with 5 additions and 1 deletions
+2
View File
@@ -94,6 +94,8 @@ async def stream_chat(
payload = update[agent] payload = update[agent]
if "place" not in payload: # TODO: why is this needed? if "place" not in payload: # TODO: why is this needed?
payload["place"] = None payload["place"] = None
if "search_area" not in payload: # TODO: why is this needed?
payload["search_area"] = None
state_payload = GeoAssistantState(**payload) state_payload = GeoAssistantState(**payload)
resp = ChatResponse(thread_id=str(thread_id), state=state_payload) resp = ChatResponse(thread_id=str(thread_id), state=state_payload)
+2 -1
View File
@@ -31,6 +31,7 @@ def stream_chat(user_message: str):
"agent_state_input": { "agent_state_input": {
"messages": [{"type": "human", "content": user_message}], "messages": [{"type": "human", "content": user_message}],
"place": None, "place": None,
"search_area": None,
}, },
} }
@@ -38,7 +39,7 @@ def stream_chat(user_message: str):
"POST", "POST",
f"{API_BASE_URL}/chat", f"{API_BASE_URL}/chat",
json=request_body, json=request_body,
timeout=60.0, timeout=360.0,
) as response: ) as response:
response.raise_for_status() response.raise_for_status()
+1
View File
@@ -31,6 +31,7 @@ async def test_hello_world(initialized_app):
"agent_state_input": { "agent_state_input": {
"messages": [{"content": "Hello, world!", "type": "human"}], "messages": [{"content": "Hello, world!", "type": "human"}],
"place": None, "place": None,
"search_area": None,
}, },
"thread_id": str(thread_id), "thread_id": str(thread_id),
}, },