arize-phoenix 5.8.0__tar.gz → 5.9.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of arize-phoenix might be problematic. Click here for more details.
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/PKG-INFO +1 -1
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/pyproject.toml +1 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/config.py +13 -1
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/db/helpers.py +55 -1
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/helpers/playground_clients.py +160 -8
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/mutations/chat_mutations.py +198 -11
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/queries.py +5 -1
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/routers/oauth2.py +55 -23
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/routers/v1/spans.py +25 -1
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/ExperimentRun.py +38 -1
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/GenerativeProvider.py +2 -1
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/app.py +7 -2
- arize_phoenix-5.9.1/src/phoenix/server/static/.vite/manifest.json +78 -0
- arize_phoenix-5.8.0/src/phoenix/server/static/assets/components-MllbfxfJ.js → arize_phoenix-5.9.1/src/phoenix/server/static/assets/components-BcvRmBnN.js +320 -297
- arize_phoenix-5.8.0/src/phoenix/server/static/assets/index-BVO2YcT1.js → arize_phoenix-5.9.1/src/phoenix/server/static/assets/index-BF4RUiOz.js +2 -2
- arize_phoenix-5.8.0/src/phoenix/server/static/assets/pages-BHfC6jnL.js → arize_phoenix-5.9.1/src/phoenix/server/static/assets/pages-CM_Zho_x.js +617 -454
- arize_phoenix-5.8.0/src/phoenix/server/static/assets/vendor-BEuNhfwH.js → arize_phoenix-5.9.1/src/phoenix/server/static/assets/vendor-Bjm5T3cE.js +181 -181
- arize_phoenix-5.8.0/src/phoenix/server/static/assets/vendor-arizeai-Bskhzyjm.js → arize_phoenix-5.9.1/src/phoenix/server/static/assets/vendor-arizeai-CQhWGEdL.js +2 -2
- arize_phoenix-5.8.0/src/phoenix/server/static/assets/vendor-codemirror-DLlXCf0x.js → arize_phoenix-5.9.1/src/phoenix/server/static/assets/vendor-codemirror-CdtiO80y.js +5 -5
- arize_phoenix-5.8.0/src/phoenix/server/static/assets/vendor-recharts-CRqhvLYg.js → arize_phoenix-5.9.1/src/phoenix/server/static/assets/vendor-recharts-BqWon6Py.js +1 -1
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/session/client.py +27 -7
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/utilities/json.py +31 -1
- arize_phoenix-5.9.1/src/phoenix/version.py +1 -0
- arize_phoenix-5.8.0/src/phoenix/server/static/.vite/manifest.json +0 -78
- arize_phoenix-5.8.0/src/phoenix/version.py +0 -1
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/.gitignore +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/IP_NOTICE +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/LICENSE +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/README.md +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/__init__.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/auth.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/core/__init__.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/core/embedding_dimension.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/core/model.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/core/model_schema.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/core/model_schema_adapter.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/datetime_utils.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/db/README.md +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/db/__init__.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/db/alembic.ini +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/db/bulk_inserter.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/db/engines.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/db/enums.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/db/facilitator.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/db/insertion/__init__.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/db/insertion/constants.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/db/insertion/dataset.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/db/insertion/document_annotation.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/db/insertion/evaluation.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/db/insertion/helpers.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/db/insertion/span.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/db/insertion/span_annotation.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/db/insertion/trace_annotation.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/db/insertion/types.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/db/migrate.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/db/migrations/__init__.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/db/migrations/env.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/db/migrations/script.py.mako +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/db/migrations/versions/10460e46d750_datasets.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/db/migrations/versions/3be8647b87d8_add_token_columns_to_spans_table.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/db/migrations/versions/cd164e83824f_users_and_tokens.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/db/migrations/versions/cf03bd6bae1d_init.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/db/models.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/exceptions.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/experiments/__init__.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/experiments/evaluators/__init__.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/experiments/evaluators/base.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/experiments/evaluators/code_evaluators.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/experiments/evaluators/llm_evaluators.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/experiments/evaluators/utils.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/experiments/functions.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/experiments/tracing.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/experiments/types.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/experiments/utils.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/inferences/__init__.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/inferences/errors.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/inferences/fixtures.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/inferences/inferences.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/inferences/schema.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/inferences/validation.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/logging/__init__.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/logging/_config.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/logging/_filter.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/logging/_formatter.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/metrics/README.md +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/metrics/__init__.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/metrics/binning.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/metrics/metrics.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/metrics/mixins.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/metrics/retrieval_metrics.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/metrics/timeseries.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/metrics/wrappers.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/pointcloud/__init__.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/pointcloud/clustering.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/pointcloud/pointcloud.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/pointcloud/projectors.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/pointcloud/umap_parameters.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/py.typed +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/__init__.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/README.md +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/__init__.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/auth.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/context.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/dataloaders/__init__.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/dataloaders/annotation_summaries.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/dataloaders/average_experiment_run_latency.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/dataloaders/cache/__init__.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/dataloaders/cache/two_tier_cache.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/dataloaders/dataset_example_revisions.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/dataloaders/dataset_example_spans.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/dataloaders/document_evaluation_summaries.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/dataloaders/document_evaluations.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/dataloaders/document_retrieval_metrics.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/dataloaders/experiment_annotation_summaries.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/dataloaders/experiment_error_rates.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/dataloaders/experiment_run_annotations.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/dataloaders/experiment_run_counts.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/dataloaders/experiment_sequence_number.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/dataloaders/latency_ms_quantile.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/dataloaders/min_start_or_max_end_times.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/dataloaders/project_by_name.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/dataloaders/record_counts.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/dataloaders/span_annotations.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/dataloaders/span_dataset_examples.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/dataloaders/span_descendants.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/dataloaders/span_projects.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/dataloaders/token_counts.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/dataloaders/trace_row_ids.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/dataloaders/user_roles.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/dataloaders/users.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/exceptions.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/helpers/__init__.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/helpers/dataset_helpers.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/helpers/playground_registry.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/helpers/playground_spans.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/input_types/AddExamplesToDatasetInput.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/input_types/AddSpansToDatasetInput.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/input_types/ChatCompletionInput.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/input_types/ChatCompletionMessageInput.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/input_types/ClearProjectInput.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/input_types/ClusterInput.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/input_types/Coordinates.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/input_types/CreateDatasetInput.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/input_types/CreateSpanAnnotationInput.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/input_types/CreateTraceAnnotationInput.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/input_types/DataQualityMetricInput.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/input_types/DatasetExampleInput.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/input_types/DatasetSort.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/input_types/DatasetVersionSort.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/input_types/DeleteAnnotationsInput.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/input_types/DeleteDatasetExamplesInput.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/input_types/DeleteDatasetInput.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/input_types/DeleteExperimentsInput.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/input_types/DimensionFilter.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/input_types/DimensionInput.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/input_types/GenerativeModelInput.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/input_types/Granularity.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/input_types/InvocationParameters.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/input_types/PatchAnnotationInput.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/input_types/PatchDatasetExamplesInput.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/input_types/PatchDatasetInput.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/input_types/PerformanceMetricInput.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/input_types/SpanAnnotationSort.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/input_types/SpanSort.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/input_types/TemplateOptions.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/input_types/TimeRange.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/input_types/TraceAnnotationSort.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/input_types/UserRoleInput.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/input_types/__init__.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/interceptor.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/mutations/__init__.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/mutations/api_key_mutations.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/mutations/dataset_mutations.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/mutations/experiment_mutations.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/mutations/export_events_mutations.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/mutations/project_mutations.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/mutations/span_annotations_mutations.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/mutations/trace_annotations_mutations.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/mutations/user_mutations.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/openapi/__init__.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/openapi/main.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/openapi/schema.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/routers/__init__.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/routers/auth.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/routers/embeddings.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/routers/utils.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/routers/v1/__init__.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/routers/v1/datasets.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/routers/v1/evaluations.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/routers/v1/experiment_evaluations.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/routers/v1/experiment_runs.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/routers/v1/experiments.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/routers/v1/pydantic_compat.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/routers/v1/traces.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/routers/v1/utils.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/schema.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/subscriptions.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/Annotation.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/AnnotationSummary.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/AnnotatorKind.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/ApiKey.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/AuthMethod.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/ChatCompletionMessageRole.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/ChatCompletionSubscriptionPayload.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/Cluster.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/CreateDatasetPayload.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/DataQualityMetric.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/Dataset.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/DatasetExample.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/DatasetExampleRevision.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/DatasetValues.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/DatasetVersion.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/Dimension.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/DimensionDataType.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/DimensionShape.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/DimensionType.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/DimensionWithValue.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/DocumentEvaluationSummary.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/DocumentRetrievalMetrics.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/EmbeddingDimension.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/EmbeddingMetadata.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/Evaluation.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/EvaluationSummary.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/Event.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/EventMetadata.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/ExampleRevisionInterface.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/Experiment.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/ExperimentAnnotationSummary.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/ExperimentComparison.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/ExperimentRunAnnotation.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/ExportedFile.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/Functionality.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/GenerativeModel.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/Inferences.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/InferencesRole.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/LabelFraction.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/MimeType.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/Model.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/NumericRange.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/PerformanceMetric.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/Project.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/PromptResponse.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/Retrieval.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/ScalarDriftMetricEnum.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/Segments.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/SortDir.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/Span.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/SpanAnnotation.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/SystemApiKey.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/TemplateLanguage.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/TimeSeries.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/Trace.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/TraceAnnotation.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/UMAPPoints.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/User.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/UserApiKey.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/UserRole.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/ValidationResult.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/VectorDriftMetricEnum.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/__init__.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/node.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/types/pagination.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/utils.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/bearer_auth.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/dml_event.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/dml_event_handler.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/email/__init__.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/email/sender.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/email/templates/__init__.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/email/templates/password_reset.html +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/email/types.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/grpc_server.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/jwt_store.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/main.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/oauth2.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/openapi/__init__.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/prometheus.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/rate_limiters.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/static/apple-touch-icon-114x114.png +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/static/apple-touch-icon-120x120.png +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/static/apple-touch-icon-144x144.png +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/static/apple-touch-icon-152x152.png +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/static/apple-touch-icon-180x180.png +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/static/apple-touch-icon-72x72.png +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/static/apple-touch-icon-76x76.png +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/static/apple-touch-icon.png +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/static/assets/vendor-DxkFTwjz.css +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/static/assets/vendor-three-DwGkEfCM.js +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/static/favicon.ico +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/static/modernizr.js +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/telemetry.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/templates/__init__.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/templates/index.html +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/thread_server.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/types.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/services.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/session/__init__.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/session/data_extractor.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/session/evaluation.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/session/session.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/settings.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/trace/__init__.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/trace/attributes.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/trace/dsl/README.md +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/trace/dsl/__init__.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/trace/dsl/filter.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/trace/dsl/helpers.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/trace/dsl/query.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/trace/errors.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/trace/evaluation_conventions.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/trace/exporter.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/trace/fixtures.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/trace/otel.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/trace/projects.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/trace/schemas.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/trace/span_evaluations.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/trace/span_json_decoder.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/trace/span_json_encoder.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/trace/trace_dataset.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/trace/utils.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/trace/v1/__init__.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/trace/v1/evaluation_pb2.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/trace/v1/evaluation_pb2.pyi +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/utilities/__init__.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/utilities/client.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/utilities/deprecation.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/utilities/error_handling.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/utilities/logging.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/utilities/project.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/utilities/re.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/utilities/span_store.py +0 -0
- {arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/utilities/template_formatters.py +0 -0
|
@@ -559,7 +559,19 @@ def get_env_host() -> str:
|
|
|
559
559
|
|
|
560
560
|
|
|
561
561
|
def get_env_host_root_path() -> str:
|
|
562
|
-
|
|
562
|
+
if (host_root_path := os.getenv(ENV_PHOENIX_HOST_ROOT_PATH)) is None:
|
|
563
|
+
return HOST_ROOT_PATH
|
|
564
|
+
if not host_root_path.startswith("/"):
|
|
565
|
+
raise ValueError(
|
|
566
|
+
f"Invalid value for environment variable {ENV_PHOENIX_HOST_ROOT_PATH}: "
|
|
567
|
+
f"{host_root_path}. Value must start with '/'"
|
|
568
|
+
)
|
|
569
|
+
if host_root_path.endswith("/"):
|
|
570
|
+
raise ValueError(
|
|
571
|
+
f"Invalid value for environment variable {ENV_PHOENIX_HOST_ROOT_PATH}: "
|
|
572
|
+
f"{host_root_path}. Value cannot end with '/'"
|
|
573
|
+
)
|
|
574
|
+
return host_root_path
|
|
563
575
|
|
|
564
576
|
|
|
565
577
|
def get_env_collector_endpoint() -> Optional[str]:
|
|
@@ -7,7 +7,16 @@ from openinference.semconv.trace import (
|
|
|
7
7
|
RerankerAttributes,
|
|
8
8
|
SpanAttributes,
|
|
9
9
|
)
|
|
10
|
-
from sqlalchemy import
|
|
10
|
+
from sqlalchemy import (
|
|
11
|
+
Integer,
|
|
12
|
+
Select,
|
|
13
|
+
SQLColumnExpression,
|
|
14
|
+
and_,
|
|
15
|
+
case,
|
|
16
|
+
distinct,
|
|
17
|
+
func,
|
|
18
|
+
select,
|
|
19
|
+
)
|
|
11
20
|
from typing_extensions import assert_never
|
|
12
21
|
|
|
13
22
|
from phoenix.db import models
|
|
@@ -103,3 +112,48 @@ def dedup(
|
|
|
103
112
|
ans.append(item)
|
|
104
113
|
seen.add(k)
|
|
105
114
|
return ans
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
def get_dataset_example_revisions(
|
|
118
|
+
dataset_version_id: int,
|
|
119
|
+
) -> Select[tuple[models.DatasetExampleRevision]]:
|
|
120
|
+
version = (
|
|
121
|
+
select(
|
|
122
|
+
models.DatasetVersion.id,
|
|
123
|
+
models.DatasetVersion.dataset_id,
|
|
124
|
+
)
|
|
125
|
+
.filter_by(id=dataset_version_id)
|
|
126
|
+
.subquery()
|
|
127
|
+
)
|
|
128
|
+
table = models.DatasetExampleRevision
|
|
129
|
+
revision = (
|
|
130
|
+
select(
|
|
131
|
+
table.dataset_example_id,
|
|
132
|
+
func.max(table.dataset_version_id).label("dataset_version_id"),
|
|
133
|
+
)
|
|
134
|
+
.join_from(
|
|
135
|
+
table,
|
|
136
|
+
models.DatasetExample,
|
|
137
|
+
table.dataset_example_id == models.DatasetExample.id,
|
|
138
|
+
)
|
|
139
|
+
.join_from(
|
|
140
|
+
models.DatasetExample,
|
|
141
|
+
version,
|
|
142
|
+
models.DatasetExample.dataset_id == version.c.dataset_id,
|
|
143
|
+
)
|
|
144
|
+
.where(models.DatasetExample.dataset_id == version.c.dataset_id)
|
|
145
|
+
.where(table.dataset_version_id <= version.c.id)
|
|
146
|
+
.group_by(table.dataset_example_id)
|
|
147
|
+
.subquery()
|
|
148
|
+
)
|
|
149
|
+
return (
|
|
150
|
+
select(table)
|
|
151
|
+
.where(table.revision_kind != "DELETE")
|
|
152
|
+
.join(
|
|
153
|
+
revision,
|
|
154
|
+
onclause=and_(
|
|
155
|
+
revision.c.dataset_example_id == table.dataset_example_id,
|
|
156
|
+
revision.c.dataset_version_id == table.dataset_version_id,
|
|
157
|
+
),
|
|
158
|
+
)
|
|
159
|
+
)
|
{arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/helpers/playground_clients.py
RENAMED
|
@@ -26,6 +26,7 @@ from phoenix.server.api.input_types.GenerativeModelInput import GenerativeModelI
|
|
|
26
26
|
from phoenix.server.api.input_types.InvocationParameters import (
|
|
27
27
|
BoundedFloatInvocationParameter,
|
|
28
28
|
CanonicalParameterName,
|
|
29
|
+
FloatInvocationParameter,
|
|
29
30
|
IntInvocationParameter,
|
|
30
31
|
InvocationParameter,
|
|
31
32
|
InvocationParameterInput,
|
|
@@ -44,14 +45,28 @@ from phoenix.server.api.types.GenerativeProvider import GenerativeProviderKey
|
|
|
44
45
|
|
|
45
46
|
if TYPE_CHECKING:
|
|
46
47
|
from anthropic.types import MessageParam
|
|
48
|
+
from google.generativeai.types import ContentType
|
|
47
49
|
from openai.types import CompletionUsage
|
|
48
50
|
from openai.types.chat import ChatCompletionMessageParam, ChatCompletionMessageToolCallParam
|
|
49
51
|
|
|
50
|
-
DependencyName: TypeAlias = str
|
|
51
52
|
SetSpanAttributesFn: TypeAlias = Callable[[Mapping[str, Any]], None]
|
|
52
53
|
ChatCompletionChunk: TypeAlias = Union[TextChunk, ToolCallChunk]
|
|
53
54
|
|
|
54
55
|
|
|
56
|
+
class Dependency:
|
|
57
|
+
"""
|
|
58
|
+
Set the module_name to the import name if it is different from the install name
|
|
59
|
+
"""
|
|
60
|
+
|
|
61
|
+
def __init__(self, name: str, module_name: Optional[str] = None):
|
|
62
|
+
self.name = name
|
|
63
|
+
self.module_name = module_name
|
|
64
|
+
|
|
65
|
+
@property
|
|
66
|
+
def import_name(self) -> str:
|
|
67
|
+
return self.module_name or self.name
|
|
68
|
+
|
|
69
|
+
|
|
55
70
|
class KeyedSingleton:
|
|
56
71
|
_instances: dict[Hashable, "KeyedSingleton"] = {}
|
|
57
72
|
|
|
@@ -148,8 +163,8 @@ class PlaygroundStreamingClient(ABC):
|
|
|
148
163
|
|
|
149
164
|
@classmethod
|
|
150
165
|
@abstractmethod
|
|
151
|
-
def dependencies(cls) -> list[
|
|
152
|
-
# A list of
|
|
166
|
+
def dependencies(cls) -> list[Dependency]:
|
|
167
|
+
# A list of dependencies this client needs to run
|
|
153
168
|
...
|
|
154
169
|
|
|
155
170
|
@classmethod
|
|
@@ -194,7 +209,8 @@ class PlaygroundStreamingClient(ABC):
|
|
|
194
209
|
def dependencies_are_installed(cls) -> bool:
|
|
195
210
|
try:
|
|
196
211
|
for dependency in cls.dependencies():
|
|
197
|
-
|
|
212
|
+
import_name = dependency.import_name
|
|
213
|
+
if importlib.util.find_spec(import_name) is None:
|
|
198
214
|
return False
|
|
199
215
|
return True
|
|
200
216
|
except ValueError:
|
|
@@ -244,8 +260,8 @@ class OpenAIStreamingClient(PlaygroundStreamingClient):
|
|
|
244
260
|
self.rate_limiter = PlaygroundRateLimiter(model.provider_key, OpenAIRateLimitError)
|
|
245
261
|
|
|
246
262
|
@classmethod
|
|
247
|
-
def dependencies(cls) -> list[
|
|
248
|
-
return ["openai"]
|
|
263
|
+
def dependencies(cls) -> list[Dependency]:
|
|
264
|
+
return [Dependency(name="openai")]
|
|
249
265
|
|
|
250
266
|
@classmethod
|
|
251
267
|
def supported_invocation_parameters(cls) -> list[InvocationParameter]:
|
|
@@ -331,6 +347,9 @@ class OpenAIStreamingClient(PlaygroundStreamingClient):
|
|
|
331
347
|
if (usage := chunk.usage) is not None:
|
|
332
348
|
token_usage = usage
|
|
333
349
|
continue
|
|
350
|
+
if not chunk.choices:
|
|
351
|
+
# for Azure, initial chunk contains the content filter
|
|
352
|
+
continue
|
|
334
353
|
choice = chunk.choices[0]
|
|
335
354
|
delta = choice.delta
|
|
336
355
|
if choice.finish_reason is None:
|
|
@@ -624,8 +643,8 @@ class AnthropicStreamingClient(PlaygroundStreamingClient):
|
|
|
624
643
|
self.rate_limiter = PlaygroundRateLimiter(model.provider_key, anthropic.RateLimitError)
|
|
625
644
|
|
|
626
645
|
@classmethod
|
|
627
|
-
def dependencies(cls) -> list[
|
|
628
|
-
return ["anthropic"]
|
|
646
|
+
def dependencies(cls) -> list[Dependency]:
|
|
647
|
+
return [Dependency(name="anthropic")]
|
|
629
648
|
|
|
630
649
|
@classmethod
|
|
631
650
|
def supported_invocation_parameters(cls) -> list[InvocationParameter]:
|
|
@@ -746,6 +765,139 @@ class AnthropicStreamingClient(PlaygroundStreamingClient):
|
|
|
746
765
|
return anthropic_messages, system_prompt
|
|
747
766
|
|
|
748
767
|
|
|
768
|
+
@register_llm_client(
|
|
769
|
+
provider_key=GenerativeProviderKey.GEMINI,
|
|
770
|
+
model_names=[
|
|
771
|
+
PROVIDER_DEFAULT,
|
|
772
|
+
"gemini-1.5-flash",
|
|
773
|
+
"gemini-1.5-flash-8b",
|
|
774
|
+
"gemini-1.5-pro",
|
|
775
|
+
"gemini-1.0-pro",
|
|
776
|
+
],
|
|
777
|
+
)
|
|
778
|
+
class GeminiStreamingClient(PlaygroundStreamingClient):
|
|
779
|
+
def __init__(
|
|
780
|
+
self,
|
|
781
|
+
model: GenerativeModelInput,
|
|
782
|
+
api_key: Optional[str] = None,
|
|
783
|
+
) -> None:
|
|
784
|
+
import google.generativeai as google_genai
|
|
785
|
+
|
|
786
|
+
super().__init__(model=model, api_key=api_key)
|
|
787
|
+
google_genai.configure(api_key=api_key)
|
|
788
|
+
self.model_name = model.name
|
|
789
|
+
|
|
790
|
+
@classmethod
|
|
791
|
+
def dependencies(cls) -> list[Dependency]:
|
|
792
|
+
return [Dependency(name="google-generativeai", module_name="google.generativeai")]
|
|
793
|
+
|
|
794
|
+
@classmethod
|
|
795
|
+
def supported_invocation_parameters(cls) -> list[InvocationParameter]:
|
|
796
|
+
return [
|
|
797
|
+
BoundedFloatInvocationParameter(
|
|
798
|
+
invocation_name="temperature",
|
|
799
|
+
canonical_name=CanonicalParameterName.TEMPERATURE,
|
|
800
|
+
label="Temperature",
|
|
801
|
+
default_value=0.0,
|
|
802
|
+
min_value=0.0,
|
|
803
|
+
max_value=2.0,
|
|
804
|
+
),
|
|
805
|
+
IntInvocationParameter(
|
|
806
|
+
invocation_name="max_output_tokens",
|
|
807
|
+
canonical_name=CanonicalParameterName.MAX_COMPLETION_TOKENS,
|
|
808
|
+
label="Max Output Tokens",
|
|
809
|
+
),
|
|
810
|
+
StringListInvocationParameter(
|
|
811
|
+
invocation_name="stop",
|
|
812
|
+
canonical_name=CanonicalParameterName.STOP_SEQUENCES,
|
|
813
|
+
label="Stop Sequences",
|
|
814
|
+
),
|
|
815
|
+
FloatInvocationParameter(
|
|
816
|
+
invocation_name="presence_penalty",
|
|
817
|
+
label="Presence Penalty",
|
|
818
|
+
),
|
|
819
|
+
FloatInvocationParameter(
|
|
820
|
+
invocation_name="frequency_penalty",
|
|
821
|
+
label="Frequency Penalty",
|
|
822
|
+
),
|
|
823
|
+
BoundedFloatInvocationParameter(
|
|
824
|
+
invocation_name="top_p",
|
|
825
|
+
canonical_name=CanonicalParameterName.TOP_P,
|
|
826
|
+
label="Top P",
|
|
827
|
+
min_value=0.0,
|
|
828
|
+
max_value=1.0,
|
|
829
|
+
),
|
|
830
|
+
BoundedFloatInvocationParameter(
|
|
831
|
+
invocation_name="top_k",
|
|
832
|
+
label="Top K",
|
|
833
|
+
min_value=0.0,
|
|
834
|
+
max_value=1.0,
|
|
835
|
+
),
|
|
836
|
+
IntInvocationParameter(
|
|
837
|
+
invocation_name="seed",
|
|
838
|
+
canonical_name=CanonicalParameterName.RANDOM_SEED,
|
|
839
|
+
label="Seed",
|
|
840
|
+
),
|
|
841
|
+
]
|
|
842
|
+
|
|
843
|
+
async def chat_completion_create(
|
|
844
|
+
self,
|
|
845
|
+
messages: list[
|
|
846
|
+
tuple[ChatCompletionMessageRole, str, Optional[str], Optional[list[JSONScalarType]]]
|
|
847
|
+
],
|
|
848
|
+
tools: list[JSONScalarType],
|
|
849
|
+
**invocation_parameters: Any,
|
|
850
|
+
) -> AsyncIterator[ChatCompletionChunk]:
|
|
851
|
+
import google.generativeai as google_genai
|
|
852
|
+
|
|
853
|
+
gemini_message_history, current_message, system_prompt = self._build_gemini_messages(
|
|
854
|
+
messages
|
|
855
|
+
)
|
|
856
|
+
|
|
857
|
+
model_args = {"model_name": self.model_name}
|
|
858
|
+
if system_prompt:
|
|
859
|
+
model_args["system_instruction"] = system_prompt
|
|
860
|
+
client = google_genai.GenerativeModel(**model_args)
|
|
861
|
+
|
|
862
|
+
gemini_config = google_genai.GenerationConfig(
|
|
863
|
+
**invocation_parameters,
|
|
864
|
+
)
|
|
865
|
+
gemini_params = {
|
|
866
|
+
"content": current_message,
|
|
867
|
+
"generation_config": gemini_config,
|
|
868
|
+
"stream": True,
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
chat = client.start_chat(history=gemini_message_history)
|
|
872
|
+
stream = await chat.send_message_async(**gemini_params)
|
|
873
|
+
async for event in stream:
|
|
874
|
+
yield TextChunk(content=event.text)
|
|
875
|
+
|
|
876
|
+
def _build_gemini_messages(
|
|
877
|
+
self,
|
|
878
|
+
messages: list[tuple[ChatCompletionMessageRole, str, Optional[str], Optional[list[str]]]],
|
|
879
|
+
) -> tuple[list["ContentType"], str, str]:
|
|
880
|
+
gemini_message_history: list["ContentType"] = []
|
|
881
|
+
system_prompts = []
|
|
882
|
+
for role, content, _tool_call_id, _tool_calls in messages:
|
|
883
|
+
if role == ChatCompletionMessageRole.USER:
|
|
884
|
+
gemini_message_history.append({"role": "user", "parts": content})
|
|
885
|
+
elif role == ChatCompletionMessageRole.AI:
|
|
886
|
+
gemini_message_history.append({"role": "model", "parts": content})
|
|
887
|
+
elif role == ChatCompletionMessageRole.SYSTEM:
|
|
888
|
+
system_prompts.append(content)
|
|
889
|
+
elif role == ChatCompletionMessageRole.TOOL:
|
|
890
|
+
raise NotImplementedError
|
|
891
|
+
else:
|
|
892
|
+
assert_never(role)
|
|
893
|
+
if gemini_message_history:
|
|
894
|
+
prompt = gemini_message_history.pop()["parts"]
|
|
895
|
+
else:
|
|
896
|
+
prompt = ""
|
|
897
|
+
|
|
898
|
+
return gemini_message_history, prompt, "\n".join(system_prompts)
|
|
899
|
+
|
|
900
|
+
|
|
749
901
|
def initialize_playground_clients() -> None:
|
|
750
902
|
"""
|
|
751
903
|
Ensure that all playground clients are registered at import time.
|
{arize_phoenix-5.8.0 → arize_phoenix-5.9.1}/src/phoenix/server/api/mutations/chat_mutations.py
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
from dataclasses import asdict
|
|
1
|
+
import asyncio
|
|
2
|
+
from dataclasses import asdict, field
|
|
3
3
|
from datetime import datetime, timezone
|
|
4
4
|
from itertools import chain
|
|
5
5
|
from traceback import format_exc
|
|
6
|
-
from typing import Any, Iterable, Iterator, List, Optional
|
|
6
|
+
from typing import Any, Iterable, Iterator, List, Optional, Union
|
|
7
7
|
|
|
8
8
|
import strawberry
|
|
9
9
|
from openinference.instrumentation import safe_json_dumps
|
|
@@ -18,14 +18,19 @@ from openinference.semconv.trace import (
|
|
|
18
18
|
from opentelemetry.sdk.trace.id_generator import RandomIdGenerator as DefaultOTelIDGenerator
|
|
19
19
|
from opentelemetry.trace import StatusCode
|
|
20
20
|
from sqlalchemy import insert, select
|
|
21
|
+
from strawberry.relay import GlobalID
|
|
21
22
|
from strawberry.types import Info
|
|
22
23
|
from typing_extensions import assert_never
|
|
23
24
|
|
|
24
25
|
from phoenix.datetime_utils import local_now, normalize_datetime
|
|
25
26
|
from phoenix.db import models
|
|
27
|
+
from phoenix.db.helpers import get_dataset_example_revisions
|
|
26
28
|
from phoenix.server.api.context import Context
|
|
27
|
-
from phoenix.server.api.exceptions import BadRequest
|
|
28
|
-
from phoenix.server.api.helpers.playground_clients import
|
|
29
|
+
from phoenix.server.api.exceptions import BadRequest, NotFound
|
|
30
|
+
from phoenix.server.api.helpers.playground_clients import (
|
|
31
|
+
PlaygroundStreamingClient,
|
|
32
|
+
initialize_playground_clients,
|
|
33
|
+
)
|
|
29
34
|
from phoenix.server.api.helpers.playground_registry import PLAYGROUND_CLIENT_REGISTRY
|
|
30
35
|
from phoenix.server.api.helpers.playground_spans import (
|
|
31
36
|
input_value_and_mime_type,
|
|
@@ -35,17 +40,28 @@ from phoenix.server.api.helpers.playground_spans import (
|
|
|
35
40
|
llm_span_kind,
|
|
36
41
|
llm_tools,
|
|
37
42
|
)
|
|
38
|
-
from phoenix.server.api.input_types.ChatCompletionInput import
|
|
43
|
+
from phoenix.server.api.input_types.ChatCompletionInput import (
|
|
44
|
+
ChatCompletionInput,
|
|
45
|
+
ChatCompletionOverDatasetInput,
|
|
46
|
+
)
|
|
39
47
|
from phoenix.server.api.input_types.TemplateOptions import TemplateOptions
|
|
48
|
+
from phoenix.server.api.subscriptions import (
|
|
49
|
+
_default_playground_experiment_description,
|
|
50
|
+
_default_playground_experiment_metadata,
|
|
51
|
+
_default_playground_experiment_name,
|
|
52
|
+
)
|
|
40
53
|
from phoenix.server.api.types.ChatCompletionMessageRole import ChatCompletionMessageRole
|
|
41
54
|
from phoenix.server.api.types.ChatCompletionSubscriptionPayload import (
|
|
42
55
|
TextChunk,
|
|
43
56
|
ToolCallChunk,
|
|
44
57
|
)
|
|
58
|
+
from phoenix.server.api.types.Dataset import Dataset
|
|
59
|
+
from phoenix.server.api.types.DatasetVersion import DatasetVersion
|
|
60
|
+
from phoenix.server.api.types.node import from_global_id_with_expected_type
|
|
45
61
|
from phoenix.server.api.types.Span import Span, to_gql_span
|
|
46
62
|
from phoenix.server.api.types.TemplateLanguage import TemplateLanguage
|
|
47
63
|
from phoenix.server.dml_event import SpanInsertEvent
|
|
48
|
-
from phoenix.trace.attributes import unflatten
|
|
64
|
+
from phoenix.trace.attributes import get_attribute_value, unflatten
|
|
49
65
|
from phoenix.trace.schemas import SpanException
|
|
50
66
|
from phoenix.utilities.json import jsonify
|
|
51
67
|
from phoenix.utilities.template_formatters import (
|
|
@@ -79,21 +95,192 @@ class ChatCompletionMutationPayload:
|
|
|
79
95
|
error_message: Optional[str]
|
|
80
96
|
|
|
81
97
|
|
|
98
|
+
@strawberry.type
|
|
99
|
+
class ChatCompletionMutationError:
|
|
100
|
+
message: str
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
@strawberry.type
|
|
104
|
+
class ChatCompletionOverDatasetMutationExamplePayload:
|
|
105
|
+
dataset_example_id: GlobalID
|
|
106
|
+
experiment_run_id: GlobalID
|
|
107
|
+
result: Union[ChatCompletionMutationPayload, ChatCompletionMutationError]
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
@strawberry.type
|
|
111
|
+
class ChatCompletionOverDatasetMutationPayload:
|
|
112
|
+
dataset_id: GlobalID
|
|
113
|
+
dataset_version_id: GlobalID
|
|
114
|
+
experiment_id: GlobalID
|
|
115
|
+
examples: list[ChatCompletionOverDatasetMutationExamplePayload] = field(default_factory=list)
|
|
116
|
+
|
|
117
|
+
|
|
82
118
|
@strawberry.type
|
|
83
119
|
class ChatCompletionMutationMixin:
|
|
84
120
|
@strawberry.mutation
|
|
121
|
+
@classmethod
|
|
122
|
+
async def chat_completion_over_dataset(
|
|
123
|
+
cls,
|
|
124
|
+
info: Info[Context, None],
|
|
125
|
+
input: ChatCompletionOverDatasetInput,
|
|
126
|
+
) -> ChatCompletionOverDatasetMutationPayload:
|
|
127
|
+
provider_key = input.model.provider_key
|
|
128
|
+
llm_client_class = PLAYGROUND_CLIENT_REGISTRY.get_client(provider_key, input.model.name)
|
|
129
|
+
if llm_client_class is None:
|
|
130
|
+
raise BadRequest(f"No LLM client registered for provider '{provider_key}'")
|
|
131
|
+
llm_client = llm_client_class(
|
|
132
|
+
model=input.model,
|
|
133
|
+
api_key=input.api_key,
|
|
134
|
+
)
|
|
135
|
+
dataset_id = from_global_id_with_expected_type(input.dataset_id, Dataset.__name__)
|
|
136
|
+
dataset_version_id = (
|
|
137
|
+
from_global_id_with_expected_type(
|
|
138
|
+
global_id=input.dataset_version_id, expected_type_name=DatasetVersion.__name__
|
|
139
|
+
)
|
|
140
|
+
if input.dataset_version_id
|
|
141
|
+
else None
|
|
142
|
+
)
|
|
143
|
+
async with info.context.db() as session:
|
|
144
|
+
dataset = await session.scalar(select(models.Dataset).filter_by(id=dataset_id))
|
|
145
|
+
if dataset is None:
|
|
146
|
+
raise NotFound("Dataset not found")
|
|
147
|
+
if dataset_version_id is None:
|
|
148
|
+
resolved_version_id = await session.scalar(
|
|
149
|
+
select(models.DatasetVersion.id)
|
|
150
|
+
.filter_by(dataset_id=dataset_id)
|
|
151
|
+
.order_by(models.DatasetVersion.id.desc())
|
|
152
|
+
.limit(1)
|
|
153
|
+
)
|
|
154
|
+
if resolved_version_id is None:
|
|
155
|
+
raise NotFound("No versions found for the given dataset")
|
|
156
|
+
else:
|
|
157
|
+
resolved_version_id = dataset_version_id
|
|
158
|
+
revisions = [
|
|
159
|
+
revision
|
|
160
|
+
async for revision in await session.stream_scalars(
|
|
161
|
+
get_dataset_example_revisions(resolved_version_id)
|
|
162
|
+
)
|
|
163
|
+
]
|
|
164
|
+
if not revisions:
|
|
165
|
+
raise NotFound("No examples found for the given dataset and version")
|
|
166
|
+
experiment = models.Experiment(
|
|
167
|
+
dataset_id=from_global_id_with_expected_type(input.dataset_id, Dataset.__name__),
|
|
168
|
+
dataset_version_id=resolved_version_id,
|
|
169
|
+
name=input.experiment_name or _default_playground_experiment_name(),
|
|
170
|
+
description=input.experiment_description
|
|
171
|
+
or _default_playground_experiment_description(dataset_name=dataset.name),
|
|
172
|
+
repetitions=1,
|
|
173
|
+
metadata_=input.experiment_metadata
|
|
174
|
+
or _default_playground_experiment_metadata(
|
|
175
|
+
dataset_name=dataset.name,
|
|
176
|
+
dataset_id=input.dataset_id,
|
|
177
|
+
version_id=GlobalID(DatasetVersion.__name__, str(resolved_version_id)),
|
|
178
|
+
),
|
|
179
|
+
project_name=PLAYGROUND_PROJECT_NAME,
|
|
180
|
+
)
|
|
181
|
+
session.add(experiment)
|
|
182
|
+
await session.flush()
|
|
183
|
+
|
|
184
|
+
start_time = datetime.now(timezone.utc)
|
|
185
|
+
results = await asyncio.gather(
|
|
186
|
+
*(
|
|
187
|
+
cls._chat_completion(
|
|
188
|
+
info,
|
|
189
|
+
llm_client,
|
|
190
|
+
ChatCompletionInput(
|
|
191
|
+
model=input.model,
|
|
192
|
+
api_key=input.api_key,
|
|
193
|
+
messages=input.messages,
|
|
194
|
+
tools=input.tools,
|
|
195
|
+
invocation_parameters=input.invocation_parameters,
|
|
196
|
+
template=TemplateOptions(
|
|
197
|
+
language=input.template_language,
|
|
198
|
+
variables=revision.input,
|
|
199
|
+
),
|
|
200
|
+
),
|
|
201
|
+
)
|
|
202
|
+
for revision in revisions
|
|
203
|
+
),
|
|
204
|
+
return_exceptions=True,
|
|
205
|
+
)
|
|
206
|
+
|
|
207
|
+
payload = ChatCompletionOverDatasetMutationPayload(
|
|
208
|
+
dataset_id=GlobalID(models.Dataset.__name__, str(dataset.id)),
|
|
209
|
+
dataset_version_id=GlobalID(DatasetVersion.__name__, str(resolved_version_id)),
|
|
210
|
+
experiment_id=GlobalID(models.Experiment.__name__, str(experiment.id)),
|
|
211
|
+
)
|
|
212
|
+
experiment_runs = []
|
|
213
|
+
for revision, result in zip(revisions, results):
|
|
214
|
+
if isinstance(result, BaseException):
|
|
215
|
+
experiment_run = models.ExperimentRun(
|
|
216
|
+
experiment_id=experiment.id,
|
|
217
|
+
dataset_example_id=revision.dataset_example_id,
|
|
218
|
+
output={},
|
|
219
|
+
repetition_number=1,
|
|
220
|
+
start_time=start_time,
|
|
221
|
+
end_time=start_time,
|
|
222
|
+
error=str(result),
|
|
223
|
+
)
|
|
224
|
+
else:
|
|
225
|
+
db_span = result.span.db_span
|
|
226
|
+
experiment_run = models.ExperimentRun(
|
|
227
|
+
experiment_id=experiment.id,
|
|
228
|
+
dataset_example_id=revision.dataset_example_id,
|
|
229
|
+
trace_id=str(result.span.context.trace_id),
|
|
230
|
+
output=models.ExperimentRunOutput(
|
|
231
|
+
task_output=get_attribute_value(db_span.attributes, LLM_OUTPUT_MESSAGES),
|
|
232
|
+
),
|
|
233
|
+
prompt_token_count=db_span.cumulative_llm_token_count_prompt,
|
|
234
|
+
completion_token_count=db_span.cumulative_llm_token_count_completion,
|
|
235
|
+
repetition_number=1,
|
|
236
|
+
start_time=result.span.start_time,
|
|
237
|
+
end_time=result.span.end_time,
|
|
238
|
+
error=str(result.error_message) if result.error_message else None,
|
|
239
|
+
)
|
|
240
|
+
experiment_runs.append(experiment_run)
|
|
241
|
+
|
|
242
|
+
async with info.context.db() as session:
|
|
243
|
+
session.add_all(experiment_runs)
|
|
244
|
+
await session.flush()
|
|
245
|
+
|
|
246
|
+
for revision, experiment_run, result in zip(revisions, experiment_runs, results):
|
|
247
|
+
dataset_example_id = GlobalID(
|
|
248
|
+
models.DatasetExample.__name__, str(revision.dataset_example_id)
|
|
249
|
+
)
|
|
250
|
+
experiment_run_id = GlobalID(models.ExperimentRun.__name__, str(experiment_run.id))
|
|
251
|
+
example_payload = ChatCompletionOverDatasetMutationExamplePayload(
|
|
252
|
+
dataset_example_id=dataset_example_id,
|
|
253
|
+
experiment_run_id=experiment_run_id,
|
|
254
|
+
result=result
|
|
255
|
+
if isinstance(result, ChatCompletionMutationPayload)
|
|
256
|
+
else ChatCompletionMutationError(message=str(result)),
|
|
257
|
+
)
|
|
258
|
+
payload.examples.append(example_payload)
|
|
259
|
+
return payload
|
|
260
|
+
|
|
261
|
+
@strawberry.mutation
|
|
262
|
+
@classmethod
|
|
85
263
|
async def chat_completion(
|
|
86
|
-
|
|
264
|
+
cls, info: Info[Context, None], input: ChatCompletionInput
|
|
87
265
|
) -> ChatCompletionMutationPayload:
|
|
88
266
|
provider_key = input.model.provider_key
|
|
89
267
|
llm_client_class = PLAYGROUND_CLIENT_REGISTRY.get_client(provider_key, input.model.name)
|
|
90
268
|
if llm_client_class is None:
|
|
91
269
|
raise BadRequest(f"No LLM client registered for provider '{provider_key}'")
|
|
92
|
-
attributes: dict[str, Any] = {}
|
|
93
270
|
llm_client = llm_client_class(
|
|
94
271
|
model=input.model,
|
|
95
272
|
api_key=input.api_key,
|
|
96
273
|
)
|
|
274
|
+
return await cls._chat_completion(info, llm_client, input)
|
|
275
|
+
|
|
276
|
+
@classmethod
|
|
277
|
+
async def _chat_completion(
|
|
278
|
+
cls,
|
|
279
|
+
info: Info[Context, None],
|
|
280
|
+
llm_client: PlaygroundStreamingClient,
|
|
281
|
+
input: ChatCompletionInput,
|
|
282
|
+
) -> ChatCompletionMutationPayload:
|
|
283
|
+
attributes: dict[str, Any] = {}
|
|
97
284
|
|
|
98
285
|
messages = [
|
|
99
286
|
(
|
|
@@ -122,7 +309,6 @@ class ChatCompletionMutationMixin:
|
|
|
122
309
|
llm_input_messages(messages),
|
|
123
310
|
llm_invocation_parameters(invocation_parameters),
|
|
124
311
|
input_value_and_mime_type(input),
|
|
125
|
-
**llm_client.attributes,
|
|
126
312
|
)
|
|
127
313
|
)
|
|
128
314
|
|
|
@@ -167,6 +353,7 @@ class ChatCompletionMutationMixin:
|
|
|
167
353
|
else:
|
|
168
354
|
end_time = normalize_datetime(dt=local_now(), tz=timezone.utc)
|
|
169
355
|
|
|
356
|
+
attributes.update(llm_client.attributes)
|
|
170
357
|
if text_content or tool_calls:
|
|
171
358
|
attributes.update(
|
|
172
359
|
chain(
|
|
@@ -306,7 +493,7 @@ def _llm_output_messages(
|
|
|
306
493
|
if arguments := tool_call.function.arguments:
|
|
307
494
|
yield (
|
|
308
495
|
f"{LLM_OUTPUT_MESSAGES}.0.{MESSAGE_TOOL_CALLS}.{tool_call_index}.{TOOL_CALL_FUNCTION_ARGUMENTS_JSON}",
|
|
309
|
-
|
|
496
|
+
arguments,
|
|
310
497
|
)
|
|
311
498
|
|
|
312
499
|
|
|
@@ -48,6 +48,7 @@ from phoenix.server.api.input_types.DatasetSort import DatasetSort
|
|
|
48
48
|
from phoenix.server.api.input_types.InvocationParameters import (
|
|
49
49
|
InvocationParameter,
|
|
50
50
|
)
|
|
51
|
+
from phoenix.server.api.subscriptions import PLAYGROUND_PROJECT_NAME
|
|
51
52
|
from phoenix.server.api.types.Cluster import Cluster, to_gql_clusters
|
|
52
53
|
from phoenix.server.api.types.Dataset import Dataset, to_gql_dataset
|
|
53
54
|
from phoenix.server.api.types.DatasetExample import DatasetExample
|
|
@@ -237,7 +238,10 @@ class Query:
|
|
|
237
238
|
select(models.Project)
|
|
238
239
|
.outerjoin(
|
|
239
240
|
models.Experiment,
|
|
240
|
-
|
|
241
|
+
and_(
|
|
242
|
+
models.Project.name == models.Experiment.project_name,
|
|
243
|
+
models.Experiment.project_name != PLAYGROUND_PROJECT_NAME,
|
|
244
|
+
),
|
|
241
245
|
)
|
|
242
246
|
.where(models.Experiment.project_name.is_(None))
|
|
243
247
|
.order_by(models.Project.id)
|