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.

Files changed (205) hide show
  1. payi-0.1.0a83/.release-please-manifest.json +3 -0
  2. {payi-0.1.0a82 → payi-0.1.0a83}/CHANGELOG.md +8 -0
  3. {payi-0.1.0a82 → payi-0.1.0a83}/PKG-INFO +1 -1
  4. {payi-0.1.0a82 → payi-0.1.0a83}/pyproject.toml +1 -1
  5. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/_version.py +1 -1
  6. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/lib/AnthropicInstrumentor.py +10 -3
  7. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/lib/BedrockInstrumentor.py +16 -11
  8. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/lib/GoogleGenAiInstrumentor.py +5 -3
  9. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/lib/OpenAIInstrumentor.py +13 -9
  10. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/lib/VertexInstrumentor.py +40 -16
  11. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/lib/instrument.py +119 -64
  12. payi-0.1.0a82/.release-please-manifest.json +0 -3
  13. {payi-0.1.0a82 → payi-0.1.0a83}/.gitignore +0 -0
  14. {payi-0.1.0a82 → payi-0.1.0a83}/CONTRIBUTING.md +0 -0
  15. {payi-0.1.0a82 → payi-0.1.0a83}/LICENSE +0 -0
  16. {payi-0.1.0a82 → payi-0.1.0a83}/README.md +0 -0
  17. {payi-0.1.0a82 → payi-0.1.0a83}/SECURITY.md +0 -0
  18. {payi-0.1.0a82 → payi-0.1.0a83}/api.md +0 -0
  19. {payi-0.1.0a82 → payi-0.1.0a83}/bin/check-release-environment +0 -0
  20. {payi-0.1.0a82 → payi-0.1.0a83}/bin/publish-pypi +0 -0
  21. {payi-0.1.0a82 → payi-0.1.0a83}/examples/.keep +0 -0
  22. {payi-0.1.0a82 → payi-0.1.0a83}/mypy.ini +0 -0
  23. {payi-0.1.0a82 → payi-0.1.0a83}/noxfile.py +0 -0
  24. {payi-0.1.0a82 → payi-0.1.0a83}/release-please-config.json +0 -0
  25. {payi-0.1.0a82 → payi-0.1.0a83}/requirements-dev.lock +0 -0
  26. {payi-0.1.0a82 → payi-0.1.0a83}/requirements.lock +0 -0
  27. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/__init__.py +0 -0
  28. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/_base_client.py +0 -0
  29. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/_client.py +0 -0
  30. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/_compat.py +0 -0
  31. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/_constants.py +0 -0
  32. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/_exceptions.py +0 -0
  33. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/_files.py +0 -0
  34. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/_models.py +0 -0
  35. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/_qs.py +0 -0
  36. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/_resource.py +0 -0
  37. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/_response.py +0 -0
  38. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/_streaming.py +0 -0
  39. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/_types.py +0 -0
  40. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/_utils/__init__.py +0 -0
  41. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/_utils/_logs.py +0 -0
  42. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/_utils/_proxy.py +0 -0
  43. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/_utils/_reflection.py +0 -0
  44. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/_utils/_resources_proxy.py +0 -0
  45. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/_utils/_streams.py +0 -0
  46. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/_utils/_sync.py +0 -0
  47. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/_utils/_transform.py +0 -0
  48. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/_utils/_typing.py +0 -0
  49. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/_utils/_utils.py +0 -0
  50. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/lib/.keep +0 -0
  51. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/lib/Stopwatch.py +0 -0
  52. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/lib/helpers.py +0 -0
  53. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/pagination.py +0 -0
  54. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/py.typed +0 -0
  55. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/resources/__init__.py +0 -0
  56. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/resources/categories/__init__.py +0 -0
  57. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/resources/categories/categories.py +0 -0
  58. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/resources/categories/resources.py +0 -0
  59. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/resources/experiences/__init__.py +0 -0
  60. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/resources/experiences/experiences.py +0 -0
  61. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/resources/experiences/properties.py +0 -0
  62. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/resources/experiences/types/__init__.py +0 -0
  63. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/resources/experiences/types/limit_config.py +0 -0
  64. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/resources/experiences/types/types.py +0 -0
  65. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/resources/ingest.py +0 -0
  66. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/resources/limits/__init__.py +0 -0
  67. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/resources/limits/limits.py +0 -0
  68. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/resources/limits/tags.py +0 -0
  69. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/resources/requests/__init__.py +0 -0
  70. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/resources/requests/properties.py +0 -0
  71. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/resources/requests/requests.py +0 -0
  72. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/resources/requests/result.py +0 -0
  73. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/resources/use_cases/__init__.py +0 -0
  74. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/resources/use_cases/definitions/__init__.py +0 -0
  75. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/resources/use_cases/definitions/definitions.py +0 -0
  76. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/resources/use_cases/definitions/kpis.py +0 -0
  77. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/resources/use_cases/definitions/limit_config.py +0 -0
  78. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/resources/use_cases/definitions/version.py +0 -0
  79. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/resources/use_cases/kpis.py +0 -0
  80. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/resources/use_cases/properties.py +0 -0
  81. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/resources/use_cases/use_cases.py +0 -0
  82. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/__init__.py +0 -0
  83. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/bulk_ingest_response.py +0 -0
  84. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/categories/__init__.py +0 -0
  85. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/categories/resource_create_params.py +0 -0
  86. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/categories/resource_list_params.py +0 -0
  87. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/category_delete_resource_response.py +0 -0
  88. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/category_delete_response.py +0 -0
  89. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/category_list_params.py +0 -0
  90. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/category_list_resources_params.py +0 -0
  91. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/category_resource_response.py +0 -0
  92. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/category_response.py +0 -0
  93. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/cost_data.py +0 -0
  94. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/cost_details.py +0 -0
  95. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/default_response.py +0 -0
  96. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/experience_instance_response.py +0 -0
  97. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/experiences/__init__.py +0 -0
  98. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/experiences/experience_type.py +0 -0
  99. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/experiences/property_create_params.py +0 -0
  100. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/experiences/type_create_params.py +0 -0
  101. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/experiences/type_list_params.py +0 -0
  102. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/experiences/type_update_params.py +0 -0
  103. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/experiences/types/__init__.py +0 -0
  104. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/experiences/types/limit_config_create_params.py +0 -0
  105. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/ingest_bulk_params.py +0 -0
  106. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/ingest_event_param.py +0 -0
  107. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/ingest_response.py +0 -0
  108. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/ingest_units_params.py +0 -0
  109. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/limit_create_params.py +0 -0
  110. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/limit_history_response.py +0 -0
  111. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/limit_list_params.py +0 -0
  112. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/limit_list_response.py +0 -0
  113. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/limit_reset_params.py +0 -0
  114. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/limit_response.py +0 -0
  115. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/limit_update_params.py +0 -0
  116. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/limits/__init__.py +0 -0
  117. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/limits/limit_tags.py +0 -0
  118. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/limits/tag_create_params.py +0 -0
  119. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/limits/tag_create_response.py +0 -0
  120. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/limits/tag_delete_response.py +0 -0
  121. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/limits/tag_list_response.py +0 -0
  122. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/limits/tag_remove_params.py +0 -0
  123. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/limits/tag_remove_response.py +0 -0
  124. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/limits/tag_update_params.py +0 -0
  125. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/limits/tag_update_response.py +0 -0
  126. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/pay_i_common_models_api_router_header_info_param.py +0 -0
  127. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/requests/__init__.py +0 -0
  128. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/requests/property_create_params.py +0 -0
  129. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/requests/request_result.py +0 -0
  130. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/requests_data.py +0 -0
  131. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/shared/__init__.py +0 -0
  132. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/shared/evaluation_response.py +0 -0
  133. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/shared/ingest_units.py +0 -0
  134. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/shared/pay_i_common_models_budget_management_cost_details_base.py +0 -0
  135. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/shared/pay_i_common_models_budget_management_create_limit_base.py +0 -0
  136. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/shared/properties_response.py +0 -0
  137. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/shared/xproxy_error.py +0 -0
  138. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/shared/xproxy_result.py +0 -0
  139. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/shared_params/__init__.py +0 -0
  140. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/shared_params/ingest_units.py +0 -0
  141. {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
  142. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/total_cost_data.py +0 -0
  143. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/use_case_instance_response.py +0 -0
  144. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/use_cases/__init__.py +0 -0
  145. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/use_cases/definition_create_params.py +0 -0
  146. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/use_cases/definition_list_params.py +0 -0
  147. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/use_cases/definition_update_params.py +0 -0
  148. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/use_cases/definitions/__init__.py +0 -0
  149. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/use_cases/definitions/kpi_create_params.py +0 -0
  150. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/use_cases/definitions/kpi_create_response.py +0 -0
  151. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/use_cases/definitions/kpi_delete_response.py +0 -0
  152. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/use_cases/definitions/kpi_list_params.py +0 -0
  153. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/use_cases/definitions/kpi_list_response.py +0 -0
  154. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/use_cases/definitions/kpi_retrieve_response.py +0 -0
  155. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/use_cases/definitions/kpi_update_params.py +0 -0
  156. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/use_cases/definitions/kpi_update_response.py +0 -0
  157. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/use_cases/definitions/limit_config_create_params.py +0 -0
  158. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/use_cases/kpi_create_params.py +0 -0
  159. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/use_cases/kpi_list_params.py +0 -0
  160. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/use_cases/kpi_list_response.py +0 -0
  161. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/use_cases/kpi_update_params.py +0 -0
  162. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/use_cases/property_create_params.py +0 -0
  163. {payi-0.1.0a82 → payi-0.1.0a83}/src/payi/types/use_cases/use_case_definition.py +0 -0
  164. {payi-0.1.0a82 → payi-0.1.0a83}/tests/__init__.py +0 -0
  165. {payi-0.1.0a82 → payi-0.1.0a83}/tests/api_resources/__init__.py +0 -0
  166. {payi-0.1.0a82 → payi-0.1.0a83}/tests/api_resources/categories/__init__.py +0 -0
  167. {payi-0.1.0a82 → payi-0.1.0a83}/tests/api_resources/categories/test_resources.py +0 -0
  168. {payi-0.1.0a82 → payi-0.1.0a83}/tests/api_resources/experiences/__init__.py +0 -0
  169. {payi-0.1.0a82 → payi-0.1.0a83}/tests/api_resources/experiences/test_properties.py +0 -0
  170. {payi-0.1.0a82 → payi-0.1.0a83}/tests/api_resources/experiences/test_types.py +0 -0
  171. {payi-0.1.0a82 → payi-0.1.0a83}/tests/api_resources/experiences/types/__init__.py +0 -0
  172. {payi-0.1.0a82 → payi-0.1.0a83}/tests/api_resources/experiences/types/test_limit_config.py +0 -0
  173. {payi-0.1.0a82 → payi-0.1.0a83}/tests/api_resources/limits/__init__.py +0 -0
  174. {payi-0.1.0a82 → payi-0.1.0a83}/tests/api_resources/limits/test_tags.py +0 -0
  175. {payi-0.1.0a82 → payi-0.1.0a83}/tests/api_resources/requests/__init__.py +0 -0
  176. {payi-0.1.0a82 → payi-0.1.0a83}/tests/api_resources/requests/test_properties.py +0 -0
  177. {payi-0.1.0a82 → payi-0.1.0a83}/tests/api_resources/requests/test_result.py +0 -0
  178. {payi-0.1.0a82 → payi-0.1.0a83}/tests/api_resources/test_categories.py +0 -0
  179. {payi-0.1.0a82 → payi-0.1.0a83}/tests/api_resources/test_experiences.py +0 -0
  180. {payi-0.1.0a82 → payi-0.1.0a83}/tests/api_resources/test_ingest.py +0 -0
  181. {payi-0.1.0a82 → payi-0.1.0a83}/tests/api_resources/test_limits.py +0 -0
  182. {payi-0.1.0a82 → payi-0.1.0a83}/tests/api_resources/test_use_cases.py +0 -0
  183. {payi-0.1.0a82 → payi-0.1.0a83}/tests/api_resources/use_cases/__init__.py +0 -0
  184. {payi-0.1.0a82 → payi-0.1.0a83}/tests/api_resources/use_cases/definitions/__init__.py +0 -0
  185. {payi-0.1.0a82 → payi-0.1.0a83}/tests/api_resources/use_cases/definitions/test_kpis.py +0 -0
  186. {payi-0.1.0a82 → payi-0.1.0a83}/tests/api_resources/use_cases/definitions/test_limit_config.py +0 -0
  187. {payi-0.1.0a82 → payi-0.1.0a83}/tests/api_resources/use_cases/definitions/test_version.py +0 -0
  188. {payi-0.1.0a82 → payi-0.1.0a83}/tests/api_resources/use_cases/test_definitions.py +0 -0
  189. {payi-0.1.0a82 → payi-0.1.0a83}/tests/api_resources/use_cases/test_kpis.py +0 -0
  190. {payi-0.1.0a82 → payi-0.1.0a83}/tests/api_resources/use_cases/test_properties.py +0 -0
  191. {payi-0.1.0a82 → payi-0.1.0a83}/tests/conftest.py +0 -0
  192. {payi-0.1.0a82 → payi-0.1.0a83}/tests/sample_file.txt +0 -0
  193. {payi-0.1.0a82 → payi-0.1.0a83}/tests/test_client.py +0 -0
  194. {payi-0.1.0a82 → payi-0.1.0a83}/tests/test_deepcopy.py +0 -0
  195. {payi-0.1.0a82 → payi-0.1.0a83}/tests/test_extract_files.py +0 -0
  196. {payi-0.1.0a82 → payi-0.1.0a83}/tests/test_files.py +0 -0
  197. {payi-0.1.0a82 → payi-0.1.0a83}/tests/test_models.py +0 -0
  198. {payi-0.1.0a82 → payi-0.1.0a83}/tests/test_qs.py +0 -0
  199. {payi-0.1.0a82 → payi-0.1.0a83}/tests/test_required_args.py +0 -0
  200. {payi-0.1.0a82 → payi-0.1.0a83}/tests/test_response.py +0 -0
  201. {payi-0.1.0a82 → payi-0.1.0a83}/tests/test_streaming.py +0 -0
  202. {payi-0.1.0a82 → payi-0.1.0a83}/tests/test_transform.py +0 -0
  203. {payi-0.1.0a82 → payi-0.1.0a83}/tests/test_utils/test_proxy.py +0 -0
  204. {payi-0.1.0a82 → payi-0.1.0a83}/tests/test_utils/test_typing.py +0 -0
  205. {payi-0.1.0a82 → payi-0.1.0a83}/tests/utils.py +0 -0
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "0.1.0-alpha.83"
3
+ }
@@ -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)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: payi
3
- Version: 0.1.0a82
3
+ Version: 0.1.0a83
4
4
  Summary: The official Python library for the payi API
5
5
  Project-URL: Homepage, https://github.com/Pay-i/pay-i-python
6
6
  Project-URL: Repository, https://github.com/Pay-i/pay-i-python
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "payi"
3
- version = "0.1.0-alpha.82"
3
+ version = "0.1.0-alpha.83"
4
4
  description = "The official Python library for the payi API"
5
5
  dynamic = ["readme"]
6
6
  license = "Apache-2.0"
@@ -1,4 +1,4 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  __title__ = "payi"
4
- __version__ = "0.1.0-alpha.82" # x-release-please-version
4
+ __version__ = "0.1.0-alpha.83" # x-release-please-version
@@ -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) -> bool:
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) -> bool:
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) -> bool:
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) -> bool:
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]') -> bool:
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
- return True
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) -> bool:
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) -> bool:
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) -> bool:
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) -> bool:
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
- model: str = response_dict.get("model_version", "")
203
-
204
- self._ingest["resource"] = "google." + model
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] = response_dict.get("model_version", None)
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 = response_dict.get("model_version", "")
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"