posthog 8.2.7__tar.gz → 8.2.8__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-8.2.7/posthog.egg-info → posthog-8.2.8}/PKG-INFO +1 -1
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/evaluations/_async_datasets.py +1 -1
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/evaluations/_client.py +7 -7
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/evaluations/_datasets.py +1 -1
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/evaluations/_scorers.py +1 -1
- {posthog-8.2.7 → posthog-8.2.8}/posthog/client.py +2 -2
- {posthog-8.2.7 → posthog-8.2.8}/posthog/feature_flags.py +22 -1
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/test_evaluations_transport.py +36 -4
- posthog-8.2.8/posthog/test/test_feature_flags_person_metadata.py +511 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/types.py +3 -3
- posthog-8.2.8/posthog/version.py +1 -0
- {posthog-8.2.7 → posthog-8.2.8/posthog.egg-info}/PKG-INFO +1 -1
- {posthog-8.2.7 → posthog-8.2.8}/posthog.egg-info/SOURCES.txt +1 -0
- {posthog-8.2.7 → posthog-8.2.8}/pyproject.toml +1 -1
- posthog-8.2.7/posthog/version.py +0 -1
- {posthog-8.2.7 → posthog-8.2.8}/LICENSE +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/MANIFEST.in +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/README.md +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/__init__.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/_async_consumer.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/_async_request.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/_async_utils.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/_disabled_lane_queue.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/_logging.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/_metrics_autocapture.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/__init__.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/anthropic/__init__.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/anthropic/_anthropic_stream.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/anthropic/anthropic.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/anthropic/anthropic_async.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/anthropic/anthropic_converter.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/anthropic/anthropic_providers.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/claude_agent_sdk/__init__.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/claude_agent_sdk/client.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/claude_agent_sdk/formatting.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/claude_agent_sdk/processor.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/evaluations/__init__.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/evaluations/_dataset_serialization.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/evaluations/_dataset_types.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/evaluations/_errors.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/evaluations/_mutations.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/evaluations/_scorer_types.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/evaluations/_serialization.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/evaluations/_tags.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/evaluations/_transport.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/evaluations/_types.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/gateway.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/gemini/__init__.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/gemini/_shared.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/gemini/gemini.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/gemini/gemini_async.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/gemini/gemini_converter.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/langchain/__init__.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/langchain/callbacks.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/langchain/middleware.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/media.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/openai/__init__.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/openai/_embeddings.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/openai/_streaming.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/openai/openai.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/openai/openai_async.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/openai/openai_converter.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/openai/openai_providers.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/openai/wrapper_utils.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/openai_agents/__init__.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/openai_agents/processor.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/otel/__init__.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/otel/_privacy.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/otel/_request_context.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/otel/exporter.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/otel/processor.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/otel/spans.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/prompts.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/sanitization.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/stream.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/types.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/utils.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/args.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/async_client.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/bucketed_rate_limiter.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/capture_compression.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/capture_event.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/capture_send.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/consumer.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/contexts.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/emails.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/exception_capture.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/exception_utils.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/feature_flag_evaluations.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/flag_definition_cache.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/integrations/__init__.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/integrations/_tracing_headers.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/integrations/asgi.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/integrations/celery.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/integrations/django.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/integrations/drf.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/integrations/flask.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/integrations/otel.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/__init__.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/_argument_ownership.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/_capture.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/_compatibility.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/_context_parameters.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/_conversation_id.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/_event_types.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/_exceptions.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/_ids.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/_instrument_fastmcp.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/_instrument_lowlevel.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/_instrument_v2.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/_instrumentation.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/_intent.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/_internal.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/_model_parameters.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/_output_instructions.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/_posthog_events.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/_raised_tool_error.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/_sanitization.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/_server_build.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/_sink.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/_tool_input.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/_transport_identity.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/_truncation.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/asgi.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/constants.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/feedback.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/logger.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/posthog_mcp.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/request_headers.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/session.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/session_token.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/tools.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/types.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/version.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/metrics_capture.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/poller.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/py.typed +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/release_id.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/request.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/__init__.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/__init__.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/claude_agent_sdk/__init__.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/claude_agent_sdk/test_client.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/claude_agent_sdk/test_processor.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/claude_agent_sdk/test_processor_content.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/openai_agents/__init__.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/openai_agents/test_processor.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/otel/__init__.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/otel/conftest.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/otel/test_exporter.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/otel/test_processor.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/otel/test_spans.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/test_async_cancellation.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/test_async_stream_wrapper.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/test_capture_contract.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/test_capture_pipeline.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/test_evaluations.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/test_evaluations_datasets.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/test_evaluations_mutations.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/test_evaluations_scorers.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/test_gateway.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/test_http_status.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/test_media.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/test_privacy_mode.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/test_prompts.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/test_sanitization.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/test_stream_midstream_error.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/test_system_prompts.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/test_token_reporting.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/test_tokens_source.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/test_utils.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/utils.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/capture_helpers.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/conftest.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/logging_helpers.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/__init__.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/_helpers.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/_helpers_lowlevel.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/_helpers_v2.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/conftest.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_asgi.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_capture.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_conversation_session.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_defaults.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_error_properties.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_error_status.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_fastmcp.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_fastmcp_tool_errors.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_fastmcp_v2.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_fastmcp_v4.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_features_m4.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_feedback.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_initialize_handshake.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_instrument_lowlevel_ownership.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_instrument_v2.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_instrumentation_fork.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_lib_label.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_lowlevel.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_model_parameters.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_no_crash.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_output_instructions.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_pending_tasks.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_pipeline.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_posthog_mcp.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_request_headers.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_resources.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_review_fixes.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_send_tools_list_event.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_session_token.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_tool_input.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_transport_identity.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_truncation.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_types.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_units.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_unknown_tool.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_v2_lowlevel.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_v2_mcpserver.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_v2_wire_dual_era.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_virtual_tools.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/released_flags_scenarios.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_ai_capture_lane.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_async_client.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_async_consumer.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_async_feature_flags.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_async_request.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_async_utils.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_before_send.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_bucketed_rate_limiter.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_capture_compression.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_capture_event.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_capture_invariants.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_capture_send.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_client.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_client_crap_flags.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_client_fork.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_code_variables.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_consumer.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_contexts.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_emails.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_evaluate_flags.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_event_options.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_exception_capture.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_exception_utils.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_experiment_exposure.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_failed_flag_records.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_feature_flag.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_feature_flag_called_minimization.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_feature_flag_has_experiment.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_feature_flag_result.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_feature_flags.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_feature_flags_regex.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_flag_cache_eviction_reads.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_flag_cache_publication.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_flag_definition_cache.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_flag_payload_parsing.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_flags_released_behaviour.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_flags_v4_response.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_gevent_compat.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_metrics.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_metrics_autocapture.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_module.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_posthog_upgrade_workflow.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_property_matching_version.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_redis_flag_cache_snapshot.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_reference_markdown.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_release_id.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_request.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_server_payload_snapshots.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_size_limited_dict.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_types.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_utils.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_utils_acceptance.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/tracing/__init__.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/tracing/conftest.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/tracing/helpers.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/tracing/test_client_traces.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/tracing/test_config.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/tracing/test_export.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/tracing/test_ids.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/tracing/test_limits.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/tracing/test_otlp.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/tracing/test_pipeline.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/tracing/test_sanitize.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/tracing/test_span.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/tracing/test_traceparent.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/test/tracing/test_transport.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/tracing/__init__.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/tracing/_before_span_send.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/tracing/_config.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/tracing/_context.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/tracing/_drops.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/tracing/_export.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/tracing/_ids.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/tracing/_limits.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/tracing/_otlp.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/tracing/_pipeline.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/tracing/_sanitize.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/tracing/_span.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/tracing/_traceparent.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/tracing/_transport.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/tracing/span.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog/utils.py +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog.egg-info/dependency_links.txt +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog.egg-info/requires.txt +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/posthog.egg-info/top_level.txt +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/setup.cfg +0 -0
- {posthog-8.2.7 → posthog-8.2.8}/setup.py +0 -0
|
@@ -40,7 +40,7 @@ from ._transport import AsyncTransport
|
|
|
40
40
|
class AsyncDatasets:
|
|
41
41
|
"""Manage datasets through ``AsyncOfflineEvaluations.datasets``.
|
|
42
42
|
|
|
43
|
-
Requires a
|
|
43
|
+
Requires a key with ``dataset:read`` or ``dataset:write`` and the
|
|
44
44
|
datasets feature enabled. Mutations return after acknowledgment; only item
|
|
45
45
|
creates with a caller-supplied ``client_item_id`` are automatically retried.
|
|
46
46
|
Other lost write responses require inspecting state before retrying.
|
|
@@ -277,7 +277,7 @@ class Experiment:
|
|
|
277
277
|
return None if self._submission is None else json.loads(self._submission)
|
|
278
278
|
|
|
279
279
|
def get_tags(self) -> tuple[str, ...]:
|
|
280
|
-
"""Fetch current tags using a
|
|
280
|
+
"""Fetch current tags using a key with ``evaluation:read``."""
|
|
281
281
|
with self._lock:
|
|
282
282
|
data = self._transport.request("GET", self._path)
|
|
283
283
|
return _experiment_tags(data, self.id)
|
|
@@ -285,7 +285,7 @@ class Experiment:
|
|
|
285
285
|
def set_tags(self, tags: Sequence[str]) -> tuple[str, ...]:
|
|
286
286
|
"""Replace tags and return the server's normalized names; [] clears them.
|
|
287
287
|
|
|
288
|
-
Requires a
|
|
288
|
+
Requires a key with ``evaluation:write``. Tags can change after
|
|
289
289
|
completion and are separate from the immutable creation ``submission``.
|
|
290
290
|
Updates are not retried automatically: inspect tags after a lost response.
|
|
291
291
|
"""
|
|
@@ -645,11 +645,11 @@ class AsyncExperiment:
|
|
|
645
645
|
class OfflineEvaluations:
|
|
646
646
|
"""Upload offline evaluations and manage scorers and datasets in one project.
|
|
647
647
|
|
|
648
|
-
|
|
649
|
-
offline_evaluation_ingestion:write.
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
648
|
+
Pass a personal API key or a project secret API key for this project.
|
|
649
|
+
Uploads require offline_evaluation_ingestion:write. Scorers use
|
|
650
|
+
llm_analytics:read/write and datasets use dataset:read/write. Corrections
|
|
651
|
+
require evaluation:write. Result edits and item deletion also require
|
|
652
|
+
llm_analytics:read. Personal keys need the user's resource permissions.
|
|
653
653
|
Each operation requires its corresponding product feature to be enabled.
|
|
654
654
|
``host`` defaults to the US app API; known ingestion hosts are mapped to
|
|
655
655
|
their app hosts. Custom hosts are preserved. Requests use a 15 second
|
|
@@ -40,7 +40,7 @@ from ._transport import SyncTransport
|
|
|
40
40
|
class Datasets:
|
|
41
41
|
"""Manage datasets through ``OfflineEvaluations.datasets``.
|
|
42
42
|
|
|
43
|
-
Requires a
|
|
43
|
+
Requires a key with ``dataset:read`` or ``dataset:write`` and the
|
|
44
44
|
datasets feature enabled. Mutations return after acknowledgment; only item
|
|
45
45
|
creates with a caller-supplied ``client_item_id`` are automatically retried.
|
|
46
46
|
Other lost write responses require inspecting state before retrying.
|
|
@@ -379,7 +379,7 @@ def _version_params(limit: int, cursor: str | None) -> dict[str, str | int]:
|
|
|
379
379
|
|
|
380
380
|
|
|
381
381
|
class Scorers:
|
|
382
|
-
"""Manage scorers using a
|
|
382
|
+
"""Manage scorers using a key with ``llm_analytics`` scopes.
|
|
383
383
|
|
|
384
384
|
Access through ``OfflineEvaluations.scorers``. Creating a scorer or version
|
|
385
385
|
is not idempotent: mutations are never retried automatically. If a response
|
|
@@ -4279,8 +4279,8 @@ class Client(object):
|
|
|
4279
4279
|
self.log.warning(
|
|
4280
4280
|
f"[FEATURE FLAGS] {len(unsupported_definition_keys)} flag(s) use "
|
|
4281
4281
|
"something local evaluation doesn't support, such as a static "
|
|
4282
|
-
"cohort, an unknown operator, a malformed value, or a
|
|
4283
|
-
"circular flag dependency "
|
|
4282
|
+
"cohort, an unknown operator or filter type, a malformed value, or a "
|
|
4283
|
+
"missing or circular flag dependency "
|
|
4284
4284
|
f"(reason: {UnresolvedFlagReason.UNSUPPORTED_DEFINITION.value}): "
|
|
4285
4285
|
f"{', '.join(unsupported_definition_keys)}. Evaluating them makes a "
|
|
4286
4286
|
"remote request when evaluation reaches that part, or leaves them "
|
|
@@ -629,6 +629,7 @@ def _match_flag_conditions(
|
|
|
629
629
|
cohort_properties,
|
|
630
630
|
group_type_mapping,
|
|
631
631
|
)
|
|
632
|
+
e.reason = _pick_unresolved_reason(inconclusive_reason, e.reason)
|
|
632
633
|
raise
|
|
633
634
|
except InconclusiveMatchError as e:
|
|
634
635
|
# Evaluation error (bad regex, invalid date, missing property, etc.)
|
|
@@ -795,6 +796,22 @@ def _match_feature_enrollment(flag, flag_filters, properties) -> bool:
|
|
|
795
796
|
return enrollment is True or enrollment == "true"
|
|
796
797
|
|
|
797
798
|
|
|
799
|
+
# Filter types matched against the person or group properties the caller passes. Cohort
|
|
800
|
+
# and flag filters have their own matching. Any other type, such as "person_metadata"
|
|
801
|
+
# (a value /flags reads from the persons table, not from person properties), can't be
|
|
802
|
+
# evaluated locally: matching it against a caller property with the same key could
|
|
803
|
+
# disagree with /flags. A missing, null, or empty type is a person filter.
|
|
804
|
+
_PROPERTY_FILTER_TYPES = (None, "", "person", "group")
|
|
805
|
+
|
|
806
|
+
|
|
807
|
+
def _assert_property_filter_type_supported(prop) -> None:
|
|
808
|
+
if prop.get("type") not in _PROPERTY_FILTER_TYPES:
|
|
809
|
+
raise InconclusiveMatchError(
|
|
810
|
+
f"Can't evaluate a '{prop['type']}' filter on '{prop.get('key')}' locally",
|
|
811
|
+
reason=UnresolvedFlagReason.UNSUPPORTED_DEFINITION,
|
|
812
|
+
)
|
|
813
|
+
|
|
814
|
+
|
|
798
815
|
def _match_condition_filter(
|
|
799
816
|
prop,
|
|
800
817
|
properties,
|
|
@@ -829,6 +846,7 @@ def _match_condition_filter(
|
|
|
829
846
|
device_id=device_id,
|
|
830
847
|
property_matching_version=property_matching_version,
|
|
831
848
|
)
|
|
849
|
+
_assert_property_filter_type_supported(prop)
|
|
832
850
|
return match_property(prop, properties, property_matching_version)
|
|
833
851
|
|
|
834
852
|
|
|
@@ -930,6 +948,7 @@ def _raise_condition_errors(feature_flag, server_evaluation_error, inconclusive_
|
|
|
930
948
|
# Re-raise the original error type: match_feature_flag_properties stops at it
|
|
931
949
|
# and falls back to the server instead of trying later conditions.
|
|
932
950
|
if server_evaluation_error is not None:
|
|
951
|
+
server_evaluation_error.reason = inconclusive_reason
|
|
933
952
|
raise server_evaluation_error
|
|
934
953
|
if inconclusive_reason is not None:
|
|
935
954
|
raise InconclusiveMatchError(
|
|
@@ -1730,9 +1749,10 @@ def match_property_group(
|
|
|
1730
1749
|
)
|
|
1731
1750
|
if effective_match != is_and:
|
|
1732
1751
|
decisive_result = effective_match
|
|
1733
|
-
except RequiresServerEvaluation:
|
|
1752
|
+
except RequiresServerEvaluation as e:
|
|
1734
1753
|
# Static/missing cohorts and malformed definitions always require server evaluation,
|
|
1735
1754
|
# even when another branch would otherwise resolve the group locally.
|
|
1755
|
+
e.reason = _pick_unresolved_reason(inconclusive_reason, e.reason)
|
|
1736
1756
|
raise
|
|
1737
1757
|
except InconclusiveMatchError as e:
|
|
1738
1758
|
log.debug(f"Failed to compute property {prop} locally: {e}")
|
|
@@ -1841,6 +1861,7 @@ def _is_unsupported_property(
|
|
|
1841
1861
|
return _is_unsupported_dependency(prop, flags_by_key)
|
|
1842
1862
|
if property_type != "cohort":
|
|
1843
1863
|
try:
|
|
1864
|
+
_assert_property_filter_type_supported(prop)
|
|
1844
1865
|
_assert_filter_supported(prop)
|
|
1845
1866
|
except InconclusiveMatchError:
|
|
1846
1867
|
return True
|
|
@@ -34,6 +34,37 @@ def response(status=200, payload=None, headers=None):
|
|
|
34
34
|
return result
|
|
35
35
|
|
|
36
36
|
|
|
37
|
+
def test_project_secret_key_authenticates_management_requests():
|
|
38
|
+
page = {"count": 0, "next": None, "previous": None, "results": []}
|
|
39
|
+
tags = {"id": EXPERIMENT_ID, "tags": ["ci"]}
|
|
40
|
+
with (
|
|
41
|
+
OfflineEvaluations(project_id=123, secret_key="phs_example_only") as client,
|
|
42
|
+
patch.object(
|
|
43
|
+
requests.Session,
|
|
44
|
+
"send",
|
|
45
|
+
side_effect=[
|
|
46
|
+
response(payload=page),
|
|
47
|
+
response(payload=page),
|
|
48
|
+
response(payload=tags),
|
|
49
|
+
],
|
|
50
|
+
) as send,
|
|
51
|
+
):
|
|
52
|
+
client.datasets.list()
|
|
53
|
+
client.scorers.list()
|
|
54
|
+
client.resume_experiment(EXPERIMENT_ID).set_tags(["ci"])
|
|
55
|
+
|
|
56
|
+
requests_sent = [call.args[0] for call in send.call_args_list]
|
|
57
|
+
assert [(req.method, req.path_url.split("?")[0]) for req in requests_sent] == [
|
|
58
|
+
("GET", "/api/projects/123/datasets/"),
|
|
59
|
+
("GET", "/api/projects/123/llm_analytics/score_definitions/"),
|
|
60
|
+
("PATCH", f"{PATH}{EXPERIMENT_ID}/"),
|
|
61
|
+
]
|
|
62
|
+
assert all(
|
|
63
|
+
req.headers["Authorization"] == "Bearer phs_example_only"
|
|
64
|
+
for req in requests_sent
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
|
|
37
68
|
@pytest.fixture
|
|
38
69
|
def transport():
|
|
39
70
|
client = SyncTransport(123, "phx_test_secret")
|
|
@@ -357,13 +388,14 @@ def test_closed_client_does_not_send(transport):
|
|
|
357
388
|
|
|
358
389
|
|
|
359
390
|
@pytest.mark.asyncio
|
|
360
|
-
|
|
391
|
+
@pytest.mark.parametrize("secret_key", ["phx_example_only", "phs_example_only"])
|
|
392
|
+
async def test_async_native_request_uses_auth_host_and_preserves_bytes(secret_key):
|
|
361
393
|
seen = []
|
|
362
394
|
|
|
363
395
|
async def handle(request):
|
|
364
396
|
seen.append(request)
|
|
365
397
|
if len(seen) == 1:
|
|
366
|
-
raise httpx.ReadTimeout(
|
|
398
|
+
raise httpx.ReadTimeout(secret_key)
|
|
367
399
|
return httpx.Response(201, json={"id": "stable-id"})
|
|
368
400
|
|
|
369
401
|
real_client = httpx.AsyncClient
|
|
@@ -374,7 +406,7 @@ async def test_async_native_request_uses_auth_host_and_preserves_bytes():
|
|
|
374
406
|
),
|
|
375
407
|
) as factory:
|
|
376
408
|
transport = AsyncTransport(
|
|
377
|
-
123,
|
|
409
|
+
123, secret_key, host="https://eu.i.posthog.com", timeout=9
|
|
378
410
|
)
|
|
379
411
|
with patch(
|
|
380
412
|
"posthog.ai.evaluations._transport.asyncio.sleep", new_callable=AsyncMock
|
|
@@ -383,7 +415,7 @@ async def test_async_native_request_uses_auth_host_and_preserves_bytes():
|
|
|
383
415
|
assert len(seen) == 2
|
|
384
416
|
assert seen[0].content == seen[1].content == BODY
|
|
385
417
|
assert str(seen[0].url) == "https://eu.posthog.com" + PATH
|
|
386
|
-
assert seen[0].headers["Authorization"] == "Bearer
|
|
418
|
+
assert seen[0].headers["Authorization"] == f"Bearer {secret_key}"
|
|
387
419
|
assert factory.call_args.kwargs["follow_redirects"] is False
|
|
388
420
|
assert factory.call_args.kwargs["timeout"] == 9
|
|
389
421
|
sleep.assert_awaited_once()
|