cpacker / MemGPT

Letta (fka MemGPT) is a framework for creating stateful LLM services.
https://letta.com
Apache License 2.0
11.85k stars 1.29k forks source link

feat: add tools from the Python client #1463

Closed sarahwooders closed 3 months ago

sarahwooders commented 3 months ago

Please describe the purpose of this pull request. Add the ability to create tools from the client, and to create agents with tools (without specifying a preset):


def print_tool(message: str):
    """ 
    Args: 
        message (str): The message to print.

    Returns:
        str: The message that was printed.

    """
    print(message)
    return message

tool = client.create_tool(print_tool, tags=["extras"])
agent_state = client.create_agent(tools=[tool.name]))

How to test poetry run pytest -s tests/test_tools.py

Have you tested this PR? Yes