-
Notifications
You must be signed in to change notification settings - Fork 14k
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
get_openapi_chain throws error when running example from docs #10733
Comments
🤖 Hello, Thank you for bringing this issue to our attention. It seems like you're encountering an error when trying to use the From the error messages you provided, it appears that the issue might be related to the OpenAPI specification parsing. The error message "Unable to parse spec from source" suggests that there might be an issue with the OpenAPI specification at the provided URL. This could be due to the specification not being valid, not being accessible, or not being compatible with the version of the OpenAPI parser used by LangChain. The second error message "AttributeError: type object 'OpenAPISpec' has no attribute 'from_url'" suggests that the To help us better understand and resolve the issue, could you please provide the following additional information:
In the meantime, you might want to try using a different version of the OpenAPI parser, or check if the OpenAPI specification at the provided URL is valid and accessible. Thank you for your patience and cooperation. We're looking forward to resolving this issue for you. Best, Sources
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. |
Any fix for this? I used examples from the latest OpenAPI version - 3.1.0 and the issue still persists with the error "Unable to parse spec from source". OpenAPI version - 3.1.0 Examples |
If anyone runs into the same issue, I was able to resolve it by installing "openapi-schema-pydantic" |
I'm getting this error using the same basic example https://python.langchain.com/docs/use_cases/apis. I tried installing openapi-schema-pydantic and unfortunately that didn't fix it for me |
pip uninstall pydantic |
same issue here... |
fixed the issue by adding openapi-schema-pydantic and downgrading pydantic to 1.10.9
My environment
|
#9408 made the OpenAPI Spec dependency optional and #11936 carried over the optionality when openapi_schema_pydantic was switched to openapi_pydantic. Although after installing openapi_pydantic, I'm not getting any output other than the warning for some reason.
Related: #9520 |
Still have the same issue with clean install on Colab following the example in langchain docs. workaround above did not resolve the |
same issue here... :-( |
Solution for me on Colab at least (but maybe relevant to anyone with this issue) is that after noticing that
My specs:
|
@3cha1n It did not work for me even after I installed openapi-schema-pydantic. |
@amirhoseinsh you're welcome to check my colab: https://colab.research.google.com/drive/1_8uunxIg9VDNC-Sm74lEvPVs9ai38Z43 |
Have you solved this problem yet? |
Still having this issue. This is my langchain
openapi-schema-pydantic==1.2.4
pydantic==1.10.9 |
|
None of the above solutions worked for me. It seems that for the latest versions of langchain, you need to install
|
@fquellec's solution works for me. python version is 3.10.13 |
System Info
pydantic '1.10.0' or '2.3.0'
langchain '0.0.292'
python '3.11.5'
Who can help?
@hwchase17
@agola11
Information
Related Components
Reproduction
from langchain.chains.openai_functions.openapi import get_openapi_chain
chain = get_openapi_chain("https://www.klarna.com/us/shopping/public/openai/v0/api-docs/")
chain("What are some options for a men's large blue button down shirt")
Error message when running with pydantic 1
Unable to parse spec from source https://chat-web3-plugin.alchemy.com/openapi.yaml error
Error message when running with pydantic 2
AttributeError: type object 'OpenAPISpec' has no attribute 'from_url'
Expected behavior
normal execution without errors
The text was updated successfully, but these errors were encountered: