Skip to content
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

Function-calling with an OpenAPI specification (large OpenAPI file) #1447

Open
sienikam opened this issue Oct 3, 2024 · 0 comments
Open
Labels
support Questions about how to do something

Comments

@sienikam
Copy link

sienikam commented Oct 3, 2024

Hello,

I have following this tutorial (https://cookbook.openai.com/examples/function_calling_with_an_openapi_spec) to create some python code so that I can interact with external API using OpenAI (https://github.com/MyPureCloud/platform-client-sdk-cli/blob/main/swagger.json) however I'm getting some errors during converting an OpenAPI specification into function definitions..

Any advice how I can handle that?

Traceback (most recent call last): File "/home/kamil/gc_openai/op.py", line 59, in <module> functions = openapi_to_functions(openapi_spec) File "/home/kamil/gc_openai/op.py", line 21, in openapi_to_functions spec = jsonref.replace_refs(spec_with_ref) File "/home/kamil/.local/lib/python3.10/site-packages/jsonref.py", line 325, in replace_refs result = _replace_refs( File "/home/kamil/.local/lib/python3.10/site-packages/jsonref.py", line 368, in _replace_refs obj = { File "/home/kamil/.local/lib/python3.10/site-packages/jsonref.py", line 369, in <dictcomp> k: _replace_refs( File "/home/kamil/.local/lib/python3.10/site-packages/jsonref.py", line 368, in _replace_refs obj = { File "/home/kamil/.local/lib/python3.10/site-packages/jsonref.py", line 369, in <dictcomp> k: _replace_refs( File "/home/kamil/.local/lib/python3.10/site-packages/jsonref.py", line 368, in _replace_refs obj = { File "/home/kamil/.local/lib/python3.10/site-packages/jsonref.py", line 369, in <dictcomp> k: _replace_refs( File "/home/kamil/.local/lib/python3.10/site-packages/jsonref.py", line 368, in _replace_refs obj = { File "/home/kamil/.local/lib/python3.10/site-packages/jsonref.py", line 369, in <dictcomp> k: _replace_refs( File "/home/kamil/.local/lib/python3.10/site-packages/jsonref.py", line 368, in _replace_refs obj = { File "/home/kamil/.local/lib/python3.10/site-packages/jsonref.py", line 369, in <dictcomp> k: _replace_refs( File "/home/kamil/.local/lib/python3.10/site-packages/jsonref.py", line 368, in _replace_refs obj = { File "/home/kamil/.local/lib/python3.10/site-packages/jsonref.py", line 369, in <dictcomp> k: _replace_refs( File "/home/kamil/.local/lib/python3.10/site-packages/jsonref.py", line 368, in _replace_refs obj = { File "/home/kamil/.local/lib/python3.10/site-packages/jsonref.py", line 369, in <dictcomp> k: _replace_refs( File "/home/kamil/.local/lib/python3.10/site-packages/jsonref.py", line 368, in _replace_refs obj = { File "/home/kamil/.local/lib/python3.10/site-packages/jsonref.py", line 369, in <dictcomp> k: _replace_refs( File "/home/kamil/.local/lib/python3.10/site-packages/jsonref.py", line 368, in _replace_refs obj = { File "/home/kamil/.local/lib/python3.10/site-packages/jsonref.py", line 369, in <dictcomp> k: _replace_refs( File "/home/kamil/.local/lib/python3.10/site-packages/jsonref.py", line 368, in _replace_refs obj = { File "/home/kamil/.local/lib/python3.10/site-packages/jsonref.py", line 369, in <dictcomp> k: _replace_refs( File "/home/kamil/.local/lib/python3.10/site-packages/jsonref.py", line 368, in _replace_refs obj = { File "/home/kamil/.local/lib/python3.10/site-packages/jsonref.py", line 369, in <dictcomp> k: _replace_refs( File "/home/kamil/.local/lib/python3.10/site-packages/jsonref.py", line 368, in _replace_refs obj = { File "/home/kamil/.local/lib/python3.10/site-packages/jsonref.py", line 369, in <dictcomp> k: _replace_refs( File "/home/kamil/.local/lib/python3.10/site-packages/jsonref.py", line 368, in _replace_refs obj = { File "/home/kamil/.local/lib/python3.10/site-packages/jsonref.py", line 369, in <dictcomp> k: _replace_refs( File "/home/kamil/.local/lib/python3.10/site-packages/jsonref.py", line 368, in _replace_refs obj = { File "/home/kamil/.local/lib/python3.10/site-packages/jsonref.py", line 369, in <dictcomp> k: _replace_refs( File "/home/kamil/.local/lib/python3.10/site-packages/jsonref.py", line 368, in _replace_refs obj = { File "/home/kamil/.local/lib/python3.10/site-packages/jsonref.py", line 369, in <dictcomp> k: _replace_refs( File "/home/kamil/.local/lib/python3.10/site-packages/jsonref.py", line 368, in _replace_refs obj = { File "/home/kamil/.local/lib/python3.10/site-packages/jsonref.py", line 369, in <dictcomp> k: _replace_refs( File "/home/kamil/.local/lib/python3.10/site-packages/jsonref.py", line 368, in _replace_refs obj = { File "/home/kamil/.local/lib/python3.10/site-packages/jsonref.py", line 369, in <dictcomp> File "/home/kamil/.local/lib/python3.10/site-packages/jsonref.py", line 369, in <dictcomp> [...] k: _replace_refs( File "/home/kamil/.local/lib/python3.10/site-packages/jsonref.py", line 382, in _replace_refs elif isinstance(obj, Sequence) and not isinstance(obj, str): File "/usr/lib/python3.10/abc.py", line 119, in __instancecheck__ return _abc_instancecheck(cls, instance) File "/usr/lib/python3.10/abc.py", line 123, in __subclasscheck__ return _abc_subclasscheck(cls, subclass) RecursionError: maximum recursion depth exceeded

@sienikam sienikam added the support Questions about how to do something label Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support Questions about how to do something
Projects
None yet
Development

No branches or pull requests

1 participant