-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Tools don´t work #2330
Comments
Sorry, lots of things changed. I think now for ver0.6.7, you don't need to include the param |
Can you please provide right format how to define tool |
You should be able to do this on the lates 0.6.9 version: from letta import create_client
def create_file(relative_path: str, initial_content: str = "") -> str:
"""
Creates a new file at '/Users/Shared/Projects/<project_name>/<relative_path>'
and optionally writes initial content.
If the file already exists, it will be overwritten.
Args:
relative_path (str): The path (relative to the project directory).
initial_content (str): Optional string content to write into the newly created file.
Returns:
str: A success or error message.
"""
import os
# Retrieve the project name from memory (adapt if your memory system differs).
project_name = self.memory.get_block("project_name").value
base_dir = "/Users/Shared/Projects"
full_path = os.path.join(base_dir, project_name, relative_path)
try:
os.makedirs(os.path.dirname(full_path), exist_ok=True)
with open(full_path, "w", encoding="utf-8") as f:
f.write(initial_content)
return f"File created at '{full_path}' with initial content."
except Exception as e:
return f"Failed to create file '{full_path}': {str(e)}"
client = create_client()
tool = client.create_tool(create_file)
print(tool) Note that you'll need to attach the tool to the agent when you create it. |
Mine is showing name is not defined when I am executing my code as well as the above code also is showing same error.
|
Describe the bug
I´m trying to create any tool, but it doesn´t work. I try this tool from the Deeplearning example:
When agent is working it always return me error like this:
Whenever I add any other tool, it always has issues with ´self´:
Please describe your setup
pip install letta
What's your OS (Windows/MacOS/Linux)?
MacOS
How are you running
letta
? (cmd.exe
/Powershell/Anaconda Shell/Terminal)Terminal
Letta Config
[defaults]
preset = memgpt_chat
persona = sam_pov
human = basic
[archival_storage]
type = sqlite
path = /Users/user/.letta
[recall_storage]
type = sqlite
path = /Users/user/.letta
[metadata_storage]
type = sqlite
path = /Users/user/.letta
[version]
letta_version = 0.6.7
The text was updated successfully, but these errors were encountered: