langchain-ai / langgraph

Build resilient language agents as graphs.
https://langchain-ai.github.io/langgraph/
MIT License
5.98k stars 939 forks source link

DOC: ValidationError in LangGraph Customer Support Bot Example #2003

Open rohanbalkondekar opened 2 days ago

rohanbalkondekar commented 2 days ago

Issue with current documentation:

This Example: https://github.com/langchain-ai/langgraph/blob/main/docs/docs/tutorials/customer-support/customer-support.ipynb

Does not work, starting from Part 2 Example Conversation

Screenshot at 2024-10-04 11-51-48

Error:

---------------------------------------------------------------------------
ValidationError                           Traceback (most recent call last)
Cell In[18], [line 25](vscode-notebook-cell:?execution_count=18&line=25)
     [21](vscode-notebook-cell:?execution_count=18&line=21) for question in tutorial_questions:
     [22](vscode-notebook-cell:?execution_count=18&line=22)     events = part_2_graph.stream(
     [23](vscode-notebook-cell:?execution_count=18&line=23)         {"messages": ("user", question)}, config, stream_mode="values"
     [24](vscode-notebook-cell:?execution_count=18&line=24)     )
---> [25](vscode-notebook-cell:?execution_count=18&line=25)     for event in events:
     [26](vscode-notebook-cell:?execution_count=18&line=26)         _print_event(event, _printed)
     [27](vscode-notebook-cell:?execution_count=18&line=27)     snapshot = part_2_graph.get_state(config)

File ~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langgraph/pregel/__init__.py:876, in Pregel.stream(self, input, config, stream_mode, output_keys, input_keys, interrupt_before, interrupt_after, debug)
    [869](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langgraph/pregel/__init__.py:869) done, inflight = concurrent.futures.wait(
    [870](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langgraph/pregel/__init__.py:870)     futures,
    [871](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langgraph/pregel/__init__.py:871)     return_when=concurrent.futures.FIRST_EXCEPTION,
    [872](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langgraph/pregel/__init__.py:872)     timeout=self.step_timeout,
    [873](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langgraph/pregel/__init__.py:873) )
    [875](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langgraph/pregel/__init__.py:875) # panic on failure or timeout
--> [876](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langgraph/pregel/__init__.py:876) _panic_or_proceed(done, inflight, step)
    [878](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langgraph/pregel/__init__.py:878) # combine pending writes from all tasks
    [879](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langgraph/pregel/__init__.py:879) pending_writes = deque[tuple[str, Any]]()

File ~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langgraph/pregel/__init__.py:1422, in _panic_or_proceed(done, inflight, step)
   [1420](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langgraph/pregel/__init__.py:1420)             inflight.pop().cancel()
   [1421](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langgraph/pregel/__init__.py:1421)         # raise the exception
-> [1422](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langgraph/pregel/__init__.py:1422)         raise exc
   [1424](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langgraph/pregel/__init__.py:1424) if inflight:
   [1425](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langgraph/pregel/__init__.py:1425)     # if we got here means we timed out
   [1426](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langgraph/pregel/__init__.py:1426)     while inflight:
   [1427](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langgraph/pregel/__init__.py:1427)         # cancel all pending tasks

File /usr/lib/python3.10/concurrent/futures/thread.py:58, in _WorkItem.run(self)
     [55](https://file+.vscode-resource.vscode-cdn.net/usr/lib/python3.10/concurrent/futures/thread.py:55)     return
     [57](https://file+.vscode-resource.vscode-cdn.net/usr/lib/python3.10/concurrent/futures/thread.py:57) try:
---> [58](https://file+.vscode-resource.vscode-cdn.net/usr/lib/python3.10/concurrent/futures/thread.py:58)     result = self.fn(*self.args, **self.kwargs)
     [59](https://file+.vscode-resource.vscode-cdn.net/usr/lib/python3.10/concurrent/futures/thread.py:59) except BaseException as exc:
     [60](https://file+.vscode-resource.vscode-cdn.net/usr/lib/python3.10/concurrent/futures/thread.py:60)     self.future.set_exception(exc)

File ~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langgraph/pregel/retry.py:66, in run_with_retry(task, retry_policy)
     [64](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langgraph/pregel/retry.py:64) task.writes.clear()
     [65](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langgraph/pregel/retry.py:65) # run the task
---> [66](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langgraph/pregel/retry.py:66) task.proc.invoke(task.input, task.config)
     [67](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langgraph/pregel/retry.py:67) # if successful, end
     [68](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langgraph/pregel/retry.py:68) break

File ~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/runnables/base.py:2368, in RunnableSequence.invoke(self, input, config)
   [2366](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/runnables/base.py:2366) try:
   [2367](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/runnables/base.py:2367)     for i, step in enumerate(self.steps):
-> [2368](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/runnables/base.py:2368)         input = step.invoke(
   [2369](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/runnables/base.py:2369)             input,
   [2370](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/runnables/base.py:2370)             # mark each step as a child run
   [2371](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/runnables/base.py:2371)             patch_config(
   [2372](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/runnables/base.py:2372)                 config, callbacks=run_manager.get_child(f"seq:step:{i+1}")
   [2373](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/runnables/base.py:2373)             ),
   [2374](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/runnables/base.py:2374)         )
   [2375](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/runnables/base.py:2375) # finish the root run
   [2376](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/runnables/base.py:2376) except BaseException as e:

File ~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langgraph/utils.py:89, in RunnableCallable.invoke(self, input, config)
     [83](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langgraph/utils.py:83)     context.run(var_child_runnable_config.set, config)
     [84](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langgraph/utils.py:84)     kwargs = (
     [85](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langgraph/utils.py:85)         {**self.kwargs, "config": config}
     [86](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langgraph/utils.py:86)         if accepts_config(self.func)
     [87](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langgraph/utils.py:87)         else self.kwargs
     [88](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langgraph/utils.py:88)     )
---> [89](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langgraph/utils.py:89)     ret = context.run(self.func, input, **kwargs)
     [90](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langgraph/utils.py:90) if isinstance(ret, Runnable) and self.recurse:
     [91](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langgraph/utils.py:91)     return ret.invoke(input, config)

Cell In[16], [line 9](vscode-notebook-cell:?execution_count=16&line=9)
      [8](vscode-notebook-cell:?execution_count=16&line=8) def user_info(state: State):
----> [9](vscode-notebook-cell:?execution_count=16&line=9)     return {"user_info": fetch_user_flight_information.invoke({})}

File ~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/tools.py:260, in BaseTool.invoke(self, input, config, **kwargs)
    [253](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/tools.py:253) def invoke(
    [254](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/tools.py:254)     self,
    [255](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/tools.py:255)     input: Union[str, Dict],
    [256](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/tools.py:256)     config: Optional[RunnableConfig] = None,
    [257](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/tools.py:257)     **kwargs: Any,
    [258](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/tools.py:258) ) -> Any:
    [259](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/tools.py:259)     config = ensure_config(config)
--> [260](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/tools.py:260)     return self.run(
    [261](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/tools.py:261)         input,
    [262](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/tools.py:262)         callbacks=config.get("callbacks"),
    [263](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/tools.py:263)         tags=config.get("tags"),
    [264](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/tools.py:264)         metadata=config.get("metadata"),
    [265](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/tools.py:265)         run_name=config.get("run_name"),
    [266](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/tools.py:266)         run_id=config.pop("run_id", None),
    [267](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/tools.py:267)         config=config,
    [268](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/tools.py:268)         **kwargs,
    [269](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/tools.py:269)     )

File ~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/tools.py:417, in BaseTool.run(self, tool_input, verbose, start_color, color, callbacks, tags, metadata, run_name, run_id, config, **kwargs)
    [415](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/tools.py:415) except ValidationError as e:
    [416](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/tools.py:416)     if not self.handle_validation_error:
--> [417](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/tools.py:417)         raise e
    [418](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/tools.py:418)     elif isinstance(self.handle_validation_error, bool):
    [419](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/tools.py:419)         observation = "Tool input validation error"

File ~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/tools.py:406, in BaseTool.run(self, tool_input, verbose, start_color, color, callbacks, tags, metadata, run_name, run_id, config, **kwargs)
    [404](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/tools.py:404) context = copy_context()
    [405](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/tools.py:405) context.run(var_child_runnable_config.set, child_config)
--> [406](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/tools.py:406) parsed_input = self._parse_input(tool_input)
    [407](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/tools.py:407) tool_args, tool_kwargs = self._to_args_and_kwargs(parsed_input)
    [408](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/tools.py:408) observation = (
    [409](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/tools.py:409)     context.run(
    [410](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/tools.py:410)         self._run, *tool_args, run_manager=run_manager, **tool_kwargs
   (...)
    [413](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/tools.py:413)     else context.run(self._run, *tool_args, **tool_kwargs)
    [414](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/tools.py:414) )

File ~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/tools.py:304, in BaseTool._parse_input(self, tool_input)
    [302](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/tools.py:302) else:
    [303](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/tools.py:303)     if input_args is not None:
--> [304](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/tools.py:304)         result = input_args.parse_obj(tool_input)
    [305](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/tools.py:305)         return {
    [306](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/tools.py:306)             k: getattr(result, k)
    [307](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/tools.py:307)             for k, v in result.dict().items()
    [308](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/tools.py:308)             if k in tool_input
    [309](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/tools.py:309)         }
    [310](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/langchain_core/tools.py:310) return tool_input

File ~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/pydantic/v1/main.py:526, in BaseModel.parse_obj(cls, obj)
    [524](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/pydantic/v1/main.py:524)         exc = TypeError(f'{cls.__name__} expected dict not {obj.__class__.__name__}')
    [525](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/pydantic/v1/main.py:525)         raise ValidationError([ErrorWrapper(exc, loc=ROOT_KEY)], cls) from e
--> [526](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/pydantic/v1/main.py:526) return cls(**obj)

File ~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/pydantic/v1/main.py:341, in BaseModel.__init__(__pydantic_self__, **data)
    [339](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/pydantic/v1/main.py:339) values, fields_set, validation_error = validate_model(__pydantic_self__.__class__, data)
    [340](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/pydantic/v1/main.py:340) if validation_error:
--> [341](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/pydantic/v1/main.py:341)     raise validation_error
    [342](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/pydantic/v1/main.py:342) try:
    [343](https://file+.vscode-resource.vscode-cdn.net/home/rohan/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/~/Desktop/work/playground/calm-langgraph-customer-service-comparison/langgraph_implementation/venv/lib/python3.10/site-packages/pydantic/v1/main.py:343)     object_setattr(__pydantic_self__, '__dict__', values)

ValidationError: 1 validation error for fetch_user_flight_informationSchema
config
  field required (type=value_error.missing)

Idea or request for content:

The Official Examples Should be working out of the box, it helps with quick testing and evaluation

hinthornw commented 2 days ago

I think you need to update langchain-core ; what version are you on?

rohanbalkondekar commented 2 days ago

I think you need to update langchain-core ; what version are you on?

Name: langchain-core Version: 0.3.8

vbarda commented 2 days ago

@rohanbalkondekar I could not reproduce this issue -- could you please try in a fresh virtual environment and let me know if you're still running into this issue?