arize-phoenix 2.11.1__tar.gz → 3.0.1__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 arize-phoenix might be problematic. Click here for more details.

Files changed (185) hide show
  1. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/PKG-INFO +25 -22
  2. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/README.md +19 -20
  3. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/pyproject.toml +6 -2
  4. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/config.py +5 -3
  5. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/trace/exporter.py +24 -9
  6. arize_phoenix-3.0.1/src/phoenix/trace/langchain/__init__.py +26 -0
  7. arize_phoenix-3.0.1/src/phoenix/trace/langchain/instrumentor.py +31 -0
  8. arize_phoenix-3.0.1/src/phoenix/trace/langchain/tracer.py +46 -0
  9. arize_phoenix-3.0.1/src/phoenix/trace/llama_index/callback.py +42 -0
  10. arize_phoenix-3.0.1/src/phoenix/trace/openai/instrumentor.py +26 -0
  11. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/trace/otel.py +8 -1
  12. arize_phoenix-3.0.1/src/phoenix/trace/tracer.py +99 -0
  13. arize_phoenix-3.0.1/src/phoenix/version.py +1 -0
  14. arize_phoenix-2.11.1/src/phoenix/trace/langchain/__init__.py +0 -4
  15. arize_phoenix-2.11.1/src/phoenix/trace/langchain/instrumentor.py +0 -37
  16. arize_phoenix-2.11.1/src/phoenix/trace/langchain/tracer.py +0 -432
  17. arize_phoenix-2.11.1/src/phoenix/trace/llama_index/callback.py +0 -679
  18. arize_phoenix-2.11.1/src/phoenix/trace/llama_index/streaming.py +0 -92
  19. arize_phoenix-2.11.1/src/phoenix/trace/openai/instrumentor.py +0 -683
  20. arize_phoenix-2.11.1/src/phoenix/trace/tracer.py +0 -122
  21. arize_phoenix-2.11.1/src/phoenix/version.py +0 -1
  22. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/.gitignore +0 -0
  23. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/IP_NOTICE +0 -0
  24. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/LICENSE +0 -0
  25. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/__init__.py +0 -0
  26. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/core/__init__.py +0 -0
  27. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/core/embedding_dimension.py +0 -0
  28. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/core/evals.py +0 -0
  29. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/core/model.py +0 -0
  30. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/core/model_schema.py +0 -0
  31. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/core/model_schema_adapter.py +0 -0
  32. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/core/traces.py +0 -0
  33. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/datasets/__init__.py +0 -0
  34. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/datasets/dataset.py +0 -0
  35. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/datasets/errors.py +0 -0
  36. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/datasets/fixtures.py +0 -0
  37. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/datasets/schema.py +0 -0
  38. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/datasets/validation.py +0 -0
  39. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/datetime_utils.py +0 -0
  40. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/exceptions.py +0 -0
  41. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/experimental/__init__.py +0 -0
  42. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/experimental/evals/__init__.py +0 -0
  43. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/experimental/evals/evaluators.py +0 -0
  44. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/experimental/evals/functions/__init__.py +0 -0
  45. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/experimental/evals/functions/classify.py +0 -0
  46. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/experimental/evals/functions/executor.py +0 -0
  47. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/experimental/evals/functions/generate.py +0 -0
  48. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/experimental/evals/functions/processing.py +0 -0
  49. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/experimental/evals/models/__init__.py +0 -0
  50. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/experimental/evals/models/anthropic.py +0 -0
  51. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/experimental/evals/models/base.py +0 -0
  52. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/experimental/evals/models/bedrock.py +0 -0
  53. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/experimental/evals/models/litellm.py +0 -0
  54. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/experimental/evals/models/openai.py +0 -0
  55. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/experimental/evals/models/rate_limiters.py +0 -0
  56. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/experimental/evals/models/vertex.py +0 -0
  57. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/experimental/evals/models/vertexai.py +0 -0
  58. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/experimental/evals/retrievals.py +0 -0
  59. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/experimental/evals/templates/__init__.py +0 -0
  60. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/experimental/evals/templates/default_templates.py +0 -0
  61. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/experimental/evals/templates/template.py +0 -0
  62. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/experimental/evals/utils/__init__.py +0 -0
  63. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/experimental/evals/utils/threads.py +0 -0
  64. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/metrics/README.md +0 -0
  65. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/metrics/__init__.py +0 -0
  66. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/metrics/binning.py +0 -0
  67. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/metrics/metrics.py +0 -0
  68. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/metrics/mixins.py +0 -0
  69. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/metrics/retrieval_metrics.py +0 -0
  70. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/metrics/timeseries.py +0 -0
  71. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/metrics/wrappers.py +0 -0
  72. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/pointcloud/__init__.py +0 -0
  73. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/pointcloud/clustering.py +0 -0
  74. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/pointcloud/pointcloud.py +0 -0
  75. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/pointcloud/projectors.py +0 -0
  76. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/pointcloud/umap_parameters.py +0 -0
  77. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/py.typed +0 -0
  78. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/__init__.py +0 -0
  79. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/__init__.py +0 -0
  80. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/context.py +0 -0
  81. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/helpers.py +0 -0
  82. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/input_types/ClusterInput.py +0 -0
  83. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/input_types/Coordinates.py +0 -0
  84. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/input_types/DataQualityMetricInput.py +0 -0
  85. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/input_types/DimensionFilter.py +0 -0
  86. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/input_types/DimensionInput.py +0 -0
  87. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/input_types/Granularity.py +0 -0
  88. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/input_types/PerformanceMetricInput.py +0 -0
  89. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/input_types/SpanSort.py +0 -0
  90. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/input_types/TimeRange.py +0 -0
  91. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/input_types/__init__.py +0 -0
  92. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/interceptor.py +0 -0
  93. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/routers/__init__.py +0 -0
  94. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/routers/evaluation_handler.py +0 -0
  95. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/routers/span_handler.py +0 -0
  96. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/routers/trace_handler.py +0 -0
  97. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/routers/utils.py +0 -0
  98. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/schema.py +0 -0
  99. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/types/Cluster.py +0 -0
  100. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/types/DataQualityMetric.py +0 -0
  101. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/types/Dataset.py +0 -0
  102. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/types/DatasetInfo.py +0 -0
  103. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/types/DatasetRole.py +0 -0
  104. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/types/DatasetValues.py +0 -0
  105. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/types/Dimension.py +0 -0
  106. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/types/DimensionDataType.py +0 -0
  107. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/types/DimensionShape.py +0 -0
  108. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/types/DimensionType.py +0 -0
  109. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/types/DimensionWithValue.py +0 -0
  110. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/types/DocumentEvaluationSummary.py +0 -0
  111. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/types/DocumentRetrievalMetrics.py +0 -0
  112. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/types/EmbeddingDimension.py +0 -0
  113. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/types/EmbeddingMetadata.py +0 -0
  114. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/types/Evaluation.py +0 -0
  115. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/types/EvaluationSummary.py +0 -0
  116. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/types/Event.py +0 -0
  117. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/types/EventMetadata.py +0 -0
  118. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/types/ExportEventsMutation.py +0 -0
  119. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/types/ExportedFile.py +0 -0
  120. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/types/Functionality.py +0 -0
  121. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/types/MimeType.py +0 -0
  122. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/types/Model.py +0 -0
  123. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/types/NumericRange.py +0 -0
  124. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/types/PerformanceMetric.py +0 -0
  125. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/types/PromptResponse.py +0 -0
  126. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/types/Retrieval.py +0 -0
  127. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/types/ScalarDriftMetricEnum.py +0 -0
  128. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/types/Segments.py +0 -0
  129. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/types/SortDir.py +0 -0
  130. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/types/Span.py +0 -0
  131. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/types/TimeSeries.py +0 -0
  132. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/types/UMAPPoints.py +0 -0
  133. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/types/ValidationResult.py +0 -0
  134. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/types/VectorDriftMetricEnum.py +0 -0
  135. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/types/__init__.py +0 -0
  136. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/types/node.py +0 -0
  137. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/api/types/pagination.py +0 -0
  138. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/app.py +0 -0
  139. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/main.py +0 -0
  140. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/static/apple-touch-icon-114x114.png +0 -0
  141. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/static/apple-touch-icon-120x120.png +0 -0
  142. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/static/apple-touch-icon-144x144.png +0 -0
  143. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/static/apple-touch-icon-152x152.png +0 -0
  144. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/static/apple-touch-icon-180x180.png +0 -0
  145. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/static/apple-touch-icon-72x72.png +0 -0
  146. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/static/apple-touch-icon-76x76.png +0 -0
  147. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/static/apple-touch-icon.png +0 -0
  148. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/static/favicon.ico +0 -0
  149. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/static/index.css +0 -0
  150. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/static/index.js +0 -0
  151. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/static/modernizr.js +0 -0
  152. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/templates/__init__.py +0 -0
  153. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/templates/index.html +0 -0
  154. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/server/thread_server.py +0 -0
  155. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/services.py +0 -0
  156. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/session/__init__.py +0 -0
  157. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/session/client.py +0 -0
  158. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/session/data_extractor.py +0 -0
  159. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/session/evaluation.py +0 -0
  160. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/session/session.py +0 -0
  161. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/trace/__init__.py +0 -0
  162. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/trace/dsl/__init__.py +0 -0
  163. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/trace/dsl/filter.py +0 -0
  164. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/trace/dsl/helpers.py +0 -0
  165. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/trace/dsl/missing.py +0 -0
  166. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/trace/dsl/query.py +0 -0
  167. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/trace/errors.py +0 -0
  168. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/trace/evaluation_conventions.py +0 -0
  169. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/trace/fixtures.py +0 -0
  170. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/trace/llama_index/__init__.py +0 -0
  171. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/trace/llama_index/debug_callback.py +0 -0
  172. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/trace/openai/__init__.py +0 -0
  173. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/trace/schemas.py +0 -0
  174. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/trace/semantic_conventions.py +0 -0
  175. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/trace/span_evaluations.py +0 -0
  176. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/trace/span_json_decoder.py +0 -0
  177. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/trace/span_json_encoder.py +0 -0
  178. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/trace/trace_dataset.py +0 -0
  179. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/trace/utils.py +0 -0
  180. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/trace/v1/__init__.py +0 -0
  181. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/trace/v1/evaluation_pb2.py +0 -0
  182. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/trace/v1/evaluation_pb2.pyi +0 -0
  183. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/utilities/__init__.py +0 -0
  184. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/utilities/error_handling.py +0 -0
  185. {arize_phoenix-2.11.1 → arize_phoenix-3.0.1}/src/phoenix/utilities/logging.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: arize-phoenix
3
- Version: 2.11.1
3
+ Version: 3.0.1
4
4
  Summary: ML Observability in your notebook
5
5
  Project-URL: Documentation, https://docs.arize.com/phoenix/
6
6
  Project-URL: Issues, https://github.com/Arize-ai/phoenix/issues
@@ -20,6 +20,10 @@ Requires-Dist: ddsketch
20
20
  Requires-Dist: hdbscan<1.0.0,>=0.8.33
21
21
  Requires-Dist: jinja2
22
22
  Requires-Dist: numpy
23
+ Requires-Dist: openinference-instrumentation-langchain
24
+ Requires-Dist: openinference-instrumentation-llama-index
25
+ Requires-Dist: openinference-instrumentation-openai
26
+ Requires-Dist: opentelemetry-exporter-otlp
23
27
  Requires-Dist: opentelemetry-proto
24
28
  Requires-Dist: opentelemetry-sdk
25
29
  Requires-Dist: pandas
@@ -50,10 +54,10 @@ Requires-Dist: llama-index>=0.9.14; extra == 'dev'
50
54
  Requires-Dist: nbqa; extra == 'dev'
51
55
  Requires-Dist: pandas-stubs<=2.0.2.230605; extra == 'dev'
52
56
  Requires-Dist: pre-commit; extra == 'dev'
53
- Requires-Dist: pytest; extra == 'dev'
54
57
  Requires-Dist: pytest-asyncio; extra == 'dev'
55
58
  Requires-Dist: pytest-cov; extra == 'dev'
56
59
  Requires-Dist: pytest-lazy-fixture; extra == 'dev'
60
+ Requires-Dist: pytest==7.4.4; extra == 'dev'
57
61
  Requires-Dist: ruff==0.1.5; extra == 'dev'
58
62
  Requires-Dist: strawberry-graphql[debug-server]==0.208.2; extra == 'dev'
59
63
  Provides-Extra: experimental
@@ -103,22 +107,22 @@ Phoenix provides MLOps and LLMOps insights at lightning speed with zero-config o
103
107
 
104
108
  **Table of Contents**
105
109
 
106
- - [Installation](#installation)
107
- - [LLM Traces](#llm-traces)
108
- - [Tracing with LlamaIndex](#tracing-with-llamaindex)
109
- - [Tracing with LangChain](#tracing-with-langchain)
110
- - [LLM Evals](#llm-evals)
111
- - [Embedding Analysis](#embedding-analysis)
112
- - [UMAP-based Exploratory Data Analysis](#umap-based-exploratory-data-analysis)
113
- - [Cluster-driven Drift and Performance Analysis](#cluster-driven-drift-and-performance-analysis)
114
- - [Exportable Clusters](#exportable-clusters)
115
- - [Retrieval-Augmented Generation Analysis](#retrieval-augmented-generation-analysis)
116
- - [Structured Data Analysis](#structured-data-analysis)
117
- - [Deploying Phoenix](#deploying-phoenix)
118
- - [Breaking Changes](#breaking-changes)
119
- - [Community](#community)
120
- - [Thanks](#thanks)
121
- - [Copyright, Patent, and License](#copyright-patent-and-license)
110
+ - [Installation](#installation)
111
+ - [LLM Traces](#llm-traces)
112
+ - [Tracing with LlamaIndex](#tracing-with-llamaindex)
113
+ - [Tracing with LangChain](#tracing-with-langchain)
114
+ - [LLM Evals](#llm-evals)
115
+ - [Embedding Analysis](#embedding-analysis)
116
+ - [UMAP-based Exploratory Data Analysis](#umap-based-exploratory-data-analysis)
117
+ - [Cluster-driven Drift and Performance Analysis](#cluster-driven-drift-and-performance-analysis)
118
+ - [Exportable Clusters](#exportable-clusters)
119
+ - [Retrieval-Augmented Generation Analysis](#retrieval-augmented-generation-analysis)
120
+ - [Structured Data Analysis](#structured-data-analysis)
121
+ - [Deploying Phoenix](#deploying-phoenix)
122
+ - [Breaking Changes](#breaking-changes)
123
+ - [Community](#community)
124
+ - [Thanks](#thanks)
125
+ - [Copyright, Patent, and License](#copyright-patent-and-license)
122
126
 
123
127
  ## Installation
124
128
 
@@ -219,9 +223,8 @@ session = px.launch_app()
219
223
 
220
224
  from phoenix.trace.langchain import OpenInferenceTracer, LangChainInstrumentor
221
225
 
222
- # If no exporter is specified, the tracer will export to the locally running Phoenix server
223
- tracer = OpenInferenceTracer()
224
- LangChainInstrumentor(tracer).instrument()
226
+ # By default, the traces will be exported to the locally running Phoenix server.
227
+ LangChainInstrumentor().instrument()
225
228
 
226
229
  # Initialize your LangChain application
227
230
  from langchain.chains import RetrievalQA
@@ -456,7 +459,7 @@ For more information on deploying Phoenix, see the [Phoenix Deployment Guide](ht
456
459
 
457
460
  ## Breaking Changes
458
461
 
459
- - **v1.0.0** - Phoenix now exclusively supports the `openai>=1.0.0` sdk. If you are using an older version of the OpenAI SDK, you can continue to use `arize-phoenix==0.1.1`. However, we recommend upgrading to the latest version of the OpenAI SDK as it contains many improvements. If you are using Phoenix with LlamaIndex and and LangChain, you will have to upgrade to the versions of these packages that support the OpenAI `1.0.0` SDK as well (`llama-index>=0.8.64`, `langchain>=0.0.334`)
462
+ see the [migration guide](./MIGRATION.md) for a list of breaking changes.
460
463
 
461
464
  ## Community
462
465
 
@@ -39,22 +39,22 @@ Phoenix provides MLOps and LLMOps insights at lightning speed with zero-config o
39
39
 
40
40
  **Table of Contents**
41
41
 
42
- - [Installation](#installation)
43
- - [LLM Traces](#llm-traces)
44
- - [Tracing with LlamaIndex](#tracing-with-llamaindex)
45
- - [Tracing with LangChain](#tracing-with-langchain)
46
- - [LLM Evals](#llm-evals)
47
- - [Embedding Analysis](#embedding-analysis)
48
- - [UMAP-based Exploratory Data Analysis](#umap-based-exploratory-data-analysis)
49
- - [Cluster-driven Drift and Performance Analysis](#cluster-driven-drift-and-performance-analysis)
50
- - [Exportable Clusters](#exportable-clusters)
51
- - [Retrieval-Augmented Generation Analysis](#retrieval-augmented-generation-analysis)
52
- - [Structured Data Analysis](#structured-data-analysis)
53
- - [Deploying Phoenix](#deploying-phoenix)
54
- - [Breaking Changes](#breaking-changes)
55
- - [Community](#community)
56
- - [Thanks](#thanks)
57
- - [Copyright, Patent, and License](#copyright-patent-and-license)
42
+ - [Installation](#installation)
43
+ - [LLM Traces](#llm-traces)
44
+ - [Tracing with LlamaIndex](#tracing-with-llamaindex)
45
+ - [Tracing with LangChain](#tracing-with-langchain)
46
+ - [LLM Evals](#llm-evals)
47
+ - [Embedding Analysis](#embedding-analysis)
48
+ - [UMAP-based Exploratory Data Analysis](#umap-based-exploratory-data-analysis)
49
+ - [Cluster-driven Drift and Performance Analysis](#cluster-driven-drift-and-performance-analysis)
50
+ - [Exportable Clusters](#exportable-clusters)
51
+ - [Retrieval-Augmented Generation Analysis](#retrieval-augmented-generation-analysis)
52
+ - [Structured Data Analysis](#structured-data-analysis)
53
+ - [Deploying Phoenix](#deploying-phoenix)
54
+ - [Breaking Changes](#breaking-changes)
55
+ - [Community](#community)
56
+ - [Thanks](#thanks)
57
+ - [Copyright, Patent, and License](#copyright-patent-and-license)
58
58
 
59
59
  ## Installation
60
60
 
@@ -155,9 +155,8 @@ session = px.launch_app()
155
155
 
156
156
  from phoenix.trace.langchain import OpenInferenceTracer, LangChainInstrumentor
157
157
 
158
- # If no exporter is specified, the tracer will export to the locally running Phoenix server
159
- tracer = OpenInferenceTracer()
160
- LangChainInstrumentor(tracer).instrument()
158
+ # By default, the traces will be exported to the locally running Phoenix server.
159
+ LangChainInstrumentor().instrument()
161
160
 
162
161
  # Initialize your LangChain application
163
162
  from langchain.chains import RetrievalQA
@@ -392,7 +391,7 @@ For more information on deploying Phoenix, see the [Phoenix Deployment Guide](ht
392
391
 
393
392
  ## Breaking Changes
394
393
 
395
- - **v1.0.0** - Phoenix now exclusively supports the `openai>=1.0.0` sdk. If you are using an older version of the OpenAI SDK, you can continue to use `arize-phoenix==0.1.1`. However, we recommend upgrading to the latest version of the OpenAI SDK as it contains many improvements. If you are using Phoenix with LlamaIndex and and LangChain, you will have to upgrade to the versions of these packages that support the OpenAI `1.0.0` SDK as well (`llama-index>=0.8.64`, `langchain>=0.0.334`)
394
+ see the [migration guide](./MIGRATION.md) for a list of breaking changes.
396
395
 
397
396
  ## Community
398
397
 
@@ -42,6 +42,10 @@ dependencies = [
42
42
  "requests",
43
43
  "opentelemetry-sdk",
44
44
  "opentelemetry-proto",
45
+ "opentelemetry-exporter-otlp",
46
+ "openinference-instrumentation-langchain",
47
+ "openinference-instrumentation-llama-index",
48
+ "openinference-instrumentation-openai",
45
49
  ]
46
50
  dynamic = ["version"]
47
51
 
@@ -53,7 +57,7 @@ dev = [
53
57
  "nbqa",
54
58
  "ruff==0.1.5",
55
59
  "pandas-stubs<=2.0.2.230605", # version 2.0.3.230814 is causing a dependency conflict.
56
- "pytest",
60
+ "pytest==7.4.4",
57
61
  "pytest-asyncio",
58
62
  "pytest-cov",
59
63
  "pytest-lazy-fixture",
@@ -98,7 +102,7 @@ artifacts = ["src/phoenix/server/static"]
98
102
  [tool.hatch.envs.default]
99
103
  dependencies = [
100
104
  "pandas==1.4.0",
101
- "pytest",
105
+ "pytest==7.4.4",
102
106
  "pytest-asyncio",
103
107
  "pytest-cov",
104
108
  "pytest-lazy-fixture",
@@ -12,7 +12,7 @@ ENV_PHOENIX_COLLECTOR_ENDPOINT = "PHOENIX_COLLECTOR_ENDPOINT"
12
12
  The endpoint traces and evals are sent to. This must be set if the Phoenix
13
13
  server is running on a remote instance.
14
14
  """
15
- ENV_WORKING_DIR = "PHOENIX_WORKING_DIR"
15
+ ENV_PHOENIX_WORKING_DIR = "PHOENIX_WORKING_DIR"
16
16
  """
17
17
  The directory in which to save, load, and export datasets. This directory must
18
18
  be accessible by both the Phoenix server and the notebook environment.
@@ -45,7 +45,7 @@ def get_working_dir() -> Path:
45
45
  """
46
46
  Get the working directory for saving, loading, and exporting datasets.
47
47
  """
48
- working_dir_str = os.getenv(ENV_WORKING_DIR)
48
+ working_dir_str = os.getenv(ENV_PHOENIX_WORKING_DIR)
49
49
  if working_dir_str is not None:
50
50
  return Path(working_dir_str)
51
51
  # Fall back to ~/.phoenix if PHOENIX_WORKING_DIR is not set
@@ -77,7 +77,9 @@ except Exception as e:
77
77
  f"⚠️ Failed to initialize the working directory at {WORKING_DIR} due to an error: {str(e)}"
78
78
  )
79
79
  print("⚠️ While phoenix will still run, you will not be able to save, load, or export data")
80
- print("ℹ️ To change, set the `{ENV_WORKING_DIR}` environment variable before importing phoenix.")
80
+ print(
81
+ f"ℹ️ To change, set the `{ENV_PHOENIX_WORKING_DIR}` environment variable before importing phoenix." # noqa: E501
82
+ )
81
83
 
82
84
 
83
85
  def get_exported_files(directory: Path) -> List[Path]:
@@ -9,6 +9,7 @@ from urllib.parse import urljoin
9
9
 
10
10
  import opentelemetry.proto.trace.v1.trace_pb2 as otlp
11
11
  import requests
12
+ from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter
12
13
  from requests import Session
13
14
  from typing_extensions import TypeAlias, assert_never
14
15
 
@@ -30,6 +31,19 @@ class NoOpExporter:
30
31
  pass
31
32
 
32
33
 
34
+ class _OpenInferenceExporter(OTLPSpanExporter):
35
+ def __init__(self) -> None:
36
+ host = get_env_host()
37
+ if host == "0.0.0.0":
38
+ host = "127.0.0.1"
39
+ endpoint = urljoin(
40
+ get_env_collector_endpoint() or f"http://{host}:{get_env_port()}",
41
+ "/v1/traces",
42
+ )
43
+ _warn_if_phoenix_is_not_running(endpoint)
44
+ super().__init__(endpoint)
45
+
46
+
33
47
  class HttpExporter:
34
48
  def __init__(
35
49
  self,
@@ -62,7 +76,7 @@ class HttpExporter:
62
76
  or get_env_collector_endpoint()
63
77
  or f"http://{'127.0.0.1' if self._host == '0.0.0.0' else self._host}:{self._port}"
64
78
  )
65
- self._warn_if_phoenix_is_not_running()
79
+ _warn_if_phoenix_is_not_running(self._base_url)
66
80
  self._session = Session()
67
81
  weakref.finalize(self, self._session.close)
68
82
  self._session.headers.update(
@@ -114,11 +128,12 @@ class HttpExporter:
114
128
  logger.exception(f"unrecognized message type: {type(message)}")
115
129
  assert_never(message)
116
130
 
117
- def _warn_if_phoenix_is_not_running(self) -> None:
118
- try:
119
- requests.get(urljoin(self._base_url, "arize_phoenix_version")).raise_for_status()
120
- except Exception:
121
- logger.warning(
122
- f"Arize Phoenix is not running on {self._base_url}. Launch Phoenix "
123
- f"with `import phoenix as px; px.launch_app()`"
124
- )
131
+
132
+ def _warn_if_phoenix_is_not_running(endpoint: str) -> None:
133
+ try:
134
+ requests.get(urljoin(endpoint, "/arize_phoenix_version")).raise_for_status()
135
+ except Exception:
136
+ logger.warning(
137
+ f"Arize Phoenix is not running on {endpoint}. Launch Phoenix "
138
+ f"with `import phoenix as px; px.launch_app()`"
139
+ )
@@ -0,0 +1,26 @@
1
+ import sys
2
+ from typing import Any
3
+
4
+ import phoenix.trace.langchain.instrumentor as _instrumentor
5
+ import phoenix.trace.langchain.tracer as _tracer
6
+
7
+ _DUMMY = "OpenInferenceTracer"
8
+
9
+
10
+ class _Deprecation:
11
+ __all__ = ("LangChainInstrumentor", _DUMMY)
12
+
13
+ def __getattr__(self, name: str) -> Any:
14
+ if name == "tracer":
15
+ return _tracer
16
+ if name == "instrumentor":
17
+ return _instrumentor
18
+ if name == _DUMMY:
19
+ return getattr(_tracer, name)
20
+ if name == "LangChainInstrumentor":
21
+ return _instrumentor.LangChainInstrumentor
22
+ raise AttributeError(f"module {__name__} has no attribute {name}")
23
+
24
+
25
+ # See e.g. https://stackoverflow.com/a/7668273
26
+ sys.modules[__name__] = _Deprecation() # type: ignore
@@ -0,0 +1,31 @@
1
+ import logging
2
+ from importlib.metadata import PackageNotFoundError
3
+ from importlib.util import find_spec
4
+ from typing import Any
5
+
6
+ from openinference.instrumentation.langchain import LangChainInstrumentor as Instrumentor
7
+ from opentelemetry.sdk import trace as trace_sdk
8
+ from opentelemetry.sdk.trace.export import SimpleSpanProcessor
9
+
10
+ from phoenix.trace.exporter import _OpenInferenceExporter
11
+ from phoenix.trace.tracer import _show_deprecation_warnings
12
+
13
+ logger = logging.getLogger(__name__)
14
+
15
+
16
+ __all__ = ("LangChainInstrumentor",)
17
+
18
+
19
+ class LangChainInstrumentor(Instrumentor):
20
+ def __init__(self, *args: Any, **kwargs: Any) -> None:
21
+ _show_deprecation_warnings(self, *args, **kwargs)
22
+ if find_spec("langchain_core") is None:
23
+ raise PackageNotFoundError(
24
+ "Missing `langchain-core`. Install with `pip install langchain-core`."
25
+ )
26
+ super().__init__()
27
+
28
+ def instrument(self) -> None:
29
+ tracer_provider = trace_sdk.TracerProvider()
30
+ tracer_provider.add_span_processor(SimpleSpanProcessor(_OpenInferenceExporter()))
31
+ super().instrument(skip_dep_check=True, tracer_provider=tracer_provider)
@@ -0,0 +1,46 @@
1
+ """
2
+ This module is defunct and will be removed in the future. It's currently
3
+ maintaining a dummy class to avoid breaking any import code.
4
+ """
5
+ import logging
6
+ import sys
7
+ from typing import Any, Iterator
8
+
9
+ from phoenix.trace.schemas import Span
10
+
11
+ logger = logging.getLogger(__name__)
12
+
13
+ _DUMMY = "OpenInferenceTracer"
14
+ _DEPRECATION_MESSAGE = (
15
+ f"`{__name__}.{_DUMMY}` is a defunct class in the current version of Phoenix, "
16
+ "and will be removed in the future. For a migration guide, see "
17
+ "https://github.com/Arize-ai/phoenix/blob/main/MIGRATION.md"
18
+ )
19
+
20
+
21
+ class _DummyObject:
22
+ def __init__(self, *_: Any, **__: Any) -> None:
23
+ logger.warning(_DEPRECATION_MESSAGE)
24
+
25
+ def get_spans(self) -> Iterator[Span]:
26
+ logger.warning(_DEPRECATION_MESSAGE)
27
+ logger.warning(
28
+ "`.get_spans()` is a defunct method that does nothing, and will be removed "
29
+ "in the future. For a migration guide, see "
30
+ "https://github.com/Arize-ai/phoenix/blob/main/MIGRATION.md"
31
+ )
32
+ return iter(())
33
+
34
+
35
+ class _DefunctModule:
36
+ __all__ = (_DUMMY,)
37
+
38
+ def __getattr__(self, name: str) -> Any:
39
+ if name == _DUMMY:
40
+ logger.warning(_DEPRECATION_MESSAGE)
41
+ return _DummyObject
42
+ raise AttributeError(f"module {__name__} has no attribute {name}")
43
+
44
+
45
+ # See e.g. https://stackoverflow.com/a/7668273
46
+ sys.modules[__name__] = _DefunctModule() # type: ignore
@@ -0,0 +1,42 @@
1
+ import logging
2
+ from importlib.metadata import PackageNotFoundError
3
+ from importlib.util import find_spec
4
+ from typing import (
5
+ Any,
6
+ )
7
+
8
+ from openinference.instrumentation.llama_index._callback import (
9
+ OpenInferenceTraceCallbackHandler as _OpenInferenceTraceCallbackHandler,
10
+ )
11
+ from openinference.instrumentation.llama_index.version import (
12
+ __version__,
13
+ )
14
+ from opentelemetry import trace as trace_api
15
+ from opentelemetry.sdk import trace as trace_sdk
16
+ from opentelemetry.sdk.trace.export import SimpleSpanProcessor
17
+
18
+ from phoenix.trace.exporter import _OpenInferenceExporter
19
+ from phoenix.trace.tracer import _show_deprecation_warnings
20
+
21
+ logger = logging.getLogger(__name__)
22
+
23
+
24
+ class OpenInferenceTraceCallbackHandler(_OpenInferenceTraceCallbackHandler):
25
+ """Callback handler for storing LLM application trace data in OpenInference format.
26
+ OpenInference is an open standard for capturing and storing AI model
27
+ inferences. It enables production LLMapp servers to seamlessly integrate
28
+ with LLM observability solutions such as Arize and Phoenix.
29
+
30
+ For more information on the specification, see
31
+ https://github.com/Arize-ai/openinference
32
+ """
33
+
34
+ def __init__(self, *args: Any, **kwargs: Any) -> None:
35
+ _show_deprecation_warnings(self, *args, **kwargs)
36
+ if find_spec("llama_index") is None:
37
+ raise PackageNotFoundError(
38
+ "Missing `llama-index`. Install with `pip install llama-index`."
39
+ )
40
+ tracer_provider = trace_sdk.TracerProvider()
41
+ tracer_provider.add_span_processor(SimpleSpanProcessor(_OpenInferenceExporter()))
42
+ super().__init__(trace_api.get_tracer(__name__, __version__, tracer_provider))
@@ -0,0 +1,26 @@
1
+ import logging
2
+ from importlib.metadata import PackageNotFoundError
3
+ from importlib.util import find_spec
4
+ from typing import Any
5
+
6
+ from openinference.instrumentation.openai import OpenAIInstrumentor as Instrumentor
7
+ from opentelemetry.sdk import trace as trace_sdk
8
+ from opentelemetry.sdk.trace.export import SimpleSpanProcessor
9
+
10
+ from phoenix.trace.exporter import _OpenInferenceExporter
11
+ from phoenix.trace.tracer import _show_deprecation_warnings
12
+
13
+ logger = logging.getLogger(__name__)
14
+
15
+
16
+ class OpenAIInstrumentor(Instrumentor):
17
+ def __init__(self, *args: Any, **kwargs: Any) -> None:
18
+ _show_deprecation_warnings(self, *args, **kwargs)
19
+ if find_spec("openai") is None:
20
+ raise PackageNotFoundError("Missing `openai`. Install with `pip install openai`.")
21
+ super().__init__()
22
+
23
+ def instrument(self) -> None:
24
+ tracer_provider = trace_sdk.TracerProvider()
25
+ tracer_provider.add_span_processor(SimpleSpanProcessor(_OpenInferenceExporter()))
26
+ super().instrument(skip_dep_check=True, tracer_provider=tracer_provider)
@@ -19,6 +19,7 @@ from typing import (
19
19
  cast,
20
20
  )
21
21
 
22
+ import numpy as np
22
23
  import opentelemetry.proto.trace.v1.trace_pb2 as otlp
23
24
  from opentelemetry.proto.common.v1.common_pb2 import AnyValue, ArrayValue, KeyValue
24
25
  from opentelemetry.util.types import Attributes, AttributeValue
@@ -320,7 +321,11 @@ def encode(span: Span) -> otlp.Span:
320
321
  attributes[key] = json.dumps(value)
321
322
  else:
322
323
  attributes.update(_flatten_mapping(value, key))
323
- elif not isinstance(value, str) and isinstance(value, Sequence) and _has_mapping(value):
324
+ elif (
325
+ not isinstance(value, str)
326
+ and (isinstance(value, Sequence) or isinstance(value, np.ndarray))
327
+ and _has_mapping(value)
328
+ ):
324
329
  attributes.pop(key, None)
325
330
  attributes.update(_flatten_sequence(value, key))
326
331
 
@@ -413,6 +418,8 @@ def _encode_attributes(attributes: Attributes) -> Iterator[KeyValue]:
413
418
  if not attributes:
414
419
  return
415
420
  for key, value in attributes.items():
421
+ if isinstance(value, np.ndarray):
422
+ value = value.tolist()
416
423
  yield KeyValue(key=key, value=_encode_value(value))
417
424
 
418
425
 
@@ -0,0 +1,99 @@
1
+ """
2
+ This module is defunct and will be removed in the future. It's currently
3
+ maintaining a dummy class to avoid breaking any import code.
4
+ """
5
+ import logging
6
+ import sys
7
+ from typing import Any, Iterator, Protocol
8
+
9
+ from phoenix.trace.exporter import HttpExporter
10
+
11
+ logger = logging.getLogger(__name__)
12
+
13
+
14
+ class SpanExporter(Protocol):
15
+ def export(self, _: Any) -> None:
16
+ ...
17
+
18
+
19
+ _DEFUNCT_MSG = (
20
+ "`phoenix.trace.tracer.Tracer` is defunct in the current version of Phoenix, "
21
+ "and will be removed in the future. For a migration guide, see "
22
+ "https://github.com/Arize-ai/phoenix/blob/main/MIGRATION.md"
23
+ )
24
+
25
+ _USE_ENV_MSG = """
26
+ Setting the Phoenix endpoint via HttpExporter() is no longer supported.
27
+ Please use environment variables instead:
28
+ - os.environ["PHOENIX_HOST"] = "127.0.0.1"
29
+ - os.environ["PHOENIX_PORT"] = "54321"
30
+ - os.environ["PHOENIX_COLLECTOR_ENDPOINT"] = "http://127.0.0.1:54321
31
+ For a migration guide, see https://github.com/Arize-ai/phoenix/blob/main/MIGRATION.md
32
+ """
33
+
34
+ _ON_APPEND_DEPRECATION_MSG = (
35
+ "OpenInference has been updated for full OpenTelemetry compliance. The ability to set "
36
+ "`on_append` callbacks are removed. For a migration guide, see "
37
+ "https://github.com/Arize-ai/phoenix/blob/main/MIGRATION.md"
38
+ )
39
+
40
+
41
+ def _show_deprecation_warnings(obj: object, *args: Any, **kwargs: Any) -> None:
42
+ if args or kwargs:
43
+ logger.warning(
44
+ f"{obj.__class__.__name__}() no longer takes any arguments. "
45
+ "The arguments provided has been ignored. For a migration guide, "
46
+ "see https://github.com/Arize-ai/phoenix/blob/main/MIGRATION.md"
47
+ )
48
+ if any(callable(arg) for arg in args) or "callback" in kwargs:
49
+ logger.warning(
50
+ "The `callback` argument is defunct and no longer has any effect. "
51
+ "If you need access to spans for processing, some options include "
52
+ "exporting spans from Phoenix or adding a SpanProcessor to the "
53
+ "OpenTelemetry TracerProvider. For a migration guide, "
54
+ "see https://github.com/Arize-ai/phoenix/blob/main/MIGRATION.md"
55
+ )
56
+ if any(isinstance(arg, HttpExporter) for arg in args):
57
+ logger.warning(_USE_ENV_MSG)
58
+
59
+
60
+ class Tracer:
61
+ _exporter: Any
62
+
63
+ def __init__(self, exporter: Any = None, on_append: Any = None) -> None:
64
+ logger.warning(_DEFUNCT_MSG)
65
+ if exporter is not None:
66
+ logger.warning(_USE_ENV_MSG)
67
+ if on_append is not None:
68
+ logger.warning(_ON_APPEND_DEPRECATION_MSG)
69
+
70
+ def create_span(self, *_: Any, **__: Any) -> Any:
71
+ logger.warning(_DEFUNCT_MSG)
72
+
73
+ def get_spans(self) -> Iterator[Any]:
74
+ logger.warning(_DEFUNCT_MSG)
75
+ logger.warning(
76
+ ".get_spans() is a defunct method that does nothing. "
77
+ "It will be removed in the future. For a migration guide, "
78
+ "see https://github.com/Arize-ai/phoenix/blob/main/MIGRATION.md"
79
+ )
80
+ return iter(())
81
+
82
+
83
+ class _DefunctModule:
84
+ __all__ = ("Tracer", "SpanExporter")
85
+
86
+ def __getattr__(self, name: str) -> Any:
87
+ if name == "Tracer":
88
+ logger.warning(_DEFUNCT_MSG)
89
+ return Tracer
90
+ if name == "SpanExporter":
91
+ logger.warning("`SpanExporter` is defunct and will be removed in the future.")
92
+ return SpanExporter
93
+ if name == "_show_deprecation_warnings":
94
+ return _show_deprecation_warnings
95
+ raise AttributeError(f"module {__name__} has no attribute {name}")
96
+
97
+
98
+ # See e.g. https://stackoverflow.com/a/7668273
99
+ sys.modules[__name__] = _DefunctModule() # type: ignore
@@ -0,0 +1 @@
1
+ __version__ = "3.0.1"
@@ -1,4 +0,0 @@
1
- from .instrumentor import LangChainInstrumentor
2
- from .tracer import OpenInferenceTracer
3
-
4
- __all__ = ["OpenInferenceTracer", "LangChainInstrumentor"]
@@ -1,37 +0,0 @@
1
- from typing import Any, Optional
2
-
3
- from .tracer import OpenInferenceTracer
4
-
5
-
6
- class LangChainInstrumentor:
7
- """
8
- Instruments the OpenInferenceTracer for LangChain automatically by patching the
9
- BaseCallbackManager in LangChain.
10
- """
11
-
12
- def __init__(self, tracer: Optional[OpenInferenceTracer] = None) -> None:
13
- self._tracer = tracer if tracer is not None else OpenInferenceTracer()
14
-
15
- def instrument(self) -> None:
16
- try:
17
- from langchain.callbacks.base import BaseCallbackManager
18
- except ImportError:
19
- # Raise a cleaner error if LangChain is not installed
20
- raise ImportError(
21
- "LangChain is not installed. Please install LangChain first to use the instrumentor"
22
- )
23
-
24
- source_init = BaseCallbackManager.__init__
25
-
26
- # Keep track of the source init so we can tell if the patching occurred
27
- self._source_callback_manager_init = source_init
28
-
29
- tracer = self._tracer
30
-
31
- # Patch the init method of the BaseCallbackManager to add the tracer
32
- # to all callback managers
33
- def patched_init(self: BaseCallbackManager, *args: Any, **kwargs: Any) -> None:
34
- source_init(self, *args, **kwargs)
35
- self.add_handler(tracer, True)
36
-
37
- BaseCallbackManager.__init__ = patched_init