payi 0.1.0a79__tar.gz → 0.1.0a81__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.0a81/.release-please-manifest.json +3 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/CHANGELOG.md +16 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/PKG-INFO +1 -1
- {payi-0.1.0a79 → payi-0.1.0a81}/pyproject.toml +1 -1
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/_version.py +1 -1
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/lib/AnthropicInstrumentor.py +20 -13
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/lib/BedrockInstrumentor.py +16 -4
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/lib/GoogleGenAiInstrumentor.py +5 -2
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/lib/OpenAIInstrumentor.py +45 -28
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/lib/VertexInstrumentor.py +3 -2
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/lib/instrument.py +130 -22
- payi-0.1.0a79/.release-please-manifest.json +0 -3
- {payi-0.1.0a79 → payi-0.1.0a81}/.gitignore +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/CONTRIBUTING.md +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/LICENSE +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/README.md +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/SECURITY.md +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/api.md +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/bin/check-release-environment +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/bin/publish-pypi +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/examples/.keep +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/mypy.ini +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/noxfile.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/release-please-config.json +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/requirements-dev.lock +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/requirements.lock +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/__init__.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/_base_client.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/_client.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/_compat.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/_constants.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/_exceptions.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/_files.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/_models.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/_qs.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/_resource.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/_response.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/_streaming.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/_types.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/_utils/__init__.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/_utils/_logs.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/_utils/_proxy.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/_utils/_reflection.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/_utils/_resources_proxy.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/_utils/_streams.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/_utils/_sync.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/_utils/_transform.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/_utils/_typing.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/_utils/_utils.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/lib/.keep +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/lib/Stopwatch.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/lib/helpers.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/pagination.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/py.typed +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/resources/__init__.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/resources/categories/__init__.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/resources/categories/categories.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/resources/categories/resources.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/resources/experiences/__init__.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/resources/experiences/experiences.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/resources/experiences/properties.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/resources/experiences/types/__init__.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/resources/experiences/types/limit_config.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/resources/experiences/types/types.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/resources/ingest.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/resources/limits/__init__.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/resources/limits/limits.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/resources/limits/tags.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/resources/requests/__init__.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/resources/requests/properties.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/resources/requests/requests.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/resources/requests/result.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/resources/use_cases/__init__.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/resources/use_cases/definitions/__init__.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/resources/use_cases/definitions/definitions.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/resources/use_cases/definitions/kpis.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/resources/use_cases/definitions/limit_config.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/resources/use_cases/definitions/version.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/resources/use_cases/kpis.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/resources/use_cases/properties.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/resources/use_cases/use_cases.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/__init__.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/bulk_ingest_response.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/categories/__init__.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/categories/resource_create_params.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/categories/resource_list_params.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/category_delete_resource_response.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/category_delete_response.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/category_list_params.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/category_list_resources_params.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/category_resource_response.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/category_response.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/cost_data.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/cost_details.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/default_response.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/experience_instance_response.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/experiences/__init__.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/experiences/experience_type.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/experiences/property_create_params.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/experiences/type_create_params.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/experiences/type_list_params.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/experiences/type_update_params.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/experiences/types/__init__.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/experiences/types/limit_config_create_params.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/ingest_bulk_params.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/ingest_event_param.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/ingest_response.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/ingest_units_params.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/limit_create_params.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/limit_history_response.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/limit_list_params.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/limit_list_response.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/limit_reset_params.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/limit_response.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/limit_update_params.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/limits/__init__.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/limits/limit_tags.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/limits/tag_create_params.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/limits/tag_create_response.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/limits/tag_delete_response.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/limits/tag_list_response.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/limits/tag_remove_params.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/limits/tag_remove_response.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/limits/tag_update_params.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/limits/tag_update_response.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/pay_i_common_models_api_router_header_info_param.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/requests/__init__.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/requests/property_create_params.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/requests/request_result.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/requests_data.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/shared/__init__.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/shared/evaluation_response.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/shared/ingest_units.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/shared/pay_i_common_models_budget_management_cost_details_base.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/shared/pay_i_common_models_budget_management_create_limit_base.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/shared/properties_response.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/shared/xproxy_error.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/shared/xproxy_result.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/shared_params/__init__.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/shared_params/ingest_units.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/shared_params/pay_i_common_models_budget_management_create_limit_base.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/total_cost_data.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/use_case_instance_response.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/use_cases/__init__.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/use_cases/definition_create_params.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/use_cases/definition_list_params.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/use_cases/definition_update_params.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/use_cases/definitions/__init__.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/use_cases/definitions/kpi_create_params.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/use_cases/definitions/kpi_create_response.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/use_cases/definitions/kpi_delete_response.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/use_cases/definitions/kpi_list_params.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/use_cases/definitions/kpi_list_response.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/use_cases/definitions/kpi_retrieve_response.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/use_cases/definitions/kpi_update_params.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/use_cases/definitions/kpi_update_response.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/use_cases/definitions/limit_config_create_params.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/use_cases/kpi_create_params.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/use_cases/kpi_list_params.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/use_cases/kpi_list_response.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/use_cases/kpi_update_params.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/use_cases/property_create_params.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/src/payi/types/use_cases/use_case_definition.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/tests/__init__.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/tests/api_resources/__init__.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/tests/api_resources/categories/__init__.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/tests/api_resources/categories/test_resources.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/tests/api_resources/experiences/__init__.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/tests/api_resources/experiences/test_properties.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/tests/api_resources/experiences/test_types.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/tests/api_resources/experiences/types/__init__.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/tests/api_resources/experiences/types/test_limit_config.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/tests/api_resources/limits/__init__.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/tests/api_resources/limits/test_tags.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/tests/api_resources/requests/__init__.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/tests/api_resources/requests/test_properties.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/tests/api_resources/requests/test_result.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/tests/api_resources/test_categories.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/tests/api_resources/test_experiences.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/tests/api_resources/test_ingest.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/tests/api_resources/test_limits.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/tests/api_resources/test_use_cases.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/tests/api_resources/use_cases/__init__.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/tests/api_resources/use_cases/definitions/__init__.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/tests/api_resources/use_cases/definitions/test_kpis.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/tests/api_resources/use_cases/definitions/test_limit_config.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/tests/api_resources/use_cases/definitions/test_version.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/tests/api_resources/use_cases/test_definitions.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/tests/api_resources/use_cases/test_kpis.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/tests/api_resources/use_cases/test_properties.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/tests/conftest.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/tests/sample_file.txt +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/tests/test_client.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/tests/test_deepcopy.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/tests/test_extract_files.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/tests/test_files.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/tests/test_models.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/tests/test_qs.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/tests/test_required_args.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/tests/test_response.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/tests/test_streaming.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/tests/test_transform.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/tests/test_utils/test_proxy.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/tests/test_utils/test_typing.py +0 -0
- {payi-0.1.0a79 → payi-0.1.0a81}/tests/utils.py +0 -0
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.0-alpha.81 (2025-06-06)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.1.0-alpha.80...v0.1.0-alpha.81](https://github.com/Pay-i/pay-i-python/compare/v0.1.0-alpha.80...v0.1.0-alpha.81)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* logger support ([#312](https://github.com/Pay-i/pay-i-python/issues/312)) ([f353bb2](https://github.com/Pay-i/pay-i-python/commit/f353bb2cbc24d28114c3bd770a8243f8b115d1fc))
|
|
10
|
+
|
|
11
|
+
## 0.1.0-alpha.80 (2025-06-04)
|
|
12
|
+
|
|
13
|
+
Full Changelog: [v0.1.0-alpha.79...v0.1.0-alpha.80](https://github.com/Pay-i/pay-i-python/compare/v0.1.0-alpha.79...v0.1.0-alpha.80)
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* tiktoken fallback failure ([#310](https://github.com/Pay-i/pay-i-python/issues/310)) ([76f6a31](https://github.com/Pay-i/pay-i-python/commit/76f6a318f514da2dc5b4e9fbe7927cc6f28a7b27))
|
|
18
|
+
|
|
3
19
|
## 0.1.0-alpha.79 (2025-06-04)
|
|
4
20
|
|
|
5
21
|
Full Changelog: [v0.1.0-alpha.78...v0.1.0-alpha.79](https://github.com/Pay-i/pay-i-python/compare/v0.1.0-alpha.78...v0.1.0-alpha.79)
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import logging
|
|
2
1
|
from typing import Any, Union, Optional, Sequence
|
|
3
2
|
from typing_extensions import override
|
|
4
3
|
|
|
@@ -48,7 +47,7 @@ class AnthropicInstrumentor:
|
|
|
48
47
|
)
|
|
49
48
|
|
|
50
49
|
except Exception as e:
|
|
51
|
-
|
|
50
|
+
instrumentor._logger.debug(f"Error instrumenting anthropic: {e}")
|
|
52
51
|
return
|
|
53
52
|
|
|
54
53
|
|
|
@@ -60,6 +59,7 @@ def messages_wrapper(
|
|
|
60
59
|
*args: Any,
|
|
61
60
|
**kwargs: Any,
|
|
62
61
|
) -> Any:
|
|
62
|
+
instrumentor._logger.debug("Anthropic messages wrapper")
|
|
63
63
|
return instrumentor.invoke_wrapper(
|
|
64
64
|
_AnthropicProviderRequest(instrumentor=instrumentor, streaming_type=_StreamingType.iterator, instance=instance),
|
|
65
65
|
_IsStreaming.kwargs,
|
|
@@ -77,6 +77,7 @@ def stream_messages_wrapper(
|
|
|
77
77
|
*args: Any,
|
|
78
78
|
**kwargs: Any,
|
|
79
79
|
) -> Any:
|
|
80
|
+
instrumentor._logger.debug("Anthropic stream wrapper")
|
|
80
81
|
return instrumentor.invoke_wrapper(
|
|
81
82
|
_AnthropicProviderRequest(instrumentor=instrumentor, streaming_type=_StreamingType.stream_manager, instance=instance),
|
|
82
83
|
_IsStreaming.true,
|
|
@@ -94,6 +95,7 @@ async def amessages_wrapper(
|
|
|
94
95
|
*args: Any,
|
|
95
96
|
**kwargs: Any,
|
|
96
97
|
) -> Any:
|
|
98
|
+
instrumentor._logger.debug("aync Anthropic messages wrapper")
|
|
97
99
|
return await instrumentor.async_invoke_wrapper(
|
|
98
100
|
_AnthropicProviderRequest(instrumentor=instrumentor, streaming_type=_StreamingType.iterator, instance=instance),
|
|
99
101
|
_IsStreaming.kwargs,
|
|
@@ -111,6 +113,7 @@ async def astream_messages_wrapper(
|
|
|
111
113
|
*args: Any,
|
|
112
114
|
**kwargs: Any,
|
|
113
115
|
) -> Any:
|
|
116
|
+
instrumentor._logger.debug("aync Anthropic stream wrapper")
|
|
114
117
|
return await instrumentor.async_invoke_wrapper(
|
|
115
118
|
_AnthropicProviderRequest(instrumentor=instrumentor, streaming_type=_StreamingType.stream_manager, instance=instance),
|
|
116
119
|
_IsStreaming.true,
|
|
@@ -190,16 +193,20 @@ class _AnthropicProviderRequest(_ProviderRequest):
|
|
|
190
193
|
estimated_token_count = 0
|
|
191
194
|
has_image = False
|
|
192
195
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
196
|
+
try:
|
|
197
|
+
enc = tiktoken.get_encoding("cl100k_base")
|
|
198
|
+
for message in messages:
|
|
199
|
+
msg_has_image, msg_prompt_tokens = has_image_and_get_texts(enc, message.get('content', ''))
|
|
200
|
+
if msg_has_image:
|
|
201
|
+
has_image = True
|
|
202
|
+
estimated_token_count += msg_prompt_tokens
|
|
203
|
+
|
|
204
|
+
if has_image and estimated_token_count > 0:
|
|
205
|
+
self._estimated_prompt_tokens = estimated_token_count
|
|
206
|
+
|
|
207
|
+
except Exception:
|
|
208
|
+
self._instrumentor._logger.warning("Error getting encoding for cl100k_base")
|
|
209
|
+
|
|
203
210
|
return True
|
|
204
211
|
|
|
205
212
|
@override
|
|
@@ -229,7 +236,7 @@ class _AnthropicProviderRequest(_ProviderRequest):
|
|
|
229
236
|
self._ingest["provider_response_json"] = text
|
|
230
237
|
|
|
231
238
|
except Exception as e:
|
|
232
|
-
|
|
239
|
+
self._instrumentor._logger.debug(f"Error processing exception: {e}")
|
|
233
240
|
return False
|
|
234
241
|
|
|
235
242
|
return True
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import os
|
|
2
2
|
import json
|
|
3
|
-
import logging
|
|
4
3
|
from typing import Any, Sequence
|
|
5
4
|
from functools import wraps
|
|
6
5
|
from typing_extensions import override
|
|
@@ -38,12 +37,13 @@ class BedrockInstrumentor:
|
|
|
38
37
|
)
|
|
39
38
|
|
|
40
39
|
except Exception as e:
|
|
41
|
-
|
|
40
|
+
instrumentor._logger.debug(f"Error instrumenting bedrock: {e}")
|
|
42
41
|
return
|
|
43
42
|
|
|
44
43
|
@_PayiInstrumentor.payi_wrapper
|
|
45
44
|
def create_client_wrapper(instrumentor: _PayiInstrumentor, wrapped: Any, instance: Any, *args: Any, **kwargs: Any) -> Any: # noqa: ARG001
|
|
46
45
|
if kwargs.get("service_name") != "bedrock-runtime":
|
|
46
|
+
instrumentor._logger.debug(f"skipping client wrapper creation for {kwargs.get('service_name', '')} service")
|
|
47
47
|
return wrapped(*args, **kwargs)
|
|
48
48
|
|
|
49
49
|
try:
|
|
@@ -53,13 +53,16 @@ def create_client_wrapper(instrumentor: _PayiInstrumentor, wrapped: Any, instanc
|
|
|
53
53
|
client.converse = wrap_converse(instrumentor, client.converse)
|
|
54
54
|
client.converse_stream = wrap_converse_stream(instrumentor, client.converse_stream)
|
|
55
55
|
|
|
56
|
+
instrumentor._logger.debug(f"Instrumented bedrock client")
|
|
57
|
+
|
|
56
58
|
if BedrockInstrumentor._instrumentor._proxy_default:
|
|
57
59
|
# Register client callbacks to handle the Pay-i extra_headers parameter in the inference calls and redirect the request to the Pay-i endpoint
|
|
58
60
|
_register_bedrock_client_callbacks(client)
|
|
61
|
+
instrumentor._logger.debug(f"Registered bedrock client callbaks for proxy")
|
|
59
62
|
|
|
60
63
|
return client
|
|
61
64
|
except Exception as e:
|
|
62
|
-
|
|
65
|
+
instrumentor._logger.debug(f"Error instrumenting bedrock client: {e}")
|
|
63
66
|
|
|
64
67
|
return wrapped(*args, **kwargs)
|
|
65
68
|
|
|
@@ -148,6 +151,7 @@ def wrap_invoke(instrumentor: _PayiInstrumentor, wrapped: Any) -> Any:
|
|
|
148
151
|
modelId:str = kwargs.get("modelId", "") # type: ignore
|
|
149
152
|
|
|
150
153
|
if _is_supported_model(modelId):
|
|
154
|
+
instrumentor._logger.debug(f"bedrock invoke wrapper, modelId: {modelId}")
|
|
151
155
|
return instrumentor.invoke_wrapper(
|
|
152
156
|
_BedrockInvokeSynchronousProviderRequest(instrumentor=instrumentor),
|
|
153
157
|
_IsStreaming.false,
|
|
@@ -156,6 +160,8 @@ def wrap_invoke(instrumentor: _PayiInstrumentor, wrapped: Any) -> Any:
|
|
|
156
160
|
args,
|
|
157
161
|
kwargs,
|
|
158
162
|
)
|
|
163
|
+
|
|
164
|
+
instrumentor._logger.debug(f"bedrock invoke wrapper, unsupported modelId: {modelId}")
|
|
159
165
|
return wrapped(*args, **kwargs)
|
|
160
166
|
|
|
161
167
|
return invoke_wrapper
|
|
@@ -166,6 +172,7 @@ def wrap_invoke_stream(instrumentor: _PayiInstrumentor, wrapped: Any) -> Any:
|
|
|
166
172
|
modelId: str = kwargs.get("modelId", "") # type: ignore
|
|
167
173
|
|
|
168
174
|
if _is_supported_model(modelId):
|
|
175
|
+
instrumentor._logger.debug(f"bedrock invoke stream wrapper, modelId: {modelId}")
|
|
169
176
|
return instrumentor.invoke_wrapper(
|
|
170
177
|
_BedrockInvokeStreamingProviderRequest(instrumentor=instrumentor, model_id=modelId),
|
|
171
178
|
_IsStreaming.true,
|
|
@@ -174,6 +181,7 @@ def wrap_invoke_stream(instrumentor: _PayiInstrumentor, wrapped: Any) -> Any:
|
|
|
174
181
|
args,
|
|
175
182
|
kwargs,
|
|
176
183
|
)
|
|
184
|
+
instrumentor._logger.debug(f"bedrock invoke stream wrapper, unsupported modelId: {modelId}")
|
|
177
185
|
return wrapped(*args, **kwargs)
|
|
178
186
|
|
|
179
187
|
return invoke_wrapper
|
|
@@ -184,6 +192,7 @@ def wrap_converse(instrumentor: _PayiInstrumentor, wrapped: Any) -> Any:
|
|
|
184
192
|
modelId:str = kwargs.get("modelId", "") # type: ignore
|
|
185
193
|
|
|
186
194
|
if _is_supported_model(modelId):
|
|
195
|
+
instrumentor._logger.debug(f"bedrock converse wrapper, modelId: {modelId}")
|
|
187
196
|
return instrumentor.invoke_wrapper(
|
|
188
197
|
_BedrockConverseSynchronousProviderRequest(instrumentor=instrumentor),
|
|
189
198
|
_IsStreaming.false,
|
|
@@ -192,6 +201,7 @@ def wrap_converse(instrumentor: _PayiInstrumentor, wrapped: Any) -> Any:
|
|
|
192
201
|
args,
|
|
193
202
|
kwargs,
|
|
194
203
|
)
|
|
204
|
+
instrumentor._logger.debug(f"bedrock converse wrapper, unsupported modelId: {modelId}")
|
|
195
205
|
return wrapped(*args, **kwargs)
|
|
196
206
|
|
|
197
207
|
return invoke_wrapper
|
|
@@ -202,6 +212,7 @@ def wrap_converse_stream(instrumentor: _PayiInstrumentor, wrapped: Any) -> Any:
|
|
|
202
212
|
modelId: str = kwargs.get("modelId", "") # type: ignore
|
|
203
213
|
|
|
204
214
|
if _is_supported_model(modelId):
|
|
215
|
+
instrumentor._logger.debug(f"bedrock converse stream wrapper, modelId: {modelId}")
|
|
205
216
|
return instrumentor.invoke_wrapper(
|
|
206
217
|
_BedrockConverseStreamingProviderRequest(instrumentor=instrumentor),
|
|
207
218
|
_IsStreaming.true,
|
|
@@ -210,6 +221,7 @@ def wrap_converse_stream(instrumentor: _PayiInstrumentor, wrapped: Any) -> Any:
|
|
|
210
221
|
args,
|
|
211
222
|
kwargs,
|
|
212
223
|
)
|
|
224
|
+
instrumentor._logger.debug(f"bedrock converse stream wrapper, unsupported modelId: {modelId}")
|
|
213
225
|
return wrapped(*args, **kwargs)
|
|
214
226
|
|
|
215
227
|
return invoke_wrapper
|
|
@@ -251,7 +263,7 @@ class _BedrockProviderRequest(_ProviderRequest):
|
|
|
251
263
|
return True
|
|
252
264
|
|
|
253
265
|
except Exception as e:
|
|
254
|
-
|
|
266
|
+
self._instrumentor._logger.debug(f"Error processing exception: {e}")
|
|
255
267
|
return False
|
|
256
268
|
|
|
257
269
|
class _BedrockInvokeStreamingProviderRequest(_BedrockProviderRequest):
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import json
|
|
2
2
|
import math
|
|
3
|
-
import logging
|
|
4
3
|
from typing import Any, List, Union, Optional, Sequence
|
|
5
4
|
from typing_extensions import override
|
|
6
5
|
|
|
@@ -41,7 +40,7 @@ class GoogleGenAiInstrumentor:
|
|
|
41
40
|
)
|
|
42
41
|
|
|
43
42
|
except Exception as e:
|
|
44
|
-
|
|
43
|
+
instrumentor._logger.debug(f"Error instrumenting vertex: {e}")
|
|
45
44
|
return
|
|
46
45
|
|
|
47
46
|
@_PayiInstrumentor.payi_wrapper
|
|
@@ -52,6 +51,7 @@ def generate_wrapper(
|
|
|
52
51
|
*args: Any,
|
|
53
52
|
**kwargs: Any,
|
|
54
53
|
) -> Any:
|
|
54
|
+
instrumentor._logger.debug("genai generate_content wrapper")
|
|
55
55
|
return instrumentor.invoke_wrapper(
|
|
56
56
|
_GoogleGenAiRequest(instrumentor),
|
|
57
57
|
_IsStreaming.false,
|
|
@@ -69,6 +69,7 @@ def generate_stream_wrapper(
|
|
|
69
69
|
*args: Any,
|
|
70
70
|
**kwargs: Any,
|
|
71
71
|
) -> Any:
|
|
72
|
+
instrumentor._logger.debug("genai generate_content_stream wrapper")
|
|
72
73
|
return instrumentor.invoke_wrapper(
|
|
73
74
|
_GoogleGenAiRequest(instrumentor),
|
|
74
75
|
_IsStreaming.true,
|
|
@@ -86,6 +87,7 @@ async def agenerate_wrapper(
|
|
|
86
87
|
*args: Any,
|
|
87
88
|
**kwargs: Any,
|
|
88
89
|
) -> Any:
|
|
90
|
+
instrumentor._logger.debug("async genai generate_content wrapper")
|
|
89
91
|
return await instrumentor.async_invoke_wrapper(
|
|
90
92
|
_GoogleGenAiRequest(instrumentor),
|
|
91
93
|
_IsStreaming.false,
|
|
@@ -103,6 +105,7 @@ async def agenerate_stream_wrapper(
|
|
|
103
105
|
*args: Any,
|
|
104
106
|
**kwargs: Any,
|
|
105
107
|
) -> Any:
|
|
108
|
+
instrumentor._logger.debug("async genai generate_content_stream wrapper")
|
|
106
109
|
return await instrumentor.async_invoke_wrapper(
|
|
107
110
|
_GoogleGenAiRequest(instrumentor),
|
|
108
111
|
_IsStreaming.true,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import json
|
|
2
|
-
import logging
|
|
3
2
|
from typing import Any, Union, Optional, Sequence
|
|
4
3
|
from typing_extensions import override
|
|
5
4
|
from importlib.metadata import version
|
|
@@ -62,7 +61,7 @@ class OpenAiInstrumentor:
|
|
|
62
61
|
)
|
|
63
62
|
|
|
64
63
|
except Exception as e:
|
|
65
|
-
|
|
64
|
+
instrumentor._logger.debug(f"Error instrumenting openai: {e}")
|
|
66
65
|
return
|
|
67
66
|
|
|
68
67
|
|
|
@@ -74,6 +73,7 @@ def embeddings_wrapper(
|
|
|
74
73
|
*args: Any,
|
|
75
74
|
**kwargs: Any,
|
|
76
75
|
) -> Any:
|
|
76
|
+
instrumentor._logger.debug("OpenAI Embeddings wrapper")
|
|
77
77
|
return instrumentor.invoke_wrapper(
|
|
78
78
|
_OpenAiEmbeddingsProviderRequest(instrumentor),
|
|
79
79
|
_IsStreaming.false,
|
|
@@ -91,6 +91,7 @@ async def aembeddings_wrapper(
|
|
|
91
91
|
*args: Any,
|
|
92
92
|
**kwargs: Any,
|
|
93
93
|
) -> Any:
|
|
94
|
+
instrumentor._logger.debug("async OpenAI Embeddings wrapper")
|
|
94
95
|
return await instrumentor.async_invoke_wrapper(
|
|
95
96
|
_OpenAiEmbeddingsProviderRequest(instrumentor),
|
|
96
97
|
_IsStreaming.false,
|
|
@@ -108,6 +109,7 @@ def chat_wrapper(
|
|
|
108
109
|
*args: Any,
|
|
109
110
|
**kwargs: Any,
|
|
110
111
|
) -> Any:
|
|
112
|
+
instrumentor._logger.debug("OpenAI completions wrapper")
|
|
111
113
|
return instrumentor.invoke_wrapper(
|
|
112
114
|
_OpenAiChatProviderRequest(instrumentor),
|
|
113
115
|
_IsStreaming.kwargs,
|
|
@@ -125,6 +127,7 @@ async def achat_wrapper(
|
|
|
125
127
|
*args: Any,
|
|
126
128
|
**kwargs: Any,
|
|
127
129
|
) -> Any:
|
|
130
|
+
instrumentor._logger.debug("async OpenAI completions wrapper")
|
|
128
131
|
return await instrumentor.async_invoke_wrapper(
|
|
129
132
|
_OpenAiChatProviderRequest(instrumentor),
|
|
130
133
|
_IsStreaming.kwargs,
|
|
@@ -142,6 +145,7 @@ def responses_wrapper(
|
|
|
142
145
|
*args: Any,
|
|
143
146
|
**kwargs: Any,
|
|
144
147
|
) -> Any:
|
|
148
|
+
instrumentor._logger.debug("OpenAI responses wrapper")
|
|
145
149
|
return instrumentor.invoke_wrapper(
|
|
146
150
|
_OpenAiResponsesProviderRequest(instrumentor),
|
|
147
151
|
_IsStreaming.kwargs,
|
|
@@ -159,6 +163,7 @@ async def aresponses_wrapper(
|
|
|
159
163
|
*args: Any,
|
|
160
164
|
**kwargs: Any,
|
|
161
165
|
) -> Any:
|
|
166
|
+
instrumentor._logger.debug("async OpenAI responses wrapper")
|
|
162
167
|
return await instrumentor.async_invoke_wrapper(
|
|
163
168
|
_OpenAiResponsesProviderRequest(instrumentor),
|
|
164
169
|
_IsStreaming.kwargs,
|
|
@@ -207,12 +212,12 @@ class _OpenAiProviderRequest(_ProviderRequest):
|
|
|
207
212
|
del extra_headers[PayiHeaderNames.resource_scope]
|
|
208
213
|
|
|
209
214
|
if not price_as_resource and not price_as_category:
|
|
210
|
-
|
|
215
|
+
self._instrumentor._logger.error("Azure OpenAI requires price as resource and/or category to be specified, not ingesting")
|
|
211
216
|
return False
|
|
212
217
|
|
|
213
218
|
if resource_scope:
|
|
214
219
|
if not(resource_scope in ["global", "datazone"] or resource_scope.startswith("region")):
|
|
215
|
-
|
|
220
|
+
self._instrumentor._logger.error("Azure OpenAI invalid resource scope, not ingesting")
|
|
216
221
|
return False
|
|
217
222
|
|
|
218
223
|
self._ingest["resource_scope"] = resource_scope
|
|
@@ -256,7 +261,7 @@ class _OpenAiProviderRequest(_ProviderRequest):
|
|
|
256
261
|
self._ingest["provider_response_json"] = text
|
|
257
262
|
|
|
258
263
|
except Exception as e:
|
|
259
|
-
|
|
264
|
+
self._instrumentor._logger.debug(f"Error processing exception: {e}")
|
|
260
265
|
return False
|
|
261
266
|
|
|
262
267
|
return True
|
|
@@ -364,20 +369,26 @@ class _OpenAiChatProviderRequest(_OpenAiProviderRequest):
|
|
|
364
369
|
if messages:
|
|
365
370
|
estimated_token_count = 0
|
|
366
371
|
has_image = False
|
|
372
|
+
enc: Optional[tiktoken.Encoding] = None
|
|
367
373
|
|
|
368
374
|
try:
|
|
369
375
|
enc = tiktoken.encoding_for_model(kwargs.get("model")) # type: ignore
|
|
370
|
-
except
|
|
371
|
-
|
|
376
|
+
except Exception:
|
|
377
|
+
try:
|
|
378
|
+
enc = tiktoken.get_encoding("o200k_base") # type: ignore
|
|
379
|
+
except Exception:
|
|
380
|
+
self._instrumentor._logger.warning("Error getting encoding for fallback o200k_base")
|
|
381
|
+
enc = None
|
|
372
382
|
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
383
|
+
if enc:
|
|
384
|
+
for message in messages:
|
|
385
|
+
msg_has_image, msg_prompt_tokens = self.has_image_and_get_texts(enc, message.get('content', ''))
|
|
386
|
+
if msg_has_image:
|
|
387
|
+
has_image = True
|
|
388
|
+
estimated_token_count += msg_prompt_tokens
|
|
378
389
|
|
|
379
|
-
|
|
380
|
-
|
|
390
|
+
if has_image and estimated_token_count > 0:
|
|
391
|
+
self._estimated_prompt_tokens = estimated_token_count
|
|
381
392
|
|
|
382
393
|
stream: bool = kwargs.get("stream", False)
|
|
383
394
|
if stream:
|
|
@@ -436,11 +447,16 @@ class _OpenAiResponsesProviderRequest(_OpenAiProviderRequest):
|
|
|
436
447
|
|
|
437
448
|
estimated_token_count = 0
|
|
438
449
|
has_image = False
|
|
450
|
+
enc: Optional[tiktoken.Encoding] = None
|
|
439
451
|
|
|
440
452
|
try:
|
|
441
453
|
enc = tiktoken.encoding_for_model(kwargs.get("model")) # type: ignore
|
|
442
|
-
except
|
|
443
|
-
|
|
454
|
+
except Exception:
|
|
455
|
+
try:
|
|
456
|
+
enc = tiktoken.get_encoding("o200k_base") # type: ignore
|
|
457
|
+
except Exception:
|
|
458
|
+
self._instrumentor._logger.warning("Error getting encoding for fallback o200k_base")
|
|
459
|
+
enc = None
|
|
444
460
|
|
|
445
461
|
# find each content..type="input_text" and count tokens
|
|
446
462
|
# input=[{
|
|
@@ -456,18 +472,19 @@ class _OpenAiResponsesProviderRequest(_OpenAiProviderRequest):
|
|
|
456
472
|
# },
|
|
457
473
|
# ],
|
|
458
474
|
# }]
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
if
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
475
|
+
if enc:
|
|
476
|
+
for item in input: # type: ignore
|
|
477
|
+
if isinstance(item, dict):
|
|
478
|
+
for key, value in item.items(): # type: ignore
|
|
479
|
+
if key == "content":
|
|
480
|
+
if isinstance(value, list):
|
|
481
|
+
msg_has_image, msg_prompt_tokens = self.has_image_and_get_texts(enc, value, image_type="input_image", text_type="input_text") # type: ignore
|
|
482
|
+
if msg_has_image:
|
|
483
|
+
has_image = True
|
|
484
|
+
estimated_token_count += msg_prompt_tokens
|
|
485
|
+
|
|
486
|
+
if has_image and estimated_token_count > 0:
|
|
487
|
+
self._estimated_prompt_tokens = estimated_token_count
|
|
471
488
|
|
|
472
489
|
return True
|
|
473
490
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import json
|
|
2
2
|
import math
|
|
3
|
-
import logging
|
|
4
3
|
from typing import Any, List, Union, Optional, Sequence
|
|
5
4
|
from typing_extensions import override
|
|
6
5
|
|
|
@@ -43,7 +42,7 @@ class VertexInstrumentor:
|
|
|
43
42
|
)
|
|
44
43
|
|
|
45
44
|
except Exception as e:
|
|
46
|
-
|
|
45
|
+
instrumentor._logger.debug(f"Error instrumenting vertex: {e}")
|
|
47
46
|
return
|
|
48
47
|
|
|
49
48
|
@_PayiInstrumentor.payi_wrapper
|
|
@@ -54,6 +53,7 @@ def generate_wrapper(
|
|
|
54
53
|
*args: Any,
|
|
55
54
|
**kwargs: Any,
|
|
56
55
|
) -> Any:
|
|
56
|
+
instrumentor._logger.debug("vertexai generate_content wrapper")
|
|
57
57
|
return instrumentor.invoke_wrapper(
|
|
58
58
|
_GoogleVertexRequest(instrumentor),
|
|
59
59
|
_IsStreaming.kwargs,
|
|
@@ -71,6 +71,7 @@ async def agenerate_wrapper(
|
|
|
71
71
|
*args: Any,
|
|
72
72
|
**kwargs: Any,
|
|
73
73
|
) -> Any:
|
|
74
|
+
instrumentor._logger.debug("async vertexai generate_content wrapper")
|
|
74
75
|
return await instrumentor.async_invoke_wrapper(
|
|
75
76
|
_GoogleVertexRequest(instrumentor),
|
|
76
77
|
_IsStreaming.kwargs,
|