a digital person for bluesky
at x 795 B view raw
1#!/usr/bin/env python 2"""List all available agents in the Letta project.""" 3 4from letta_client import Letta 5from config_loader import get_letta_config 6 7# Get configuration 8letta_config = get_letta_config() 9 10# Create client 11client = Letta( 12 token=letta_config['api_key'], 13 timeout=letta_config['timeout'] 14) 15 16# List all agents 17print("Available agents:") 18print("-" * 50) 19 20try: 21 agents = client.agents.list() 22 if not agents: 23 print("No agents found in this project.") 24 else: 25 for agent in agents: 26 print(f"Name: {agent.name}") 27 print(f"ID: {agent.id}") 28 if hasattr(agent, 'description'): 29 print(f"Description: {agent.description}") 30 print("-" * 50) 31except Exception as e: 32 print(f"Error listing agents: {e}")