CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-posthog

Integrate PostHog into any python application.

89

1.03x
Overview
Eval results
Files

rubric.jsonevals/scenario-6/

{
  "context": "This evaluation assesses the engineer's ability to use PostHog's AI observability features to track OpenAI streaming chat completions. The focus is on proper integration of PostHog's OpenAI wrapper for automatic analytics capture.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "PostHog OpenAI import",
      "description": "Uses the PostHog OpenAI wrapper by importing from posthog.ai.openai (e.g., 'from posthog.ai.openai import OpenAI' or similar)",
      "max_score": 20
    },
    {
      "name": "Client initialization",
      "description": "Initializes the OpenAI client using PostHog's wrapper with both OpenAI API key and PostHog client/configuration (e.g., 'OpenAI(api_key=..., posthog_client=...)' or passes PostHog client to the wrapper)",
      "max_score": 20
    },
    {
      "name": "Streaming parameter",
      "description": "Makes chat completion calls with stream=True to enable streaming responses",
      "max_score": 15
    },
    {
      "name": "Stream consumption",
      "description": "Properly iterates through the streaming response to consume all chunks (e.g., using a loop over the response object)",
      "max_score": 15
    },
    {
      "name": "User identification",
      "description": "Passes user identification to the chat completion call using posthog_distinct_id parameter or similar mechanism for tracking",
      "max_score": 15
    },
    {
      "name": "Response accumulation",
      "description": "Accumulates the streamed content chunks to build the complete response text that can be returned to the caller",
      "max_score": 10
    },
    {
      "name": "Automatic tracking",
      "description": "Relies on PostHog's automatic event generation rather than manually calling capture() or similar methods for AI events",
      "max_score": 5
    }
  ]
}

Install with Tessl CLI

npx tessl i tessl/pypi-posthog

tile.json