""" Example Bluesky Tool for Letta Agent This is a template showing the expected format for Letta tools. Replace this with your actual Bluesky tools. """ import os from typing import Optional def example_bluesky_tool(message: str, user_handle: Optional[str] = None) -> str: """ Example tool demonstrating the expected format for Bluesky integrations. This tool shows how to: - Access environment variables (BSKY_USERNAME, BSKY_APP_PASSWORD, etc.) - Use proper Google-style docstrings - Include type annotations - Return meaningful results Args: message: The message content to process user_handle: Optional Bluesky user handle (e.g., "@username.bsky.social") Returns: str: A confirmation message or result from the operation Example: >>> example_bluesky_tool("Hello world", "@alice.bsky.social") "Processed message for @alice.bsky.social: Hello world" """ # Access environment variables set by mount() bsky_username = os.getenv("BSKY_USERNAME") BSKY_APP_PASSWORD = os.getenv("BSKY_APP_PASSWORD") bsky_service_url = os.getenv("BSKY_SERVICE_URL", "https://bsky.social") # Your tool implementation here # This is just an example - replace with actual Bluesky API calls if not bsky_username or not BSKY_APP_PASSWORD: return "Error: Bluesky credentials not configured" target = user_handle or "the timeline" return f"Processed message for {target}: {message}"