Skip to content

langgraph fastapi integration error when sending multiple requests #178

@NiuBlibing

Description

@NiuBlibing
INFO:     127.0.0.1:60494 - "POST /agent/agentic_chat HTTP/1.1" 200 OK
INFO:     127.0.0.1:60498 - "POST /agent/agentic_chat HTTP/1.1" 200 OK
ERROR:    Exception in ASGI application
  + Exception Group Traceback (most recent call last):
  |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/_utils.py", line 77, in collapse_excgroups
  |     yield
  |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/responses.py", line 271, in __call__
  |     async with anyio.create_task_group() as task_group:
  |                ^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 772, in __aexit__
  |     raise BaseExceptionGroup(
  | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
  +-+---------------- 1 ----------------
    | Traceback (most recent call last):
    |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/uvicorn/protocols/http/h11_impl.py", line 403, in run_asgi
    |     result = await app(  # type: ignore[func-returns-value]
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__
    |     return await self.app(scope, receive, send)
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/fastapi/applications.py", line 1054, in __call__
    |     await super().__call__(scope, receive, send)
    |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/applications.py", line 113, in __call__
    |     await self.middleware_stack(scope, receive, send)
    |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/middleware/errors.py", line 186, in __call__
    |     raise exc
    |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/middleware/errors.py", line 164, in __call__
    |     await self.app(scope, receive, _send)
    |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/middleware/exceptions.py", line 63, in __call__
    |     await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
    |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    |     raise exc
    |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
    |     await app(scope, receive, sender)
    |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/routing.py", line 716, in __call__
    |     await self.middleware_stack(scope, receive, send)
    |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/routing.py", line 736, in app
    |     await route.handle(scope, receive, send)
    |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/routing.py", line 290, in handle
    |     await self.app(scope, receive, send)
    |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/routing.py", line 78, in app
    |     await wrap_app_handling_exceptions(app, request)(scope, receive, send)
    |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    |     raise exc
    |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
    |     await app(scope, receive, sender)
    |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/routing.py", line 76, in app
    |     await response(scope, receive, send)
    |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/responses.py", line 270, in __call__
    |     with collapse_excgroups():
    |          ^^^^^^^^^^^^^^^^^^^^
    |   File "/home/test/.local/share/uv/python/cpython-3.12.8-linux-x86_64-gnu/lib/python3.12/contextlib.py", line 158, in __exit__
    |     self.gen.throw(value)
    |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/_utils.py", line 83, in collapse_excgroups
    |     raise exc
    |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/responses.py", line 274, in wrap
    |     await func()
    |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/responses.py", line 254, in stream_response
    |     async for chunk in self.body_iterator:
    |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/ag_ui_langgraph/endpoint.py", line 21, in event_generator
    |     async for event in agent.run(input_data):
    |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/ag_ui_langgraph/agent.py", line 91, in run
    |     async for event_str in self._handle_stream_events(input_data):
    |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/ag_ui_langgraph/agent.py", line 201, in _handle_stream_events
    |     async for single_event in self._handle_single_event(event, state):
    |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/ag_ui_langgraph/agent.py", line 430, in _handle_single_event
    |     reasoning_data = resolve_reasoning_content(event["data"]["chunk"]) if event["data"]["chunk"] else None
    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/ag_ui_langgraph/utils.py", line 162, in resolve_reasoning_content
    |     type=parsed.get("type", "text"),
    |          ^^^^^^^^^^
    | AttributeError: 'int' object has no attribute 'get'
    +------------------------------------

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/uvicorn/protocols/http/h11_impl.py", line 403, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/fastapi/applications.py", line 1054, in __call__
    await super().__call__(scope, receive, send)
  File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/applications.py", line 113, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/middleware/errors.py", line 186, in __call__
    raise exc
  File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/middleware/errors.py", line 164, in __call__
    await self.app(scope, receive, _send)
  File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/middleware/exceptions.py", line 63, in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    raise exc
  File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
    await app(scope, receive, sender)
  File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/routing.py", line 716, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/routing.py", line 736, in app
    await route.handle(scope, receive, send)
  File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/routing.py", line 290, in handle
    await self.app(scope, receive, send)
  File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/routing.py", line 78, in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
  File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    raise exc
  File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
    await app(scope, receive, sender)
  File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/routing.py", line 76, in app
    await response(scope, receive, send)
  File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/responses.py", line 270, in __call__
    with collapse_excgroups():
         ^^^^^^^^^^^^^^^^^^^^
  File "/home/test/.local/share/uv/python/cpython-3.12.8-linux-x86_64-gnu/lib/python3.12/contextlib.py", line 158, in __exit__
    self.gen.throw(value)
  File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/_utils.py", line 83, in collapse_excgroups
    raise exc
  File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/responses.py", line 274, in wrap
    await func()
  File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/responses.py", line 254, in stream_response
    async for chunk in self.body_iterator:
  File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/ag_ui_langgraph/endpoint.py", line 21, in event_generator
    async for event in agent.run(input_data):
  File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/ag_ui_langgraph/agent.py", line 91, in run
    async for event_str in self._handle_stream_events(input_data):
  File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/ag_ui_langgraph/agent.py", line 201, in _handle_stream_events
    async for single_event in self._handle_single_event(event, state):
  File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/ag_ui_langgraph/agent.py", line 430, in _handle_single_event
    reasoning_data = resolve_reasoning_content(event["data"]["chunk"]) if event["data"]["chunk"] else None
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/ag_ui_langgraph/utils.py", line 162, in resolve_reasoning_content
    type=parsed.get("type", "text"),
         ^^^^^^^^^^
AttributeError: 'int' object has no attribute 'get'
ERROR:    Exception in ASGI application
  + Exception Group Traceback (most recent call last):
  |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/_utils.py", line 77, in collapse_excgroups
  |     yield
  |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/responses.py", line 271, in __call__
  |     async with anyio.create_task_group() as task_group:
  |                ^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 772, in __aexit__
  |     raise BaseExceptionGroup(
  | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
  +-+---------------- 1 ----------------
    | Traceback (most recent call last):
    |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/uvicorn/protocols/http/h11_impl.py", line 403, in run_asgi
    |     result = await app(  # type: ignore[func-returns-value]
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__
    |     return await self.app(scope, receive, send)
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/fastapi/applications.py", line 1054, in __call__
    |     await super().__call__(scope, receive, send)
    |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/applications.py", line 113, in __call__
    |     await self.middleware_stack(scope, receive, send)
    |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/middleware/errors.py", line 186, in __call__
    |     raise exc
    |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/middleware/errors.py", line 164, in __call__
    |     await self.app(scope, receive, _send)
    |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/middleware/exceptions.py", line 63, in __call__
    |     await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
    |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    |     raise exc
    |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
    |     await app(scope, receive, sender)
    |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/routing.py", line 716, in __call__
    |     await self.middleware_stack(scope, receive, send)
    |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/routing.py", line 736, in app
    |     await route.handle(scope, receive, send)
    |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/routing.py", line 290, in handle
    |     await self.app(scope, receive, send)
    |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/routing.py", line 78, in app
    |     await wrap_app_handling_exceptions(app, request)(scope, receive, send)
    |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    |     raise exc
    |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
    |     await app(scope, receive, sender)
    |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/routing.py", line 76, in app
    |     await response(scope, receive, send)
    |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/responses.py", line 270, in __call__
    |     with collapse_excgroups():
    |          ^^^^^^^^^^^^^^^^^^^^
    |   File "/home/test/.local/share/uv/python/cpython-3.12.8-linux-x86_64-gnu/lib/python3.12/contextlib.py", line 158, in __exit__
    |     self.gen.throw(value)
    |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/_utils.py", line 83, in collapse_excgroups
    |     raise exc
    |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/responses.py", line 274, in wrap
    |     await func()
    |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/responses.py", line 254, in stream_response
    |     async for chunk in self.body_iterator:
    |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/ag_ui_langgraph/endpoint.py", line 21, in event_generator
    |     async for event in agent.run(input_data):
    |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/ag_ui_langgraph/agent.py", line 91, in run
    |     async for event_str in self._handle_stream_events(input_data):
    |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/ag_ui_langgraph/agent.py", line 201, in _handle_stream_events
    |     async for single_event in self._handle_single_event(event, state):
    |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/ag_ui_langgraph/agent.py", line 430, in _handle_single_event
    |     reasoning_data = resolve_reasoning_content(event["data"]["chunk"]) if event["data"]["chunk"] else None
    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/ag_ui_langgraph/utils.py", line 162, in resolve_reasoning_content
    |     type=parsed.get("type", "text"),
    |          ^^^^^^^^^^
    | AttributeError: 'int' object has no attribute 'get'
    +------------------------------------

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/uvicorn/protocols/http/h11_impl.py", line 403, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/fastapi/applications.py", line 1054, in __call__
    await super().__call__(scope, receive, send)
  File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/applications.py", line 113, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/middleware/errors.py", line 186, in __call__
    raise exc
  File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/middleware/errors.py", line 164, in __call__
    await self.app(scope, receive, _send)
  File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/middleware/exceptions.py", line 63, in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    raise exc
  File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
    await app(scope, receive, sender)
  File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/routing.py", line 716, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/routing.py", line 736, in app
    await route.handle(scope, receive, send)
  File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/routing.py", line 290, in handle
    await self.app(scope, receive, send)
  File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/routing.py", line 78, in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
  File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    raise exc
  File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
    await app(scope, receive, sender)
  File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/routing.py", line 76, in app
    await response(scope, receive, send)
  File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/responses.py", line 270, in __call__
    with collapse_excgroups():
         ^^^^^^^^^^^^^^^^^^^^
  File "/home/test/.local/share/uv/python/cpython-3.12.8-linux-x86_64-gnu/lib/python3.12/contextlib.py", line 158, in __exit__
    self.gen.throw(value)
  File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/_utils.py", line 83, in collapse_excgroups
    raise exc
  File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/responses.py", line 274, in wrap
    await func()
  File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/starlette/responses.py", line 254, in stream_response
    async for chunk in self.body_iterator:
  File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/ag_ui_langgraph/endpoint.py", line 21, in event_generator
    async for event in agent.run(input_data):
  File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/ag_ui_langgraph/agent.py", line 91, in run
    async for event_str in self._handle_stream_events(input_data):
  File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/ag_ui_langgraph/agent.py", line 201, in _handle_stream_events
    async for single_event in self._handle_single_event(event, state):
  File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/ag_ui_langgraph/agent.py", line 430, in _handle_single_event
    reasoning_data = resolve_reasoning_content(event["data"]["chunk"]) if event["data"]["chunk"] else None
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/test/ref/llm/client/AG-UI/ag-ui/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/.venv/lib/python3.12/site-packages/ag_ui_langgraph/utils.py", line 162, in resolve_reasoning_content
    type=parsed.get("type", "text"),
         ^^^^^^^^^^
AttributeError: 'int' object has no attribute 'get'
Task chat_node with path ('__pregel_pull', 'chat_node') wrote to unknown channel branch:to:__end__, ignoring it.
Task chat_node with path ('__pregel_pull', 'chat_node') wrote to unknown channel branch:to:__end__, ignoring it.

When sending multiple requests concerently, it throw errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions