langchain-ai / langgraph

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

DOC: Chatbots > Customer Support throwing the error: "An assistant message with 'tool_calls' must be followed by tool messages responding to each 'tool_call_id'" #2075

Open justinlevi opened 3 days ago

justinlevi commented 3 days ago

Issue with current documentation:

https://langchain-ai.github.io/langgraph/tutorials/customer-support/customer-support/#utility

Running the notebook throws the following error:

---------------------------------------------------------------------------
BadRequestError                           Traceback (most recent call last)
...
    [762](https://file+.vscode-resource.vscode-cdn.net/Users/justinwinter/Projects/experiments/~/Library/Caches/pypoetry/virtualenvs/-AxVTkH6j-py3.12/lib/python3.12/site-packages/openai/resources/chat/completions.py:762)                 "stop": stop,
    [763](https://file+.vscode-resource.vscode-cdn.net/Users/justinwinter/Projects/experiments/~/Library/Caches/pypoetry/virtualenvs/-AxVTkH6j-py3.12/lib/python3.12/site-packages/openai/resources/chat/completions.py:763)                 "store": store,
    [764](https://file+.vscode-resource.vscode-cdn.net/Users/justinwinter/Projects/experiments/~/Library/Caches/pypoetry/virtualenvs/-AxVTkH6j-py3.12/lib/python3.12/site-packages/openai/resources/chat/completions.py:764)                 "stream": stream,
    [765](https://file+.vscode-resource.vscode-cdn.net/Users/justinwinter/Projects/experiments/~/Library/Caches/pypoetry/virtualenvs/-AxVTkH6j-py3.12/lib/python3.12/site-packages/openai/resources/chat/completions.py:765)                 "stream_options": stream_options,
    [766](https://file+.vscode-resource.vscode-cdn.net/Users/justinwinter/Projects/experiments/~/Library/Caches/pypoetry/virtualenvs/-AxVTkH6j-py3.12/lib/python3.12/site-packages/openai/resources/chat/completions.py:766)                 "temperature": temperature,
    [767](https://file+.vscode-resource.vscode-cdn.net/Users/justinwinter/Projects/experiments/~/Library/Caches/pypoetry/virtualenvs/-AxVTkH6j-py3.12/lib/python3.12/site-packages/openai/resources/chat/completions.py:767)                 "tool_choice": tool_choice,
    [768](https://file+.vscode-resource.vscode-cdn.net/Users/justinwinter/Projects/experiments/~/Library/Caches/pypoetry/virtualenvs/-AxVTkH6j-py3.12/lib/python3.12/site-packages/openai/resources/chat/completions.py:768)                 "tools": tools,
    [769](https://file+.vscode-resource.vscode-cdn.net/Users/justinwinter/Projects/experiments/~/Library/Caches/pypoetry/virtualenvs/-AxVTkH6j-py3.12/lib/python3.12/site-packages/openai/resources/chat/completions.py:769)                 "top_logprobs": top_logprobs,
    [770](https://file+.vscode-resource.vscode-cdn.net/Users/justinwinter/Projects/experiments/~/Library/Caches/pypoetry/virtualenvs/-AxVTkH6j-py3.12/lib/python3.12/site-packages/openai/resources/chat/completions.py:770)                 "top_p": top_p,
    [771](https://file+.vscode-resource.vscode-cdn.net/Users/justinwinter/Projects/experiments/~/Library/Caches/pypoetry/virtualenvs/-AxVTkH6j-py3.12/lib/python3.12/site-packages/openai/resources/chat/completions.py:771)                 "user": user,
    [772](https://file+.vscode-resource.vscode-cdn.net/Users/justinwinter/Projects/experiments/~/Library/Caches/pypoetry/virtualenvs/-AxVTkH6j-py3.12/lib/python3.12/site-packages/openai/resources/chat/completions.py:772)             },
    [773](https://file+.vscode-resource.vscode-cdn.net/Users/justinwinter/Projects/experiments/~/Library/Caches/pypoetry/virtualenvs/-AxVTkH6j-py3.12/lib/python3.12/site-packages/openai/resources/chat/completions.py:773)             completion_create_params.CompletionCreateParams,
    [774](https://file+.vscode-resource.vscode-cdn.net/Users/justinwinter/Projects/experiments/~/Library/Caches/pypoetry/virtualenvs/-AxVTkH6j-py3.12/lib/python3.12/site-packages/openai/resources/chat/completions.py:774)         ),
    [775](https://file+.vscode-resource.vscode-cdn.net/Users/justinwinter/Projects/experiments/~/Library/Caches/pypoetry/virtualenvs/-AxVTkH6j-py3.12/lib/python3.12/site-packages/openai/resources/chat/completions.py:775)         options=make_request_options(
    [776](https://file+.vscode-resource.vscode-cdn.net/Users/justinwinter/Projects/experiments/~/Library/Caches/pypoetry/virtualenvs/-AxVTkH6j-py3.12/lib/python3.12/site-packages/openai/resources/chat/completions.py:776)             extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
    [777](https://file+.vscode-resource.vscode-cdn.net/Users/justinwinter/Projects/experiments/~/Library/Caches/pypoetry/virtualenvs/-AxVTkH6j-py3.12/lib/python3.12/site-packages/openai/resources/chat/completions.py:777)         ),
    [778](https://file+.vscode-resource.vscode-cdn.net/Users/justinwinter/Projects/experiments/~/Library/Caches/pypoetry/virtualenvs/-AxVTkH6j-py3.12/lib/python3.12/site-packages/openai/resources/chat/completions.py:778)         cast_to=ChatCompletion,
    [779](https://file+.vscode-resource.vscode-cdn.net/Users/justinwinter/Projects/experiments/~/Library/Caches/pypoetry/virtualenvs/-AxVTkH6j-py3.12/lib/python3.12/site-packages/openai/resources/chat/completions.py:779)         stream=stream or False,
    [780](https://file+.vscode-resource.vscode-cdn.net/Users/justinwinter/Projects/experiments/~/Library/Caches/pypoetry/virtualenvs/-AxVTkH6j-py3.12/lib/python3.12/site-packages/openai/resources/chat/completions.py:780)         stream_cls=Stream[ChatCompletionChunk],
    [781](https://file+.vscode-resource.vscode-cdn.net/Users/justinwinter/Projects/experiments/~/Library/Caches/pypoetry/virtualenvs/-AxVTkH6j-py3.12/lib/python3.12/site-packages/openai/resources/chat/completions.py:781)     )

File ~/Library/Caches/pypoetry/virtualenvs/-AxVTkH6j-py3.12/lib/python3.12/site-packages/openai/_base_client.py:1277, in SyncAPIClient.post(self, path, cast_to, body, options, files, stream, stream_cls)
   [1263](https://file+.vscode-resource.vscode-cdn.net/Users/justinwinter/Projects/experiments/~/Library/Caches/pypoetry/virtualenvs/-AxVTkH6j-py3.12/lib/python3.12/site-packages/openai/_base_client.py:1263) def post(
   [1264](https://file+.vscode-resource.vscode-cdn.net/Users/justinwinter/Projects/experiments/~/Library/Caches/pypoetry/virtualenvs/-AxVTkH6j-py3.12/lib/python3.12/site-packages/openai/_base_client.py:1264)     self,
   [1265](https://file+.vscode-resource.vscode-cdn.net/Users/justinwinter/Projects/experiments/~/Library/Caches/pypoetry/virtualenvs/-AxVTkH6j-py3.12/lib/python3.12/site-packages/openai/_base_client.py:1265)     path: str,
   (...)
   [1272](https://file+.vscode-resource.vscode-cdn.net/Users/justinwinter/Projects/experiments/~/Library/Caches/pypoetry/virtualenvs/-AxVTkH6j-py3.12/lib/python3.12/site-packages/openai/_base_client.py:1272)     stream_cls: type[_StreamT] | None = None,
   [1273](https://file+.vscode-resource.vscode-cdn.net/Users/justinwinter/Projects/experiments/~/Library/Caches/pypoetry/virtualenvs/-AxVTkH6j-py3.12/lib/python3.12/site-packages/openai/_base_client.py:1273) ) -> ResponseT | _StreamT:
   [1274](https://file+.vscode-resource.vscode-cdn.net/Users/justinwinter/Projects/experiments/~/Library/Caches/pypoetry/virtualenvs/-AxVTkH6j-py3.12/lib/python3.12/site-packages/openai/_base_client.py:1274)     opts = FinalRequestOptions.construct(
   [1275](https://file+.vscode-resource.vscode-cdn.net/Users/justinwinter/Projects/experiments/~/Library/Caches/pypoetry/virtualenvs/-AxVTkH6j-py3.12/lib/python3.12/site-packages/openai/_base_client.py:1275)         method="post", url=path, json_data=body, files=to_httpx_files(files), **options
   [1276](https://file+.vscode-resource.vscode-cdn.net/Users/justinwinter/Projects/experiments/~/Library/Caches/pypoetry/virtualenvs/-AxVTkH6j-py3.12/lib/python3.12/site-packages/openai/_base_client.py:1276)     )
-> [1277](https://file+.vscode-resource.vscode-cdn.net/Users/justinwinter/Projects/experiments/~/Library/Caches/pypoetry/virtualenvs/-AxVTkH6j-py3.12/lib/python3.12/site-packages/openai/_base_client.py:1277)     return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))

File ~/Library/Caches/pypoetry/virtualenvs/-AxVTkH6j-py3.12/lib/python3.12/site-packages/openai/_base_client.py:954, in SyncAPIClient.request(self, cast_to, options, remaining_retries, stream, stream_cls)
    [951](https://file+.vscode-resource.vscode-cdn.net/Users/justinwinter/Projects/experiments/~/Library/Caches/pypoetry/virtualenvs/-AxVTkH6j-py3.12/lib/python3.12/site-packages/openai/_base_client.py:951) else:
    [952](https://file+.vscode-resource.vscode-cdn.net/Users/justinwinter/Projects/experiments/~/Library/Caches/pypoetry/virtualenvs/-AxVTkH6j-py3.12/lib/python3.12/site-packages/openai/_base_client.py:952)     retries_taken = 0
--> [954](https://file+.vscode-resource.vscode-cdn.net/Users/justinwinter/Projects/experiments/~/Library/Caches/pypoetry/virtualenvs/-AxVTkH6j-py3.12/lib/python3.12/site-packages/openai/_base_client.py:954) return self._request(
    [955](https://file+.vscode-resource.vscode-cdn.net/Users/justinwinter/Projects/experiments/~/Library/Caches/pypoetry/virtualenvs/-AxVTkH6j-py3.12/lib/python3.12/site-packages/openai/_base_client.py:955)     cast_to=cast_to,
    [956](https://file+.vscode-resource.vscode-cdn.net/Users/justinwinter/Projects/experiments/~/Library/Caches/pypoetry/virtualenvs/-AxVTkH6j-py3.12/lib/python3.12/site-packages/openai/_base_client.py:956)     options=options,
    [957](https://file+.vscode-resource.vscode-cdn.net/Users/justinwinter/Projects/experiments/~/Library/Caches/pypoetry/virtualenvs/-AxVTkH6j-py3.12/lib/python3.12/site-packages/openai/_base_client.py:957)     stream=stream,
    [958](https://file+.vscode-resource.vscode-cdn.net/Users/justinwinter/Projects/experiments/~/Library/Caches/pypoetry/virtualenvs/-AxVTkH6j-py3.12/lib/python3.12/site-packages/openai/_base_client.py:958)     stream_cls=stream_cls,
    [959](https://file+.vscode-resource.vscode-cdn.net/Users/justinwinter/Projects/experiments/~/Library/Caches/pypoetry/virtualenvs/-AxVTkH6j-py3.12/lib/python3.12/site-packages/openai/_base_client.py:959)     retries_taken=retries_taken,
    [960](https://file+.vscode-resource.vscode-cdn.net/Users/justinwinter/Projects/experiments/~/Library/Caches/pypoetry/virtualenvs/-AxVTkH6j-py3.12/lib/python3.12/site-packages/openai/_base_client.py:960) )

File ~/Library/Caches/pypoetry/virtualenvs/-AxVTkH6j-py3.12/lib/python3.12/site-packages/openai/_base_client.py:1058, in SyncAPIClient._request(self, cast_to, options, retries_taken, stream, stream_cls)
   [1055](https://file+.vscode-resource.vscode-cdn.net/Users/justinwinter/Projects/experiments/~/Library/Caches/pypoetry/virtualenvs/-AxVTkH6j-py3.12/lib/python3.12/site-packages/openai/_base_client.py:1055)         err.response.read()
   [1057](https://file+.vscode-resource.vscode-cdn.net/Users/justinwinter/Projects/experiments/~/Library/Caches/pypoetry/virtualenvs/-AxVTkH6j-py3.12/lib/python3.12/site-packages/openai/_base_client.py:1057)     log.debug("Re-raising status error")
-> [1058](https://file+.vscode-resource.vscode-cdn.net/Users/justinwinter/Projects/experiments/~/Library/Caches/pypoetry/virtualenvs/-AxVTkH6j-py3.12/lib/python3.12/site-packages/openai/_base_client.py:1058)     raise self._make_status_error_from_response(err.response) from None
   [1060](https://file+.vscode-resource.vscode-cdn.net/Users/justinwinter/Projects/experiments/~/Library/Caches/pypoetry/virtualenvs/-AxVTkH6j-py3.12/lib/python3.12/site-packages/openai/_base_client.py:1060) return self._process_response(
   [1061](https://file+.vscode-resource.vscode-cdn.net/Users/justinwinter/Projects/experiments/~/Library/Caches/pypoetry/virtualenvs/-AxVTkH6j-py3.12/lib/python3.12/site-packages/openai/_base_client.py:1061)     cast_to=cast_to,
   [1062](https://file+.vscode-resource.vscode-cdn.net/Users/justinwinter/Projects/experiments/~/Library/Caches/pypoetry/virtualenvs/-AxVTkH6j-py3.12/lib/python3.12/site-packages/openai/_base_client.py:1062)     options=options,
   (...)
   [1066](https://file+.vscode-resource.vscode-cdn.net/Users/justinwinter/Projects/experiments/~/Library/Caches/pypoetry/virtualenvs/-AxVTkH6j-py3.12/lib/python3.12/site-packages/openai/_base_client.py:1066)     retries_taken=retries_taken,
   [1067](https://file+.vscode-resource.vscode-cdn.net/Users/justinwinter/Projects/experiments/~/Library/Caches/pypoetry/virtualenvs/-AxVTkH6j-py3.12/lib/python3.12/site-packages/openai/_base_client.py:1067) )

BadRequestError: Error code: 400 - {'error': {'message': "An assistant message with 'tool_calls' must be followed by tool messages responding to each 'tool_call_id'. The following tool_call_ids did not have response messages: call_bsyGIHSEUgnD3EgLzihthfQT", 'type': 'invalid_request_error', 'param': 'messages', 'code': None}

Output before error

================================ Human Message =================================

Hi there, what time is my flight?
================================== Ai Message ==================================

Your flight LX0112 is scheduled to depart from Charles de Gaulle Airport (CDG) at 12:01 PM local time on October 10, 2024. It is set to arrive at EuroAirport Basel Mulhouse Freiburg (BSL) at 1:31 PM local time on the same day.
================================ Human Message =================================

Am i allowed to update my flight to something sooner? I want to leave later today.
================================== Ai Message ==================================
Tool Calls:
  lookup_policy (call_RYFiRp5nNOpAXbzVNmGgrR6Z)
 Call ID: call_RYFiRp5nNOpAXbzVNmGgrR6Z
  Args:
    query: flight change policy
================================= Tool Message =================================
Name: lookup_policy

## Booking and Cancellation

1. How can I change my booking?
    * The ticket number must start with 724 (SWISS ticket no./plate).
    * The ticket was not paid for by barter or voucher (there are exceptions to voucher payments; if the ticket was paid for in full by voucher, then it may be possible to rebook online under certain circumstances. If it is not possible to rebook online because of the payment method, then you will be informed accordingly during the rebooking process).
    * There must be an active flight booking for your ticket. It is not possible to rebook open tickets or tickets without the corresponding flight segments online at the moment.
    * It is currently only possible to rebook outbound (one-way) tickets or return tickets with single flight routes (point-to-point).
2. Which tickets/bookings cannot be rebooked online currently?
    * Bookings containing flight segments with other airlines
    * Bookings containing reservations, where a ticket has not yet been issued
    * Bookings with several valid tickets for the same person and route
    * Tickets with a status other than O (open) (A)
    * Bookings with segments with a status other than OK (e.g. containing flight segments with the status Waitlist) (HK|RR)
    * Tickets that do not display the tariff calculation (IT tickets)
    * Bookings that contain special services (e.g. transportation of animals/transportation of medica ... (truncated)
================================== Ai Message ==================================

You are allowed to change your flight to a later time today, as long as you meet the following conditions:

1. Your ticket number starts with 724 and was not paid for by barter or voucher.
2. You have an active flight booking, and the flight is not part of a group booking.
3. Your flight booking does not include special services like transportation of animals or medical equipment.
4. You are changing a single flight route, not a multi-leg journey.

Since your flight is scheduled to depart soon, I will assist you in making the change. Let me transfer your request to the appropriate assistant to handle this update for you.
Tool Calls:
  ToFlightBookingAssistant (call_K5zmNjUW0oczo8Cta31vohfX)
 Call ID: call_K5zmNjUW0oczo8Cta31vohfX
  Args:
    request: The user wants to reschedule their flight LX0112 from CDG to BSL for a later time today.
Currently in:  update_flight
================================= Tool Message =================================

The assistant is now the Flight Updates & Booking Assistant. Reflect on the above conversation between the host assistant and the user. The user's intent is unsatisfied. Use the provided tools to assist the user. Remember, you are Flight Updates & Booking Assistant, and the booking, update, other other action is not complete until after you have successfully invoked the appropriate tool. If the user changes their mind or needs help for other tasks, call the CompleteOrEscalate function to let the primary host assistant take control. Do not mention who you are - just act as the proxy for the assistant.
Currently in:  update_flight
================================== Ai Message ==================================
Tool Calls:
  search_flights (call_c3neUfUSOb2VwXMqmrokSeu9)
 Call ID: call_c3neUfUSOb2VwXMqmrokSeu9
  Args:
    departure_airport: CDG
    arrival_airport: BSL
    start_time: 2024-10-10T12:30:00
    end_time: 2024-10-10T23:59:00
Currently in:  update_flight
================================= Tool Message =================================
Name: search_flights

[]
Currently in:  update_flight
================================== Ai Message ==================================
Tool Calls:
  search_flights (call_y5QDJ828M0IeEDaNd1WjjTM9)
 Call ID: call_y5QDJ828M0IeEDaNd1WjjTM9
  Args:
    departure_airport: CDG
    arrival_airport: BSL
    start_time: 2024-10-10T14:00:00
    end_time: 2024-10-11T01:00:00
Currently in:  update_flight
================================= Tool Message =================================
Name: search_flights

[]
Currently in:  update_flight
================================== Ai Message ==================================
Tool Calls:
  CompleteOrEscalate (call_pVsOZFjY9AMcAqOOiQkI19Lb)
 Call ID: call_pVsOZFjY9AMcAqOOiQkI19Lb
  Args:
    reason: Unable to find available flights for the user to reschedule to a later time today.
================================= Tool Message =================================

Resuming dialog with the host assistant. Please reflect on the past conversation and assist the user as needed.
================================== Ai Message ==================================

I couldn't find any available flights from Charles de Gaulle Airport (CDG) to EuroAirport Basel Mulhouse Freiburg (BSL) later today. If you have any flexibility with your travel plans, I recommend checking back later or considering alternate travel arrangements. If there's anything else I can assist you with, please let me know!
================================ Human Message =================================

Update my flight to sometime next week then
================================== Ai Message ==================================
Tool Calls:
  ToFlightBookingAssistant (call_7vEHTv2npOPxWtByz6D12WeP)
 Call ID: call_7vEHTv2npOPxWtByz6D12WeP
  Args:
    request: The user wants to reschedule their flight LX0112 from CDG to BSL to a date next week.
Currently in:  update_flight
================================= Tool Message =================================

The assistant is now the Flight Updates & Booking Assistant. Reflect on the above conversation between the host assistant and the user. The user's intent is unsatisfied. Use the provided tools to assist the user. Remember, you are Flight Updates & Booking Assistant, and the booking, update, other other action is not complete until after you have successfully invoked the appropriate tool. If the user changes their mind or needs help for other tasks, call the CompleteOrEscalate function to let the primary host assistant take control. Do not mention who you are - just act as the proxy for the assistant.
Currently in:  update_flight
================================== Ai Message ==================================
Tool Calls:
  search_flights (call_5WCBkWDvUSIiPrJkPEWKDM3M)
 Call ID: call_5WCBkWDvUSIiPrJkPEWKDM3M
  Args:
    departure_airport: CDG
    arrival_airport: BSL
    start_time: 2024-10-17T00:00:00
    end_time: 2024-10-17T23:59:00
Currently in:  update_flight
================================= Tool Message =================================
Name: search_flights

[{"flight_id": 19251, "flight_no": "LX0112", "scheduled_departure": "2024-10-17 12:01:18.665554-04:00", "scheduled_arrival": "2024-10-17 13:31:18.665554-04:00", "departure_airport": "CDG", "arrival_airport": "BSL", "status": "Scheduled", "aircraft_code": "SU9", "actual_departure": null, "actual_arrival": null}]
Currently in:  update_flight
================================== Ai Message ==================================
Tool Calls:
  update_ticket_to_new_flight (call_pVsOZFjY9AMcAqOOiQkI19Lb)
 Call ID: call_pVsOZFjY9AMcAqOOiQkI19Lb
  Args:
    ticket_no: 7240005432906569
    new_flight_id: 19251
Currently in:  update_flight
================================ Human Message =================================

The next available option is great
Currently in:  update_flight
Currently in:  update_flight
================================== Ai Message ==================================

Let's proceed with updating your flight to October 17, 2024. I'll handle the update for you.
Tool Calls:
  update_ticket_to_new_flight (call_KxH0vjgwfyW6ShhxtSPjdUdX)
 Call ID: call_KxH0vjgwfyW6ShhxtSPjdUdX
  Args:
    ticket_no: 7240005432906569
    new_flight_id: 19251
Currently in:  update_flight
================================ Human Message =================================

what about lodging and transportation?
Currently in:  update_flight
Currently in:  update_flight
================================== Ai Message ==================================
Tool Calls:
  CompleteOrEscalate (call_puWvVoar1bOkql3LXM9f3pkB)
 Call ID: call_puWvVoar1bOkql3LXM9f3pkB
  Args:
    reason: The user needs assistance with lodging and transportation, which is outside my capabilities.
================================= Tool Message =================================

Resuming dialog with the host assistant. Please reflect on the past conversation and assist the user as needed.
================================== Ai Message ==================================

I can help you with lodging and transportation arrangements. Could you please provide the location, dates, and any specific preferences you have for booking a hotel and renting a car?
================================ Human Message =================================

Yeah i think i'd like an affordable hotel for my week-long stay (7 days). And I'll want to rent a car.
================================== Ai Message ==================================
Tool Calls:
  ToHotelBookingAssistant (call_6sqBva3nmPmTdm3qP98iQ3yU)
 Call ID: call_6sqBva3nmPmTdm3qP98iQ3yU
  Args:
    location: Basel
    checkin_date: 2024-10-17
    checkout_date: 2024-10-24
    request: Looking for an affordable hotel for a 7-day stay.
  ToBookCarRental (call_bsyGIHSEUgnD3EgLzihthfQT)
 Call ID: call_bsyGIHSEUgnD3EgLzihthfQT
  Args:
    location: Basel
    start_date: 2024-10-17
    end_date: 2024-10-24
    request: Looking to rent a car for a week-long stay.
Currently in:  book_hotel
================================= Tool Message =================================

The assistant is now the Hotel Booking Assistant. Reflect on the above conversation between the host assistant and the user. The user's intent is unsatisfied. Use the provided tools to assist the user. Remember, you are Hotel Booking Assistant, and the booking, update, other other action is not complete until after you have successfully invoked the appropriate tool. If the user changes their mind or needs help for other tasks, call the CompleteOrEscalate function to let the primary host assistant take control. Do not mention who you are - just act as the proxy for the assistant.

My python env:

langchain                 0.2.16          Building applications with LLMs through composability
langchain-anthropic       0.1.23          An integration package connecting AnthropicMessages and LangChain
langchain-community       0.2.17          Community contributed LangChain integrations.
langchain-core            0.2.41          Building applications with LLMs through composability
langchain-mistralai       0.1.13          An integration package connecting Mistral and LangChain
langchain-openai          0.1.25          An integration package connecting OpenAI and LangChain
langchain-text-splitters  0.2.4           LangChain text splitting utilities
langgraph                 0.0.69          langgraph
langserve                 0.2.3           
langsmith                 0.1.132         Client library to connect to the LangSmith LLM Tracing and Evaluation Platform.
pydantic                  1.10.18         Data validation and settings management using python type hints

Idea or request for content:

No response

justinlevi commented 3 days ago

I would really love to see a chatbot example where you stream to a frontend implementation that accepts user input for an interrupt. This piece is really throwing me off.

justinlevi commented 3 days ago

I think this thread is related https://github.com/langchain-ai/langgraph/discussions/544

User Story: As a developer building a simple chatbot, I may want to interrupt a graph to get user approval before executing a specific tool. (ex. changing airline booking) I need an AI message sent to the user with the details of the proposed change and need to record this plus the users response in as a checkpoint before continuing on with the tool execution or not. I would expect the messages state to be managed by langgraph in this situation.