posthog 7.87.2__tar.gz → 7.89.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {posthog-7.87.2/posthog.egg-info → posthog-7.89.0}/PKG-INFO +1 -1
- {posthog-7.87.2 → posthog-7.89.0}/posthog/ai/evaluations/__init__.py +8 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/ai/evaluations/_client.py +67 -26
- {posthog-7.87.2 → posthog-7.89.0}/posthog/ai/evaluations/_scorer_types.py +44 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/ai/evaluations/_scorers.py +239 -6
- {posthog-7.87.2 → posthog-7.89.0}/posthog/ai/evaluations/_types.py +70 -15
- {posthog-7.87.2 → posthog-7.89.0}/posthog/emails.py +69 -9
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/ai/test_evaluations.py +298 -2
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/ai/test_evaluations_scorers.py +292 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/test_emails.py +103 -2
- posthog-7.89.0/posthog/version.py +1 -0
- {posthog-7.87.2 → posthog-7.89.0/posthog.egg-info}/PKG-INFO +1 -1
- {posthog-7.87.2 → posthog-7.89.0}/pyproject.toml +1 -1
- posthog-7.87.2/posthog/version.py +0 -1
- {posthog-7.87.2 → posthog-7.89.0}/LICENSE +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/MANIFEST.in +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/README.md +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/__init__.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/_async_consumer.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/_async_request.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/_async_utils.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/_disabled_lane_queue.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/_logging.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/_metrics_autocapture.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/ai/__init__.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/ai/anthropic/__init__.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/ai/anthropic/_anthropic_stream.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/ai/anthropic/anthropic.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/ai/anthropic/anthropic_async.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/ai/anthropic/anthropic_converter.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/ai/anthropic/anthropic_providers.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/ai/claude_agent_sdk/__init__.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/ai/claude_agent_sdk/client.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/ai/claude_agent_sdk/formatting.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/ai/claude_agent_sdk/processor.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/ai/evaluations/_async_datasets.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/ai/evaluations/_dataset_serialization.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/ai/evaluations/_dataset_types.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/ai/evaluations/_datasets.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/ai/evaluations/_errors.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/ai/evaluations/_serialization.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/ai/evaluations/_tags.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/ai/evaluations/_transport.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/ai/gateway.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/ai/gemini/__init__.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/ai/gemini/_shared.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/ai/gemini/gemini.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/ai/gemini/gemini_async.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/ai/gemini/gemini_converter.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/ai/langchain/__init__.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/ai/langchain/callbacks.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/ai/langchain/middleware.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/ai/media.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/ai/openai/__init__.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/ai/openai/_embeddings.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/ai/openai/_streaming.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/ai/openai/openai.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/ai/openai/openai_async.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/ai/openai/openai_converter.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/ai/openai/openai_providers.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/ai/openai/wrapper_utils.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/ai/openai_agents/__init__.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/ai/openai_agents/processor.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/ai/otel/__init__.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/ai/otel/_privacy.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/ai/otel/_request_context.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/ai/otel/exporter.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/ai/otel/processor.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/ai/otel/spans.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/ai/prompts.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/ai/sanitization.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/ai/stream.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/ai/types.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/ai/utils.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/args.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/async_client.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/bucketed_rate_limiter.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/capture_compression.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/capture_mode.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/capture_v1.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/client.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/consumer.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/contexts.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/exception_capture.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/exception_utils.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/feature_flag_evaluations.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/feature_flags.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/flag_definition_cache.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/integrations/__init__.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/integrations/_tracing_headers.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/integrations/asgi.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/integrations/celery.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/integrations/django.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/integrations/drf.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/integrations/flask.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/integrations/otel.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/mcp/__init__.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/mcp/_argument_ownership.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/mcp/_capture.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/mcp/_compatibility.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/mcp/_context_parameters.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/mcp/_conversation_id.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/mcp/_event_types.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/mcp/_exceptions.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/mcp/_ids.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/mcp/_instrument_fastmcp.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/mcp/_instrument_lowlevel.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/mcp/_instrument_v2.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/mcp/_instrumentation.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/mcp/_intent.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/mcp/_internal.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/mcp/_lib_identity.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/mcp/_model_parameters.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/mcp/_output_instructions.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/mcp/_posthog_events.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/mcp/_sanitization.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/mcp/_server_build.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/mcp/_sink.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/mcp/_tool_input.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/mcp/_transport_identity.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/mcp/_truncation.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/mcp/asgi.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/mcp/constants.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/mcp/feedback.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/mcp/logger.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/mcp/posthog_mcp.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/mcp/request_headers.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/mcp/session.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/mcp/session_token.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/mcp/tools.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/mcp/types.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/mcp/version.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/metrics_capture.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/poller.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/py.typed +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/release_id.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/request.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/__init__.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/ai/__init__.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/ai/claude_agent_sdk/__init__.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/ai/claude_agent_sdk/test_processor.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/ai/claude_agent_sdk/test_processor_content.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/ai/openai_agents/__init__.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/ai/openai_agents/test_processor.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/ai/otel/__init__.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/ai/otel/conftest.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/ai/otel/test_exporter.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/ai/otel/test_processor.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/ai/otel/test_spans.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/ai/test_async_cancellation.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/ai/test_async_stream_wrapper.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/ai/test_capture_contract.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/ai/test_capture_pipeline.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/ai/test_evaluations_datasets.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/ai/test_evaluations_transport.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/ai/test_gateway.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/ai/test_http_status.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/ai/test_media.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/ai/test_privacy_mode.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/ai/test_prompts.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/ai/test_sanitization.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/ai/test_stream_midstream_error.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/ai/test_system_prompts.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/ai/test_token_reporting.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/ai/test_tokens_source.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/ai/utils.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/conftest.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/logging_helpers.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/mcp/__init__.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/mcp/_helpers.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/mcp/_helpers_lowlevel.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/mcp/_helpers_v2.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/mcp/conftest.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/mcp/test_conversation_session.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/mcp/test_defaults.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/mcp/test_error_properties.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/mcp/test_fastmcp.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/mcp/test_fastmcp_v2.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/mcp/test_fastmcp_v4.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/mcp/test_features_m4.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/mcp/test_feedback.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/mcp/test_initialize_handshake.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/mcp/test_instrumentation_fork.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/mcp/test_lowlevel.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/mcp/test_model_parameters.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/mcp/test_no_crash.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/mcp/test_output_instructions.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/mcp/test_pending_tasks.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/mcp/test_pipeline.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/mcp/test_posthog_mcp.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/mcp/test_request_headers.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/mcp/test_resources.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/mcp/test_review_fixes.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/mcp/test_send_tools_list_event.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/mcp/test_session_token.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/mcp/test_tool_input.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/mcp/test_transport_identity.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/mcp/test_truncation.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/mcp/test_types.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/mcp/test_units.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/mcp/test_unknown_tool.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/mcp/test_v2_lowlevel.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/mcp/test_v2_mcpserver.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/mcp/test_v2_wire_dual_era.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/mcp/test_virtual_tools.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/released_flags_scenarios.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/test_ai_capture_lane.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/test_async_client.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/test_async_consumer.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/test_async_feature_flags.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/test_async_request.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/test_async_utils.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/test_before_send.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/test_bucketed_rate_limiter.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/test_capture_compression.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/test_capture_mode.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/test_capture_v1.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/test_client.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/test_client_fork.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/test_code_variables.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/test_consumer.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/test_contexts.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/test_evaluate_flags.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/test_exception_capture.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/test_exception_utils.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/test_experiment_exposure.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/test_feature_flag.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/test_feature_flag_called_minimization.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/test_feature_flag_has_experiment.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/test_feature_flag_result.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/test_feature_flags.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/test_feature_flags_regex.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/test_flag_cache_eviction_reads.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/test_flag_cache_publication.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/test_flag_definition_cache.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/test_flag_payload_parsing.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/test_flags_released_behaviour.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/test_flags_v4_response.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/test_gevent_compat.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/test_metrics.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/test_metrics_autocapture.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/test_module.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/test_posthog_upgrade_workflow.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/test_property_matching_version.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/test_redis_flag_cache_snapshot.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/test_reference_markdown.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/test_release_id.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/test_request.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/test_server_payload_snapshots.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/test_size_limited_dict.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/test_types.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/test_utils.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/test_utils_acceptance.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/tracing/__init__.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/tracing/conftest.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/tracing/helpers.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/tracing/test_client_traces.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/tracing/test_config.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/tracing/test_export.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/tracing/test_ids.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/tracing/test_limits.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/tracing/test_otlp.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/tracing/test_pipeline.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/tracing/test_sanitize.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/tracing/test_span.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/tracing/test_traceparent.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/test/tracing/test_transport.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/tracing/__init__.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/tracing/_before_span_send.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/tracing/_config.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/tracing/_context.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/tracing/_drops.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/tracing/_export.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/tracing/_ids.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/tracing/_limits.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/tracing/_otlp.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/tracing/_pipeline.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/tracing/_sanitize.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/tracing/_span.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/tracing/_traceparent.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/tracing/_transport.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/tracing/span.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/types.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog/utils.py +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog.egg-info/SOURCES.txt +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog.egg-info/dependency_links.txt +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog.egg-info/requires.txt +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/posthog.egg-info/top_level.txt +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/setup.cfg +0 -0
- {posthog-7.87.2 → posthog-7.89.0}/setup.py +0 -0
|
@@ -36,7 +36,11 @@ from ._scorer_types import (
|
|
|
36
36
|
NumericPassingRule,
|
|
37
37
|
NumericScorerConfig,
|
|
38
38
|
Scorer,
|
|
39
|
+
ScorerCalculation,
|
|
40
|
+
ScorerComposition,
|
|
41
|
+
ScorerCompositionInput,
|
|
39
42
|
ScorerConfig,
|
|
43
|
+
ScorerInput,
|
|
40
44
|
ScorerKind,
|
|
41
45
|
ScorerOrder,
|
|
42
46
|
ScorerPage,
|
|
@@ -99,7 +103,11 @@ __all__ = [
|
|
|
99
103
|
"RunSource",
|
|
100
104
|
"ScoreValue",
|
|
101
105
|
"Scorer",
|
|
106
|
+
"ScorerCalculation",
|
|
107
|
+
"ScorerComposition",
|
|
108
|
+
"ScorerCompositionInput",
|
|
102
109
|
"ScorerConfig",
|
|
110
|
+
"ScorerInput",
|
|
103
111
|
"ScorerKind",
|
|
104
112
|
"ScorerOrder",
|
|
105
113
|
"ScorerPage",
|
|
@@ -95,6 +95,30 @@ def _upload_body(items: list[bytes], results: list[bytes]) -> bytes:
|
|
|
95
95
|
)
|
|
96
96
|
|
|
97
97
|
|
|
98
|
+
def _group_ends(results: tuple[EvaluationResult, ...]) -> list[int]:
|
|
99
|
+
# A calculation only names a version, so ingestion-only clients cannot
|
|
100
|
+
# discover its dependencies. Keep every supplied result for that item in
|
|
101
|
+
# one request. Merge overlapping spans to retain the original order.
|
|
102
|
+
first: dict[str, int] = {}
|
|
103
|
+
last: dict[str, int] = {}
|
|
104
|
+
composite_items: set[str] = set()
|
|
105
|
+
for index, result in enumerate(results):
|
|
106
|
+
first.setdefault(result.item_id, index)
|
|
107
|
+
last[result.item_id] = index + 1
|
|
108
|
+
if result.calculate:
|
|
109
|
+
composite_items.add(result.item_id)
|
|
110
|
+
spans = {first[item_id]: last[item_id] for item_id in composite_items}
|
|
111
|
+
ends: list[int] = []
|
|
112
|
+
index = 0
|
|
113
|
+
while index < len(results):
|
|
114
|
+
end = index + 1
|
|
115
|
+
while index < end:
|
|
116
|
+
end = max(end, spans.get(index, index + 1))
|
|
117
|
+
index += 1
|
|
118
|
+
ends.append(end)
|
|
119
|
+
return ends
|
|
120
|
+
|
|
121
|
+
|
|
98
122
|
def _chunks(results: tuple[EvaluationResult, ...]) -> list[_Chunk]:
|
|
99
123
|
# Validate the finite submission before sending any chunk. Receipts and
|
|
100
124
|
# prepared bodies use memory proportional to this caller-sized sequence.
|
|
@@ -120,38 +144,50 @@ def _chunks(results: tuple[EvaluationResult, ...]) -> list[_Chunk]:
|
|
|
120
144
|
encoded_results: list[bytes] = []
|
|
121
145
|
start = 0
|
|
122
146
|
size = len(_upload_body([], []))
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
147
|
+
group_start = 0
|
|
148
|
+
for end in _group_ends(results):
|
|
149
|
+
group = results[group_start:end]
|
|
150
|
+
group_results = [result._json for result in group]
|
|
151
|
+
group_items = {
|
|
152
|
+
result.item_id: declarations[result.item_id]
|
|
153
|
+
for result in group
|
|
154
|
+
if result.item_id in declarations
|
|
155
|
+
}
|
|
156
|
+
while True:
|
|
157
|
+
new_items = [body for id, body in group_items.items() if id not in item_ids]
|
|
158
|
+
extra = (
|
|
159
|
+
sum(map(len, group_results))
|
|
160
|
+
+ len(group_results)
|
|
161
|
+
- (not encoded_results)
|
|
162
|
+
)
|
|
163
|
+
if new_items:
|
|
164
|
+
extra += sum(map(len, new_items)) + len(new_items) - (not items)
|
|
165
|
+
fits = (
|
|
166
|
+
len(encoded_results) + len(group) <= _MAX_RESULTS
|
|
167
|
+
and len(items) + len(new_items) <= _MAX_ITEMS
|
|
168
|
+
and size + extra <= _MAX_REQUEST_BYTES
|
|
169
|
+
)
|
|
170
|
+
if fits:
|
|
171
|
+
break
|
|
172
|
+
if not encoded_results:
|
|
173
|
+
raise ValueError(
|
|
174
|
+
"One result or composite item group exceeds the upload request limit."
|
|
175
|
+
)
|
|
137
176
|
chunks.append(
|
|
138
177
|
_Chunk(
|
|
139
|
-
start,
|
|
178
|
+
start,
|
|
179
|
+
results[start:group_start],
|
|
180
|
+
_upload_body(items, encoded_results),
|
|
140
181
|
)
|
|
141
182
|
)
|
|
142
|
-
start, size =
|
|
183
|
+
start, size = group_start, len(_upload_body([], []))
|
|
143
184
|
item_ids, items, encoded_results = set(), [], []
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
"One result and its item exceed the upload request byte limit."
|
|
149
|
-
)
|
|
150
|
-
if item is not None:
|
|
151
|
-
item_ids.add(result.item_id)
|
|
152
|
-
items.append(item)
|
|
153
|
-
encoded_results.append(result._json)
|
|
185
|
+
# Repeat available declarations in every request for exact recovery.
|
|
186
|
+
item_ids.update(group_items)
|
|
187
|
+
items.extend(new_items)
|
|
188
|
+
encoded_results.extend(group_results)
|
|
154
189
|
size += extra
|
|
190
|
+
group_start = end
|
|
155
191
|
if encoded_results:
|
|
156
192
|
chunks.append(
|
|
157
193
|
_Chunk(start, results[start:], _upload_body(items, encoded_results))
|
|
@@ -245,6 +281,11 @@ class Experiment:
|
|
|
245
281
|
Returns per-chunk receipts; an empty sequence makes no requests. Memory
|
|
246
282
|
scales with the caller's sequence. For large datasets, call in batches.
|
|
247
283
|
BulkUploadError exposes committed chunks and pending_results to retry.
|
|
284
|
+
Items with calculations keep all their supplied results in one request.
|
|
285
|
+
Interleaved items may form a larger indivisible group; an oversized
|
|
286
|
+
group fails before any I/O. Group each item's results together when
|
|
287
|
+
preparing large batches. Stored inputs require evaluation:read and
|
|
288
|
+
llm_analytics:read; ingestion-only keys must supply every pinned input.
|
|
248
289
|
"""
|
|
249
290
|
prepared = tuple(results)
|
|
250
291
|
chunks = _chunks(prepared)
|
|
@@ -10,6 +10,7 @@ from typing_extensions import Required, TypedDict
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
ScorerKind = Literal["boolean", "numeric", "categorical"]
|
|
13
|
+
ScorerCalculation = Literal["reported", "composite"]
|
|
13
14
|
ScorerOrder = Literal[
|
|
14
15
|
"name",
|
|
15
16
|
"-name",
|
|
@@ -89,6 +90,43 @@ ScorerConfig = BooleanScorerConfig | NumericScorerConfig | CategoricalScorerConf
|
|
|
89
90
|
_ConfigT = TypeVar("_ConfigT", bound=ScorerConfig, covariant=True)
|
|
90
91
|
|
|
91
92
|
|
|
93
|
+
class ScorerCompositionInput(TypedDict):
|
|
94
|
+
"""A formula alias and an exact reported scorer-version UUID."""
|
|
95
|
+
|
|
96
|
+
alias: str
|
|
97
|
+
scorer_version_id: str
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
class ScorerComposition(TypedDict):
|
|
101
|
+
"""Server-evaluated formula and its pinned inputs for the same item.
|
|
102
|
+
|
|
103
|
+
Formulas accept 1–16 reported inputs; nested composites are unsupported.
|
|
104
|
+
Boolean inputs retain their raw polarity and categorical inputs are key
|
|
105
|
+
lists. Use ``number(flag)`` and ``"key" in categories`` explicitly.
|
|
106
|
+
"""
|
|
107
|
+
|
|
108
|
+
expression: str
|
|
109
|
+
inputs: list[ScorerCompositionInput]
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
@dataclass(frozen=True)
|
|
113
|
+
class ScorerInput:
|
|
114
|
+
"""Pinned input metadata alongside the source's latest version.
|
|
115
|
+
|
|
116
|
+
A new source version never changes the composite's pinned configuration.
|
|
117
|
+
"""
|
|
118
|
+
|
|
119
|
+
alias: str
|
|
120
|
+
scorer_version_id: str
|
|
121
|
+
definition_id: str
|
|
122
|
+
name: str
|
|
123
|
+
kind: ScorerKind
|
|
124
|
+
version: int
|
|
125
|
+
config: ScorerConfig
|
|
126
|
+
latest_version_id: str | None
|
|
127
|
+
latest_version: int | None
|
|
128
|
+
|
|
129
|
+
|
|
92
130
|
@dataclass(frozen=True)
|
|
93
131
|
class Scorer(Generic[_ConfigT]):
|
|
94
132
|
"""Scorer metadata and the configuration of its current immutable version.
|
|
@@ -112,6 +150,10 @@ class Scorer(Generic[_ConfigT]):
|
|
|
112
150
|
created_by: dict[str, Any] | None
|
|
113
151
|
team: int
|
|
114
152
|
tags: tuple[str, ...] = ()
|
|
153
|
+
calculation: ScorerCalculation = "reported"
|
|
154
|
+
composition: ScorerComposition | None = None
|
|
155
|
+
input_scorers: tuple[ScorerInput, ...] = ()
|
|
156
|
+
dependent_composite_count: int = 0
|
|
115
157
|
|
|
116
158
|
|
|
117
159
|
@dataclass(frozen=True)
|
|
@@ -125,6 +167,8 @@ class ScorerVersion(Generic[_ConfigT]):
|
|
|
125
167
|
config: _ConfigT
|
|
126
168
|
created_at: datetime
|
|
127
169
|
created_by: dict[str, Any] | None
|
|
170
|
+
calculation: ScorerCalculation = "reported"
|
|
171
|
+
composition: ScorerComposition | None = None
|
|
128
172
|
|
|
129
173
|
|
|
130
174
|
@dataclass(frozen=True)
|