tessl install tessl/pypi-posthog@6.7.0Integrate PostHog into any python application.
Agent Success
Agent success rate when using this tile
89%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.03x
Baseline
Agent success rate without this tile
86%
Build a Python script that sends messages to Claude AI via AWS Bedrock and automatically tracks usage analytics.
Create a Python application that:
@generates
def send_message(user_id: str, message: str, model: str = "anthropic.claude-3-5-sonnet-20241022-v2:0") -> str:
"""
Sends a message to Claude AI via AWS Bedrock with automatic analytics tracking.
Args:
user_id: Unique identifier for the user making the request
message: The message to send to Claude
model: Bedrock model ID (default: Claude 3.5 Sonnet)
Returns:
The response text from Claude
"""
pass
def get_analytics_summary(user_id: str) -> dict:
"""
Retrieves analytics summary for a user's AI interactions.
Args:
user_id: Unique identifier for the user
Returns:
Dictionary containing analytics metrics (total_interactions,
total_input_tokens, total_output_tokens, average_latency)
"""
passProvides analytics and observability tracking for AI interactions.
AWS SDK for Python to interact with AWS Bedrock service.