arize-phoenix 3.24.0__tar.gz → 4.0.0__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.
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/PKG-INFO +26 -4
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/pyproject.toml +49 -10
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/__init__.py +9 -5
- arize_phoenix-4.0.0/src/phoenix/config.py +215 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/datetime_utils.py +18 -1
- arize_phoenix-4.0.0/src/phoenix/db/README.md +25 -0
- arize_phoenix-4.0.0/src/phoenix/db/__init__.py +4 -0
- arize_phoenix-4.0.0/src/phoenix/db/alembic.ini +119 -0
- arize_phoenix-4.0.0/src/phoenix/db/bulk_inserter.py +206 -0
- arize_phoenix-4.0.0/src/phoenix/db/engines.py +152 -0
- arize_phoenix-4.0.0/src/phoenix/db/helpers.py +47 -0
- arize_phoenix-4.0.0/src/phoenix/db/insertion/evaluation.py +209 -0
- arize_phoenix-4.0.0/src/phoenix/db/insertion/helpers.py +54 -0
- arize_phoenix-4.0.0/src/phoenix/db/insertion/span.py +142 -0
- arize_phoenix-4.0.0/src/phoenix/db/migrate.py +71 -0
- arize_phoenix-4.0.0/src/phoenix/db/migrations/env.py +121 -0
- arize_phoenix-4.0.0/src/phoenix/db/migrations/script.py.mako +26 -0
- arize_phoenix-4.0.0/src/phoenix/db/migrations/versions/cf03bd6bae1d_init.py +280 -0
- arize_phoenix-4.0.0/src/phoenix/db/models.py +371 -0
- arize_phoenix-4.0.0/src/phoenix/exceptions.py +10 -0
- arize_phoenix-4.0.0/src/phoenix/server/api/context.py +57 -0
- arize_phoenix-4.0.0/src/phoenix/server/api/dataloaders/__init__.py +97 -0
- arize_phoenix-4.0.0/src/phoenix/server/api/dataloaders/cache/__init__.py +3 -0
- arize_phoenix-4.0.0/src/phoenix/server/api/dataloaders/cache/two_tier_cache.py +67 -0
- arize_phoenix-4.0.0/src/phoenix/server/api/dataloaders/document_evaluation_summaries.py +152 -0
- arize_phoenix-4.0.0/src/phoenix/server/api/dataloaders/document_evaluations.py +37 -0
- arize_phoenix-4.0.0/src/phoenix/server/api/dataloaders/document_retrieval_metrics.py +98 -0
- arize_phoenix-4.0.0/src/phoenix/server/api/dataloaders/evaluation_summaries.py +151 -0
- arize_phoenix-4.0.0/src/phoenix/server/api/dataloaders/latency_ms_quantile.py +198 -0
- arize_phoenix-4.0.0/src/phoenix/server/api/dataloaders/min_start_or_max_end_times.py +93 -0
- arize_phoenix-4.0.0/src/phoenix/server/api/dataloaders/record_counts.py +125 -0
- arize_phoenix-4.0.0/src/phoenix/server/api/dataloaders/span_descendants.py +64 -0
- arize_phoenix-4.0.0/src/phoenix/server/api/dataloaders/span_evaluations.py +37 -0
- arize_phoenix-4.0.0/src/phoenix/server/api/dataloaders/token_counts.py +138 -0
- arize_phoenix-4.0.0/src/phoenix/server/api/dataloaders/trace_evaluations.py +37 -0
- arize_phoenix-4.0.0/src/phoenix/server/api/input_types/SpanSort.py +179 -0
- arize_phoenix-4.0.0/src/phoenix/server/api/routers/v1/__init__.py +11 -0
- arize_phoenix-4.0.0/src/phoenix/server/api/routers/v1/evaluations.py +275 -0
- arize_phoenix-4.0.0/src/phoenix/server/api/routers/v1/spans.py +126 -0
- arize_phoenix-4.0.0/src/phoenix/server/api/routers/v1/traces.py +82 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/api/schema.py +112 -48
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/api/types/DocumentEvaluationSummary.py +1 -1
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/api/types/Evaluation.py +29 -12
- arize_phoenix-4.0.0/src/phoenix/server/api/types/EvaluationSummary.py +60 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/api/types/MimeType.py +2 -2
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/api/types/Model.py +9 -9
- arize_phoenix-4.0.0/src/phoenix/server/api/types/Project.py +357 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/api/types/Span.py +87 -131
- arize_phoenix-4.0.0/src/phoenix/server/api/types/Trace.py +56 -0
- arize_phoenix-4.0.0/src/phoenix/server/api/types/pagination.py +315 -0
- arize_phoenix-4.0.0/src/phoenix/server/app.py +456 -0
- arize_phoenix-4.0.0/src/phoenix/server/grpc_server.py +93 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/main.py +75 -60
- arize_phoenix-4.0.0/src/phoenix/server/openapi/docs.py +218 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/prometheus.py +23 -7
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/static/index.js +662 -643
- arize_phoenix-4.0.0/src/phoenix/server/telemetry.py +68 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/services.py +4 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/session/client.py +34 -30
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/session/data_extractor.py +8 -3
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/session/session.py +176 -155
- arize_phoenix-4.0.0/src/phoenix/settings.py +13 -0
- arize_phoenix-4.0.0/src/phoenix/trace/attributes.py +349 -0
- arize_phoenix-4.0.0/src/phoenix/trace/dsl/README.md +116 -0
- arize_phoenix-4.0.0/src/phoenix/trace/dsl/filter.py +842 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/trace/dsl/helpers.py +24 -5
- arize_phoenix-4.0.0/src/phoenix/trace/dsl/query.py +783 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/trace/fixtures.py +69 -7
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/trace/otel.py +33 -199
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/trace/schemas.py +14 -8
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/trace/span_evaluations.py +5 -2
- arize_phoenix-4.0.0/src/phoenix/utilities/__init__.py +0 -0
- arize_phoenix-4.0.0/src/phoenix/utilities/span_store.py +0 -0
- arize_phoenix-4.0.0/src/phoenix/version.py +1 -0
- arize_phoenix-3.24.0/src/phoenix/config.py +0 -159
- arize_phoenix-3.24.0/src/phoenix/core/project.py +0 -773
- arize_phoenix-3.24.0/src/phoenix/core/traces.py +0 -96
- arize_phoenix-3.24.0/src/phoenix/datasets/dataset.py +0 -214
- arize_phoenix-3.24.0/src/phoenix/datasets/fixtures.py +0 -24
- arize_phoenix-3.24.0/src/phoenix/datasets/schema.py +0 -31
- arize_phoenix-3.24.0/src/phoenix/exceptions.py +0 -6
- arize_phoenix-3.24.0/src/phoenix/experimental/evals/__init__.py +0 -73
- arize_phoenix-3.24.0/src/phoenix/experimental/evals/evaluators.py +0 -413
- arize_phoenix-3.24.0/src/phoenix/experimental/evals/functions/__init__.py +0 -4
- arize_phoenix-3.24.0/src/phoenix/experimental/evals/functions/classify.py +0 -453
- arize_phoenix-3.24.0/src/phoenix/experimental/evals/functions/executor.py +0 -353
- arize_phoenix-3.24.0/src/phoenix/experimental/evals/functions/generate.py +0 -138
- arize_phoenix-3.24.0/src/phoenix/experimental/evals/functions/processing.py +0 -76
- arize_phoenix-3.24.0/src/phoenix/experimental/evals/models/__init__.py +0 -14
- arize_phoenix-3.24.0/src/phoenix/experimental/evals/models/anthropic.py +0 -175
- arize_phoenix-3.24.0/src/phoenix/experimental/evals/models/base.py +0 -170
- arize_phoenix-3.24.0/src/phoenix/experimental/evals/models/bedrock.py +0 -221
- arize_phoenix-3.24.0/src/phoenix/experimental/evals/models/litellm.py +0 -134
- arize_phoenix-3.24.0/src/phoenix/experimental/evals/models/openai.py +0 -453
- arize_phoenix-3.24.0/src/phoenix/experimental/evals/models/rate_limiters.py +0 -246
- arize_phoenix-3.24.0/src/phoenix/experimental/evals/models/vertex.py +0 -173
- arize_phoenix-3.24.0/src/phoenix/experimental/evals/models/vertexai.py +0 -186
- arize_phoenix-3.24.0/src/phoenix/experimental/evals/retrievals.py +0 -96
- arize_phoenix-3.24.0/src/phoenix/experimental/evals/templates/__init__.py +0 -50
- arize_phoenix-3.24.0/src/phoenix/experimental/evals/templates/default_templates.py +0 -472
- arize_phoenix-3.24.0/src/phoenix/experimental/evals/templates/template.py +0 -195
- arize_phoenix-3.24.0/src/phoenix/experimental/evals/utils/__init__.py +0 -172
- arize_phoenix-3.24.0/src/phoenix/experimental/evals/utils/threads.py +0 -27
- arize_phoenix-3.24.0/src/phoenix/server/api/context.py +0 -20
- arize_phoenix-3.24.0/src/phoenix/server/api/input_types/SpanSort.py +0 -109
- arize_phoenix-3.24.0/src/phoenix/server/api/routers/evaluation_handler.py +0 -110
- arize_phoenix-3.24.0/src/phoenix/server/api/routers/span_handler.py +0 -70
- arize_phoenix-3.24.0/src/phoenix/server/api/routers/trace_handler.py +0 -60
- arize_phoenix-3.24.0/src/phoenix/server/api/types/EvaluationSummary.py +0 -75
- arize_phoenix-3.24.0/src/phoenix/server/api/types/Project.py +0 -288
- arize_phoenix-3.24.0/src/phoenix/server/api/types/Trace.py +0 -47
- arize_phoenix-3.24.0/src/phoenix/server/api/types/pagination.py +0 -174
- arize_phoenix-3.24.0/src/phoenix/server/app.py +0 -228
- arize_phoenix-3.24.0/src/phoenix/storage/span_store/__init__.py +0 -23
- arize_phoenix-3.24.0/src/phoenix/storage/span_store/text_file.py +0 -85
- arize_phoenix-3.24.0/src/phoenix/trace/dsl/filter.py +0 -374
- arize_phoenix-3.24.0/src/phoenix/trace/dsl/missing.py +0 -60
- arize_phoenix-3.24.0/src/phoenix/trace/dsl/query.py +0 -406
- arize_phoenix-3.24.0/src/phoenix/utilities/__init__.py +0 -26
- arize_phoenix-3.24.0/src/phoenix/utilities/span_store.py +0 -23
- arize_phoenix-3.24.0/src/phoenix/version.py +0 -1
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/.gitignore +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/IP_NOTICE +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/LICENSE +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/README.md +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/examples/manually-instrumented-chatbot/chat-service/chat/__init__.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/examples/manually-instrumented-chatbot/chat-service/chat/app.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/examples/manually-instrumented-chatbot/chat-service/chat/types.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/examples/manually-instrumented-chatbot/frontend/Dockerfile +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/examples/manually-instrumented-chatbot/frontend/Makefile +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/examples/manually-instrumented-chatbot/frontend/__init__.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/examples/manually-instrumented-chatbot/frontend/pyproject.toml +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/examples/manually-instrumented-chatbot/frontend/requirements.txt +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/examples/manually-instrumented-chatbot/frontend/schema.json +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/core/__init__.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/core/embedding_dimension.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/core/model.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/core/model_schema.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/core/model_schema_adapter.py +0 -0
- {arize_phoenix-3.24.0/src/phoenix/datasets → arize_phoenix-4.0.0/src/phoenix/db/insertion}/__init__.py +0 -0
- {arize_phoenix-3.24.0/src/phoenix/experimental → arize_phoenix-4.0.0/src/phoenix/db/migrations}/__init__.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/inferences/__init__.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/inferences/errors.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/inferences/fixtures.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/inferences/inferences.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/inferences/schema.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/inferences/validation.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/metrics/README.md +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/metrics/__init__.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/metrics/binning.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/metrics/metrics.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/metrics/mixins.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/metrics/retrieval_metrics.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/metrics/timeseries.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/metrics/wrappers.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/pointcloud/__init__.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/pointcloud/clustering.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/pointcloud/pointcloud.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/pointcloud/projectors.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/pointcloud/umap_parameters.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/py.typed +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/__init__.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/api/__init__.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/api/helpers.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/api/input_types/ClusterInput.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/api/input_types/Coordinates.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/api/input_types/DataQualityMetricInput.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/api/input_types/DimensionFilter.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/api/input_types/DimensionInput.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/api/input_types/Granularity.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/api/input_types/PerformanceMetricInput.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/api/input_types/TimeRange.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/api/input_types/__init__.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/api/interceptor.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/api/routers/__init__.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/api/routers/utils.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/api/types/Cluster.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/api/types/DataQualityMetric.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/api/types/Dataset.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/api/types/DatasetRole.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/api/types/DatasetValues.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/api/types/Dimension.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/api/types/DimensionDataType.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/api/types/DimensionShape.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/api/types/DimensionType.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/api/types/DimensionWithValue.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/api/types/DocumentRetrievalMetrics.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/api/types/EmbeddingDimension.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/api/types/EmbeddingMetadata.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/api/types/Event.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/api/types/EventMetadata.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/api/types/ExportEventsMutation.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/api/types/ExportedFile.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/api/types/Functionality.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/api/types/NumericRange.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/api/types/PerformanceMetric.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/api/types/PromptResponse.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/api/types/Retrieval.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/api/types/ScalarDriftMetricEnum.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/api/types/Segments.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/api/types/SortDir.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/api/types/TimeSeries.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/api/types/UMAPPoints.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/api/types/ValidationResult.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/api/types/VectorDriftMetricEnum.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/api/types/__init__.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/api/types/node.py +0 -0
- {arize_phoenix-3.24.0/src/phoenix/server/templates → arize_phoenix-4.0.0/src/phoenix/server/openapi}/__init__.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/static/apple-touch-icon-114x114.png +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/static/apple-touch-icon-120x120.png +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/static/apple-touch-icon-144x144.png +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/static/apple-touch-icon-152x152.png +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/static/apple-touch-icon-180x180.png +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/static/apple-touch-icon-72x72.png +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/static/apple-touch-icon-76x76.png +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/static/apple-touch-icon.png +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/static/favicon.ico +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/static/index.css +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/static/modernizr.js +0 -0
- {arize_phoenix-3.24.0/src/phoenix/session → arize_phoenix-4.0.0/src/phoenix/server/templates}/__init__.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/templates/index.html +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/server/thread_server.py +0 -0
- {arize_phoenix-3.24.0/src/phoenix/storage → arize_phoenix-4.0.0/src/phoenix/session}/__init__.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/session/evaluation.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/trace/__init__.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/trace/dsl/__init__.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/trace/errors.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/trace/evaluation_conventions.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/trace/exporter.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/trace/langchain/__init__.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/trace/langchain/instrumentor.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/trace/llama_index/__init__.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/trace/llama_index/callback.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/trace/openai/__init__.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/trace/openai/instrumentor.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/trace/projects.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/trace/span_json_decoder.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/trace/span_json_encoder.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/trace/trace_dataset.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/trace/utils.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/trace/v1/__init__.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/trace/v1/evaluation_pb2.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/trace/v1/evaluation_pb2.pyi +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/utilities/deprecation.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/utilities/error_handling.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/utilities/logging.py +0 -0
- {arize_phoenix-3.24.0 → arize_phoenix-4.0.0}/src/phoenix/utilities/project.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: arize-phoenix
|
|
3
|
-
Version:
|
|
3
|
+
Version: 4.0.0
|
|
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
|
|
@@ -17,6 +17,11 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.11
|
|
18
18
|
Classifier: Programming Language :: Python :: 3.12
|
|
19
19
|
Requires-Python: <3.13,>=3.8
|
|
20
|
+
Requires-Dist: aioitertools
|
|
21
|
+
Requires-Dist: aiosqlite
|
|
22
|
+
Requires-Dist: alembic<2,>=1.3.0
|
|
23
|
+
Requires-Dist: cachetools
|
|
24
|
+
Requires-Dist: grpcio
|
|
20
25
|
Requires-Dist: hdbscan>=0.8.33
|
|
21
26
|
Requires-Dist: jinja2
|
|
22
27
|
Requires-Dist: numpy
|
|
@@ -28,6 +33,7 @@ Requires-Dist: openinference-semantic-conventions>=0.1.5
|
|
|
28
33
|
Requires-Dist: opentelemetry-exporter-otlp
|
|
29
34
|
Requires-Dist: opentelemetry-proto>=1.12.0
|
|
30
35
|
Requires-Dist: opentelemetry-sdk
|
|
36
|
+
Requires-Dist: opentelemetry-semantic-conventions
|
|
31
37
|
Requires-Dist: pandas
|
|
32
38
|
Requires-Dist: protobuf<6.0,>=3.20
|
|
33
39
|
Requires-Dist: psutil
|
|
@@ -35,9 +41,10 @@ Requires-Dist: pyarrow
|
|
|
35
41
|
Requires-Dist: requests
|
|
36
42
|
Requires-Dist: scikit-learn
|
|
37
43
|
Requires-Dist: scipy
|
|
38
|
-
Requires-Dist:
|
|
44
|
+
Requires-Dist: sqlalchemy[asyncio]<3,>=2.0.4
|
|
45
|
+
Requires-Dist: sqlean-py>=3.45.1
|
|
39
46
|
Requires-Dist: starlette
|
|
40
|
-
Requires-Dist: strawberry-graphql==0.
|
|
47
|
+
Requires-Dist: strawberry-graphql==0.227.2
|
|
41
48
|
Requires-Dist: tqdm
|
|
42
49
|
Requires-Dist: typing-extensions>=4.5; python_version < '3.12'
|
|
43
50
|
Requires-Dist: typing-extensions>=4.6; python_version >= '3.12'
|
|
@@ -45,10 +52,21 @@ Requires-Dist: umap-learn
|
|
|
45
52
|
Requires-Dist: uvicorn
|
|
46
53
|
Requires-Dist: wrapt
|
|
47
54
|
Provides-Extra: container
|
|
55
|
+
Requires-Dist: opentelemetry-exporter-otlp; extra == 'container'
|
|
56
|
+
Requires-Dist: opentelemetry-instrumentation-grpc; extra == 'container'
|
|
57
|
+
Requires-Dist: opentelemetry-instrumentation-sqlalchemy; extra == 'container'
|
|
58
|
+
Requires-Dist: opentelemetry-instrumentation-starlette; extra == 'container'
|
|
59
|
+
Requires-Dist: opentelemetry-proto>=1.12.0; extra == 'container'
|
|
60
|
+
Requires-Dist: opentelemetry-sdk; extra == 'container'
|
|
61
|
+
Requires-Dist: opentelemetry-semantic-conventions; extra == 'container'
|
|
48
62
|
Requires-Dist: prometheus-client; extra == 'container'
|
|
63
|
+
Requires-Dist: py-grpc-prometheus; extra == 'container'
|
|
64
|
+
Requires-Dist: strawberry-graphql[opentelemetry]==0.227.2; extra == 'container'
|
|
65
|
+
Requires-Dist: uvloop; (platform_system != 'Windows') and extra == 'container'
|
|
49
66
|
Provides-Extra: dev
|
|
50
67
|
Requires-Dist: anthropic; extra == 'dev'
|
|
51
68
|
Requires-Dist: arize[autoembeddings,llm-evaluation]; extra == 'dev'
|
|
69
|
+
Requires-Dist: asyncpg; extra == 'dev'
|
|
52
70
|
Requires-Dist: gcsfs; extra == 'dev'
|
|
53
71
|
Requires-Dist: google-cloud-aiplatform>=1.3; extra == 'dev'
|
|
54
72
|
Requires-Dist: hatch; extra == 'dev'
|
|
@@ -60,12 +78,14 @@ Requires-Dist: nbqa; extra == 'dev'
|
|
|
60
78
|
Requires-Dist: pandas-stubs<=2.0.2.230605; extra == 'dev'
|
|
61
79
|
Requires-Dist: pre-commit; extra == 'dev'
|
|
62
80
|
Requires-Dist: prometheus-client; extra == 'dev'
|
|
81
|
+
Requires-Dist: psycopg[binary]; extra == 'dev'
|
|
63
82
|
Requires-Dist: pytest-asyncio; extra == 'dev'
|
|
64
83
|
Requires-Dist: pytest-cov; extra == 'dev'
|
|
65
84
|
Requires-Dist: pytest-lazy-fixture; extra == 'dev'
|
|
85
|
+
Requires-Dist: pytest-postgresql; extra == 'dev'
|
|
66
86
|
Requires-Dist: pytest==7.4.4; extra == 'dev'
|
|
67
87
|
Requires-Dist: ruff==0.3.0; extra == 'dev'
|
|
68
|
-
Requires-Dist: strawberry-graphql[debug-server]==0.
|
|
88
|
+
Requires-Dist: strawberry-graphql[debug-server,opentelemetry]==0.227.2; extra == 'dev'
|
|
69
89
|
Provides-Extra: evals
|
|
70
90
|
Requires-Dist: arize-phoenix-evals>=0.3.0; extra == 'evals'
|
|
71
91
|
Provides-Extra: experimental
|
|
@@ -74,6 +94,8 @@ Provides-Extra: llama-index
|
|
|
74
94
|
Requires-Dist: llama-index-callbacks-arize-phoenix>=0.1.2; extra == 'llama-index'
|
|
75
95
|
Requires-Dist: llama-index==0.10.3; extra == 'llama-index'
|
|
76
96
|
Requires-Dist: openinference-instrumentation-llama-index>=1.2.0; extra == 'llama-index'
|
|
97
|
+
Provides-Extra: pg
|
|
98
|
+
Requires-Dist: asyncpg; extra == 'pg'
|
|
77
99
|
Description-Content-Type: text/markdown
|
|
78
100
|
|
|
79
101
|
<p align="center">
|
|
@@ -31,25 +31,32 @@ dependencies = [
|
|
|
31
31
|
"starlette",
|
|
32
32
|
"uvicorn",
|
|
33
33
|
"psutil",
|
|
34
|
-
"strawberry-graphql==0.
|
|
34
|
+
"strawberry-graphql==0.227.2", # need to pin version because we're monkey-patching
|
|
35
35
|
"pyarrow",
|
|
36
36
|
"typing-extensions>=4.5; python_version<'3.12'",
|
|
37
37
|
# A minimum version of typing-extensions==4.6.0 is needed to avoid this issue on Python 3.12: https://github.com/Azure/azure-sdk-for-python/issues/33442#issuecomment-1847886784
|
|
38
38
|
"typing-extensions>=4.6; python_version>='3.12'",
|
|
39
39
|
"scipy",
|
|
40
40
|
"wrapt",
|
|
41
|
-
"sortedcontainers",
|
|
42
41
|
"protobuf>=3.20, <6.0",
|
|
42
|
+
"grpcio",
|
|
43
43
|
"tqdm",
|
|
44
44
|
"requests",
|
|
45
45
|
"opentelemetry-sdk",
|
|
46
46
|
"opentelemetry-proto>=1.12.0", # needed to avoid this issue: https://github.com/Arize-ai/phoenix/issues/2695
|
|
47
47
|
"opentelemetry-exporter-otlp",
|
|
48
|
+
"opentelemetry-semantic-conventions",
|
|
48
49
|
"openinference-semantic-conventions>=0.1.5",
|
|
49
50
|
"openinference-instrumentation",
|
|
50
51
|
"openinference-instrumentation-langchain>=0.1.12",
|
|
51
52
|
"openinference-instrumentation-llama-index>=1.2.0",
|
|
52
53
|
"openinference-instrumentation-openai>=0.1.4",
|
|
54
|
+
"sqlalchemy[asyncio]>=2.0.4, <3",
|
|
55
|
+
"alembic>=1.3.0, <2",
|
|
56
|
+
"aiosqlite",
|
|
57
|
+
"aioitertools",
|
|
58
|
+
"sqlean.py>=3.45.1",
|
|
59
|
+
"cachetools",
|
|
53
60
|
]
|
|
54
61
|
dynamic = ["version"]
|
|
55
62
|
|
|
@@ -65,7 +72,10 @@ dev = [
|
|
|
65
72
|
"pytest-asyncio",
|
|
66
73
|
"pytest-cov",
|
|
67
74
|
"pytest-lazy-fixture",
|
|
68
|
-
"
|
|
75
|
+
"pytest-postgresql",
|
|
76
|
+
"asyncpg",
|
|
77
|
+
"psycopg[binary]",
|
|
78
|
+
"strawberry-graphql[debug-server,opentelemetry]==0.227.2", # need to pin version because we're monkey-patching
|
|
69
79
|
"pre-commit",
|
|
70
80
|
"arize[AutoEmbeddings, LLM_Evaluation]",
|
|
71
81
|
"llama-index>=0.10.3",
|
|
@@ -86,8 +96,21 @@ llama-index = [
|
|
|
86
96
|
"llama-index-callbacks-arize-phoenix>=0.1.2",
|
|
87
97
|
"openinference-instrumentation-llama-index>=1.2.0",
|
|
88
98
|
]
|
|
99
|
+
pg = [
|
|
100
|
+
"asyncpg",
|
|
101
|
+
]
|
|
89
102
|
container = [
|
|
90
103
|
"prometheus-client",
|
|
104
|
+
"opentelemetry-sdk",
|
|
105
|
+
"opentelemetry-proto>=1.12.0",
|
|
106
|
+
"opentelemetry-exporter-otlp",
|
|
107
|
+
"opentelemetry-semantic-conventions",
|
|
108
|
+
"opentelemetry-instrumentation-starlette",
|
|
109
|
+
"opentelemetry-instrumentation-sqlalchemy",
|
|
110
|
+
"opentelemetry-instrumentation-grpc",
|
|
111
|
+
"py-grpc-prometheus",
|
|
112
|
+
"strawberry-graphql[opentelemetry]==0.227.2", # need to pin version because we're monkey-patching
|
|
113
|
+
"uvloop; platform_system != 'Windows'",
|
|
91
114
|
]
|
|
92
115
|
|
|
93
116
|
[project.urls]
|
|
@@ -105,14 +128,14 @@ build-backend = "hatchling.build"
|
|
|
105
128
|
[tool.hatch.build.targets.wheel]
|
|
106
129
|
packages = ["src/phoenix"]
|
|
107
130
|
exclude = ["src/phoenix/evals/"]
|
|
108
|
-
artifacts = ["src/phoenix/server/static"]
|
|
131
|
+
artifacts = ["src/phoenix/server/static", "src/phoenix/db/migrations"]
|
|
109
132
|
|
|
110
133
|
[tool.hatch.build]
|
|
111
134
|
only-packages = true
|
|
112
135
|
|
|
113
136
|
[tool.hatch.build.targets.sdist]
|
|
114
137
|
exclude = ["src/phoenix/evals/", "packages/"]
|
|
115
|
-
artifacts = ["src/phoenix/server/static"]
|
|
138
|
+
artifacts = ["src/phoenix/server/static", "src/phoenix/db/migrations"]
|
|
116
139
|
|
|
117
140
|
[tool.hatch.envs.default]
|
|
118
141
|
dependencies = [
|
|
@@ -121,6 +144,9 @@ dependencies = [
|
|
|
121
144
|
"pytest-asyncio",
|
|
122
145
|
"pytest-cov",
|
|
123
146
|
"pytest-lazy-fixture",
|
|
147
|
+
"pytest-postgresql",
|
|
148
|
+
"asyncpg",
|
|
149
|
+
"psycopg[binary]",
|
|
124
150
|
"arize",
|
|
125
151
|
"litellm>=1.0.3",
|
|
126
152
|
"openai>=1.0.0",
|
|
@@ -134,12 +160,12 @@ dependencies = [
|
|
|
134
160
|
"httpx", # For OpenAI testing
|
|
135
161
|
"respx", # For OpenAI testing
|
|
136
162
|
"nest-asyncio", # for executor testing
|
|
137
|
-
"
|
|
163
|
+
"astunparse; python_version<'3.9'", # `ast.unparse(...)` is only available starting with Python 3.9
|
|
138
164
|
]
|
|
139
165
|
|
|
140
166
|
[tool.hatch.envs.type]
|
|
141
167
|
dependencies = [
|
|
142
|
-
"mypy==1.
|
|
168
|
+
"mypy==1.9.0",
|
|
143
169
|
"tenacity",
|
|
144
170
|
"pandas-stubs<=2.0.2.230605", # version 2.0.3.230814 is causing a dependency conflict.
|
|
145
171
|
"types-psutil",
|
|
@@ -147,15 +173,26 @@ dependencies = [
|
|
|
147
173
|
"types-requests",
|
|
148
174
|
"types-protobuf",
|
|
149
175
|
"types-setuptools",
|
|
176
|
+
"types-cachetools",
|
|
150
177
|
"openai>=1.0.0",
|
|
151
178
|
"litellm>=1.0.3",
|
|
152
179
|
"prometheus_client",
|
|
180
|
+
"grpcio",
|
|
181
|
+
"opentelemetry-sdk",
|
|
182
|
+
"opentelemetry-proto>=1.12.0",
|
|
183
|
+
"opentelemetry-exporter-otlp",
|
|
184
|
+
"opentelemetry-semantic-conventions",
|
|
185
|
+
"opentelemetry-instrumentation-starlette",
|
|
186
|
+
"opentelemetry-instrumentation-sqlalchemy",
|
|
187
|
+
"opentelemetry-instrumentation-grpc",
|
|
188
|
+
"py-grpc-prometheus",
|
|
189
|
+
"strawberry-graphql[opentelemetry]==0.227.2", # need to pin version because we're monkey-patching
|
|
153
190
|
]
|
|
154
191
|
|
|
155
192
|
[tool.hatch.envs.style]
|
|
156
193
|
detached = true
|
|
157
194
|
dependencies = [
|
|
158
|
-
"ruff==0.
|
|
195
|
+
"ruff==0.4.1",
|
|
159
196
|
]
|
|
160
197
|
|
|
161
198
|
[tool.hatch.envs.notebooks]
|
|
@@ -248,7 +285,7 @@ check = [
|
|
|
248
285
|
|
|
249
286
|
[tool.hatch.envs.gql]
|
|
250
287
|
dependencies = [
|
|
251
|
-
"strawberry-graphql[cli]==0.
|
|
288
|
+
"strawberry-graphql[cli]==0.227.2", # need to pin version because we're monkey-patching
|
|
252
289
|
"requests",
|
|
253
290
|
]
|
|
254
291
|
|
|
@@ -308,12 +345,14 @@ module = [
|
|
|
308
345
|
"sklearn.*",
|
|
309
346
|
"arize.*",
|
|
310
347
|
"wrapt",
|
|
311
|
-
"sortedcontainers",
|
|
312
348
|
"langchain.*",
|
|
313
349
|
"litellm",
|
|
314
350
|
"nest_asyncio",
|
|
315
351
|
"opentelemetry.*",
|
|
316
352
|
"pyarrow",
|
|
353
|
+
"sqlean",
|
|
354
|
+
"grpc.*",
|
|
355
|
+
"py_grpc_prometheus.*",
|
|
317
356
|
]
|
|
318
357
|
ignore_missing_imports = true
|
|
319
358
|
|
|
@@ -4,14 +4,19 @@ from importlib.machinery import ModuleSpec
|
|
|
4
4
|
from types import ModuleType
|
|
5
5
|
from typing import Any, Optional
|
|
6
6
|
|
|
7
|
-
from .datasets.dataset import Dataset
|
|
8
|
-
from .datasets.fixtures import ExampleDatasets
|
|
9
7
|
from .inferences.fixtures import ExampleInferences, load_example
|
|
10
8
|
from .inferences.inferences import Inferences
|
|
11
9
|
from .inferences.schema import EmbeddingColumnNames, RetrievalEmbeddingColumnNames, Schema
|
|
12
10
|
from .session.client import Client
|
|
13
11
|
from .session.evaluation import log_evaluations
|
|
14
|
-
from .session.session import
|
|
12
|
+
from .session.session import (
|
|
13
|
+
NotebookEnvironment,
|
|
14
|
+
Session,
|
|
15
|
+
active_session,
|
|
16
|
+
close_app,
|
|
17
|
+
delete_all,
|
|
18
|
+
launch_app,
|
|
19
|
+
)
|
|
15
20
|
from .trace.fixtures import load_example_traces
|
|
16
21
|
from .trace.trace_dataset import TraceDataset
|
|
17
22
|
from .version import __version__
|
|
@@ -34,8 +39,6 @@ Here are just a few of the things that phoenix does well:
|
|
|
34
39
|
|
|
35
40
|
__all__ = [
|
|
36
41
|
"__version__",
|
|
37
|
-
"Dataset",
|
|
38
|
-
"ExampleDatasets",
|
|
39
42
|
"Inferences",
|
|
40
43
|
"EmbeddingColumnNames",
|
|
41
44
|
"RetrievalEmbeddingColumnNames",
|
|
@@ -45,6 +48,7 @@ __all__ = [
|
|
|
45
48
|
"active_session",
|
|
46
49
|
"close_app",
|
|
47
50
|
"launch_app",
|
|
51
|
+
"delete_all",
|
|
48
52
|
"Session",
|
|
49
53
|
"load_example_traces",
|
|
50
54
|
"TraceDataset",
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import tempfile
|
|
3
|
+
from logging import getLogger
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
from typing import List, Optional
|
|
6
|
+
|
|
7
|
+
logger = getLogger(__name__)
|
|
8
|
+
|
|
9
|
+
# Phoenix environment variables
|
|
10
|
+
ENV_PHOENIX_PORT = "PHOENIX_PORT"
|
|
11
|
+
ENV_PHOENIX_GRPC_PORT = "PHOENIX_GRPC_PORT"
|
|
12
|
+
ENV_PHOENIX_HOST = "PHOENIX_HOST"
|
|
13
|
+
ENV_NOTEBOOK_ENV = "PHOENIX_NOTEBOOK_ENV"
|
|
14
|
+
ENV_PHOENIX_COLLECTOR_ENDPOINT = "PHOENIX_COLLECTOR_ENDPOINT"
|
|
15
|
+
"""
|
|
16
|
+
The endpoint traces and evals are sent to. This must be set if the Phoenix
|
|
17
|
+
server is running on a remote instance.
|
|
18
|
+
"""
|
|
19
|
+
ENV_PHOENIX_WORKING_DIR = "PHOENIX_WORKING_DIR"
|
|
20
|
+
"""
|
|
21
|
+
The directory in which to save, load, and export datasets. This directory must
|
|
22
|
+
be accessible by both the Phoenix server and the notebook environment.
|
|
23
|
+
"""
|
|
24
|
+
ENV_PHOENIX_PROJECT_NAME = "PHOENIX_PROJECT_NAME"
|
|
25
|
+
"""
|
|
26
|
+
The project name to use when logging traces and evals. defaults to 'default'.
|
|
27
|
+
"""
|
|
28
|
+
ENV_PHOENIX_SQL_DATABASE_URL = "PHOENIX_SQL_DATABASE_URL"
|
|
29
|
+
"""
|
|
30
|
+
The SQL database URL to use when logging traces and evals.
|
|
31
|
+
By default, Phoenix uses an SQLite database and stores it in the working directory.
|
|
32
|
+
|
|
33
|
+
Phoenix supports two types of database URLs:
|
|
34
|
+
- SQLite: 'sqlite:///path/to/database.db'
|
|
35
|
+
- PostgreSQL: 'postgresql://@host/dbname?user=user&password=password' or 'postgresql://user:password@host/dbname'
|
|
36
|
+
|
|
37
|
+
Note that if you plan on using SQLite, it's advised to to use a persistent volume
|
|
38
|
+
and simply point the PHOENIX_WORKING_DIR to that volume.
|
|
39
|
+
"""
|
|
40
|
+
|
|
41
|
+
ENV_PHOENIX_ENABLE_PROMETHEUS = "PHOENIX_ENABLE_PROMETHEUS"
|
|
42
|
+
"""
|
|
43
|
+
Whether to enable Prometheus. Defaults to false.
|
|
44
|
+
"""
|
|
45
|
+
|
|
46
|
+
# Phoenix server OpenTelemetry instrumentation environment variables
|
|
47
|
+
ENV_PHOENIX_SERVER_INSTRUMENTATION_OTLP_TRACE_COLLECTOR_HTTP_ENDPOINT = (
|
|
48
|
+
"PHOENIX_SERVER_INSTRUMENTATION_OTLP_TRACE_COLLECTOR_HTTP_ENDPOINT"
|
|
49
|
+
)
|
|
50
|
+
ENV_PHOENIX_SERVER_INSTRUMENTATION_OTLP_TRACE_COLLECTOR_GRPC_ENDPOINT = (
|
|
51
|
+
"PHOENIX_SERVER_INSTRUMENTATION_OTLP_TRACE_COLLECTOR_GRPC_ENDPOINT"
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def server_instrumentation_is_enabled() -> bool:
|
|
56
|
+
return bool(
|
|
57
|
+
os.getenv(ENV_PHOENIX_SERVER_INSTRUMENTATION_OTLP_TRACE_COLLECTOR_HTTP_ENDPOINT)
|
|
58
|
+
) or bool(os.getenv(ENV_PHOENIX_SERVER_INSTRUMENTATION_OTLP_TRACE_COLLECTOR_GRPC_ENDPOINT))
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def _get_temp_path() -> Path:
|
|
62
|
+
"""Get path to directory in which to store temp phoenix server files."""
|
|
63
|
+
return Path(tempfile.gettempdir()) / ".arize-phoenix"
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def get_pids_path() -> Path:
|
|
67
|
+
"""Get path to directory in which to store temp phoenix instance pid files.
|
|
68
|
+
This directory is used to track any currently running instances of Arize Phoenix
|
|
69
|
+
on the host machine. The directory will be created if it does not exist.
|
|
70
|
+
"""
|
|
71
|
+
path = _get_temp_path() / "pids"
|
|
72
|
+
path.mkdir(parents=True, exist_ok=True)
|
|
73
|
+
return path
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def get_running_pid() -> Optional[int]:
|
|
77
|
+
for file in get_pids_path().iterdir():
|
|
78
|
+
if file.name.isnumeric():
|
|
79
|
+
return int(file.name)
|
|
80
|
+
return None
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
def get_working_dir() -> Path:
|
|
84
|
+
"""
|
|
85
|
+
Get the working directory for saving, loading, and exporting datasets.
|
|
86
|
+
"""
|
|
87
|
+
working_dir_str = os.getenv(ENV_PHOENIX_WORKING_DIR)
|
|
88
|
+
if working_dir_str is not None:
|
|
89
|
+
return Path(working_dir_str)
|
|
90
|
+
# Fall back to ~/.phoenix if PHOENIX_WORKING_DIR is not set
|
|
91
|
+
return Path.home().resolve() / ".phoenix"
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
PHOENIX_DIR = Path(__file__).resolve().parent
|
|
95
|
+
# Server config
|
|
96
|
+
SERVER_DIR = PHOENIX_DIR / "server"
|
|
97
|
+
HOST = "0.0.0.0"
|
|
98
|
+
"""The host the server will run on after launch_app is called."""
|
|
99
|
+
PORT = 6006
|
|
100
|
+
"""The port the server will run on after launch_app is called."""
|
|
101
|
+
GRPC_PORT = 4317
|
|
102
|
+
"""The port the gRPC server will run on after launch_app is called.
|
|
103
|
+
The default network port for OTLP/gRPC is 4317.
|
|
104
|
+
See https://opentelemetry.io/docs/specs/otlp/#otlpgrpc-default-port"""
|
|
105
|
+
GENERATED_DATASET_NAME_PREFIX = "phoenix_dataset_"
|
|
106
|
+
"""The prefix of datasets that are auto-assigned a name."""
|
|
107
|
+
WORKING_DIR = get_working_dir()
|
|
108
|
+
"""The work directory for saving, loading, and exporting datasets."""
|
|
109
|
+
|
|
110
|
+
ROOT_DIR = WORKING_DIR
|
|
111
|
+
EXPORT_DIR = ROOT_DIR / "exports"
|
|
112
|
+
DATASET_DIR = ROOT_DIR / "datasets"
|
|
113
|
+
TRACE_DATASET_DIR = ROOT_DIR / "trace_datasets"
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
def ensure_working_dir() -> None:
|
|
117
|
+
"""
|
|
118
|
+
Ensure the working directory exists. This is needed because the working directory
|
|
119
|
+
must exist before certain operations can be performed.
|
|
120
|
+
"""
|
|
121
|
+
logger.info(f"📋 Ensuring phoenix working directory: {WORKING_DIR}")
|
|
122
|
+
try:
|
|
123
|
+
for path in (
|
|
124
|
+
ROOT_DIR,
|
|
125
|
+
EXPORT_DIR,
|
|
126
|
+
DATASET_DIR,
|
|
127
|
+
TRACE_DATASET_DIR,
|
|
128
|
+
):
|
|
129
|
+
path.mkdir(parents=True, exist_ok=True)
|
|
130
|
+
except Exception as e:
|
|
131
|
+
print(
|
|
132
|
+
"💥 Failed to initialize the working directory at "
|
|
133
|
+
+ f"{WORKING_DIR} due to an error: {str(e)}."
|
|
134
|
+
+ "Phoenix requires a working directory to persist data"
|
|
135
|
+
)
|
|
136
|
+
raise
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
# Invoke ensure_working_dir() to ensure the working directory exists
|
|
140
|
+
ensure_working_dir()
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
def get_exported_files(directory: Path) -> List[Path]:
|
|
144
|
+
"""
|
|
145
|
+
Yields the list of paths of exported files.
|
|
146
|
+
|
|
147
|
+
Parameters
|
|
148
|
+
----------
|
|
149
|
+
directory: Path
|
|
150
|
+
Disk location to search exported files.
|
|
151
|
+
|
|
152
|
+
Returns
|
|
153
|
+
-------
|
|
154
|
+
list: List[Path]
|
|
155
|
+
List of paths of the exported files.
|
|
156
|
+
"""
|
|
157
|
+
return list(directory.glob("*.parquet"))
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
def get_env_port() -> int:
|
|
161
|
+
if not (port := os.getenv(ENV_PHOENIX_PORT)):
|
|
162
|
+
return PORT
|
|
163
|
+
if port.isnumeric():
|
|
164
|
+
return int(port)
|
|
165
|
+
raise ValueError(
|
|
166
|
+
f"Invalid value for environment variable {ENV_PHOENIX_PORT}: "
|
|
167
|
+
f"{port}. Value must be an integer."
|
|
168
|
+
)
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
def get_env_grpc_port() -> int:
|
|
172
|
+
if not (port := os.getenv(ENV_PHOENIX_GRPC_PORT)):
|
|
173
|
+
return GRPC_PORT
|
|
174
|
+
if port.isnumeric():
|
|
175
|
+
return int(port)
|
|
176
|
+
raise ValueError(
|
|
177
|
+
f"Invalid value for environment variable {ENV_PHOENIX_GRPC_PORT}: "
|
|
178
|
+
f"{port}. Value must be an integer."
|
|
179
|
+
)
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
def get_env_host() -> str:
|
|
183
|
+
return os.getenv(ENV_PHOENIX_HOST) or HOST
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
def get_env_collector_endpoint() -> Optional[str]:
|
|
187
|
+
return os.getenv(ENV_PHOENIX_COLLECTOR_ENDPOINT)
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
def get_env_project_name() -> str:
|
|
191
|
+
return os.getenv(ENV_PHOENIX_PROJECT_NAME) or DEFAULT_PROJECT_NAME
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
def get_env_database_connection_str() -> str:
|
|
195
|
+
env_url = os.getenv(ENV_PHOENIX_SQL_DATABASE_URL)
|
|
196
|
+
if env_url is None:
|
|
197
|
+
working_dir = get_working_dir()
|
|
198
|
+
return f"sqlite:///{working_dir}/phoenix.db"
|
|
199
|
+
return env_url
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
def get_env_enable_prometheus() -> bool:
|
|
203
|
+
if (enable_promotheus := os.getenv(ENV_PHOENIX_ENABLE_PROMETHEUS)) is None or (
|
|
204
|
+
enable_promotheus_lower := enable_promotheus.lower()
|
|
205
|
+
) == "false":
|
|
206
|
+
return False
|
|
207
|
+
if enable_promotheus_lower == "true":
|
|
208
|
+
return True
|
|
209
|
+
raise ValueError(
|
|
210
|
+
f"Invalid value for environment variable {ENV_PHOENIX_ENABLE_PROMETHEUS}: "
|
|
211
|
+
f"{enable_promotheus}. Value values are 'TRUE' and 'FALSE' (case-insensitive)."
|
|
212
|
+
)
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
DEFAULT_PROJECT_NAME = "default"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from datetime import datetime, timedelta, timezone
|
|
1
|
+
from datetime import datetime, timedelta, timezone, tzinfo
|
|
2
2
|
from typing import Any, Optional, Tuple, cast
|
|
3
3
|
|
|
4
4
|
import pandas as pd
|
|
@@ -11,6 +11,23 @@ from pandas.core.dtypes.common import (
|
|
|
11
11
|
is_object_dtype,
|
|
12
12
|
)
|
|
13
13
|
|
|
14
|
+
_LOCAL_TIMEZONE = datetime.now(timezone.utc).astimezone().tzinfo
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def normalize_datetime(
|
|
18
|
+
dt: Optional[datetime],
|
|
19
|
+
tz: Optional[tzinfo] = None,
|
|
20
|
+
) -> Optional[datetime]:
|
|
21
|
+
"""
|
|
22
|
+
If the input datetime is timezone-naive, it is localized as local timezone
|
|
23
|
+
unless tzinfo is specified.
|
|
24
|
+
"""
|
|
25
|
+
if not isinstance(dt, datetime):
|
|
26
|
+
return None
|
|
27
|
+
if dt.tzinfo is None or dt.tzinfo.utcoffset(dt) is None:
|
|
28
|
+
dt = dt.replace(tzinfo=tz if tz else _LOCAL_TIMEZONE)
|
|
29
|
+
return dt.astimezone(timezone.utc)
|
|
30
|
+
|
|
14
31
|
|
|
15
32
|
def normalize_timestamps(
|
|
16
33
|
timestamps: "pd.Series[Any]",
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Database
|
|
2
|
+
|
|
3
|
+
This module is responsible for the database connection and the migrations.
|
|
4
|
+
|
|
5
|
+
## Migrations
|
|
6
|
+
|
|
7
|
+
All migrations are managed by Alembic. Migrations are applied to the database automatically when the application starts.
|
|
8
|
+
|
|
9
|
+
### Applying migrations
|
|
10
|
+
|
|
11
|
+
To manually apply the migrations, run the following command:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
alembic upgrade head
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### Creating a migration
|
|
18
|
+
|
|
19
|
+
All migrations are stored in the `migrations` folder. To create a new migration, run the following command:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
alembic revision -m "your_revision_name"
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Then fill the migration file with the necessary changes.
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# A generic, single database configuration.
|
|
2
|
+
|
|
3
|
+
[alembic]
|
|
4
|
+
# path to migration scripts
|
|
5
|
+
# Note this is overridden in .migrate during programatic migrations
|
|
6
|
+
script_location = migrations
|
|
7
|
+
|
|
8
|
+
# template used to generate migration file names; The default value is %%(rev)s_%%(slug)s
|
|
9
|
+
# Uncomment the line below if you want the files to be prepended with date and time
|
|
10
|
+
# see https://alembic.sqlalchemy.org/en/latest/tutorial.html#editing-the-ini-file
|
|
11
|
+
# for all available tokens
|
|
12
|
+
# file_template = %%(year)d_%%(month).2d_%%(day).2d_%%(hour).2d%%(minute).2d-%%(rev)s_%%(slug)s
|
|
13
|
+
|
|
14
|
+
# sys.path path, will be prepended to sys.path if present.
|
|
15
|
+
# defaults to the current working directory.
|
|
16
|
+
prepend_sys_path = .
|
|
17
|
+
|
|
18
|
+
# timezone to use when rendering the date within the migration file
|
|
19
|
+
# as well as the filename.
|
|
20
|
+
# If specified, requires the python>=3.9 or backports.zoneinfo library.
|
|
21
|
+
# Any required deps can installed by adding `alembic[tz]` to the pip requirements
|
|
22
|
+
# string value is passed to ZoneInfo()
|
|
23
|
+
# leave blank for localtime
|
|
24
|
+
# timezone =
|
|
25
|
+
|
|
26
|
+
# max length of characters to apply to the
|
|
27
|
+
# "slug" field
|
|
28
|
+
# truncate_slug_length = 40
|
|
29
|
+
|
|
30
|
+
# set to 'true' to run the environment during
|
|
31
|
+
# the 'revision' command, regardless of autogenerate
|
|
32
|
+
# revision_environment = false
|
|
33
|
+
|
|
34
|
+
# set to 'true' to allow .pyc and .pyo files without
|
|
35
|
+
# a source .py file to be detected as revisions in the
|
|
36
|
+
# versions/ directory
|
|
37
|
+
# sourceless = false
|
|
38
|
+
|
|
39
|
+
# version location specification; This defaults
|
|
40
|
+
# to migrations/versions. When using multiple version
|
|
41
|
+
# directories, initial revisions must be specified with --version-path.
|
|
42
|
+
# The path separator used here should be the separator specified by "version_path_separator" below.
|
|
43
|
+
# version_locations = %(here)s/bar:%(here)s/bat:migrations/versions
|
|
44
|
+
|
|
45
|
+
# version path separator; As mentioned above, this is the character used to split
|
|
46
|
+
# version_locations. The default within new alembic.ini files is "os", which uses os.pathsep.
|
|
47
|
+
# If this key is omitted entirely, it falls back to the legacy behavior of splitting on spaces and/or commas.
|
|
48
|
+
# Valid values for version_path_separator are:
|
|
49
|
+
#
|
|
50
|
+
# version_path_separator = :
|
|
51
|
+
# version_path_separator = ;
|
|
52
|
+
# version_path_separator = space
|
|
53
|
+
version_path_separator = os # Use os.pathsep. Default configuration used for new projects.
|
|
54
|
+
|
|
55
|
+
# set to 'true' to search source files recursively
|
|
56
|
+
# in each "version_locations" directory
|
|
57
|
+
# new in Alembic version 1.10
|
|
58
|
+
# recursive_version_locations = false
|
|
59
|
+
|
|
60
|
+
# the output encoding used when revision files
|
|
61
|
+
# are written from script.py.mako
|
|
62
|
+
# output_encoding = utf-8
|
|
63
|
+
|
|
64
|
+
# NB: This is commented out intentionally as it is dynamic
|
|
65
|
+
# See migrations/env.py
|
|
66
|
+
# sqlalchemy.url = driver://user:pass@localhost/dbname
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
[post_write_hooks]
|
|
70
|
+
# post_write_hooks defines scripts or Python functions that are run
|
|
71
|
+
# on newly generated revision scripts. See the documentation for further
|
|
72
|
+
# detail and examples
|
|
73
|
+
|
|
74
|
+
# format using "black" - use the console_scripts runner, against the "black" entrypoint
|
|
75
|
+
# hooks = black
|
|
76
|
+
# black.type = console_scripts
|
|
77
|
+
# black.entrypoint = black
|
|
78
|
+
# black.options = -l 79 REVISION_SCRIPT_FILENAME
|
|
79
|
+
|
|
80
|
+
# lint with attempts to fix using "ruff" - use the exec runner, execute a binary
|
|
81
|
+
# hooks = ruff
|
|
82
|
+
# ruff.type = exec
|
|
83
|
+
# ruff.executable = %(here)s/.venv/bin/ruff
|
|
84
|
+
# ruff.options = --fix REVISION_SCRIPT_FILENAME
|
|
85
|
+
|
|
86
|
+
# Logging configuration
|
|
87
|
+
[loggers]
|
|
88
|
+
keys = root,sqlalchemy,alembic
|
|
89
|
+
|
|
90
|
+
[handlers]
|
|
91
|
+
keys = console
|
|
92
|
+
|
|
93
|
+
[formatters]
|
|
94
|
+
keys = generic
|
|
95
|
+
|
|
96
|
+
[logger_root]
|
|
97
|
+
level = WARN
|
|
98
|
+
handlers = console
|
|
99
|
+
qualname =
|
|
100
|
+
|
|
101
|
+
[logger_sqlalchemy]
|
|
102
|
+
level = WARN
|
|
103
|
+
handlers =
|
|
104
|
+
qualname = sqlalchemy.engine
|
|
105
|
+
|
|
106
|
+
[logger_alembic]
|
|
107
|
+
level = WARN
|
|
108
|
+
handlers =
|
|
109
|
+
qualname = alembic
|
|
110
|
+
|
|
111
|
+
[handler_console]
|
|
112
|
+
class = StreamHandler
|
|
113
|
+
args = (sys.stderr,)
|
|
114
|
+
level = NOTSET
|
|
115
|
+
formatter = generic
|
|
116
|
+
|
|
117
|
+
[formatter_generic]
|
|
118
|
+
format = %(levelname)-5.5s [%(name)s] %(message)s
|
|
119
|
+
datefmt = %H:%M:%S
|