arize-phoenix 4.20.1__tar.gz → 4.20.2__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 (300) hide show
  1. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/PKG-INFO +1 -1
  2. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/examples/manually-instrumented-chatbot/chat-service/chat/app.py +41 -4
  3. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/examples/manually-instrumented-chatbot/chat-service/chat/types.py +8 -1
  4. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/examples/manually-instrumented-chatbot/frontend/Dockerfile +2 -2
  5. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/examples/manually-instrumented-chatbot/frontend/Makefile +2 -2
  6. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/db/insertion/span.py +9 -0
  7. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/db/migrations/versions/10460e46d750_datasets.py +28 -2
  8. arize_phoenix-4.20.2/src/phoenix/db/migrations/versions/3be8647b87d8_add_token_columns_to_spans_table.py +134 -0
  9. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/db/migrations/versions/cf03bd6bae1d_init.py +28 -2
  10. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/db/models.py +9 -1
  11. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/dataloaders/token_counts.py +2 -7
  12. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/input_types/SpanSort.py +3 -8
  13. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/Span.py +3 -15
  14. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/static/.vite/manifest.json +14 -14
  15. arize_phoenix-4.20.1/src/phoenix/server/static/assets/components-CAummAJx.js → arize_phoenix-4.20.2/src/phoenix/server/static/assets/components-BSw2e1Zr.js +108 -100
  16. arize_phoenix-4.20.1/src/phoenix/server/static/assets/index-Cg5hdf3g.js → arize_phoenix-4.20.2/src/phoenix/server/static/assets/index-BYUFcdtx.js +1 -1
  17. arize_phoenix-4.20.1/src/phoenix/server/static/assets/pages-BU__X1UX.js → arize_phoenix-4.20.2/src/phoenix/server/static/assets/pages-p_fuED5k.js +251 -237
  18. arize_phoenix-4.20.1/src/phoenix/server/static/assets/vendor-arizeai-CkyzG9Wl.js → arize_phoenix-4.20.2/src/phoenix/server/static/assets/vendor-arizeai-CIETbKDq.js +28 -28
  19. arize_phoenix-4.20.2/src/phoenix/version.py +1 -0
  20. arize_phoenix-4.20.1/src/phoenix/db/migrations/types.py +0 -29
  21. arize_phoenix-4.20.1/src/phoenix/version.py +0 -1
  22. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/.gitignore +0 -0
  23. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/IP_NOTICE +0 -0
  24. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/LICENSE +0 -0
  25. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/README.md +0 -0
  26. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/examples/manually-instrumented-chatbot/chat-service/chat/__init__.py +0 -0
  27. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/examples/manually-instrumented-chatbot/frontend/__init__.py +0 -0
  28. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/examples/manually-instrumented-chatbot/frontend/pyproject.toml +0 -0
  29. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/examples/manually-instrumented-chatbot/frontend/requirements.txt +0 -0
  30. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/examples/manually-instrumented-chatbot/frontend/schema.json +0 -0
  31. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/pyproject.toml +0 -0
  32. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/__init__.py +0 -0
  33. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/config.py +0 -0
  34. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/core/__init__.py +0 -0
  35. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/core/embedding_dimension.py +0 -0
  36. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/core/model.py +0 -0
  37. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/core/model_schema.py +0 -0
  38. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/core/model_schema_adapter.py +0 -0
  39. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/datetime_utils.py +0 -0
  40. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/db/README.md +0 -0
  41. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/db/__init__.py +0 -0
  42. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/db/alembic.ini +0 -0
  43. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/db/bulk_inserter.py +0 -0
  44. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/db/engines.py +0 -0
  45. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/db/helpers.py +0 -0
  46. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/db/insertion/__init__.py +0 -0
  47. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/db/insertion/constants.py +0 -0
  48. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/db/insertion/dataset.py +0 -0
  49. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/db/insertion/document_annotation.py +0 -0
  50. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/db/insertion/evaluation.py +0 -0
  51. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/db/insertion/helpers.py +0 -0
  52. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/db/insertion/span_annotation.py +0 -0
  53. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/db/insertion/trace_annotation.py +0 -0
  54. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/db/insertion/types.py +0 -0
  55. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/db/migrate.py +0 -0
  56. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/db/migrations/__init__.py +0 -0
  57. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/db/migrations/env.py +0 -0
  58. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/db/migrations/script.py.mako +0 -0
  59. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/exceptions.py +0 -0
  60. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/experiments/__init__.py +0 -0
  61. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/experiments/evaluators/__init__.py +0 -0
  62. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/experiments/evaluators/base.py +0 -0
  63. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/experiments/evaluators/code_evaluators.py +0 -0
  64. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/experiments/evaluators/llm_evaluators.py +0 -0
  65. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/experiments/evaluators/utils.py +0 -0
  66. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/experiments/functions.py +0 -0
  67. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/experiments/tracing.py +0 -0
  68. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/experiments/types.py +0 -0
  69. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/experiments/utils.py +0 -0
  70. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/inferences/__init__.py +0 -0
  71. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/inferences/errors.py +0 -0
  72. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/inferences/fixtures.py +0 -0
  73. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/inferences/inferences.py +0 -0
  74. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/inferences/schema.py +0 -0
  75. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/inferences/validation.py +0 -0
  76. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/metrics/README.md +0 -0
  77. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/metrics/__init__.py +0 -0
  78. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/metrics/binning.py +0 -0
  79. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/metrics/metrics.py +0 -0
  80. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/metrics/mixins.py +0 -0
  81. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/metrics/retrieval_metrics.py +0 -0
  82. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/metrics/timeseries.py +0 -0
  83. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/metrics/wrappers.py +0 -0
  84. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/pointcloud/__init__.py +0 -0
  85. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/pointcloud/clustering.py +0 -0
  86. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/pointcloud/pointcloud.py +0 -0
  87. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/pointcloud/projectors.py +0 -0
  88. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/pointcloud/umap_parameters.py +0 -0
  89. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/py.typed +0 -0
  90. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/__init__.py +0 -0
  91. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/__init__.py +0 -0
  92. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/context.py +0 -0
  93. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/dataloaders/__init__.py +0 -0
  94. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/dataloaders/annotation_summaries.py +0 -0
  95. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/dataloaders/average_experiment_run_latency.py +0 -0
  96. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/dataloaders/cache/__init__.py +0 -0
  97. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/dataloaders/cache/two_tier_cache.py +0 -0
  98. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/dataloaders/dataset_example_revisions.py +0 -0
  99. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/dataloaders/dataset_example_spans.py +0 -0
  100. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/dataloaders/document_evaluation_summaries.py +0 -0
  101. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/dataloaders/document_evaluations.py +0 -0
  102. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/dataloaders/document_retrieval_metrics.py +0 -0
  103. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/dataloaders/evaluation_summaries.py +0 -0
  104. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/dataloaders/experiment_annotation_summaries.py +0 -0
  105. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/dataloaders/experiment_error_rates.py +0 -0
  106. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/dataloaders/experiment_run_counts.py +0 -0
  107. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/dataloaders/experiment_sequence_number.py +0 -0
  108. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/dataloaders/latency_ms_quantile.py +0 -0
  109. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/dataloaders/min_start_or_max_end_times.py +0 -0
  110. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/dataloaders/project_by_name.py +0 -0
  111. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/dataloaders/record_counts.py +0 -0
  112. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/dataloaders/span_annotations.py +0 -0
  113. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/dataloaders/span_dataset_examples.py +0 -0
  114. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/dataloaders/span_descendants.py +0 -0
  115. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/dataloaders/span_evaluations.py +0 -0
  116. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/dataloaders/span_projects.py +0 -0
  117. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/dataloaders/trace_evaluations.py +0 -0
  118. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/dataloaders/trace_row_ids.py +0 -0
  119. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/helpers/__init__.py +0 -0
  120. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/helpers/dataset_helpers.py +0 -0
  121. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/input_types/AddExamplesToDatasetInput.py +0 -0
  122. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/input_types/AddSpansToDatasetInput.py +0 -0
  123. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/input_types/ClearProjectInput.py +0 -0
  124. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/input_types/ClusterInput.py +0 -0
  125. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/input_types/Coordinates.py +0 -0
  126. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/input_types/CreateDatasetInput.py +0 -0
  127. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/input_types/CreateSpanAnnotationInput.py +0 -0
  128. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/input_types/CreateTraceAnnotationInput.py +0 -0
  129. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/input_types/DataQualityMetricInput.py +0 -0
  130. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/input_types/DatasetExampleInput.py +0 -0
  131. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/input_types/DatasetSort.py +0 -0
  132. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/input_types/DatasetVersionSort.py +0 -0
  133. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/input_types/DeleteAnnotationsInput.py +0 -0
  134. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/input_types/DeleteDatasetExamplesInput.py +0 -0
  135. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/input_types/DeleteDatasetInput.py +0 -0
  136. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/input_types/DeleteExperimentsInput.py +0 -0
  137. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/input_types/DimensionFilter.py +0 -0
  138. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/input_types/DimensionInput.py +0 -0
  139. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/input_types/Granularity.py +0 -0
  140. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/input_types/PatchAnnotationInput.py +0 -0
  141. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/input_types/PatchDatasetExamplesInput.py +0 -0
  142. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/input_types/PatchDatasetInput.py +0 -0
  143. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/input_types/PerformanceMetricInput.py +0 -0
  144. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/input_types/SpanAnnotationSort.py +0 -0
  145. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/input_types/TimeRange.py +0 -0
  146. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/input_types/TraceAnnotationSort.py +0 -0
  147. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/input_types/__init__.py +0 -0
  148. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/interceptor.py +0 -0
  149. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/mutations/__init__.py +0 -0
  150. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/mutations/auth.py +0 -0
  151. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/mutations/dataset_mutations.py +0 -0
  152. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/mutations/experiment_mutations.py +0 -0
  153. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/mutations/export_events_mutations.py +0 -0
  154. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/mutations/project_mutations.py +0 -0
  155. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/mutations/span_annotations_mutations.py +0 -0
  156. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/mutations/trace_annotations_mutations.py +0 -0
  157. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/openapi/__init__.py +0 -0
  158. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/openapi/main.py +0 -0
  159. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/openapi/schema.py +0 -0
  160. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/queries.py +0 -0
  161. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/routers/__init__.py +0 -0
  162. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/routers/utils.py +0 -0
  163. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/routers/v1/__init__.py +0 -0
  164. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/routers/v1/datasets.py +0 -0
  165. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/routers/v1/evaluations.py +0 -0
  166. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/routers/v1/experiment_evaluations.py +0 -0
  167. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/routers/v1/experiment_runs.py +0 -0
  168. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/routers/v1/experiments.py +0 -0
  169. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/routers/v1/pydantic_compat.py +0 -0
  170. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/routers/v1/spans.py +0 -0
  171. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/routers/v1/traces.py +0 -0
  172. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/routers/v1/utils.py +0 -0
  173. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/schema.py +0 -0
  174. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/Annotation.py +0 -0
  175. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/AnnotationSummary.py +0 -0
  176. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/AnnotatorKind.py +0 -0
  177. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/Cluster.py +0 -0
  178. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/CreateDatasetPayload.py +0 -0
  179. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/DataQualityMetric.py +0 -0
  180. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/Dataset.py +0 -0
  181. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/DatasetExample.py +0 -0
  182. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/DatasetExampleRevision.py +0 -0
  183. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/DatasetValues.py +0 -0
  184. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/DatasetVersion.py +0 -0
  185. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/Dimension.py +0 -0
  186. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/DimensionDataType.py +0 -0
  187. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/DimensionShape.py +0 -0
  188. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/DimensionType.py +0 -0
  189. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/DimensionWithValue.py +0 -0
  190. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/DocumentEvaluationSummary.py +0 -0
  191. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/DocumentRetrievalMetrics.py +0 -0
  192. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/EmbeddingDimension.py +0 -0
  193. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/EmbeddingMetadata.py +0 -0
  194. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/Evaluation.py +0 -0
  195. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/EvaluationSummary.py +0 -0
  196. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/Event.py +0 -0
  197. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/EventMetadata.py +0 -0
  198. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/ExampleRevisionInterface.py +0 -0
  199. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/Experiment.py +0 -0
  200. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/ExperimentAnnotationSummary.py +0 -0
  201. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/ExperimentComparison.py +0 -0
  202. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/ExperimentRun.py +0 -0
  203. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/ExperimentRunAnnotation.py +0 -0
  204. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/ExportedFile.py +0 -0
  205. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/Functionality.py +0 -0
  206. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/Inferences.py +0 -0
  207. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/InferencesRole.py +0 -0
  208. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/LabelFraction.py +0 -0
  209. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/MimeType.py +0 -0
  210. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/Model.py +0 -0
  211. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/NumericRange.py +0 -0
  212. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/PerformanceMetric.py +0 -0
  213. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/Project.py +0 -0
  214. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/PromptResponse.py +0 -0
  215. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/Retrieval.py +0 -0
  216. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/ScalarDriftMetricEnum.py +0 -0
  217. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/Segments.py +0 -0
  218. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/SortDir.py +0 -0
  219. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/SpanAnnotation.py +0 -0
  220. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/TimeSeries.py +0 -0
  221. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/Trace.py +0 -0
  222. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/TraceAnnotation.py +0 -0
  223. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/UMAPPoints.py +0 -0
  224. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/ValidationResult.py +0 -0
  225. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/VectorDriftMetricEnum.py +0 -0
  226. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/__init__.py +0 -0
  227. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/node.py +0 -0
  228. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/types/pagination.py +0 -0
  229. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/api/utils.py +0 -0
  230. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/app.py +0 -0
  231. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/dml_event.py +0 -0
  232. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/dml_event_handler.py +0 -0
  233. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/grpc_server.py +0 -0
  234. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/main.py +0 -0
  235. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/openapi/__init__.py +0 -0
  236. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/prometheus.py +0 -0
  237. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/static/apple-touch-icon-114x114.png +0 -0
  238. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/static/apple-touch-icon-120x120.png +0 -0
  239. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/static/apple-touch-icon-144x144.png +0 -0
  240. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/static/apple-touch-icon-152x152.png +0 -0
  241. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/static/apple-touch-icon-180x180.png +0 -0
  242. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/static/apple-touch-icon-72x72.png +0 -0
  243. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/static/apple-touch-icon-76x76.png +0 -0
  244. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/static/apple-touch-icon.png +0 -0
  245. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/static/assets/vendor-BMWfu6zp.js +0 -0
  246. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/static/assets/vendor-DxkFTwjz.css +0 -0
  247. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/static/assets/vendor-codemirror-DO3VqEcD.js +0 -0
  248. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/static/assets/vendor-recharts-BGN0SxgJ.js +0 -0
  249. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/static/assets/vendor-three-DwGkEfCM.js +0 -0
  250. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/static/favicon.ico +0 -0
  251. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/static/modernizr.js +0 -0
  252. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/telemetry.py +0 -0
  253. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/templates/__init__.py +0 -0
  254. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/templates/index.html +0 -0
  255. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/thread_server.py +0 -0
  256. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/server/types.py +0 -0
  257. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/services.py +0 -0
  258. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/session/__init__.py +0 -0
  259. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/session/client.py +0 -0
  260. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/session/data_extractor.py +0 -0
  261. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/session/evaluation.py +0 -0
  262. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/session/session.py +0 -0
  263. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/settings.py +0 -0
  264. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/trace/__init__.py +0 -0
  265. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/trace/attributes.py +0 -0
  266. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/trace/dsl/README.md +0 -0
  267. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/trace/dsl/__init__.py +0 -0
  268. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/trace/dsl/filter.py +0 -0
  269. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/trace/dsl/helpers.py +0 -0
  270. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/trace/dsl/query.py +0 -0
  271. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/trace/errors.py +0 -0
  272. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/trace/evaluation_conventions.py +0 -0
  273. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/trace/exporter.py +0 -0
  274. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/trace/fixtures.py +0 -0
  275. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/trace/langchain/__init__.py +0 -0
  276. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/trace/langchain/instrumentor.py +0 -0
  277. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/trace/llama_index/__init__.py +0 -0
  278. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/trace/llama_index/callback.py +0 -0
  279. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/trace/openai/__init__.py +0 -0
  280. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/trace/openai/instrumentor.py +0 -0
  281. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/trace/otel.py +0 -0
  282. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/trace/projects.py +0 -0
  283. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/trace/schemas.py +0 -0
  284. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/trace/span_evaluations.py +0 -0
  285. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/trace/span_json_decoder.py +0 -0
  286. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/trace/span_json_encoder.py +0 -0
  287. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/trace/trace_dataset.py +0 -0
  288. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/trace/utils.py +0 -0
  289. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/trace/v1/__init__.py +0 -0
  290. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/trace/v1/evaluation_pb2.py +0 -0
  291. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/trace/v1/evaluation_pb2.pyi +0 -0
  292. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/utilities/__init__.py +0 -0
  293. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/utilities/client.py +0 -0
  294. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/utilities/deprecation.py +0 -0
  295. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/utilities/error_handling.py +0 -0
  296. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/utilities/json.py +0 -0
  297. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/utilities/logging.py +0 -0
  298. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/utilities/project.py +0 -0
  299. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/utilities/re.py +0 -0
  300. {arize_phoenix-4.20.1 → arize_phoenix-4.20.2}/src/phoenix/utilities/span_store.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: arize-phoenix
3
- Version: 4.20.1
3
+ Version: 4.20.2
4
4
  Summary: AI Observability and Evaluation
5
5
  Project-URL: Documentation, https://docs.arize.com/phoenix/
6
6
  Project-URL: Issues, https://github.com/Arize-ai/phoenix/issues
@@ -1,9 +1,11 @@
1
1
  import json
2
2
  import os
3
+ import warnings
3
4
  from typing import Any, Dict, Iterator, List, Tuple
5
+ from uuid import uuid4
4
6
 
5
7
  from fastapi import FastAPI, HTTPException
6
- from httpx import AsyncClient
8
+ from httpx import AsyncClient, ConnectError
7
9
  from openinference.semconv.trace import (
8
10
  MessageAttributes,
9
11
  OpenInferenceMimeTypeValues,
@@ -17,12 +19,14 @@ from opentelemetry.sdk.trace.export import (
17
19
  SimpleSpanProcessor,
18
20
  )
19
21
 
20
- from chat.types import Message, MessagesPayload, MessagesResponse
22
+ from chat.types import FeedbackRequest, Message, MessagesPayload, MessagesResponse
21
23
 
22
24
  COLLECTOR_HOST = os.getenv("COLLECTOR_HOST", "localhost")
23
- endpoint = f"http://{COLLECTOR_HOST}:6006/v1/traces"
25
+ endpoint = f"http://{COLLECTOR_HOST}:6006/v1"
24
26
  tracer_provider = trace_sdk.TracerProvider()
25
- tracer_provider.add_span_processor(SimpleSpanProcessor(OTLPSpanExporter(endpoint)))
27
+ tracer_provider.add_span_processor(
28
+ SimpleSpanProcessor(OTLPSpanExporter(f"{endpoint}/traces"))
29
+ )
26
30
  trace_api.set_tracer_provider(tracer_provider)
27
31
  tracer = trace_api.get_tracer(__name__)
28
32
 
@@ -78,9 +82,11 @@ async def messages(messages_payload: MessagesPayload) -> MessagesResponse:
78
82
  span.set_status(trace_api.StatusCode.OK)
79
83
  response_data = response.json()
80
84
  assistant_message_content = response_data["choices"][0]["message"]["content"]
85
+ message_uuid = str(uuid4())
81
86
  assistant_message = Message(
82
87
  role="assistant",
83
88
  content=assistant_message_content,
89
+ uuid=message_uuid,
84
90
  )
85
91
  for (
86
92
  attribute_key,
@@ -91,9 +97,40 @@ async def messages(messages_payload: MessagesPayload) -> MessagesResponse:
91
97
  *_llm_token_usage_attributes(response_data),
92
98
  ):
93
99
  span.set_attribute(attribute_key, attribute_value)
100
+ span_id = span.get_span_context().span_id.to_bytes(8, "big").hex()
101
+ assistant_message.span_id = span_id
102
+
94
103
  return MessagesResponse(message=assistant_message)
95
104
 
96
105
 
106
+ @app.post("/feedback/")
107
+ async def post_feedback(feedback_request: FeedbackRequest) -> None:
108
+ if feedback_request.feedback == 1:
109
+ label = "thumbs_up"
110
+ elif feedback_request.feedback == 0:
111
+ label = "thumbs_down"
112
+
113
+ request_body = {
114
+ "data": [
115
+ {
116
+ "span_id": feedback_request.span_id,
117
+ "name": "correctness",
118
+ "annotator_kind": "HUMAN",
119
+ "result": {"label": label, "score": feedback_request.feedback},
120
+ "metadata": {},
121
+ }
122
+ ]
123
+ }
124
+
125
+ try:
126
+ await http_client.post(
127
+ f"{endpoint}/span_annotations",
128
+ json=request_body,
129
+ )
130
+ except ConnectError:
131
+ warnings.warn("Could not connect to Phoenix server.")
132
+
133
+
97
134
  def _llm_span_kind_attributes() -> Iterator[Tuple[str, str]]:
98
135
  """
99
136
  Yields the OpenInference span kind attribute for LLMs.
@@ -1,4 +1,4 @@
1
- from typing import List, Literal
1
+ from typing import List, Literal, Optional
2
2
 
3
3
  from pydantic import BaseModel
4
4
 
@@ -8,6 +8,8 @@ Role = Literal["system", "assistant", "user"]
8
8
  class Message(BaseModel):
9
9
  role: Role
10
10
  content: str
11
+ uuid: str
12
+ span_id: Optional[str] = None
11
13
 
12
14
 
13
15
  class MessagesPayload(BaseModel):
@@ -16,3 +18,8 @@ class MessagesPayload(BaseModel):
16
18
 
17
19
  class MessagesResponse(BaseModel):
18
20
  message: Message
21
+
22
+
23
+ class FeedbackRequest(BaseModel):
24
+ feedback: int
25
+ span_id: str
@@ -10,6 +10,6 @@ FROM gcr.io/distroless/python3-debian12
10
10
  WORKDIR /app
11
11
  COPY --from=builder /app/.venv/lib/python3.11/site-packages/ /app/site-packages/
12
12
  ENV PYTHONPATH="/app/site-packages:$PYTHONPATH"
13
- COPY frontend/ /app/frontend/
13
+ COPY src/ /app/src/
14
14
  EXPOSE 8501
15
- CMD ["-m", "streamlit", "run", "frontend/app.py", "--server.port=8501", "--server.address=0.0.0.0"]
15
+ CMD ["-m", "streamlit", "run", "src/app.py", "--server.port=8501", "--server.address=0.0.0.0"]
@@ -1,5 +1,5 @@
1
- server:
2
- streamlit run app.py
1
+ frontend:
2
+ streamlit run ./src/app.py
3
3
 
4
4
  format:
5
5
  ruff check --fix . && ruff format .
@@ -71,6 +71,13 @@ async def insert_span(
71
71
  cumulative_llm_token_count_completion = cast(
72
72
  int, get_attribute_value(span.attributes, SpanAttributes.LLM_TOKEN_COUNT_COMPLETION) or 0
73
73
  )
74
+ llm_token_count_prompt = cast(
75
+ Optional[int], get_attribute_value(span.attributes, SpanAttributes.LLM_TOKEN_COUNT_PROMPT)
76
+ )
77
+ llm_token_count_completion = cast(
78
+ Optional[int],
79
+ get_attribute_value(span.attributes, SpanAttributes.LLM_TOKEN_COUNT_COMPLETION),
80
+ )
74
81
  if accumulation := (
75
82
  await session.execute(
76
83
  select(
@@ -100,6 +107,8 @@ async def insert_span(
100
107
  cumulative_error_count=cumulative_error_count,
101
108
  cumulative_llm_token_count_prompt=cumulative_llm_token_count_prompt,
102
109
  cumulative_llm_token_count_completion=cumulative_llm_token_count_completion,
110
+ llm_token_count_prompt=llm_token_count_prompt,
111
+ llm_token_count_completion=llm_token_count_completion,
103
112
  ),
104
113
  dialect=dialect,
105
114
  table=models.Span,
@@ -6,11 +6,37 @@ Create Date: 2024-05-10 11:24:23.985834
6
6
 
7
7
  """
8
8
 
9
- from typing import Sequence, Union
9
+ from typing import Any, Sequence, Union
10
10
 
11
11
  import sqlalchemy as sa
12
12
  from alembic import op
13
- from phoenix.db.migrations.types import JSON_
13
+ from sqlalchemy import JSON
14
+ from sqlalchemy.dialects import postgresql
15
+ from sqlalchemy.ext.compiler import compiles
16
+
17
+
18
+ class JSONB(JSON):
19
+ # See https://docs.sqlalchemy.org/en/20/core/custom_types.html
20
+ __visit_name__ = "JSONB"
21
+
22
+
23
+ @compiles(JSONB, "sqlite") # type: ignore
24
+ def _(*args: Any, **kwargs: Any) -> str:
25
+ # See https://docs.sqlalchemy.org/en/20/core/custom_types.html
26
+ return "JSONB"
27
+
28
+
29
+ JSON_ = (
30
+ JSON()
31
+ .with_variant(
32
+ postgresql.JSONB(), # type: ignore
33
+ "postgresql",
34
+ )
35
+ .with_variant(
36
+ JSONB(),
37
+ "sqlite",
38
+ )
39
+ )
14
40
 
15
41
  # revision identifiers, used by Alembic.
16
42
  revision: str = "10460e46d750"
@@ -0,0 +1,134 @@
1
+ """add token columns to spans table
2
+
3
+ Revision ID: 3be8647b87d8
4
+ Revises: 10460e46d750
5
+ Create Date: 2024-08-03 22:11:28.733133
6
+
7
+ """
8
+
9
+ from typing import Any, Dict, List, Optional, Sequence, TypedDict, Union
10
+
11
+ import sqlalchemy as sa
12
+ from alembic import op
13
+ from openinference.semconv.trace import SpanAttributes
14
+ from sqlalchemy import (
15
+ JSON,
16
+ Dialect,
17
+ MetaData,
18
+ TypeDecorator,
19
+ update,
20
+ )
21
+ from sqlalchemy.dialects import postgresql
22
+ from sqlalchemy.ext.asyncio.engine import AsyncConnection
23
+ from sqlalchemy.ext.compiler import compiles
24
+ from sqlalchemy.orm import (
25
+ DeclarativeBase,
26
+ Mapped,
27
+ mapped_column,
28
+ )
29
+
30
+
31
+ class JSONB(JSON):
32
+ # See https://docs.sqlalchemy.org/en/20/core/custom_types.html
33
+ __visit_name__ = "JSONB"
34
+
35
+
36
+ @compiles(JSONB, "sqlite") # type: ignore
37
+ def _(*args: Any, **kwargs: Any) -> str:
38
+ # See https://docs.sqlalchemy.org/en/20/core/custom_types.html
39
+ return "JSONB"
40
+
41
+
42
+ JSON_ = (
43
+ JSON()
44
+ .with_variant(
45
+ postgresql.JSONB(), # type: ignore
46
+ "postgresql",
47
+ )
48
+ .with_variant(
49
+ JSONB(),
50
+ "sqlite",
51
+ )
52
+ )
53
+
54
+
55
+ class JsonDict(TypeDecorator[Dict[str, Any]]):
56
+ # See # See https://docs.sqlalchemy.org/en/20/core/custom_types.html
57
+ cache_ok = True
58
+ impl = JSON_
59
+
60
+ def process_bind_param(self, value: Optional[Dict[str, Any]], _: Dialect) -> Dict[str, Any]:
61
+ return value if isinstance(value, dict) else {}
62
+
63
+
64
+ class JsonList(TypeDecorator[List[Any]]):
65
+ # See # See https://docs.sqlalchemy.org/en/20/core/custom_types.html
66
+ cache_ok = True
67
+ impl = JSON_
68
+
69
+ def process_bind_param(self, value: Optional[List[Any]], _: Dialect) -> List[Any]:
70
+ return value if isinstance(value, list) else []
71
+
72
+
73
+ class ExperimentRunOutput(TypedDict, total=False):
74
+ task_output: Any
75
+
76
+
77
+ class Base(DeclarativeBase):
78
+ # Enforce best practices for naming constraints
79
+ # https://alembic.sqlalchemy.org/en/latest/naming.html#integration-of-naming-conventions-into-operations-autogenerate
80
+ metadata = MetaData(
81
+ naming_convention={
82
+ "ix": "ix_%(table_name)s_%(column_0_N_name)s",
83
+ "uq": "uq_%(table_name)s_%(column_0_N_name)s",
84
+ "ck": "ck_%(table_name)s_`%(constraint_name)s`",
85
+ "fk": "fk_%(table_name)s_%(column_0_name)s_%(referred_table_name)s",
86
+ "pk": "pk_%(table_name)s",
87
+ }
88
+ )
89
+ type_annotation_map = {
90
+ Dict[str, Any]: JsonDict,
91
+ List[Dict[str, Any]]: JsonList,
92
+ ExperimentRunOutput: JsonDict,
93
+ }
94
+
95
+
96
+ class Span(Base):
97
+ __tablename__ = "spans"
98
+ id: Mapped[int] = mapped_column(primary_key=True)
99
+ attributes: Mapped[Dict[str, Any]]
100
+ llm_token_count_prompt: Mapped[Optional[int]]
101
+ llm_token_count_completion: Mapped[Optional[int]]
102
+
103
+
104
+ # revision identifiers, used by Alembic.
105
+ revision: str = "3be8647b87d8"
106
+ down_revision: Union[str, None] = "10460e46d750"
107
+ branch_labels: Union[str, Sequence[str], None] = None
108
+ depends_on: Union[str, Sequence[str], None] = None
109
+
110
+ LLM_TOKEN_COUNT_PROMPT = SpanAttributes.LLM_TOKEN_COUNT_PROMPT.split(".")
111
+ LLM_TOKEN_COUNT_COMPLETION = SpanAttributes.LLM_TOKEN_COUNT_COMPLETION.split(".")
112
+
113
+
114
+ async def get_token_counts_from_attributes(connection: AsyncConnection) -> None:
115
+ """
116
+ Gets token counts from attributes if present.
117
+ """
118
+ await connection.execute(
119
+ update(Span).values(
120
+ llm_token_count_prompt=Span.attributes[LLM_TOKEN_COUNT_PROMPT].as_float(),
121
+ llm_token_count_completion=Span.attributes[LLM_TOKEN_COUNT_COMPLETION].as_float(),
122
+ )
123
+ )
124
+
125
+
126
+ def upgrade() -> None:
127
+ op.add_column("spans", sa.Column("llm_token_count_prompt", sa.Integer, nullable=True))
128
+ op.add_column("spans", sa.Column("llm_token_count_completion", sa.Integer, nullable=True))
129
+ op.run_async(get_token_counts_from_attributes)
130
+
131
+
132
+ def downgrade() -> None:
133
+ op.drop_column("spans", "llm_token_count_completion")
134
+ op.drop_column("spans", "llm_token_count_prompt")
@@ -6,11 +6,37 @@ Create Date: 2024-04-03 19:41:48.871555
6
6
 
7
7
  """
8
8
 
9
- from typing import Sequence, Union
9
+ from typing import Any, Sequence, Union
10
10
 
11
11
  import sqlalchemy as sa
12
12
  from alembic import op
13
- from phoenix.db.migrations.types import JSON_
13
+ from sqlalchemy import JSON
14
+ from sqlalchemy.dialects import postgresql
15
+ from sqlalchemy.ext.compiler import compiles
16
+
17
+
18
+ class JSONB(JSON):
19
+ # See https://docs.sqlalchemy.org/en/20/core/custom_types.html
20
+ __visit_name__ = "JSONB"
21
+
22
+
23
+ @compiles(JSONB, "sqlite") # type: ignore
24
+ def _(*args: Any, **kwargs: Any) -> str:
25
+ # See https://docs.sqlalchemy.org/en/20/core/custom_types.html
26
+ return "JSONB"
27
+
28
+
29
+ JSON_ = (
30
+ JSON()
31
+ .with_variant(
32
+ postgresql.JSONB(), # type: ignore
33
+ "postgresql",
34
+ )
35
+ .with_variant(
36
+ JSONB(),
37
+ "sqlite",
38
+ )
39
+ )
14
40
 
15
41
  # revision identifiers, used by Alembic.
16
42
  revision: str = "cf03bd6bae1d"
@@ -197,7 +197,7 @@ class Span(Base):
197
197
  ForeignKey("traces.id", ondelete="CASCADE"),
198
198
  index=True,
199
199
  )
200
- span_id: Mapped[str]
200
+ span_id: Mapped[str] = mapped_column(index=True)
201
201
  parent_id: Mapped[Optional[str]] = mapped_column(index=True)
202
202
  name: Mapped[str]
203
203
  span_kind: Mapped[str]
@@ -214,6 +214,8 @@ class Span(Base):
214
214
  cumulative_error_count: Mapped[int]
215
215
  cumulative_llm_token_count_prompt: Mapped[int]
216
216
  cumulative_llm_token_count_completion: Mapped[int]
217
+ llm_token_count_prompt: Mapped[Optional[int]]
218
+ llm_token_count_completion: Mapped[Optional[int]]
217
219
 
218
220
  @hybrid_property
219
221
  def latency_ms(self) -> float:
@@ -230,6 +232,12 @@ class Span(Base):
230
232
  def cumulative_llm_token_count_total(self) -> int:
231
233
  return self.cumulative_llm_token_count_prompt + self.cumulative_llm_token_count_completion
232
234
 
235
+ @hybrid_property
236
+ def llm_token_count_total(self) -> Optional[int]:
237
+ if self.llm_token_count_prompt is None and self.llm_token_count_completion is None:
238
+ return None
239
+ return (self.llm_token_count_prompt or 0) + (self.llm_token_count_completion or 0)
240
+
233
241
  trace: Mapped["Trace"] = relationship("Trace", back_populates="spans")
234
242
  document_annotations: Mapped[List["DocumentAnnotation"]] = relationship(back_populates="span")
235
243
  dataset_examples: Mapped[List["DatasetExample"]] = relationship(back_populates="span")
@@ -10,7 +10,6 @@ from typing import (
10
10
  )
11
11
 
12
12
  from cachetools import LFUCache, TTLCache
13
- from openinference.semconv.trace import SpanAttributes
14
13
  from sqlalchemy import Select, func, select
15
14
  from sqlalchemy.sql.functions import coalesce
16
15
  from strawberry.dataloader import AbstractCache, DataLoader
@@ -107,8 +106,8 @@ def _get_stmt(
107
106
  *params: Param,
108
107
  ) -> Select[Any]:
109
108
  (start_time, end_time), filter_condition = segment
110
- prompt = func.sum(models.Span.attributes[_LLM_TOKEN_COUNT_PROMPT].as_float())
111
- completion = func.sum(models.Span.attributes[_LLM_TOKEN_COUNT_COMPLETION].as_float())
109
+ prompt = func.sum(models.Span.llm_token_count_prompt)
110
+ completion = func.sum(models.Span.llm_token_count_completion)
112
111
  total = coalesce(prompt, 0) + coalesce(completion, 0)
113
112
  pid = models.Trace.project_rowid
114
113
  stmt: Select[Any] = (
@@ -130,7 +129,3 @@ def _get_stmt(
130
129
  stmt = sf(stmt)
131
130
  stmt = stmt.where(pid.in_([rowid for rowid, _ in params]))
132
131
  return stmt
133
-
134
-
135
- _LLM_TOKEN_COUNT_PROMPT = SpanAttributes.LLM_TOKEN_COUNT_PROMPT.split(".")
136
- _LLM_TOKEN_COUNT_COMPLETION = SpanAttributes.LLM_TOKEN_COUNT_COMPLETION.split(".")
@@ -3,7 +3,6 @@ from enum import Enum, auto
3
3
  from typing import Any, Optional, Protocol
4
4
 
5
5
  import strawberry
6
- from openinference.semconv.trace import SpanAttributes
7
6
  from sqlalchemy import and_, desc, nulls_last
8
7
  from sqlalchemy.orm import InstrumentedAttribute
9
8
  from sqlalchemy.sql.expression import Select
@@ -16,10 +15,6 @@ from phoenix.server.api.types.pagination import CursorSortColumnDataType
16
15
  from phoenix.server.api.types.SortDir import SortDir
17
16
  from phoenix.trace.schemas import SpanID
18
17
 
19
- LLM_TOKEN_COUNT_PROMPT = SpanAttributes.LLM_TOKEN_COUNT_PROMPT.split(".")
20
- LLM_TOKEN_COUNT_COMPLETION = SpanAttributes.LLM_TOKEN_COUNT_COMPLETION.split(".")
21
- LLM_TOKEN_COUNT_TOTAL = SpanAttributes.LLM_TOKEN_COUNT_TOTAL.split(".")
22
-
23
18
 
24
19
  @strawberry.enum
25
20
  class SpanColumn(Enum):
@@ -47,11 +42,11 @@ class SpanColumn(Enum):
47
42
  elif self is SpanColumn.latencyMs:
48
43
  expr = models.Span.latency_ms
49
44
  elif self is SpanColumn.tokenCountTotal:
50
- expr = models.Span.attributes[LLM_TOKEN_COUNT_TOTAL].as_float()
45
+ expr = models.Span.llm_token_count_total
51
46
  elif self is SpanColumn.tokenCountPrompt:
52
- expr = models.Span.attributes[LLM_TOKEN_COUNT_PROMPT].as_float()
47
+ expr = models.Span.llm_token_count_prompt
53
48
  elif self is SpanColumn.tokenCountCompletion:
54
- expr = models.Span.attributes[LLM_TOKEN_COUNT_COMPLETION].as_float()
49
+ expr = models.Span.llm_token_count_completion
55
50
  elif self is SpanColumn.cumulativeTokenCountTotal:
56
51
  expr = (
57
52
  models.Span.cumulative_llm_token_count_prompt
@@ -40,9 +40,6 @@ EMBEDDING_EMBEDDINGS = SpanAttributes.EMBEDDING_EMBEDDINGS
40
40
  EMBEDDING_VECTOR = EmbeddingAttributes.EMBEDDING_VECTOR
41
41
  INPUT_MIME_TYPE = SpanAttributes.INPUT_MIME_TYPE
42
42
  INPUT_VALUE = SpanAttributes.INPUT_VALUE
43
- LLM_TOKEN_COUNT_COMPLETION = SpanAttributes.LLM_TOKEN_COUNT_COMPLETION
44
- LLM_TOKEN_COUNT_PROMPT = SpanAttributes.LLM_TOKEN_COUNT_PROMPT
45
- LLM_TOKEN_COUNT_TOTAL = SpanAttributes.LLM_TOKEN_COUNT_TOTAL
46
43
  LLM_PROMPT_TEMPLATE_VARIABLES = SpanAttributes.LLM_PROMPT_TEMPLATE_VARIABLES
47
44
  LLM_INPUT_MESSAGES = SpanAttributes.LLM_INPUT_MESSAGES
48
45
  LLM_OUTPUT_MESSAGES = SpanAttributes.LLM_OUTPUT_MESSAGES
@@ -308,18 +305,9 @@ def to_gql_span(span: models.Span) -> Span:
308
305
  attributes=json.dumps(_hide_embedding_vectors(span.attributes), cls=_JSONEncoder),
309
306
  metadata=_convert_metadata_to_string(get_attribute_value(span.attributes, METADATA)),
310
307
  num_documents=num_documents,
311
- token_count_total=cast(
312
- Optional[int],
313
- get_attribute_value(span.attributes, LLM_TOKEN_COUNT_TOTAL),
314
- ),
315
- token_count_prompt=cast(
316
- Optional[int],
317
- get_attribute_value(span.attributes, LLM_TOKEN_COUNT_PROMPT),
318
- ),
319
- token_count_completion=cast(
320
- Optional[int],
321
- get_attribute_value(span.attributes, LLM_TOKEN_COUNT_COMPLETION),
322
- ),
308
+ token_count_total=span.llm_token_count_total,
309
+ token_count_prompt=span.llm_token_count_prompt,
310
+ token_count_completion=span.llm_token_count_completion,
323
311
  cumulative_token_count_total=span.cumulative_llm_token_count_prompt
324
312
  + span.cumulative_llm_token_count_completion,
325
313
  cumulative_token_count_prompt=span.cumulative_llm_token_count_prompt,
@@ -1,22 +1,22 @@
1
1
  {
2
- "_components-CAummAJx.js": {
3
- "file": "assets/components-CAummAJx.js",
2
+ "_components-BSw2e1Zr.js": {
3
+ "file": "assets/components-BSw2e1Zr.js",
4
4
  "name": "components",
5
5
  "imports": [
6
6
  "_vendor-BMWfu6zp.js",
7
- "_vendor-arizeai-CkyzG9Wl.js",
8
- "_pages-BU__X1UX.js",
7
+ "_vendor-arizeai-CIETbKDq.js",
8
+ "_pages-p_fuED5k.js",
9
9
  "_vendor-three-DwGkEfCM.js",
10
10
  "_vendor-codemirror-DO3VqEcD.js"
11
11
  ]
12
12
  },
13
- "_pages-BU__X1UX.js": {
14
- "file": "assets/pages-BU__X1UX.js",
13
+ "_pages-p_fuED5k.js": {
14
+ "file": "assets/pages-p_fuED5k.js",
15
15
  "name": "pages",
16
16
  "imports": [
17
17
  "_vendor-BMWfu6zp.js",
18
- "_components-CAummAJx.js",
19
- "_vendor-arizeai-CkyzG9Wl.js",
18
+ "_components-BSw2e1Zr.js",
19
+ "_vendor-arizeai-CIETbKDq.js",
20
20
  "_vendor-recharts-BGN0SxgJ.js",
21
21
  "_vendor-codemirror-DO3VqEcD.js"
22
22
  ]
@@ -35,8 +35,8 @@
35
35
  "assets/vendor-DxkFTwjz.css"
36
36
  ]
37
37
  },
38
- "_vendor-arizeai-CkyzG9Wl.js": {
39
- "file": "assets/vendor-arizeai-CkyzG9Wl.js",
38
+ "_vendor-arizeai-CIETbKDq.js": {
39
+ "file": "assets/vendor-arizeai-CIETbKDq.js",
40
40
  "name": "vendor-arizeai",
41
41
  "imports": [
42
42
  "_vendor-BMWfu6zp.js"
@@ -61,15 +61,15 @@
61
61
  "name": "vendor-three"
62
62
  },
63
63
  "index.tsx": {
64
- "file": "assets/index-Cg5hdf3g.js",
64
+ "file": "assets/index-BYUFcdtx.js",
65
65
  "name": "index",
66
66
  "src": "index.tsx",
67
67
  "isEntry": true,
68
68
  "imports": [
69
69
  "_vendor-BMWfu6zp.js",
70
- "_vendor-arizeai-CkyzG9Wl.js",
71
- "_components-CAummAJx.js",
72
- "_pages-BU__X1UX.js",
70
+ "_vendor-arizeai-CIETbKDq.js",
71
+ "_components-BSw2e1Zr.js",
72
+ "_pages-p_fuED5k.js",
73
73
  "_vendor-three-DwGkEfCM.js",
74
74
  "_vendor-codemirror-DO3VqEcD.js",
75
75
  "_vendor-recharts-BGN0SxgJ.js"