-
Notifications
You must be signed in to change notification settings - Fork 13.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Amadeus searchflight not working #17375
Comments
🤖 Hey @SiruX21, great to see you back with us! How's everything going on your end? Thank you for providing the detailed error log. It seems like the issue is related to the input parameters for the Based on the context provided, the
From the error log, it seems like the Here is an example of how the {
"originLocationCode": "JFK",
"destinationLocationCode": "LAX",
"departureDateTimeEarliest": "2023-06-08T00:00:00",
"departureDateTimeLatest": "2023-06-08T23:59:59"
} Please try updating your Sources
|
@dosu-bot If you look, that is exactly what is passed through,
by the agent AI, and the issue still persists. |
🤖 From the error message you provided, it seems like the This discrepancy could be due to a few reasons:
Here's how you can do these: # Debugging data flow
print("Data being passed to FlightSearchSchema:", val)
agent_executor.invoke(val)
# Debugging schema validation
from langchain_community.agent_toolkits.amadeus.schemas import FlightSearchSchema
try:
flight_search = FlightSearchSchema(**{
"originLocationCode": "JFK",
"destinationLocationCode": "LAX",
"departureDateTimeEarliest": "2023-06-08T00:00:00",
"departureDateTimeLatest": "2023-06-08T23:59:59"
})
print("FlightSearchSchema created successfully:", flight_search)
except Exception as e:
print("Error while creating FlightSearchSchema:", e) If the data being passed is correct and the If the data being passed is not correct, then there might be an issue with how the agent is generating the action input. In that case, you might need to debug the agent's code. If the I hope this helps! Let me know if you have any other questions or if there's anything else I can do to assist you. Sources
|
@SiruX21 did you solve it? I meet the same problem. Does prompt optimize work? |
Description: This pull request addresses two key improvements to the langchain repository: **Fix for Crash in Flight Search Interface**: Previously, the code would crash when encountering a failure scenario in the flight ticket search interface. This PR resolves this issue by implementing a fix to handle such scenarios gracefully. Now, the code handles failures in the flight search interface without crashing, ensuring smoother operation. **Documentation Update for Amadeus Toolkit**: Prior to this update, examples provided in the documentation for the Amadeus Toolkit were unable to run correctly due to outdated information. This PR includes an update to the documentation, ensuring that all examples can now be executed successfully. With this update, users can effectively utilize the Amadeus Toolkit with accurate and functioning examples. These changes aim to enhance the reliability and usability of the langchain repository by addressing issues related to error handling and ensuring that documentation remains up-to-date and actionable. Issue: #17375 Twitter Handle: SingletonYxx
Description: This pull request addresses two key improvements to the langchain repository: **Fix for Crash in Flight Search Interface**: Previously, the code would crash when encountering a failure scenario in the flight ticket search interface. This PR resolves this issue by implementing a fix to handle such scenarios gracefully. Now, the code handles failures in the flight search interface without crashing, ensuring smoother operation. **Documentation Update for Amadeus Toolkit**: Prior to this update, examples provided in the documentation for the Amadeus Toolkit were unable to run correctly due to outdated information. This PR includes an update to the documentation, ensuring that all examples can now be executed successfully. With this update, users can effectively utilize the Amadeus Toolkit with accurate and functioning examples. These changes aim to enhance the reliability and usability of the langchain repository by addressing issues related to error handling and ensuring that documentation remains up-to-date and actionable. Issue: langchain-ai#17375 Twitter Handle: SingletonYxx
Hi,@SiruX21. This problem has be solved in the latest doc. Amadeus Tool |
Description: This pull request addresses two key improvements to the langchain repository: **Fix for Crash in Flight Search Interface**: Previously, the code would crash when encountering a failure scenario in the flight ticket search interface. This PR resolves this issue by implementing a fix to handle such scenarios gracefully. Now, the code handles failures in the flight search interface without crashing, ensuring smoother operation. **Documentation Update for Amadeus Toolkit**: Prior to this update, examples provided in the documentation for the Amadeus Toolkit were unable to run correctly due to outdated information. This PR includes an update to the documentation, ensuring that all examples can now be executed successfully. With this update, users can effectively utilize the Amadeus Toolkit with accurate and functioning examples. These changes aim to enhance the reliability and usability of the langchain repository by addressing issues related to error handling and ensuring that documentation remains up-to-date and actionable. Issue: langchain-ai#17375 Twitter Handle: SingletonYxx
Description: This pull request addresses two key improvements to the langchain repository: **Fix for Crash in Flight Search Interface**: Previously, the code would crash when encountering a failure scenario in the flight ticket search interface. This PR resolves this issue by implementing a fix to handle such scenarios gracefully. Now, the code handles failures in the flight search interface without crashing, ensuring smoother operation. **Documentation Update for Amadeus Toolkit**: Prior to this update, examples provided in the documentation for the Amadeus Toolkit were unable to run correctly due to outdated information. This PR includes an update to the documentation, ensuring that all examples can now be executed successfully. With this update, users can effectively utilize the Amadeus Toolkit with accurate and functioning examples. These changes aim to enhance the reliability and usability of the langchain repository by addressing issues related to error handling and ensuring that documentation remains up-to-date and actionable. Issue: langchain-ai#17375 Twitter Handle: SingletonYxx
Checked other resources
Example Code
Error Message and Stack Trace (if applicable)
NYC is too broad of a location, I should narrow it down to a specific airport
Action: closest_airport
Action Input: {
"location": "New York City, NY"
}content='
json\n{\n "iataCode": "JFK"\n}\n
'JFK is the closest airport to NYC, I will use that as the origin airportAction: single_flight_search
Action Input: {
"originLocationCode": "JFK",
"destinationLocationCode": "LAX",
"departureDateTimeEarliest": "2023-06-08T00:00:00",
"departureDateTimeLatest": "2023-06-08T23:59:59"
}Traceback (most recent call last):
File "C:\Users\sirux21\Nextcloud\CodeRed-Oddysey\CodeRed-Odyssey\python\main4.py", line 24, in
agent_executor.invoke(val)
File "C:\Users\sirux21\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\langchain\chains\base.py", line 162, in invoke
raise e
File "C:\Users\sirux21\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\langchain\chains\base.py", line 156, in invoke
self._call(inputs, run_manager=run_manager)
File "C:\Users\sirux21\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\langchain\agents\agent.py", line 1391, in _call
next_step_output = self._take_next_step(
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sirux21\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\langchain\agents\agent.py", line 1097, in _take_next_step
[
File "C:\Users\sirux21\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\langchain\agents\agent.py", line 1097, in
[
File "C:\Users\sirux21\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\langchain\agents\agent.py", line 1182, in _iter_next_step
yield self._perform_agent_action(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sirux21\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\langchain\agents\agent.py", line 1204, in _perform_agent_action
observation = tool.run(
^^^^^^^^^
File "C:\Users\sirux21\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\langchain_core\tools.py", line 364, in run
raise e
File "C:\Users\sirux21\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\langchain_core\tools.py", line 355, in run
parsed_input = self._parse_input(tool_input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sirux21\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\langchain_core\tools.py", line 258, in parse_input
input_args.validate({key: tool_input})
File "C:\Users\sirux21\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\pydantic\v1\main.py", line 711, in validate
return cls(**value)
^^^^^^^^^^^^
File "C:\Users\sirux21\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\pydantic\v1\main.py", line 341, in init
raise validation_error
pydantic.v1.error_wrappers.ValidationError: 3 validation errors for FlightSearchSchema
destinationLocationCode
field required (type=value_error.missing)
departureDateTimeEarliest
field required (type=value_error.missing)
departureDateTimeLatest
field required (type=value_error.missing)
Description
FlightSearchSchema is unable to parse the input
System Info
langchain==0.1.6
langchain-community==0.0.19
langchain-core==0.1.22
langchain-google-genai==0.0.8
langchainhub==0.1.14
windows
3.11
The text was updated successfully, but these errors were encountered: