a digital person for bluesky

Update bsky.py to use new reply tool with required parameters

- Change tool name from bluesky_reply to reply_to_bluesky_post
- Extract CID from notification data
- Update prompt to provide required URI and CID parameters
- Fix parameter extraction to use 'text' instead of 'message'

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

+8 -3
+8 -3
bsky.py
··· 91 # Handle both dict and object inputs for backwards compatibility 92 if isinstance(notification_data, dict): 93 uri = notification_data['uri'] 94 mention_text = notification_data.get('record', {}).get('text', '') 95 author_handle = notification_data['author']['handle'] 96 author_name = notification_data['author'].get('display_name') or author_handle 97 else: 98 # Legacy object access 99 uri = notification_data.uri 100 mention_text = notification_data.record.text if hasattr(notification_data.record, 'text') else "" 101 author_handle = notification_data.author.handle 102 author_name = notification_data.author.display_name or author_handle ··· 137 138 The YAML above shows the complete conversation thread. The most recent post is the one mentioned above that you should respond to, but use the full thread context to understand the conversation flow. 139 140 - Use the bluesky_reply tool to send a response less than 300 characters.""" 141 142 # Get response from Letta agent 143 logger.info(f"Generating reply for mention from @{author_handle}") ··· 177 178 # Check if this is a ToolCallMessage with bluesky_reply tool 179 if hasattr(message, 'tool_call') and message.tool_call: 180 - if message.tool_call.name == 'bluesky_reply': 181 # Parse the JSON arguments to get the message 182 try: 183 args = json.loads(message.tool_call.arguments) 184 - reply_text = args.get('message', '') 185 logger.info(f"Extracted reply from tool call: {reply_text[:50]}...") 186 break 187 except json.JSONDecodeError as e:
··· 91 # Handle both dict and object inputs for backwards compatibility 92 if isinstance(notification_data, dict): 93 uri = notification_data['uri'] 94 + cid = notification_data['cid'] 95 mention_text = notification_data.get('record', {}).get('text', '') 96 author_handle = notification_data['author']['handle'] 97 author_name = notification_data['author'].get('display_name') or author_handle 98 else: 99 # Legacy object access 100 uri = notification_data.uri 101 + cid = notification_data.cid 102 mention_text = notification_data.record.text if hasattr(notification_data.record, 'text') else "" 103 author_handle = notification_data.author.handle 104 author_name = notification_data.author.display_name or author_handle ··· 139 140 The YAML above shows the complete conversation thread. The most recent post is the one mentioned above that you should respond to, but use the full thread context to understand the conversation flow. 141 142 + Use the reply_to_bluesky_post tool to send a response less than 300 characters. The required parameters are: 143 + - text: Your reply message (max 300 chars) 144 + - reply_to_uri: {uri} 145 + - reply_to_cid: {cid}""" 146 147 # Get response from Letta agent 148 logger.info(f"Generating reply for mention from @{author_handle}") ··· 182 183 # Check if this is a ToolCallMessage with bluesky_reply tool 184 if hasattr(message, 'tool_call') and message.tool_call: 185 + if message.tool_call.name == 'reply_to_bluesky_post': 186 # Parse the JSON arguments to get the message 187 try: 188 args = json.loads(message.tool_call.arguments) 189 + reply_text = args.get('text', '') 190 logger.info(f"Extracted reply from tool call: {reply_text[:50]}...") 191 break 192 except json.JSONDecodeError as e: