payi 0.1.0a82__tar.gz → 0.1.0a83__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.
Potentially problematic release.
This version of payi might be problematic. Click here for more details.
- payi-0.1.0a83/.release-please-manifest.json +3 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/CHANGELOG.md +8 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/PKG-INFO +1 -1
- {payi-0.1.0a82 → payi-0.1.0a83}/pyproject.toml +1 -1
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/_version.py +1 -1
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/lib/AnthropicInstrumentor.py +10 -3
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/lib/BedrockInstrumentor.py +16 -11
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/lib/GoogleGenAiInstrumentor.py +5 -3
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/lib/OpenAIInstrumentor.py +13 -9
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/lib/VertexInstrumentor.py +40 -16
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/lib/instrument.py +119 -64
- payi-0.1.0a82/.release-please-manifest.json +0 -3
- {payi-0.1.0a82 → payi-0.1.0a83}/.gitignore +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/CONTRIBUTING.md +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/LICENSE +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/README.md +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/SECURITY.md +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/api.md +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/bin/check-release-environment +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/bin/publish-pypi +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/examples/.keep +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/mypy.ini +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/noxfile.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/release-please-config.json +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/requirements-dev.lock +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/requirements.lock +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/__init__.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/_base_client.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/_client.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/_compat.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/_constants.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/_exceptions.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/_files.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/_models.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/_qs.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/_resource.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/_response.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/_streaming.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/_types.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/_utils/__init__.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/_utils/_logs.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/_utils/_proxy.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/_utils/_reflection.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/_utils/_resources_proxy.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/_utils/_streams.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/_utils/_sync.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/_utils/_transform.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/_utils/_typing.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/_utils/_utils.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/lib/.keep +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/lib/Stopwatch.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/lib/helpers.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/pagination.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/py.typed +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/resources/__init__.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/resources/categories/__init__.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/resources/categories/categories.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/resources/categories/resources.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/resources/experiences/__init__.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/resources/experiences/experiences.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/resources/experiences/properties.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/resources/experiences/types/__init__.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/resources/experiences/types/limit_config.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/resources/experiences/types/types.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/resources/ingest.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/resources/limits/__init__.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/resources/limits/limits.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/resources/limits/tags.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/resources/requests/__init__.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/resources/requests/properties.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/resources/requests/requests.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/resources/requests/result.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/resources/use_cases/__init__.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/resources/use_cases/definitions/__init__.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/resources/use_cases/definitions/definitions.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/resources/use_cases/definitions/kpis.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/resources/use_cases/definitions/limit_config.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/resources/use_cases/definitions/version.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/resources/use_cases/kpis.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/resources/use_cases/properties.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/resources/use_cases/use_cases.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/__init__.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/bulk_ingest_response.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/categories/__init__.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/categories/resource_create_params.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/categories/resource_list_params.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/category_delete_resource_response.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/category_delete_response.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/category_list_params.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/category_list_resources_params.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/category_resource_response.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/category_response.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/cost_data.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/cost_details.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/default_response.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/experience_instance_response.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/experiences/__init__.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/experiences/experience_type.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/experiences/property_create_params.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/experiences/type_create_params.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/experiences/type_list_params.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/experiences/type_update_params.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/experiences/types/__init__.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/experiences/types/limit_config_create_params.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/ingest_bulk_params.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/ingest_event_param.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/ingest_response.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/ingest_units_params.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/limit_create_params.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/limit_history_response.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/limit_list_params.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/limit_list_response.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/limit_reset_params.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/limit_response.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/limit_update_params.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/limits/__init__.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/limits/limit_tags.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/limits/tag_create_params.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/limits/tag_create_response.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/limits/tag_delete_response.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/limits/tag_list_response.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/limits/tag_remove_params.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/limits/tag_remove_response.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/limits/tag_update_params.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/limits/tag_update_response.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/pay_i_common_models_api_router_header_info_param.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/requests/__init__.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/requests/property_create_params.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/requests/request_result.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/requests_data.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/shared/__init__.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/shared/evaluation_response.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/shared/ingest_units.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/shared/pay_i_common_models_budget_management_cost_details_base.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/shared/pay_i_common_models_budget_management_create_limit_base.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/shared/properties_response.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/shared/xproxy_error.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/shared/xproxy_result.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/shared_params/__init__.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/shared_params/ingest_units.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/shared_params/pay_i_common_models_budget_management_create_limit_base.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/total_cost_data.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/use_case_instance_response.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/use_cases/__init__.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/use_cases/definition_create_params.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/use_cases/definition_list_params.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/use_cases/definition_update_params.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/use_cases/definitions/__init__.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/use_cases/definitions/kpi_create_params.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/use_cases/definitions/kpi_create_response.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/use_cases/definitions/kpi_delete_response.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/use_cases/definitions/kpi_list_params.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/use_cases/definitions/kpi_list_response.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/use_cases/definitions/kpi_retrieve_response.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/use_cases/definitions/kpi_update_params.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/use_cases/definitions/kpi_update_response.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/use_cases/definitions/limit_config_create_params.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/use_cases/kpi_create_params.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/use_cases/kpi_list_params.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/use_cases/kpi_list_response.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/use_cases/kpi_update_params.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/use_cases/property_create_params.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/use_cases/use_case_definition.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/tests/__init__.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/tests/api_resources/__init__.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/tests/api_resources/categories/__init__.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/tests/api_resources/categories/test_resources.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/tests/api_resources/experiences/__init__.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/tests/api_resources/experiences/test_properties.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/tests/api_resources/experiences/test_types.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/tests/api_resources/experiences/types/__init__.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/tests/api_resources/experiences/types/test_limit_config.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/tests/api_resources/limits/__init__.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/tests/api_resources/limits/test_tags.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/tests/api_resources/requests/__init__.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/tests/api_resources/requests/test_properties.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/tests/api_resources/requests/test_result.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/tests/api_resources/test_categories.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/tests/api_resources/test_experiences.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/tests/api_resources/test_ingest.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/tests/api_resources/test_limits.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/tests/api_resources/test_use_cases.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/tests/api_resources/use_cases/__init__.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/tests/api_resources/use_cases/definitions/__init__.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/tests/api_resources/use_cases/definitions/test_kpis.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/tests/api_resources/use_cases/definitions/test_limit_config.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/tests/api_resources/use_cases/definitions/test_version.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/tests/api_resources/use_cases/test_definitions.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/tests/api_resources/use_cases/test_kpis.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/tests/api_resources/use_cases/test_properties.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/tests/conftest.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/tests/sample_file.txt +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/tests/test_client.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/tests/test_deepcopy.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/tests/test_extract_files.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/tests/test_files.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/tests/test_models.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/tests/test_qs.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/tests/test_required_args.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/tests/test_response.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/tests/test_streaming.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/tests/test_transform.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/tests/test_utils/test_proxy.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/tests/test_utils/test_typing.py +0 -0
- {payi-0.1.0a82 → payi-0.1.0a83}/tests/utils.py +0 -0
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.0-alpha.83 (2025-06-06)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.1.0-alpha.82...v0.1.0-alpha.83](https://github.com/Pay-i/pay-i-python/compare/v0.1.0-alpha.82...v0.1.0-alpha.83)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* ingest streaming results aggressively ([#316](https://github.com/Pay-i/pay-i-python/issues/316)) ([2d196f7](https://github.com/Pay-i/pay-i-python/commit/2d196f781c7d4ed1317f453e99501d682f684d3c))
|
|
10
|
+
|
|
3
11
|
## 0.1.0-alpha.82 (2025-06-06)
|
|
4
12
|
|
|
5
13
|
Full Changelog: [v0.1.0-alpha.81...v0.1.0-alpha.82](https://github.com/Pay-i/pay-i-python/compare/v0.1.0-alpha.81...v0.1.0-alpha.82)
|
|
@@ -7,7 +7,7 @@ from wrapt import wrap_function_wrapper # type: ignore
|
|
|
7
7
|
from payi.lib.helpers import PayiCategories
|
|
8
8
|
from payi.types.ingest_units_params import Units
|
|
9
9
|
|
|
10
|
-
from .instrument import _IsStreaming, _StreamingType, _ProviderRequest, _PayiInstrumentor
|
|
10
|
+
from .instrument import _ChunkResult, _IsStreaming, _StreamingType, _ProviderRequest, _PayiInstrumentor
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
class AnthropicInstrumentor:
|
|
@@ -133,7 +133,8 @@ class _AnthropicProviderRequest(_ProviderRequest):
|
|
|
133
133
|
)
|
|
134
134
|
|
|
135
135
|
@override
|
|
136
|
-
def process_chunk(self, chunk: Any) ->
|
|
136
|
+
def process_chunk(self, chunk: Any) -> _ChunkResult:
|
|
137
|
+
ingest = False
|
|
137
138
|
if chunk.type == "message_start":
|
|
138
139
|
self._ingest["provider_response_id"] = chunk.message.id
|
|
139
140
|
|
|
@@ -154,9 +155,15 @@ class _AnthropicProviderRequest(_ProviderRequest):
|
|
|
154
155
|
|
|
155
156
|
elif chunk.type == "message_delta":
|
|
156
157
|
usage = chunk.usage
|
|
158
|
+
ingest = True
|
|
159
|
+
|
|
160
|
+
# Web search will return an updated input tokens value at the end of streaming
|
|
161
|
+
if usage.input_tokens > 0:
|
|
162
|
+
self._ingest["units"]["text"]["input"] = usage.input_tokens
|
|
163
|
+
|
|
157
164
|
self._ingest["units"]["text"]["output"] = usage.output_tokens
|
|
158
165
|
|
|
159
|
-
return True
|
|
166
|
+
return _ChunkResult(send_chunk_to_caller=True, ingest=ingest)
|
|
160
167
|
|
|
161
168
|
@override
|
|
162
169
|
def process_synchronous_response(self, response: Any, log_prompt_and_response: bool, kwargs: Any) -> Any:
|
|
@@ -10,7 +10,7 @@ from payi.lib.helpers import PayiCategories, PayiHeaderNames, payi_aws_bedrock_u
|
|
|
10
10
|
from payi.types.ingest_units_params import Units, IngestUnitsParams
|
|
11
11
|
from payi.types.pay_i_common_models_api_router_header_info_param import PayICommonModelsAPIRouterHeaderInfoParam
|
|
12
12
|
|
|
13
|
-
from .instrument import _IsStreaming, _StreamingType, _ProviderRequest, _PayiInstrumentor
|
|
13
|
+
from .instrument import _ChunkResult, _IsStreaming, _StreamingType, _ProviderRequest, _PayiInstrumentor
|
|
14
14
|
|
|
15
15
|
_supported_model_prefixes = ["meta.llama3", "anthropic.", "amazon.nova-pro", "amazon.nova-lite", "amazon.nova-micro"]
|
|
16
16
|
|
|
@@ -22,8 +22,6 @@ class BedrockInstrumentor:
|
|
|
22
22
|
BedrockInstrumentor._instrumentor = instrumentor
|
|
23
23
|
|
|
24
24
|
try:
|
|
25
|
-
import boto3 # type: ignore # noqa: F401 I001
|
|
26
|
-
|
|
27
25
|
wrap_function_wrapper(
|
|
28
26
|
"botocore.client",
|
|
29
27
|
"ClientCreator.create_client",
|
|
@@ -43,7 +41,7 @@ class BedrockInstrumentor:
|
|
|
43
41
|
@_PayiInstrumentor.payi_wrapper
|
|
44
42
|
def create_client_wrapper(instrumentor: _PayiInstrumentor, wrapped: Any, instance: Any, *args: Any, **kwargs: Any) -> Any: # noqa: ARG001
|
|
45
43
|
if kwargs.get("service_name") != "bedrock-runtime":
|
|
46
|
-
instrumentor._logger.debug(f"skipping client wrapper creation for {kwargs.get('service_name', '')} service")
|
|
44
|
+
# instrumentor._logger.debug(f"skipping client wrapper creation for {kwargs.get('service_name', '')} service")
|
|
47
45
|
return wrapped(*args, **kwargs)
|
|
48
46
|
|
|
49
47
|
try:
|
|
@@ -272,13 +270,14 @@ class _BedrockInvokeStreamingProviderRequest(_BedrockProviderRequest):
|
|
|
272
270
|
self._is_anthropic: bool = model_id.startswith("anthropic.")
|
|
273
271
|
|
|
274
272
|
@override
|
|
275
|
-
def process_chunk(self, chunk: Any) ->
|
|
273
|
+
def process_chunk(self, chunk: Any) -> _ChunkResult:
|
|
276
274
|
if self._is_anthropic:
|
|
277
275
|
return self.process_invoke_streaming_anthropic_chunk(chunk)
|
|
278
276
|
else:
|
|
279
277
|
return self.process_invoke_streaming_llama_chunk(chunk)
|
|
280
278
|
|
|
281
|
-
def process_invoke_streaming_anthropic_chunk(self, chunk: str) ->
|
|
279
|
+
def process_invoke_streaming_anthropic_chunk(self, chunk: str) -> _ChunkResult:
|
|
280
|
+
ingest = False
|
|
282
281
|
chunk_dict = json.loads(chunk)
|
|
283
282
|
type = chunk_dict.get("type", "")
|
|
284
283
|
|
|
@@ -301,18 +300,21 @@ class _BedrockInvokeStreamingProviderRequest(_BedrockProviderRequest):
|
|
|
301
300
|
elif type == "message_delta":
|
|
302
301
|
usage = chunk_dict['usage']
|
|
303
302
|
self._ingest["units"]["text"]["output"] = usage['output_tokens']
|
|
303
|
+
ingest = True
|
|
304
304
|
|
|
305
|
-
return True
|
|
305
|
+
return _ChunkResult(send_chunk_to_caller=True, ingest=ingest)
|
|
306
306
|
|
|
307
|
-
def process_invoke_streaming_llama_chunk(self, chunk: str) ->
|
|
307
|
+
def process_invoke_streaming_llama_chunk(self, chunk: str) -> _ChunkResult:
|
|
308
|
+
ingest = False
|
|
308
309
|
chunk_dict = json.loads(chunk)
|
|
309
310
|
metrics = chunk_dict.get("amazon-bedrock-invocationMetrics", {})
|
|
310
311
|
if metrics:
|
|
311
312
|
input = metrics.get("inputTokenCount", 0)
|
|
312
313
|
output = metrics.get("outputTokenCount", 0)
|
|
313
314
|
self._ingest["units"]["text"] = Units(input=input, output=output)
|
|
315
|
+
ingest = True
|
|
314
316
|
|
|
315
|
-
return True
|
|
317
|
+
return _ChunkResult(send_chunk_to_caller=True, ingest=ingest)
|
|
316
318
|
|
|
317
319
|
class _BedrockInvokeSynchronousProviderRequest(_BedrockProviderRequest):
|
|
318
320
|
@override
|
|
@@ -374,7 +376,8 @@ class _BedrockConverseSynchronousProviderRequest(_BedrockProviderRequest):
|
|
|
374
376
|
|
|
375
377
|
class _BedrockConverseStreamingProviderRequest(_BedrockProviderRequest):
|
|
376
378
|
@override
|
|
377
|
-
def process_chunk(self, chunk: 'dict[str, Any]') ->
|
|
379
|
+
def process_chunk(self, chunk: 'dict[str, Any]') -> _ChunkResult:
|
|
380
|
+
ingest = False
|
|
378
381
|
metadata = chunk.get("metadata", {})
|
|
379
382
|
|
|
380
383
|
if metadata:
|
|
@@ -383,4 +386,6 @@ class _BedrockConverseStreamingProviderRequest(_BedrockProviderRequest):
|
|
|
383
386
|
output = usage["outputTokens"]
|
|
384
387
|
self._ingest["units"]["text"] = Units(input=input, output=output)
|
|
385
388
|
|
|
386
|
-
|
|
389
|
+
ingest = True
|
|
390
|
+
|
|
391
|
+
return _ChunkResult(send_chunk_to_caller=True, ingest=ingest)
|
|
@@ -8,7 +8,7 @@ from wrapt import wrap_function_wrapper # type: ignore
|
|
|
8
8
|
from payi.lib.helpers import PayiCategories
|
|
9
9
|
from payi.types.ingest_units_params import Units
|
|
10
10
|
|
|
11
|
-
from .instrument import _IsStreaming, _StreamingType, _ProviderRequest, _PayiInstrumentor
|
|
11
|
+
from .instrument import _ChunkResult, _IsStreaming, _StreamingType, _ProviderRequest, _PayiInstrumentor
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
class GoogleGenAiInstrumentor:
|
|
@@ -248,7 +248,8 @@ class _GoogleGenAiRequest(_ProviderRequest):
|
|
|
248
248
|
prompt["tool_config"] = tool_config
|
|
249
249
|
|
|
250
250
|
@override
|
|
251
|
-
def process_chunk(self, chunk: Any) ->
|
|
251
|
+
def process_chunk(self, chunk: Any) -> _ChunkResult:
|
|
252
|
+
ingest = False
|
|
252
253
|
response_dict: dict[str, Any] = chunk.to_json_dict()
|
|
253
254
|
if "provider_response_id" not in self._ingest:
|
|
254
255
|
id = response_dict.get("response_id", None)
|
|
@@ -267,8 +268,9 @@ class _GoogleGenAiRequest(_ProviderRequest):
|
|
|
267
268
|
usage = response_dict.get("usage_metadata", {})
|
|
268
269
|
if usage and "prompt_token_count" in usage and "candidates_token_count" in usage:
|
|
269
270
|
self._compute_usage(response_dict, streaming_candidates_characters=self._candiates_character_count)
|
|
271
|
+
ingest = True
|
|
270
272
|
|
|
271
|
-
return True
|
|
273
|
+
return _ChunkResult(send_chunk_to_caller=True, ingest=ingest)
|
|
272
274
|
|
|
273
275
|
@staticmethod
|
|
274
276
|
def _is_character_billing_model(model: str) -> bool:
|
|
@@ -9,7 +9,7 @@ from wrapt import wrap_function_wrapper # type: ignore
|
|
|
9
9
|
from payi.lib.helpers import PayiCategories, PayiHeaderNames
|
|
10
10
|
from payi.types.ingest_units_params import Units
|
|
11
11
|
|
|
12
|
-
from .instrument import _IsStreaming, _StreamingType, _ProviderRequest, _PayiInstrumentor
|
|
12
|
+
from .instrument import _ChunkResult, _IsStreaming, _StreamingType, _ProviderRequest, _PayiInstrumentor
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
class OpenAiInstrumentor:
|
|
@@ -22,8 +22,6 @@ class OpenAiInstrumentor:
|
|
|
22
22
|
@staticmethod
|
|
23
23
|
def instrument(instrumentor: _PayiInstrumentor) -> None:
|
|
24
24
|
try:
|
|
25
|
-
from openai import OpenAI # type: ignore # noqa: F401 I001
|
|
26
|
-
|
|
27
25
|
wrap_function_wrapper(
|
|
28
26
|
"openai.resources.chat.completions",
|
|
29
27
|
"Completions.create",
|
|
@@ -47,7 +45,11 @@ class OpenAiInstrumentor:
|
|
|
47
45
|
"AsyncEmbeddings.create",
|
|
48
46
|
aembeddings_wrapper(instrumentor),
|
|
49
47
|
)
|
|
48
|
+
except Exception as e:
|
|
49
|
+
instrumentor._logger.debug(f"Error instrumenting openai: {e}")
|
|
50
50
|
|
|
51
|
+
# responses separately as they are relatively new and the client may not be using the latest openai module
|
|
52
|
+
try:
|
|
51
53
|
wrap_function_wrapper(
|
|
52
54
|
"openai.resources.responses",
|
|
53
55
|
"Responses.create",
|
|
@@ -62,8 +64,6 @@ class OpenAiInstrumentor:
|
|
|
62
64
|
|
|
63
65
|
except Exception as e:
|
|
64
66
|
instrumentor._logger.debug(f"Error instrumenting openai: {e}")
|
|
65
|
-
return
|
|
66
|
-
|
|
67
67
|
|
|
68
68
|
@_PayiInstrumentor.payi_wrapper
|
|
69
69
|
def embeddings_wrapper(
|
|
@@ -338,7 +338,8 @@ class _OpenAiChatProviderRequest(_OpenAiProviderRequest):
|
|
|
338
338
|
self._include_usage_added = False
|
|
339
339
|
|
|
340
340
|
@override
|
|
341
|
-
def process_chunk(self, chunk: Any) ->
|
|
341
|
+
def process_chunk(self, chunk: Any) -> _ChunkResult:
|
|
342
|
+
ingest = False
|
|
342
343
|
model = model_to_dict(chunk)
|
|
343
344
|
|
|
344
345
|
if "provider_response_id" not in self._ingest:
|
|
@@ -356,8 +357,9 @@ class _OpenAiChatProviderRequest(_OpenAiProviderRequest):
|
|
|
356
357
|
# packet which contains the usage to the client as they are not expecting the data
|
|
357
358
|
if self._include_usage_added:
|
|
358
359
|
send_chunk_to_client = False
|
|
360
|
+
ingest = True
|
|
359
361
|
|
|
360
|
-
return send_chunk_to_client
|
|
362
|
+
return _ChunkResult(send_chunk_to_caller=send_chunk_to_client, ingest=ingest)
|
|
361
363
|
|
|
362
364
|
@override
|
|
363
365
|
def process_request(self, instance: Any, extra_headers: 'dict[str, str]', args: Sequence[Any], kwargs: Any) -> bool:
|
|
@@ -420,7 +422,8 @@ class _OpenAiResponsesProviderRequest(_OpenAiProviderRequest):
|
|
|
420
422
|
input_tokens_details_key=_OpenAiProviderRequest.responses_input_tokens_details_key)
|
|
421
423
|
|
|
422
424
|
@override
|
|
423
|
-
def process_chunk(self, chunk: Any) ->
|
|
425
|
+
def process_chunk(self, chunk: Any) -> _ChunkResult:
|
|
426
|
+
ingest = False
|
|
424
427
|
model = model_to_dict(chunk)
|
|
425
428
|
response: dict[str, Any] = model.get("response", {})
|
|
426
429
|
|
|
@@ -432,8 +435,9 @@ class _OpenAiResponsesProviderRequest(_OpenAiProviderRequest):
|
|
|
432
435
|
usage = response.get("usage")
|
|
433
436
|
if usage:
|
|
434
437
|
self.add_usage_units(usage)
|
|
438
|
+
ingest = True
|
|
435
439
|
|
|
436
|
-
return True
|
|
440
|
+
return _ChunkResult(send_chunk_to_caller=True, ingest=ingest)
|
|
437
441
|
|
|
438
442
|
@override
|
|
439
443
|
def process_request(self, instance: Any, extra_headers: 'dict[str, str]', args: Sequence[Any], kwargs: Any) -> bool:
|
|
@@ -8,33 +8,37 @@ from wrapt import wrap_function_wrapper # type: ignore
|
|
|
8
8
|
from payi.lib.helpers import PayiCategories
|
|
9
9
|
from payi.types.ingest_units_params import Units
|
|
10
10
|
|
|
11
|
-
from .instrument import _IsStreaming, _StreamingType, _ProviderRequest, _PayiInstrumentor
|
|
11
|
+
from .instrument import _ChunkResult, _IsStreaming, _StreamingType, _ProviderRequest, _PayiInstrumentor
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
class VertexInstrumentor:
|
|
15
15
|
@staticmethod
|
|
16
16
|
def instrument(instrumentor: _PayiInstrumentor) -> None:
|
|
17
17
|
try:
|
|
18
|
-
import vertexai # type: ignore # noqa: F401 I001
|
|
19
|
-
|
|
20
18
|
wrap_function_wrapper(
|
|
21
19
|
"vertexai.generative_models",
|
|
22
20
|
"GenerativeModel.generate_content",
|
|
23
21
|
generate_wrapper(instrumentor),
|
|
24
22
|
)
|
|
25
23
|
|
|
26
|
-
wrap_function_wrapper(
|
|
27
|
-
"vertexai.preview.generative_models",
|
|
28
|
-
"GenerativeModel.generate_content",
|
|
29
|
-
generate_wrapper(instrumentor),
|
|
30
|
-
)
|
|
31
|
-
|
|
32
24
|
wrap_function_wrapper(
|
|
33
25
|
"vertexai.generative_models",
|
|
34
26
|
"GenerativeModel.generate_content_async",
|
|
35
27
|
agenerate_wrapper(instrumentor),
|
|
36
28
|
)
|
|
37
29
|
|
|
30
|
+
except Exception as e:
|
|
31
|
+
instrumentor._logger.debug(f"Error instrumenting vertex: {e}")
|
|
32
|
+
return
|
|
33
|
+
|
|
34
|
+
# separate instrumetning preview functionality from released in case it fails
|
|
35
|
+
try:
|
|
36
|
+
wrap_function_wrapper(
|
|
37
|
+
"vertexai.preview.generative_models",
|
|
38
|
+
"GenerativeModel.generate_content",
|
|
39
|
+
generate_wrapper(instrumentor),
|
|
40
|
+
)
|
|
41
|
+
|
|
38
42
|
wrap_function_wrapper(
|
|
39
43
|
"vertexai.preview.generative_models",
|
|
40
44
|
"GenerativeModel.generate_content_async",
|
|
@@ -93,11 +97,19 @@ class _GoogleVertexRequest(_ProviderRequest):
|
|
|
93
97
|
)
|
|
94
98
|
self._prompt_character_count = 0
|
|
95
99
|
self._candiates_character_count = 0
|
|
100
|
+
self._model_name: Optional[str] = None
|
|
96
101
|
|
|
97
102
|
@override
|
|
98
103
|
def process_request(self, instance: Any, extra_headers: 'dict[str, str]', args: Sequence[Any], kwargs: Any) -> bool:
|
|
99
104
|
from vertexai.generative_models import Content, Image, Part # type: ignore # noqa: F401 I001
|
|
100
105
|
|
|
106
|
+
# Try to extra the model name as a backup if the response does not provide it (older vertexai versions do not)
|
|
107
|
+
if instance and hasattr(instance, "_model_name"):
|
|
108
|
+
model = instance._model_name
|
|
109
|
+
if model and isinstance(model, str):
|
|
110
|
+
# Extract the model name after the last slash
|
|
111
|
+
self._model_name = model.split('/')[-1]
|
|
112
|
+
|
|
101
113
|
if not args:
|
|
102
114
|
return True
|
|
103
115
|
|
|
@@ -191,17 +203,26 @@ class _GoogleVertexRequest(_ProviderRequest):
|
|
|
191
203
|
# tool_config does not have to_dict or any other serializable object
|
|
192
204
|
prompt["tool_config"] = str(tool_config) # type: ignore
|
|
193
205
|
|
|
206
|
+
def _get_model_name(self, response: 'dict[str, Any]') -> Optional[str]:
|
|
207
|
+
model: Optional[str] = response.get("model_version", None)
|
|
208
|
+
if model:
|
|
209
|
+
return model
|
|
210
|
+
|
|
211
|
+
return self._model_name
|
|
212
|
+
|
|
194
213
|
@override
|
|
195
|
-
def process_chunk(self, chunk: Any) ->
|
|
214
|
+
def process_chunk(self, chunk: Any) -> _ChunkResult:
|
|
215
|
+
ingest = False
|
|
196
216
|
response_dict: dict[str, Any] = chunk.to_dict()
|
|
197
217
|
if "provider_response_id" not in self._ingest:
|
|
198
218
|
id = response_dict.get("response_id", None)
|
|
199
219
|
if id:
|
|
200
220
|
self._ingest["provider_response_id"] = id
|
|
201
221
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
222
|
+
if "resource" not in self._ingest:
|
|
223
|
+
model: Optional[str] = self._get_model_name(response_dict) # type: ignore[unreachable]
|
|
224
|
+
if model:
|
|
225
|
+
self._ingest["resource"] = "google." + model
|
|
205
226
|
|
|
206
227
|
for candidate in response_dict.get("candidates", []):
|
|
207
228
|
parts = candidate.get("content", {}).get("parts", [])
|
|
@@ -211,8 +232,9 @@ class _GoogleVertexRequest(_ProviderRequest):
|
|
|
211
232
|
usage = response_dict.get("usage_metadata", {})
|
|
212
233
|
if usage and "prompt_token_count" in usage and "candidates_token_count" in usage:
|
|
213
234
|
self._compute_usage(response_dict, streaming_candidates_characters=self._candiates_character_count)
|
|
235
|
+
ingest = True
|
|
214
236
|
|
|
215
|
-
return True
|
|
237
|
+
return _ChunkResult(send_chunk_to_caller=True, ingest=ingest)
|
|
216
238
|
|
|
217
239
|
@staticmethod
|
|
218
240
|
def _is_character_billing_model(model: str) -> bool:
|
|
@@ -230,7 +252,7 @@ class _GoogleVertexRequest(_ProviderRequest):
|
|
|
230
252
|
if id:
|
|
231
253
|
self._ingest["provider_response_id"] = id
|
|
232
254
|
|
|
233
|
-
model: Optional[str] =
|
|
255
|
+
model: Optional[str] = self._get_model_name(response_dict)
|
|
234
256
|
if model:
|
|
235
257
|
self._ingest["resource"] = "google." + model
|
|
236
258
|
|
|
@@ -256,7 +278,9 @@ class _GoogleVertexRequest(_ProviderRequest):
|
|
|
256
278
|
prompt_tokens_details: list[dict[str, Any]] = usage.get("prompt_tokens_details", [])
|
|
257
279
|
candidates_tokens_details: list[dict[str, Any]] = usage.get("candidates_tokens_details", [])
|
|
258
280
|
|
|
259
|
-
model: str =
|
|
281
|
+
model: Optional[str] = self._get_model_name(response_dict)
|
|
282
|
+
if not model:
|
|
283
|
+
model = ""
|
|
260
284
|
|
|
261
285
|
# for character billing only
|
|
262
286
|
large_context = "" if input < 128000 else "_large_context"
|