You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
�[1;31;40mLANGSERVE:�[0m ⚠️ Using pydantic 2.6.4. OpenAPI docs for invoke, batch, stream, stream_log endpoints will not be generated. API endpoints and playground should work as expected. If you need to see the docs, you can downgrade to pydantic 1. For example, pip install pydantic==1.10.13. See https://github.com/fastapi/fastapi/issues/10360 for details.
�[32mINFO�[0m: Application startup complete.
�[32mINFO�[0m: 127.0.0.1:5654 - "�[1mGET /agent/playground/ HTTP/1.1�[0m" �[32m200 OK�[0m
�[32mINFO�[0m: 127.0.0.1:5654 - "�[1mGET /agent/playground/assets/index-dbc96538.js HTTP/1.1�[0m" �[32m200 OK�[0m
�[32mINFO�[0m: 127.0.0.1:5655 - "�[1mGET /agent/playground/assets/index-52e8ab2f.css HTTP/1.1�[0m" �[32m200 OK�[0m
�[32mINFO�[0m: 127.0.0.1:5657 - "�[1mPOST /agent/stream_log HTTP/1.1�[0m" �[32m200 OK�[0m
�[31mERROR�[0m: Exception in ASGI application
Traceback (most recent call last):
File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\sse_starlette\sse.py", line 269, in call
await wrap(partial(self.listen_for_disconnect, receive))
File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\sse_starlette\sse.py", line 258, in wrap
await func()
File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\sse_starlette\sse.py", line 215, in listen_for_disconnect
message = await receive()
^^^^^^^^^^^^^^^
File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 538, in receive
await self.message_event.wait()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\asyncio\locks.py", line 212, in wait
await fut
asyncio.exceptions.CancelledError: Cancelled by cancel scope 2df4e5ec1d0
During handling of the above exception, another exception occurred:
Exception Group Traceback (most recent call last):
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 408, in run_asgi
| result = await app( # type: ignore[func-returns-value]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\uvicorn\middleware\proxy_headers.py", line 84, in call
| return await self.app(scope, receive, send)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\fastapi\applications.py", line 1054, in call
| await super().call(scope, receive, send)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette\applications.py", line 123, in call
| await self.middleware_stack(scope, receive, send)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette\middleware\errors.py", line 186, in call
| raise exc
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette\middleware\errors.py", line 164, in call
| await self.app(scope, receive, _send)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette\middleware\cors.py", line 91, in call
| await self.simple_response(scope, receive, send, request_headers=headers)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette\middleware\cors.py", line 146, in simple_response
| await self.app(scope, receive, send)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette\middleware\exceptions.py", line 62, in call
| await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette_exception_handler.py", line 64, in wrapped_app
| raise exc
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette_exception_handler.py", line 53, in wrapped_app
| await app(scope, receive, sender)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette\routing.py", line 758, in call
| await self.middleware_stack(scope, receive, send)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette\routing.py", line 778, in app
| await route.handle(scope, receive, send)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette\routing.py", line 299, in handle
| await self.app(scope, receive, send)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette\routing.py", line 79, in app
| await wrap_app_handling_exceptions(app, request)(scope, receive, send)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette_exception_handler.py", line 64, in wrapped_app
| raise exc
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette_exception_handler.py", line 53, in wrapped_app
| await app(scope, receive, sender)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette\routing.py", line 77, in app
| await response(scope, receive, send)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\sse_starlette\sse.py", line 255, in call
| async with anyio.create_task_group() as task_group:
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\anyio_backends_asyncio.py", line 678, in aexit
| raise BaseExceptionGroup(
| ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
+-+---------------- 1 ----------------
| Traceback (most recent call last):
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\messages\utils.py", line 202, in _convert_to_message
| msg_type = msg_kwargs.pop("role")
| ^^^^^^^^^^^^^^^^^^^^^^
| KeyError: 'role'
|
| During handling of the above exception, another exception occurred:
|
| Traceback (most recent call last):
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\sse_starlette\sse.py", line 258, in wrap
| await func()
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\sse_starlette\sse.py", line 245, in stream_response
| async for data in self.body_iterator:
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langserve\api_handler.py", line 1077, in _stream_log
| async for chunk in self._runnable.astream_log(
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 840, in astream_log
| async for item in astream_log_implementation( # type: ignore
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\tracers\log_stream.py", line 616, in astream_log_implementation
| await task
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\tracers\log_stream.py", line 570, in consume_astream
| async for chunk in runnable.astream(input, config, **kwargs):
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langgraph\pregel_init.py", line 940, in astream
| async for chunk in self.atransform(
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langgraph\pregel_init.py", line 964, in atransform
| async for chunk in self._atransform_stream_with_config(
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 1842, in atransform_stream_with_config
| chunk: Output = await asyncio.create_task( # type: ignore[call-arg]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\tracers\log_stream.py", line 237, in tap_output_aiter
| async for chunk in output:
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langgraph\pregel_init.py", line 763, in _atransform
| panic_or_proceed(done, inflight, step)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langgraph\pregel_init.py", line 990, in panic_or_proceed
| raise exc
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langgraph\pregel_init.py", line 1149, in _aconsume
| async for _ in iterator:
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 4508, in astream
| async for item in self.bound.astream(
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 2710, in astream
| async for chunk in self.atransform(input_aiter(), config, **kwargs):
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 2693, in atransform
| async for chunk in self._atransform_stream_with_config(
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 1842, in _atransform_stream_with_config
| chunk: Output = await asyncio.create_task( # type: ignore[call-arg]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\tracers\log_stream.py", line 237, in tap_output_aiter
| async for chunk in output:
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 2663, in _atransform
| async for output in final_pipeline:
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\passthrough.py", line 275, in atransform
| async for chunk in self._atransform_stream_with_config(
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 1806, in _atransform_stream_with_config
| final_input: Optional[Input] = await py_anext(input_for_tracing, None)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\utils\aiter.py", line 62, in anext_impl
| return await anext(iterator)
| ^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\utils\aiter.py", line 97, in tee_peer
| item = await iterator.anext()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 3976, in atransform
| async for output in self._atransform_stream_with_config(
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 1842, in _atransform_stream_with_config
| chunk: Output = await asyncio.create_task( # type: ignore[call-arg]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\tracers\log_stream.py", line 237, in tap_output_aiter
| async for chunk in output:
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 3945, in _atransform
| output = await acall_func_with_variable_args(
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 3920, in f
| return await run_in_executor(config, func, *args, **kwargs)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\config.py", line 514, in run_in_executor
| return await asyncio.get_running_loop().run_in_executor(
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\concurrent\futures\thread.py", line 58, in run
| result = self.fn(*self.args, **self.kwargs)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 3914, in func
| return call_func_with_variable_args(
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\config.py", line 347, in call_func_with_variable_args
| return func(input, **kwargs) # type: ignore[call-arg]
| ^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\app\agent.py", line 59, in call_model
| response = model.invoke(messages)
| ^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 4321, in invoke
| return self.bound.invoke(
| ^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\language_models\chat_models.py", line 154, in invoke
| [self._convert_input(input)],
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\language_models\chat_models.py", line 135, in _convert_input
| return ChatPromptValue(messages=convert_to_messages(input))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\messages\utils.py", line 228, in convert_to_messages
| return [_convert_to_message(m) for m in messages]
| ^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\messages\utils.py", line 205, in _convert_to_message
| raise ValueError(
| ValueError: Message dict must contain 'role' and 'content' keys, got {'content': '分析Nvidia', 'type': 'human'}
+------------------------------------
�[32mINFO�[0m: 127.0.0.1:5837 - "�[1mPOST /agent/stream_log HTTP/1.1�[0m" �[32m200 OK�[0m
�[31mERROR�[0m: Exception in ASGI application
Traceback (most recent call last):
File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\sse_starlette\sse.py", line 269, in call
await wrap(partial(self.listen_for_disconnect, receive))
File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\sse_starlette\sse.py", line 258, in wrap
await func()
File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\sse_starlette\sse.py", line 215, in listen_for_disconnect
message = await receive()
^^^^^^^^^^^^^^^
File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 538, in receive
await self.message_event.wait()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\asyncio\locks.py", line 212, in wait
await fut
asyncio.exceptions.CancelledError: Cancelled by cancel scope 2df4e62d580
During handling of the above exception, another exception occurred:
Exception Group Traceback (most recent call last):
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 408, in run_asgi
| result = await app( # type: ignore[func-returns-value]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\uvicorn\middleware\proxy_headers.py", line 84, in call
| return await self.app(scope, receive, send)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\fastapi\applications.py", line 1054, in call
| await super().call(scope, receive, send)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette\applications.py", line 123, in call
| await self.middleware_stack(scope, receive, send)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette\middleware\errors.py", line 186, in call
| raise exc
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette\middleware\errors.py", line 164, in call
| await self.app(scope, receive, _send)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette\middleware\cors.py", line 91, in call
| await self.simple_response(scope, receive, send, request_headers=headers)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette\middleware\cors.py", line 146, in simple_response
| await self.app(scope, receive, send)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette\middleware\exceptions.py", line 62, in call
| await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette_exception_handler.py", line 64, in wrapped_app
| raise exc
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette_exception_handler.py", line 53, in wrapped_app
| await app(scope, receive, sender)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette\routing.py", line 758, in call
| await self.middleware_stack(scope, receive, send)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette\routing.py", line 778, in app
| await route.handle(scope, receive, send)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette\routing.py", line 299, in handle
| await self.app(scope, receive, send)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette\routing.py", line 79, in app
| await wrap_app_handling_exceptions(app, request)(scope, receive, send)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette_exception_handler.py", line 64, in wrapped_app
| raise exc
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette_exception_handler.py", line 53, in wrapped_app
| await app(scope, receive, sender)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette\routing.py", line 77, in app
| await response(scope, receive, send)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\sse_starlette\sse.py", line 255, in call
| async with anyio.create_task_group() as task_group:
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\anyio_backends_asyncio.py", line 678, in aexit
| raise BaseExceptionGroup(
| ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
+-+---------------- 1 ----------------
| Traceback (most recent call last):
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\messages\utils.py", line 202, in _convert_to_message
| msg_type = msg_kwargs.pop("role")
| ^^^^^^^^^^^^^^^^^^^^^^
| KeyError: 'role'
|
| During handling of the above exception, another exception occurred:
|
| Traceback (most recent call last):
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\sse_starlette\sse.py", line 258, in wrap
| await func()
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\sse_starlette\sse.py", line 245, in stream_response
| async for data in self.body_iterator:
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langserve\api_handler.py", line 1077, in _stream_log
| async for chunk in self._runnable.astream_log(
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 840, in astream_log
| async for item in astream_log_implementation( # type: ignore
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\tracers\log_stream.py", line 616, in astream_log_implementation
| await task
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\tracers\log_stream.py", line 570, in consume_astream
| async for chunk in runnable.astream(input, config, **kwargs):
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langgraph\pregel_init.py", line 940, in astream
| async for chunk in self.atransform(
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langgraph\pregel_init.py", line 964, in atransform
| async for chunk in self._atransform_stream_with_config(
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 1842, in atransform_stream_with_config
| chunk: Output = await asyncio.create_task( # type: ignore[call-arg]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\tracers\log_stream.py", line 237, in tap_output_aiter
| async for chunk in output:
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langgraph\pregel_init.py", line 763, in _atransform
| panic_or_proceed(done, inflight, step)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langgraph\pregel_init.py", line 990, in panic_or_proceed
| raise exc
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langgraph\pregel_init.py", line 1149, in _aconsume
| async for _ in iterator:
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 4508, in astream
| async for item in self.bound.astream(
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 2710, in astream
| async for chunk in self.atransform(input_aiter(), config, **kwargs):
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 2693, in atransform
| async for chunk in self._atransform_stream_with_config(
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 1842, in _atransform_stream_with_config
| chunk: Output = await asyncio.create_task( # type: ignore[call-arg]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\tracers\log_stream.py", line 237, in tap_output_aiter
| async for chunk in output:
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 2663, in _atransform
| async for output in final_pipeline:
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\passthrough.py", line 275, in atransform
| async for chunk in self._atransform_stream_with_config(
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 1806, in _atransform_stream_with_config
| final_input: Optional[Input] = await py_anext(input_for_tracing, None)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\utils\aiter.py", line 62, in anext_impl
| return await anext(iterator)
| ^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\utils\aiter.py", line 97, in tee_peer
| item = await iterator.anext()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 3976, in atransform
| async for output in self._atransform_stream_with_config(
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 1842, in _atransform_stream_with_config
| chunk: Output = await asyncio.create_task( # type: ignore[call-arg]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\tracers\log_stream.py", line 237, in tap_output_aiter
| async for chunk in output:
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 3945, in _atransform
| output = await acall_func_with_variable_args(
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 3920, in f
| return await run_in_executor(config, func, *args, **kwargs)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\config.py", line 514, in run_in_executor
| return await asyncio.get_running_loop().run_in_executor(
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\concurrent\futures\thread.py", line 58, in run
| result = self.fn(*self.args, **self.kwargs)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 3914, in func
| return call_func_with_variable_args(
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\config.py", line 347, in call_func_with_variable_args
| return func(input, **kwargs) # type: ignore[call-arg]
| ^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\app\agent.py", line 59, in call_model
| response = model.invoke(messages)
| ^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 4321, in invoke
| return self.bound.invoke(
| ^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\language_models\chat_models.py", line 154, in invoke
| [self._convert_input(input)],
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\language_models\chat_models.py", line 135, in _convert_input
| return ChatPromptValue(messages=convert_to_messages(input))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\messages\utils.py", line 228, in convert_to_messages
| return [_convert_to_message(m) for m in messages]
| ^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\messages\utils.py", line 205, in _convert_to_message
| raise ValueError(
| ValueError: Message dict must contain 'role' and 'content' keys, got {'content': '分析Nvidia', 'type': 'ai'}
+------------------------------------
The text was updated successfully, but these errors were encountered:
wuzimi
changed the title
Can't figure what issue it is
Can't figure out what issue it is
Mar 27, 2024
�[1;31;40mLANGSERVE:�[0m⚠️ Using pydantic 2.6.4. OpenAPI docs for invoke, batch, stream, stream_log endpoints will not be generated. API endpoints and playground should work as expected. If you need to see the docs, you can downgrade to pydantic 1. For example,
pip install pydantic==1.10.13
. See https://github.com/fastapi/fastapi/issues/10360 for details.�[32mINFO�[0m: Application startup complete.
�[32mINFO�[0m: 127.0.0.1:5654 - "�[1mGET /agent/playground/ HTTP/1.1�[0m" �[32m200 OK�[0m
�[32mINFO�[0m: 127.0.0.1:5654 - "�[1mGET /agent/playground/assets/index-dbc96538.js HTTP/1.1�[0m" �[32m200 OK�[0m
�[32mINFO�[0m: 127.0.0.1:5655 - "�[1mGET /agent/playground/assets/index-52e8ab2f.css HTTP/1.1�[0m" �[32m200 OK�[0m
�[32mINFO�[0m: 127.0.0.1:5657 - "�[1mPOST /agent/stream_log HTTP/1.1�[0m" �[32m200 OK�[0m
�[31mERROR�[0m: Exception in ASGI application
Traceback (most recent call last):
File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\sse_starlette\sse.py", line 269, in call
await wrap(partial(self.listen_for_disconnect, receive))
File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\sse_starlette\sse.py", line 258, in wrap
await func()
File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\sse_starlette\sse.py", line 215, in listen_for_disconnect
message = await receive()
^^^^^^^^^^^^^^^
File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 538, in receive
await self.message_event.wait()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\asyncio\locks.py", line 212, in wait
await fut
asyncio.exceptions.CancelledError: Cancelled by cancel scope 2df4e5ec1d0
During handling of the above exception, another exception occurred:
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 408, in run_asgi
| result = await app( # type: ignore[func-returns-value]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\uvicorn\middleware\proxy_headers.py", line 84, in call
| return await self.app(scope, receive, send)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\fastapi\applications.py", line 1054, in call
| await super().call(scope, receive, send)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette\applications.py", line 123, in call
| await self.middleware_stack(scope, receive, send)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette\middleware\errors.py", line 186, in call
| raise exc
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette\middleware\errors.py", line 164, in call
| await self.app(scope, receive, _send)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette\middleware\cors.py", line 91, in call
| await self.simple_response(scope, receive, send, request_headers=headers)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette\middleware\cors.py", line 146, in simple_response
| await self.app(scope, receive, send)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette\middleware\exceptions.py", line 62, in call
| await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette_exception_handler.py", line 64, in wrapped_app
| raise exc
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette_exception_handler.py", line 53, in wrapped_app
| await app(scope, receive, sender)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette\routing.py", line 758, in call
| await self.middleware_stack(scope, receive, send)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette\routing.py", line 778, in app
| await route.handle(scope, receive, send)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette\routing.py", line 299, in handle
| await self.app(scope, receive, send)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette\routing.py", line 79, in app
| await wrap_app_handling_exceptions(app, request)(scope, receive, send)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette_exception_handler.py", line 64, in wrapped_app
| raise exc
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette_exception_handler.py", line 53, in wrapped_app
| await app(scope, receive, sender)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette\routing.py", line 77, in app
| await response(scope, receive, send)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\sse_starlette\sse.py", line 255, in call
| async with anyio.create_task_group() as task_group:
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\anyio_backends_asyncio.py", line 678, in aexit
| raise BaseExceptionGroup(
| ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
+-+---------------- 1 ----------------
| Traceback (most recent call last):
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\messages\utils.py", line 202, in _convert_to_message
| msg_type = msg_kwargs.pop("role")
| ^^^^^^^^^^^^^^^^^^^^^^
| KeyError: 'role'
|
| During handling of the above exception, another exception occurred:
|
| Traceback (most recent call last):
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\sse_starlette\sse.py", line 258, in wrap
| await func()
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\sse_starlette\sse.py", line 245, in stream_response
| async for data in self.body_iterator:
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langserve\api_handler.py", line 1077, in _stream_log
| async for chunk in self._runnable.astream_log(
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 840, in astream_log
| async for item in astream_log_implementation( # type: ignore
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\tracers\log_stream.py", line 616, in astream_log_implementation
| await task
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\tracers\log_stream.py", line 570, in consume_astream
| async for chunk in runnable.astream(input, config, **kwargs):
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langgraph\pregel_init.py", line 940, in astream
| async for chunk in self.atransform(
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langgraph\pregel_init.py", line 964, in atransform
| async for chunk in self._atransform_stream_with_config(
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 1842, in atransform_stream_with_config
| chunk: Output = await asyncio.create_task( # type: ignore[call-arg]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\tracers\log_stream.py", line 237, in tap_output_aiter
| async for chunk in output:
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langgraph\pregel_init.py", line 763, in _atransform
| panic_or_proceed(done, inflight, step)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langgraph\pregel_init.py", line 990, in panic_or_proceed
| raise exc
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langgraph\pregel_init.py", line 1149, in _aconsume
| async for _ in iterator:
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 4508, in astream
| async for item in self.bound.astream(
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 2710, in astream
| async for chunk in self.atransform(input_aiter(), config, **kwargs):
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 2693, in atransform
| async for chunk in self._atransform_stream_with_config(
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 1842, in _atransform_stream_with_config
| chunk: Output = await asyncio.create_task( # type: ignore[call-arg]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\tracers\log_stream.py", line 237, in tap_output_aiter
| async for chunk in output:
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 2663, in _atransform
| async for output in final_pipeline:
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\passthrough.py", line 275, in atransform
| async for chunk in self._atransform_stream_with_config(
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 1806, in _atransform_stream_with_config
| final_input: Optional[Input] = await py_anext(input_for_tracing, None)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\utils\aiter.py", line 62, in anext_impl
| return await anext(iterator)
| ^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\utils\aiter.py", line 97, in tee_peer
| item = await iterator.anext()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 3976, in atransform
| async for output in self._atransform_stream_with_config(
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 1842, in _atransform_stream_with_config
| chunk: Output = await asyncio.create_task( # type: ignore[call-arg]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\tracers\log_stream.py", line 237, in tap_output_aiter
| async for chunk in output:
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 3945, in _atransform
| output = await acall_func_with_variable_args(
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 3920, in f
| return await run_in_executor(config, func, *args, **kwargs)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\config.py", line 514, in run_in_executor
| return await asyncio.get_running_loop().run_in_executor(
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\concurrent\futures\thread.py", line 58, in run
| result = self.fn(*self.args, **self.kwargs)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 3914, in func
| return call_func_with_variable_args(
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\config.py", line 347, in call_func_with_variable_args
| return func(input, **kwargs) # type: ignore[call-arg]
| ^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\app\agent.py", line 59, in call_model
| response = model.invoke(messages)
| ^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 4321, in invoke
| return self.bound.invoke(
| ^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\language_models\chat_models.py", line 154, in invoke
| [self._convert_input(input)],
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\language_models\chat_models.py", line 135, in _convert_input
| return ChatPromptValue(messages=convert_to_messages(input))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\messages\utils.py", line 228, in convert_to_messages
| return [_convert_to_message(m) for m in messages]
| ^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\messages\utils.py", line 205, in _convert_to_message
| raise ValueError(
| ValueError: Message dict must contain 'role' and 'content' keys, got {'content': '分析Nvidia', 'type': 'human'}
+------------------------------------
�[32mINFO�[0m: 127.0.0.1:5837 - "�[1mPOST /agent/stream_log HTTP/1.1�[0m" �[32m200 OK�[0m
�[31mERROR�[0m: Exception in ASGI application
Traceback (most recent call last):
File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\sse_starlette\sse.py", line 269, in call
await wrap(partial(self.listen_for_disconnect, receive))
File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\sse_starlette\sse.py", line 258, in wrap
await func()
File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\sse_starlette\sse.py", line 215, in listen_for_disconnect
message = await receive()
^^^^^^^^^^^^^^^
File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 538, in receive
await self.message_event.wait()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\asyncio\locks.py", line 212, in wait
await fut
asyncio.exceptions.CancelledError: Cancelled by cancel scope 2df4e62d580
During handling of the above exception, another exception occurred:
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 408, in run_asgi
| result = await app( # type: ignore[func-returns-value]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\uvicorn\middleware\proxy_headers.py", line 84, in call
| return await self.app(scope, receive, send)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\fastapi\applications.py", line 1054, in call
| await super().call(scope, receive, send)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette\applications.py", line 123, in call
| await self.middleware_stack(scope, receive, send)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette\middleware\errors.py", line 186, in call
| raise exc
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette\middleware\errors.py", line 164, in call
| await self.app(scope, receive, _send)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette\middleware\cors.py", line 91, in call
| await self.simple_response(scope, receive, send, request_headers=headers)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette\middleware\cors.py", line 146, in simple_response
| await self.app(scope, receive, send)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette\middleware\exceptions.py", line 62, in call
| await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette_exception_handler.py", line 64, in wrapped_app
| raise exc
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette_exception_handler.py", line 53, in wrapped_app
| await app(scope, receive, sender)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette\routing.py", line 758, in call
| await self.middleware_stack(scope, receive, send)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette\routing.py", line 778, in app
| await route.handle(scope, receive, send)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette\routing.py", line 299, in handle
| await self.app(scope, receive, send)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette\routing.py", line 79, in app
| await wrap_app_handling_exceptions(app, request)(scope, receive, send)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette_exception_handler.py", line 64, in wrapped_app
| raise exc
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette_exception_handler.py", line 53, in wrapped_app
| await app(scope, receive, sender)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\starlette\routing.py", line 77, in app
| await response(scope, receive, send)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\sse_starlette\sse.py", line 255, in call
| async with anyio.create_task_group() as task_group:
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\anyio_backends_asyncio.py", line 678, in aexit
| raise BaseExceptionGroup(
| ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
+-+---------------- 1 ----------------
| Traceback (most recent call last):
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\messages\utils.py", line 202, in _convert_to_message
| msg_type = msg_kwargs.pop("role")
| ^^^^^^^^^^^^^^^^^^^^^^
| KeyError: 'role'
|
| During handling of the above exception, another exception occurred:
|
| Traceback (most recent call last):
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\sse_starlette\sse.py", line 258, in wrap
| await func()
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\sse_starlette\sse.py", line 245, in stream_response
| async for data in self.body_iterator:
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langserve\api_handler.py", line 1077, in _stream_log
| async for chunk in self._runnable.astream_log(
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 840, in astream_log
| async for item in astream_log_implementation( # type: ignore
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\tracers\log_stream.py", line 616, in astream_log_implementation
| await task
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\tracers\log_stream.py", line 570, in consume_astream
| async for chunk in runnable.astream(input, config, **kwargs):
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langgraph\pregel_init.py", line 940, in astream
| async for chunk in self.atransform(
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langgraph\pregel_init.py", line 964, in atransform
| async for chunk in self._atransform_stream_with_config(
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 1842, in atransform_stream_with_config
| chunk: Output = await asyncio.create_task( # type: ignore[call-arg]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\tracers\log_stream.py", line 237, in tap_output_aiter
| async for chunk in output:
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langgraph\pregel_init.py", line 763, in _atransform
| panic_or_proceed(done, inflight, step)
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langgraph\pregel_init.py", line 990, in panic_or_proceed
| raise exc
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langgraph\pregel_init.py", line 1149, in _aconsume
| async for _ in iterator:
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 4508, in astream
| async for item in self.bound.astream(
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 2710, in astream
| async for chunk in self.atransform(input_aiter(), config, **kwargs):
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 2693, in atransform
| async for chunk in self._atransform_stream_with_config(
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 1842, in _atransform_stream_with_config
| chunk: Output = await asyncio.create_task( # type: ignore[call-arg]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\tracers\log_stream.py", line 237, in tap_output_aiter
| async for chunk in output:
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 2663, in _atransform
| async for output in final_pipeline:
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\passthrough.py", line 275, in atransform
| async for chunk in self._atransform_stream_with_config(
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 1806, in _atransform_stream_with_config
| final_input: Optional[Input] = await py_anext(input_for_tracing, None)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\utils\aiter.py", line 62, in anext_impl
| return await anext(iterator)
| ^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\utils\aiter.py", line 97, in tee_peer
| item = await iterator.anext()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 3976, in atransform
| async for output in self._atransform_stream_with_config(
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 1842, in _atransform_stream_with_config
| chunk: Output = await asyncio.create_task( # type: ignore[call-arg]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\tracers\log_stream.py", line 237, in tap_output_aiter
| async for chunk in output:
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 3945, in _atransform
| output = await acall_func_with_variable_args(
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 3920, in f
| return await run_in_executor(config, func, *args, **kwargs)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\config.py", line 514, in run_in_executor
| return await asyncio.get_running_loop().run_in_executor(
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\concurrent\futures\thread.py", line 58, in run
| result = self.fn(*self.args, **self.kwargs)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 3914, in func
| return call_func_with_variable_args(
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\config.py", line 347, in call_func_with_variable_args
| return func(input, **kwargs) # type: ignore[call-arg]
| ^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\app\agent.py", line 59, in call_model
| response = model.invoke(messages)
| ^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\runnables\base.py", line 4321, in invoke
| return self.bound.invoke(
| ^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\language_models\chat_models.py", line 154, in invoke
| [self._convert_input(input)],
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\language_models\chat_models.py", line 135, in _convert_input
| return ChatPromptValue(messages=convert_to_messages(input))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\messages\utils.py", line 228, in convert_to_messages
| return [_convert_to_message(m) for m in messages]
| ^^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\Administrator\Documents\GitHub\financial-agent\venv\Lib\site-packages\langchain_core\messages\utils.py", line 205, in _convert_to_message
| raise ValueError(
| ValueError: Message dict must contain 'role' and 'content' keys, got {'content': '分析Nvidia', 'type': 'ai'}
+------------------------------------
The text was updated successfully, but these errors were encountered: