posthog 8.2.4__tar.gz → 8.2.6__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.4/posthog.egg-info → posthog-8.2.6}/PKG-INFO +2 -1
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/anthropic/anthropic_converter.py +28 -7
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/utils.py +83 -3
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/ai/test_privacy_mode.py +134 -0
- posthog-8.2.6/posthog/version.py +1 -0
- {posthog-8.2.4 → posthog-8.2.6/posthog.egg-info}/PKG-INFO +2 -1
- {posthog-8.2.4 → posthog-8.2.6}/pyproject.toml +2 -1
- posthog-8.2.4/posthog/version.py +0 -1
- {posthog-8.2.4 → posthog-8.2.6}/LICENSE +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/MANIFEST.in +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/README.md +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/__init__.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/_async_consumer.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/_async_request.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/_async_utils.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/_disabled_lane_queue.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/_logging.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/_metrics_autocapture.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/__init__.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/anthropic/__init__.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/anthropic/_anthropic_stream.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/anthropic/anthropic.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/anthropic/anthropic_async.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/anthropic/anthropic_providers.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/claude_agent_sdk/__init__.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/claude_agent_sdk/client.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/claude_agent_sdk/formatting.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/claude_agent_sdk/processor.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/evaluations/__init__.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/evaluations/_async_datasets.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/evaluations/_client.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/evaluations/_dataset_serialization.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/evaluations/_dataset_types.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/evaluations/_datasets.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/evaluations/_errors.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/evaluations/_mutations.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/evaluations/_scorer_types.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/evaluations/_scorers.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/evaluations/_serialization.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/evaluations/_tags.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/evaluations/_transport.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/evaluations/_types.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/gateway.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/gemini/__init__.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/gemini/_shared.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/gemini/gemini.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/gemini/gemini_async.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/gemini/gemini_converter.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/langchain/__init__.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/langchain/callbacks.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/langchain/middleware.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/media.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/openai/__init__.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/openai/_embeddings.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/openai/_streaming.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/openai/openai.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/openai/openai_async.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/openai/openai_converter.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/openai/openai_providers.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/openai/wrapper_utils.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/openai_agents/__init__.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/openai_agents/processor.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/otel/__init__.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/otel/_privacy.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/otel/_request_context.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/otel/exporter.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/otel/processor.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/otel/spans.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/prompts.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/sanitization.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/stream.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/ai/types.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/args.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/async_client.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/bucketed_rate_limiter.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/capture_compression.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/capture_event.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/capture_send.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/client.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/consumer.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/contexts.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/emails.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/exception_capture.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/exception_utils.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/feature_flag_evaluations.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/feature_flags.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/flag_definition_cache.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/integrations/__init__.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/integrations/_tracing_headers.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/integrations/asgi.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/integrations/celery.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/integrations/django.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/integrations/drf.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/integrations/flask.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/integrations/otel.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/mcp/__init__.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/mcp/_argument_ownership.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/mcp/_capture.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/mcp/_compatibility.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/mcp/_context_parameters.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/mcp/_conversation_id.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/mcp/_event_types.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/mcp/_exceptions.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/mcp/_ids.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/mcp/_instrument_fastmcp.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/mcp/_instrument_lowlevel.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/mcp/_instrument_v2.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/mcp/_instrumentation.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/mcp/_intent.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/mcp/_internal.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/mcp/_model_parameters.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/mcp/_output_instructions.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/mcp/_posthog_events.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/mcp/_raised_tool_error.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/mcp/_sanitization.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/mcp/_server_build.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/mcp/_sink.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/mcp/_tool_input.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/mcp/_transport_identity.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/mcp/_truncation.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/mcp/asgi.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/mcp/constants.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/mcp/feedback.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/mcp/logger.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/mcp/posthog_mcp.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/mcp/request_headers.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/mcp/session.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/mcp/session_token.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/mcp/tools.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/mcp/types.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/mcp/version.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/metrics_capture.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/poller.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/py.typed +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/release_id.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/request.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/__init__.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/ai/__init__.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/ai/claude_agent_sdk/__init__.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/ai/claude_agent_sdk/test_client.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/ai/claude_agent_sdk/test_processor.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/ai/claude_agent_sdk/test_processor_content.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/ai/openai_agents/__init__.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/ai/openai_agents/test_processor.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/ai/otel/__init__.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/ai/otel/conftest.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/ai/otel/test_exporter.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/ai/otel/test_processor.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/ai/otel/test_spans.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/ai/test_async_cancellation.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/ai/test_async_stream_wrapper.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/ai/test_capture_contract.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/ai/test_capture_pipeline.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/ai/test_evaluations.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/ai/test_evaluations_datasets.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/ai/test_evaluations_mutations.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/ai/test_evaluations_scorers.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/ai/test_evaluations_transport.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/ai/test_gateway.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/ai/test_http_status.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/ai/test_media.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/ai/test_prompts.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/ai/test_sanitization.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/ai/test_stream_midstream_error.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/ai/test_system_prompts.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/ai/test_token_reporting.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/ai/test_tokens_source.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/ai/test_utils.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/ai/utils.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/capture_helpers.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/conftest.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/logging_helpers.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/mcp/__init__.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/mcp/_helpers.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/mcp/_helpers_lowlevel.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/mcp/_helpers_v2.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/mcp/conftest.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/mcp/test_asgi.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/mcp/test_capture.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/mcp/test_conversation_session.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/mcp/test_defaults.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/mcp/test_error_properties.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/mcp/test_error_status.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/mcp/test_fastmcp.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/mcp/test_fastmcp_tool_errors.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/mcp/test_fastmcp_v2.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/mcp/test_fastmcp_v4.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/mcp/test_features_m4.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/mcp/test_feedback.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/mcp/test_initialize_handshake.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/mcp/test_instrument_lowlevel_ownership.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/mcp/test_instrument_v2.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/mcp/test_instrumentation_fork.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/mcp/test_lib_label.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/mcp/test_lowlevel.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/mcp/test_model_parameters.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/mcp/test_no_crash.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/mcp/test_output_instructions.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/mcp/test_pending_tasks.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/mcp/test_pipeline.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/mcp/test_posthog_mcp.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/mcp/test_request_headers.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/mcp/test_resources.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/mcp/test_review_fixes.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/mcp/test_send_tools_list_event.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/mcp/test_session_token.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/mcp/test_tool_input.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/mcp/test_transport_identity.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/mcp/test_truncation.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/mcp/test_types.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/mcp/test_units.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/mcp/test_unknown_tool.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/mcp/test_v2_lowlevel.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/mcp/test_v2_mcpserver.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/mcp/test_v2_wire_dual_era.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/mcp/test_virtual_tools.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/released_flags_scenarios.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/test_ai_capture_lane.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/test_async_client.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/test_async_consumer.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/test_async_feature_flags.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/test_async_request.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/test_async_utils.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/test_before_send.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/test_bucketed_rate_limiter.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/test_capture_compression.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/test_capture_event.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/test_capture_invariants.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/test_capture_send.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/test_client.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/test_client_crap_flags.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/test_client_fork.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/test_code_variables.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/test_consumer.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/test_contexts.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/test_emails.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/test_evaluate_flags.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/test_event_options.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/test_exception_capture.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/test_exception_utils.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/test_experiment_exposure.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/test_failed_flag_records.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/test_feature_flag.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/test_feature_flag_called_minimization.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/test_feature_flag_has_experiment.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/test_feature_flag_result.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/test_feature_flags.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/test_feature_flags_regex.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/test_flag_cache_eviction_reads.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/test_flag_cache_publication.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/test_flag_definition_cache.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/test_flag_payload_parsing.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/test_flags_released_behaviour.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/test_flags_v4_response.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/test_gevent_compat.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/test_metrics.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/test_metrics_autocapture.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/test_module.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/test_posthog_upgrade_workflow.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/test_property_matching_version.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/test_redis_flag_cache_snapshot.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/test_reference_markdown.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/test_release_id.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/test_request.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/test_server_payload_snapshots.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/test_size_limited_dict.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/test_types.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/test_utils.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/test_utils_acceptance.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/tracing/__init__.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/tracing/conftest.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/tracing/helpers.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/tracing/test_client_traces.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/tracing/test_config.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/tracing/test_export.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/tracing/test_ids.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/tracing/test_limits.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/tracing/test_otlp.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/tracing/test_pipeline.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/tracing/test_sanitize.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/tracing/test_span.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/tracing/test_traceparent.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/test/tracing/test_transport.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/tracing/__init__.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/tracing/_before_span_send.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/tracing/_config.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/tracing/_context.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/tracing/_drops.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/tracing/_export.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/tracing/_ids.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/tracing/_limits.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/tracing/_otlp.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/tracing/_pipeline.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/tracing/_sanitize.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/tracing/_span.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/tracing/_traceparent.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/tracing/_transport.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/tracing/span.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/types.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog/utils.py +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog.egg-info/SOURCES.txt +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog.egg-info/dependency_links.txt +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog.egg-info/requires.txt +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/posthog.egg-info/top_level.txt +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/setup.cfg +0 -0
- {posthog-8.2.4 → posthog-8.2.6}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: posthog
|
|
3
|
-
Version: 8.2.
|
|
3
|
+
Version: 8.2.6
|
|
4
4
|
Summary: Integrate PostHog into any python application.
|
|
5
5
|
Home-page: https://github.com/posthog/posthog-python
|
|
6
6
|
Author: Posthog
|
|
@@ -19,6 +19,7 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
19
19
|
Classifier: Programming Language :: Python :: 3.12
|
|
20
20
|
Classifier: Programming Language :: Python :: 3.13
|
|
21
21
|
Classifier: Programming Language :: Python :: 3.14
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
22
23
|
Requires-Python: >=3.10
|
|
23
24
|
Description-Content-Type: text/markdown
|
|
24
25
|
License-File: LICENSE
|
|
@@ -6,7 +6,7 @@ into standardized formats for PostHog tracking.
|
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
8
|
import json
|
|
9
|
-
from typing import Any, Dict, List, Literal, Optional, Tuple
|
|
9
|
+
from typing import Any, Dict, List, Literal, Optional, Tuple, cast
|
|
10
10
|
|
|
11
11
|
from posthog.ai.media import to_plain
|
|
12
12
|
from posthog.ai.types import (
|
|
@@ -160,6 +160,11 @@ def format_anthropic_streaming_content(
|
|
|
160
160
|
}
|
|
161
161
|
)
|
|
162
162
|
|
|
163
|
+
elif block.get("type"):
|
|
164
|
+
# Server tool blocks (server_tool_use, web_search_tool_result, ...) pass
|
|
165
|
+
# through as-is, matching what the non-streaming path records.
|
|
166
|
+
formatted.append(cast(FormattedContentItem, dict(block)))
|
|
167
|
+
|
|
163
168
|
return formatted
|
|
164
169
|
|
|
165
170
|
|
|
@@ -388,16 +393,21 @@ def finalize_anthropic_tool_input(
|
|
|
388
393
|
if hasattr(event, "index") and event.index < len(content_blocks):
|
|
389
394
|
block = content_blocks[event.index]
|
|
390
395
|
|
|
391
|
-
|
|
392
|
-
|
|
396
|
+
block_id = block.get("id")
|
|
397
|
+
if block_id is not None and block_id in tools_in_progress:
|
|
398
|
+
tool = tools_in_progress[block_id]
|
|
393
399
|
|
|
394
400
|
try:
|
|
395
|
-
|
|
401
|
+
parsed = json.loads(tool["input_string"])
|
|
402
|
+
if block.get("type") == "function":
|
|
403
|
+
block["function"]["arguments"] = parsed
|
|
404
|
+
elif tool["input_string"]:
|
|
405
|
+
cast(Dict[str, Any], block)["input"] = parsed
|
|
396
406
|
except (json.JSONDecodeError, Exception):
|
|
397
407
|
# Keep empty dict if parsing fails
|
|
398
408
|
pass
|
|
399
409
|
|
|
400
|
-
del tools_in_progress[
|
|
410
|
+
del tools_in_progress[block_id]
|
|
401
411
|
|
|
402
412
|
|
|
403
413
|
def format_anthropic_streaming_input(kwargs: Dict[str, Any]) -> Any:
|
|
@@ -569,6 +579,16 @@ def _start_anthropic_block(
|
|
|
569
579
|
}
|
|
570
580
|
return redacted_block, None
|
|
571
581
|
|
|
582
|
+
# Keep other blocks (server_tool_use, web_search_tool_result, ...) in their
|
|
583
|
+
# plain form, as format_anthropic_response does. A server tool's input streams
|
|
584
|
+
# in through input_json_delta events like a client tool's.
|
|
585
|
+
plain = to_plain(block)
|
|
586
|
+
if isinstance(plain, dict) and plain.get("type"):
|
|
587
|
+
other_block = cast(StreamingContentBlock, plain)
|
|
588
|
+
if "input" in plain and plain.get("id"):
|
|
589
|
+
return other_block, {"block": other_block, "input_string": ""}
|
|
590
|
+
return other_block, None
|
|
591
|
+
|
|
572
592
|
return None, None
|
|
573
593
|
|
|
574
594
|
|
|
@@ -592,7 +612,8 @@ def _append_anthropic_tool_json(
|
|
|
592
612
|
if hasattr(event, "index") and event.index < len(content_blocks):
|
|
593
613
|
block = content_blocks[event.index]
|
|
594
614
|
|
|
595
|
-
|
|
596
|
-
|
|
615
|
+
block_id = block.get("id")
|
|
616
|
+
if block_id is not None and block_id in tools_in_progress:
|
|
617
|
+
tool = tools_in_progress[block_id]
|
|
597
618
|
partial_json = getattr(event.delta, "partial_json", "")
|
|
598
619
|
tool["input_string"] += partial_json
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import asyncio
|
|
2
2
|
import copy
|
|
3
|
+
import functools
|
|
3
4
|
import logging
|
|
4
5
|
import re
|
|
6
|
+
import sys
|
|
5
7
|
import time
|
|
6
8
|
import uuid
|
|
7
9
|
from typing import Any, Callable, Dict, List, Optional, Tuple, cast
|
|
@@ -1108,8 +1110,77 @@ def _is_mcp_provider_tool(tool: Dict[str, Any]) -> bool:
|
|
|
1108
1110
|
)
|
|
1109
1111
|
|
|
1110
1112
|
|
|
1113
|
+
# Credential keys in google-genai `Tool` configs, such as retrieval and Maps
|
|
1114
|
+
# auth, search provider API keys, and MCP server headers. Function declarations
|
|
1115
|
+
# hold the caller's own parameter schemas and are never masked.
|
|
1116
|
+
_GEMINI_CREDENTIAL_KEYS = frozenset(
|
|
1117
|
+
{"api_auth", "apiAuth", "auth_config", "authConfig", "api_key", "apiKey", "headers"}
|
|
1118
|
+
)
|
|
1119
|
+
_GEMINI_SCHEMA_FIELDS = frozenset({"function_declarations", "functionDeclarations"})
|
|
1120
|
+
|
|
1121
|
+
|
|
1122
|
+
def _gemini_tool_class() -> Optional[type]:
|
|
1123
|
+
# Gemini tools only exist once the caller has loaded google-genai, so look it
|
|
1124
|
+
# up instead of importing it on every provider's capture path.
|
|
1125
|
+
return getattr(sys.modules.get("google.genai.types"), "Tool", None)
|
|
1126
|
+
|
|
1127
|
+
|
|
1128
|
+
@functools.lru_cache(maxsize=4)
|
|
1129
|
+
def _model_field_names(model_class: type) -> frozenset:
|
|
1130
|
+
fields = model_class.model_fields # type: ignore[attr-defined]
|
|
1131
|
+
return frozenset({*fields, *(f.alias for f in fields.values() if f.alias)})
|
|
1132
|
+
|
|
1133
|
+
|
|
1134
|
+
def _gemini_tool_fields() -> frozenset:
|
|
1135
|
+
# Read from the SDK so tools Google adds later are covered too.
|
|
1136
|
+
tool_class = _gemini_tool_class()
|
|
1137
|
+
return _model_field_names(tool_class) if tool_class else frozenset()
|
|
1138
|
+
|
|
1139
|
+
|
|
1140
|
+
def _without_gemini_credentials(value: Any) -> Any:
|
|
1141
|
+
model_dump = getattr(value, "model_dump", None)
|
|
1142
|
+
if callable(model_dump):
|
|
1143
|
+
dumped = model_dump()
|
|
1144
|
+
if isinstance(dumped, dict):
|
|
1145
|
+
return _without_gemini_credentials(dumped)
|
|
1146
|
+
if isinstance(value, dict):
|
|
1147
|
+
return {
|
|
1148
|
+
key: (
|
|
1149
|
+
_REDACTED_MCP_CREDENTIAL
|
|
1150
|
+
if key in _GEMINI_CREDENTIAL_KEYS and item is not None
|
|
1151
|
+
else _without_gemini_credentials(item)
|
|
1152
|
+
)
|
|
1153
|
+
for key, item in value.items()
|
|
1154
|
+
}
|
|
1155
|
+
if isinstance(value, (list, tuple)):
|
|
1156
|
+
return [_without_gemini_credentials(item) for item in value]
|
|
1157
|
+
return value
|
|
1158
|
+
|
|
1159
|
+
|
|
1160
|
+
def _is_gemini_tool_with_config(tool: Any) -> bool:
|
|
1161
|
+
tool_class = _gemini_tool_class()
|
|
1162
|
+
return (
|
|
1163
|
+
tool_class is not None
|
|
1164
|
+
and isinstance(tool, tool_class)
|
|
1165
|
+
and any(
|
|
1166
|
+
getattr(tool, name, None) is not None
|
|
1167
|
+
for name in tool_class.model_fields # type: ignore[attr-defined]
|
|
1168
|
+
if name not in _GEMINI_SCHEMA_FIELDS
|
|
1169
|
+
)
|
|
1170
|
+
)
|
|
1171
|
+
|
|
1172
|
+
|
|
1173
|
+
def _is_gemini_tool_dict(tool: Dict[str, Any]) -> bool:
|
|
1174
|
+
return any(
|
|
1175
|
+
key in _gemini_tool_fields() and key not in _GEMINI_SCHEMA_FIELDS
|
|
1176
|
+
for key in tool
|
|
1177
|
+
)
|
|
1178
|
+
|
|
1179
|
+
|
|
1111
1180
|
def _redact_mcp_tool(tool: Any) -> Any:
|
|
1112
1181
|
if not isinstance(tool, dict):
|
|
1182
|
+
if _is_gemini_tool_with_config(tool):
|
|
1183
|
+
return _redact_mcp_tool(tool.model_dump())
|
|
1113
1184
|
if getattr(tool, "type", None) != "mcp":
|
|
1114
1185
|
return tool
|
|
1115
1186
|
model_dump = getattr(tool, "model_dump", None)
|
|
@@ -1127,14 +1198,23 @@ def _redact_mcp_tool(tool: Any) -> Any:
|
|
|
1127
1198
|
return _without_mcp_credentials(tool)
|
|
1128
1199
|
if _is_mcp_provider_tool(tool):
|
|
1129
1200
|
return {**tool, "args": _without_mcp_credentials(tool["args"])}
|
|
1201
|
+
if _is_gemini_tool_dict(tool):
|
|
1202
|
+
return {
|
|
1203
|
+
key: (
|
|
1204
|
+
value
|
|
1205
|
+
if key in _GEMINI_SCHEMA_FIELDS
|
|
1206
|
+
else _without_gemini_credentials(value)
|
|
1207
|
+
)
|
|
1208
|
+
for key, value in tool.items()
|
|
1209
|
+
}
|
|
1130
1210
|
return tool
|
|
1131
1211
|
|
|
1132
1212
|
|
|
1133
1213
|
def _redact_mcp_tool_credentials(tools: Any) -> Any:
|
|
1134
1214
|
"""
|
|
1135
|
-
Mask the `headers` and `authorization`
|
|
1136
|
-
|
|
1137
|
-
left untouched.
|
|
1215
|
+
Mask the credentials in tool definitions: the `headers` and `authorization`
|
|
1216
|
+
of MCP tools, and the API keys, auth configs, and headers in Gemini tool
|
|
1217
|
+
configs. Returns copies; the caller's tools are left untouched.
|
|
1138
1218
|
"""
|
|
1139
1219
|
if not isinstance(tools, (list, tuple)):
|
|
1140
1220
|
return tools
|
|
@@ -242,6 +242,140 @@ def test_mcp_tool_credentials_are_masked_without_mutating_caller_tools(
|
|
|
242
242
|
assert mcp_object.headers == {"X-Api-Key": CANARY}
|
|
243
243
|
|
|
244
244
|
|
|
245
|
+
@pytest.mark.parametrize(
|
|
246
|
+
"tool",
|
|
247
|
+
[
|
|
248
|
+
pytest.param(
|
|
249
|
+
{
|
|
250
|
+
"retrieval": {
|
|
251
|
+
"external_api": {
|
|
252
|
+
"api_spec": "ELASTIC_SEARCH",
|
|
253
|
+
"endpoint": "https://es.example.com",
|
|
254
|
+
"api_auth": {"api_key_config": {"api_key_string": CANARY}},
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
},
|
|
258
|
+
id="retrieval-api-auth",
|
|
259
|
+
),
|
|
260
|
+
pytest.param(
|
|
261
|
+
{
|
|
262
|
+
"retrieval": {
|
|
263
|
+
"external_api": {
|
|
264
|
+
"endpoint": "https://es.example.com",
|
|
265
|
+
"auth_config": {"oauth_config": {"access_token": CANARY}},
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
},
|
|
269
|
+
id="retrieval-auth-config",
|
|
270
|
+
),
|
|
271
|
+
pytest.param(
|
|
272
|
+
{"google_maps": {"auth_config": {"api_key": CANARY}}},
|
|
273
|
+
id="google-maps-auth-config",
|
|
274
|
+
),
|
|
275
|
+
pytest.param(
|
|
276
|
+
{"googleMaps": {"authConfig": {"oauthConfig": {"accessToken": CANARY}}}},
|
|
277
|
+
id="camel-case-google-maps",
|
|
278
|
+
),
|
|
279
|
+
pytest.param(
|
|
280
|
+
{"exa_ai_search": {"api_key": CANARY}},
|
|
281
|
+
id="exa-ai-search-api-key",
|
|
282
|
+
),
|
|
283
|
+
pytest.param(
|
|
284
|
+
{"parallel_ai_search": {"api_key": CANARY}},
|
|
285
|
+
id="parallel-ai-search-api-key",
|
|
286
|
+
),
|
|
287
|
+
pytest.param(
|
|
288
|
+
{
|
|
289
|
+
"mcp_servers": [
|
|
290
|
+
{
|
|
291
|
+
"name": "docs",
|
|
292
|
+
"streamable_http_transport": {
|
|
293
|
+
"url": "https://mcp.example.com",
|
|
294
|
+
"headers": {"Authorization": f"Bearer {CANARY}"},
|
|
295
|
+
},
|
|
296
|
+
}
|
|
297
|
+
]
|
|
298
|
+
},
|
|
299
|
+
id="mcp-servers-headers",
|
|
300
|
+
),
|
|
301
|
+
],
|
|
302
|
+
)
|
|
303
|
+
@pytest.mark.parametrize("as_model", [True, False], ids=["model", "dict"])
|
|
304
|
+
def test_gemini_tool_credentials_are_masked(
|
|
305
|
+
tool: Dict[str, Any], as_model: bool
|
|
306
|
+
) -> None:
|
|
307
|
+
from google.genai import types
|
|
308
|
+
|
|
309
|
+
function_tool = types.Tool(
|
|
310
|
+
function_declarations=[
|
|
311
|
+
types.FunctionDeclaration(
|
|
312
|
+
name="call_api",
|
|
313
|
+
parameters_json_schema={
|
|
314
|
+
"type": "object",
|
|
315
|
+
"properties": {"api_key": {"type": "string"}},
|
|
316
|
+
},
|
|
317
|
+
)
|
|
318
|
+
]
|
|
319
|
+
)
|
|
320
|
+
credential_tool = types.Tool.model_validate(tool) if as_model else tool
|
|
321
|
+
tools = [credential_tool, function_tool]
|
|
322
|
+
|
|
323
|
+
captured = extract_available_tool_calls(
|
|
324
|
+
"gemini", {"config": SimpleNamespace(tools=tools)}
|
|
325
|
+
)
|
|
326
|
+
|
|
327
|
+
assert CANARY not in json.dumps(captured, default=str)
|
|
328
|
+
assert _REDACTED_MCP_CREDENTIAL in json.dumps(captured, default=str)
|
|
329
|
+
assert captured[0].keys() & {"google_maps", "googleMaps", *tool}
|
|
330
|
+
assert captured[1] is function_tool
|
|
331
|
+
assert CANARY in json.dumps(tool)
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
@pytest.mark.parametrize(
|
|
335
|
+
"make_tool",
|
|
336
|
+
[
|
|
337
|
+
pytest.param(
|
|
338
|
+
lambda types: {"exa_ai_search": {"api_key": CANARY}, "label": "search"},
|
|
339
|
+
id="extra-key",
|
|
340
|
+
),
|
|
341
|
+
pytest.param(
|
|
342
|
+
lambda types: {
|
|
343
|
+
"google_maps": types.GoogleMaps(
|
|
344
|
+
auth_config=types.AuthConfig(api_key=CANARY)
|
|
345
|
+
)
|
|
346
|
+
},
|
|
347
|
+
id="nested-model",
|
|
348
|
+
),
|
|
349
|
+
pytest.param(
|
|
350
|
+
lambda types: {
|
|
351
|
+
"mcp_servers": (
|
|
352
|
+
{
|
|
353
|
+
"streamable_http_transport": {
|
|
354
|
+
"headers": {"Authorization": CANARY}
|
|
355
|
+
}
|
|
356
|
+
},
|
|
357
|
+
)
|
|
358
|
+
},
|
|
359
|
+
id="tuple",
|
|
360
|
+
),
|
|
361
|
+
pytest.param(
|
|
362
|
+
lambda types: type("AppTool", (types.Tool,), {})(
|
|
363
|
+
exa_ai_search=types.ToolExaAiSearch(api_key=CANARY)
|
|
364
|
+
),
|
|
365
|
+
id="tool-subclass",
|
|
366
|
+
),
|
|
367
|
+
],
|
|
368
|
+
)
|
|
369
|
+
def test_gemini_tool_variants_are_masked(make_tool: Callable[[Any], Any]) -> None:
|
|
370
|
+
from google.genai import types
|
|
371
|
+
|
|
372
|
+
captured = extract_available_tool_calls(
|
|
373
|
+
"gemini", {"config": SimpleNamespace(tools=[make_tool(types)])}
|
|
374
|
+
)
|
|
375
|
+
|
|
376
|
+
assert CANARY not in json.dumps(captured, default=str)
|
|
377
|
+
|
|
378
|
+
|
|
245
379
|
@pytest.fixture
|
|
246
380
|
def private_client() -> Iterator[Client]:
|
|
247
381
|
client = Client(
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
VERSION = "8.2.6"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: posthog
|
|
3
|
-
Version: 8.2.
|
|
3
|
+
Version: 8.2.6
|
|
4
4
|
Summary: Integrate PostHog into any python application.
|
|
5
5
|
Home-page: https://github.com/posthog/posthog-python
|
|
6
6
|
Author: Posthog
|
|
@@ -19,6 +19,7 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
19
19
|
Classifier: Programming Language :: Python :: 3.12
|
|
20
20
|
Classifier: Programming Language :: Python :: 3.13
|
|
21
21
|
Classifier: Programming Language :: Python :: 3.14
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
22
23
|
Requires-Python: >=3.10
|
|
23
24
|
Description-Content-Type: text/markdown
|
|
24
25
|
License-File: LICENSE
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "posthog"
|
|
7
|
-
version = "8.2.
|
|
7
|
+
version = "8.2.6"
|
|
8
8
|
description = "Integrate PostHog into any python application."
|
|
9
9
|
authors = [{ name = "PostHog", email = "engineering@posthog.com" }]
|
|
10
10
|
maintainers = [{ name = "PostHog", email = "engineering@posthog.com" }]
|
|
@@ -21,6 +21,7 @@ classifiers = [
|
|
|
21
21
|
"Programming Language :: Python :: 3.12",
|
|
22
22
|
"Programming Language :: Python :: 3.13",
|
|
23
23
|
"Programming Language :: Python :: 3.14",
|
|
24
|
+
"Programming Language :: Python :: 3.15",
|
|
24
25
|
]
|
|
25
26
|
dependencies = [
|
|
26
27
|
"requests>=2.7,<3.0",
|
posthog-8.2.4/posthog/version.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
VERSION = "8.2.4"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|