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

Add missing import in functions.py #2060

Merged
merged 1 commit into from
Nov 18, 2024

Conversation

andrewrfitz
Copy link
Contributor

@andrewrfitz andrewrfitz commented Nov 18, 2024

Please describe the purpose of this pull request.
This fixes a bug

How to test
How can we test your PR during review? What commands should we run? What outcomes should we expect?

Have you tested this PR?
Have you tested the latest commit on the PR? If so please provide outputs from your tests.

Is your PR over 500 lines of code?
If so, please break up your PR into multiple smaller PRs so that we can review them quickly, or provide justification for its length.

Additional context
Traceback (most recent call last):
File "/Users/gregory/.virtualenvs/gen-ai/lib/python3.12/site-packages/letta/functions/functions.py", line 21, in derive_openai_json_schema
exec(source_code, env)
File "", line 1, in
NameError: name 'List' is not defined. Did you mean: 'list'?

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/gregory/code/gen-ai/bilt_agent/main.py", line 298, in
benefit_tool = client.create_tool(get_benefits)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/gregory/.virtualenvs/gen-ai/lib/python3.12/site-packages/letta/client/client.py", line 2326, in create_tool
return self.server.tool_manager.create_or_update_tool(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/gregory/.virtualenvs/gen-ai/lib/python3.12/site-packages/letta/utils.py", line 542, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/Users/gregory/.virtualenvs/gen-ai/lib/python3.12/site-packages/letta/services/tool_manager.py", line 38, in create_or_update_tool
derived_json_schema = pydantic_tool.json_schema or derive_openai_json_schema(source_code=pydantic_tool.source_code)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/gregory/.virtualenvs/gen-ai/lib/python3.12/site-packages/letta/functions/functions.py", line 31, in derive_openai_json_schema
raise RuntimeError(f"Failed to execute source code: {e}")
RuntimeError: Failed to execute source code: name 'List' is not defined

@mattzh72 mattzh72 merged commit 004cd69 into letta-ai:main Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants