arize-phoenix 4.12.0rc1__py3-none-any.whl → 4.14.1__py3-none-any.whl
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-4.12.0rc1.dist-info → arize_phoenix-4.14.1.dist-info}/METADATA +10 -6
- {arize_phoenix-4.12.0rc1.dist-info → arize_phoenix-4.14.1.dist-info}/RECORD +35 -35
- phoenix/db/bulk_inserter.py +3 -1
- phoenix/experiments/evaluators/base.py +4 -0
- phoenix/experiments/evaluators/code_evaluators.py +80 -0
- phoenix/experiments/evaluators/llm_evaluators.py +77 -1
- phoenix/experiments/evaluators/utils.py +70 -21
- phoenix/experiments/functions.py +14 -14
- phoenix/server/api/dataloaders/average_experiment_run_latency.py +23 -23
- phoenix/server/api/dataloaders/experiment_error_rates.py +30 -10
- phoenix/server/api/dataloaders/experiment_run_counts.py +18 -5
- phoenix/server/api/input_types/{CreateSpanAnnotationsInput.py → CreateSpanAnnotationInput.py} +4 -2
- phoenix/server/api/input_types/{CreateTraceAnnotationsInput.py → CreateTraceAnnotationInput.py} +4 -2
- phoenix/server/api/input_types/{PatchAnnotationsInput.py → PatchAnnotationInput.py} +4 -2
- phoenix/server/api/mutations/span_annotations_mutations.py +12 -6
- phoenix/server/api/mutations/trace_annotations_mutations.py +12 -6
- phoenix/server/api/types/Experiment.py +2 -2
- phoenix/server/api/types/Inferences.py +1 -2
- phoenix/server/api/types/Model.py +1 -2
- phoenix/server/app.py +3 -7
- phoenix/server/static/.vite/manifest.json +31 -31
- phoenix/server/static/assets/{components-C8sm_r1F.js → components-DeS0YEmv.js} +2 -2
- phoenix/server/static/assets/index-CQgXRwU0.js +100 -0
- phoenix/server/static/assets/{pages-bN7juCjh.js → pages-hdjlFZhO.js} +275 -198
- phoenix/server/static/assets/{vendor-CUDAPm8e.js → vendor-DPvSDRn3.js} +1 -1
- phoenix/server/static/assets/{vendor-arizeai-Do2HOmcL.js → vendor-arizeai-CkvPT67c.js} +2 -2
- phoenix/server/static/assets/{vendor-codemirror-CrdxOlMs.js → vendor-codemirror-Cqwpwlua.js} +1 -1
- phoenix/server/static/assets/{vendor-recharts-PKRvByVe.js → vendor-recharts-5jlNaZuF.js} +1 -1
- phoenix/server/templates/index.html +51 -43
- phoenix/session/client.py +7 -5
- phoenix/trace/dsl/filter.py +40 -25
- phoenix/version.py +1 -1
- phoenix/server/static/assets/index-BEKPzgQs.js +0 -100
- {arize_phoenix-4.12.0rc1.dist-info → arize_phoenix-4.14.1.dist-info}/WHEEL +0 -0
- {arize_phoenix-4.12.0rc1.dist-info → arize_phoenix-4.14.1.dist-info}/licenses/IP_NOTICE +0 -0
- {arize_phoenix-4.12.0rc1.dist-info → arize_phoenix-4.14.1.dist-info}/licenses/LICENSE +0 -0
phoenix/experiments/functions.py
CHANGED
|
@@ -120,21 +120,23 @@ def run_experiment(
|
|
|
120
120
|
output. If the `task` is a function of one argument then that argument will be bound to the
|
|
121
121
|
`input` field of the dataset example. Alternatively, the `task` can be a function of any
|
|
122
122
|
combination of specific argument names that will be bound to special values:
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
123
|
+
|
|
124
|
+
- `input`: The input field of the dataset example
|
|
125
|
+
- `expected`: The expected or reference output of the dataset example
|
|
126
|
+
- `reference`: An alias for `expected`
|
|
127
|
+
- `metadata`: Metadata associated with the dataset example
|
|
128
|
+
- `example`: The dataset `Example` object with all associated fields
|
|
128
129
|
|
|
129
130
|
An `evaluator` is either a synchronous or asynchronous function that returns either a boolean
|
|
130
131
|
or numeric "score". If the `evaluator` is a function of one argument then that argument will be
|
|
131
132
|
bound to the `output` of the task. Alternatively, the `evaluator` can be a function of any
|
|
132
133
|
combination of specific argument names that will be bound to special values:
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
134
|
+
|
|
135
|
+
- `input`: The input field of the dataset example
|
|
136
|
+
- `output`: The output of the task
|
|
137
|
+
- `expected`: The expected or reference output of the dataset example
|
|
138
|
+
- `reference`: An alias for `expected`
|
|
139
|
+
- `metadata`: Metadata associated with the dataset example
|
|
138
140
|
|
|
139
141
|
Phoenix also provides pre-built evaluators in the `phoenix.experiments.evaluators` module.
|
|
140
142
|
|
|
@@ -366,10 +368,9 @@ def run_experiment(
|
|
|
366
368
|
return exp_run
|
|
367
369
|
|
|
368
370
|
_errors: Tuple[Type[BaseException], ...]
|
|
369
|
-
if not
|
|
371
|
+
if not isinstance(rate_limit_errors, Sequence):
|
|
370
372
|
_errors = (rate_limit_errors,) if rate_limit_errors is not None else ()
|
|
371
373
|
else:
|
|
372
|
-
rate_limit_errors = cast(Sequence[Type[BaseException]], rate_limit_errors)
|
|
373
374
|
_errors = tuple(filter(None, rate_limit_errors))
|
|
374
375
|
rate_limiters = [RateLimiter(rate_limit_error=rate_limit_error) for rate_limit_error in _errors]
|
|
375
376
|
|
|
@@ -606,10 +607,9 @@ def evaluate_experiment(
|
|
|
606
607
|
return eval_run
|
|
607
608
|
|
|
608
609
|
_errors: Tuple[Type[BaseException], ...]
|
|
609
|
-
if not
|
|
610
|
+
if not isinstance(rate_limit_errors, Sequence):
|
|
610
611
|
_errors = (rate_limit_errors,) if rate_limit_errors is not None else ()
|
|
611
612
|
else:
|
|
612
|
-
rate_limit_errors = cast(Sequence[Type[BaseException]], rate_limit_errors)
|
|
613
613
|
_errors = tuple(filter(None, rate_limit_errors))
|
|
614
614
|
rate_limiters = [RateLimiter(rate_limit_error=rate_limit_error) for rate_limit_error in _errors]
|
|
615
615
|
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
from typing import
|
|
2
|
-
AsyncContextManager,
|
|
3
|
-
Callable,
|
|
4
|
-
List,
|
|
5
|
-
)
|
|
1
|
+
from typing import AsyncContextManager, Callable, List, Optional
|
|
6
2
|
|
|
7
3
|
from sqlalchemy import func, select
|
|
8
4
|
from sqlalchemy.ext.asyncio import AsyncSession
|
|
@@ -12,7 +8,7 @@ from typing_extensions import TypeAlias
|
|
|
12
8
|
from phoenix.db import models
|
|
13
9
|
|
|
14
10
|
ExperimentID: TypeAlias = int
|
|
15
|
-
RunLatency: TypeAlias = float
|
|
11
|
+
RunLatency: TypeAlias = Optional[float]
|
|
16
12
|
Key: TypeAlias = ExperimentID
|
|
17
13
|
Result: TypeAlias = RunLatency
|
|
18
14
|
|
|
@@ -27,26 +23,30 @@ class AverageExperimentRunLatencyDataLoader(DataLoader[Key, Result]):
|
|
|
27
23
|
|
|
28
24
|
async def _load_fn(self, keys: List[Key]) -> List[Result]:
|
|
29
25
|
experiment_ids = keys
|
|
26
|
+
resolved_experiment_ids = (
|
|
27
|
+
select(models.Experiment.id)
|
|
28
|
+
.where(models.Experiment.id.in_(set(experiment_ids)))
|
|
29
|
+
.subquery()
|
|
30
|
+
)
|
|
31
|
+
query = (
|
|
32
|
+
select(
|
|
33
|
+
resolved_experiment_ids.c.id,
|
|
34
|
+
func.avg(
|
|
35
|
+
func.extract("epoch", models.ExperimentRun.end_time)
|
|
36
|
+
- func.extract("epoch", models.ExperimentRun.start_time)
|
|
37
|
+
),
|
|
38
|
+
)
|
|
39
|
+
.outerjoin_from(
|
|
40
|
+
from_=resolved_experiment_ids,
|
|
41
|
+
target=models.ExperimentRun,
|
|
42
|
+
onclause=resolved_experiment_ids.c.id == models.ExperimentRun.experiment_id,
|
|
43
|
+
)
|
|
44
|
+
.group_by(resolved_experiment_ids.c.id)
|
|
45
|
+
)
|
|
30
46
|
async with self._db() as session:
|
|
31
47
|
avg_latencies = {
|
|
32
48
|
experiment_id: avg_latency
|
|
33
|
-
async for experiment_id, avg_latency in await session.stream(
|
|
34
|
-
select(
|
|
35
|
-
models.ExperimentRun.experiment_id,
|
|
36
|
-
func.avg(
|
|
37
|
-
func.extract(
|
|
38
|
-
"epoch",
|
|
39
|
-
models.ExperimentRun.end_time,
|
|
40
|
-
)
|
|
41
|
-
- func.extract(
|
|
42
|
-
"epoch",
|
|
43
|
-
models.ExperimentRun.start_time,
|
|
44
|
-
)
|
|
45
|
-
),
|
|
46
|
-
)
|
|
47
|
-
.where(models.ExperimentRun.experiment_id.in_(set(experiment_ids)))
|
|
48
|
-
.group_by(models.ExperimentRun.experiment_id)
|
|
49
|
-
)
|
|
49
|
+
async for experiment_id, avg_latency in await session.stream(query)
|
|
50
50
|
}
|
|
51
51
|
return [
|
|
52
52
|
avg_latencies.get(experiment_id, ValueError(f"Unknown experiment: {experiment_id}"))
|
|
@@ -5,7 +5,7 @@ from typing import (
|
|
|
5
5
|
Optional,
|
|
6
6
|
)
|
|
7
7
|
|
|
8
|
-
from sqlalchemy import func, select
|
|
8
|
+
from sqlalchemy import case, func, select
|
|
9
9
|
from sqlalchemy.ext.asyncio import AsyncSession
|
|
10
10
|
from strawberry.dataloader import DataLoader
|
|
11
11
|
from typing_extensions import TypeAlias
|
|
@@ -28,16 +28,36 @@ class ExperimentErrorRatesDataLoader(DataLoader[Key, Result]):
|
|
|
28
28
|
|
|
29
29
|
async def _load_fn(self, keys: List[Key]) -> List[Result]:
|
|
30
30
|
experiment_ids = keys
|
|
31
|
+
resolved_experiment_ids = (
|
|
32
|
+
select(models.Experiment.id)
|
|
33
|
+
.where(models.Experiment.id.in_(set(experiment_ids)))
|
|
34
|
+
.subquery()
|
|
35
|
+
)
|
|
36
|
+
query = (
|
|
37
|
+
select(
|
|
38
|
+
resolved_experiment_ids.c.id,
|
|
39
|
+
case(
|
|
40
|
+
(
|
|
41
|
+
func.count(models.ExperimentRun.id) != 0,
|
|
42
|
+
func.count(models.ExperimentRun.error)
|
|
43
|
+
/ func.count(models.ExperimentRun.id),
|
|
44
|
+
),
|
|
45
|
+
else_=None,
|
|
46
|
+
),
|
|
47
|
+
)
|
|
48
|
+
.outerjoin_from(
|
|
49
|
+
from_=resolved_experiment_ids,
|
|
50
|
+
target=models.ExperimentRun,
|
|
51
|
+
onclause=resolved_experiment_ids.c.id == models.ExperimentRun.experiment_id,
|
|
52
|
+
)
|
|
53
|
+
.group_by(resolved_experiment_ids.c.id)
|
|
54
|
+
)
|
|
31
55
|
async with self._db() as session:
|
|
32
56
|
error_rates = {
|
|
33
57
|
experiment_id: error_rate
|
|
34
|
-
async for experiment_id, error_rate in await session.stream(
|
|
35
|
-
select(
|
|
36
|
-
models.ExperimentRun.experiment_id,
|
|
37
|
-
func.count(models.ExperimentRun.error) / func.count(),
|
|
38
|
-
)
|
|
39
|
-
.group_by(models.ExperimentRun.experiment_id)
|
|
40
|
-
.where(models.ExperimentRun.experiment_id.in_(experiment_ids))
|
|
41
|
-
)
|
|
58
|
+
async for experiment_id, error_rate in await session.stream(query)
|
|
42
59
|
}
|
|
43
|
-
return [
|
|
60
|
+
return [
|
|
61
|
+
error_rates.get(experiment_id, ValueError(f"Unknown experiment ID: {experiment_id}"))
|
|
62
|
+
for experiment_id in experiment_ids
|
|
63
|
+
]
|
|
@@ -27,14 +27,27 @@ class ExperimentRunCountsDataLoader(DataLoader[Key, Result]):
|
|
|
27
27
|
|
|
28
28
|
async def _load_fn(self, keys: List[Key]) -> List[Result]:
|
|
29
29
|
experiment_ids = keys
|
|
30
|
+
resolved_experiment_ids = (
|
|
31
|
+
select(models.Experiment.id)
|
|
32
|
+
.where(models.Experiment.id.in_(set(experiment_ids)))
|
|
33
|
+
.subquery()
|
|
34
|
+
)
|
|
35
|
+
query = (
|
|
36
|
+
select(
|
|
37
|
+
resolved_experiment_ids.c.id,
|
|
38
|
+
func.count(models.ExperimentRun.experiment_id),
|
|
39
|
+
)
|
|
40
|
+
.outerjoin_from(
|
|
41
|
+
from_=resolved_experiment_ids,
|
|
42
|
+
target=models.ExperimentRun,
|
|
43
|
+
onclause=resolved_experiment_ids.c.id == models.ExperimentRun.experiment_id,
|
|
44
|
+
)
|
|
45
|
+
.group_by(resolved_experiment_ids.c.id)
|
|
46
|
+
)
|
|
30
47
|
async with self._db() as session:
|
|
31
48
|
run_counts = {
|
|
32
49
|
experiment_id: run_count
|
|
33
|
-
async for experiment_id, run_count in await session.stream(
|
|
34
|
-
select(models.ExperimentRun.experiment_id, func.count())
|
|
35
|
-
.where(models.ExperimentRun.experiment_id.in_(set(experiment_ids)))
|
|
36
|
-
.group_by(models.ExperimentRun.experiment_id)
|
|
37
|
-
)
|
|
50
|
+
async for experiment_id, run_count in await session.stream(query)
|
|
38
51
|
}
|
|
39
52
|
return [
|
|
40
53
|
run_counts.get(experiment_id, ValueError(f"Unknown experiment: {experiment_id}"))
|
phoenix/server/api/input_types/{CreateSpanAnnotationsInput.py → CreateSpanAnnotationInput.py}
RENAMED
|
@@ -4,12 +4,14 @@ import strawberry
|
|
|
4
4
|
from strawberry.relay import GlobalID
|
|
5
5
|
from strawberry.scalars import JSON
|
|
6
6
|
|
|
7
|
+
from phoenix.server.api.types.AnnotatorKind import AnnotatorKind
|
|
8
|
+
|
|
7
9
|
|
|
8
10
|
@strawberry.input
|
|
9
|
-
class
|
|
11
|
+
class CreateSpanAnnotationInput:
|
|
10
12
|
span_id: GlobalID
|
|
11
13
|
name: str
|
|
12
|
-
annotator_kind:
|
|
14
|
+
annotator_kind: AnnotatorKind
|
|
13
15
|
label: Optional[str] = None
|
|
14
16
|
score: Optional[float] = None
|
|
15
17
|
explanation: Optional[str] = None
|
phoenix/server/api/input_types/{CreateTraceAnnotationsInput.py → CreateTraceAnnotationInput.py}
RENAMED
|
@@ -4,12 +4,14 @@ import strawberry
|
|
|
4
4
|
from strawberry.relay import GlobalID
|
|
5
5
|
from strawberry.scalars import JSON
|
|
6
6
|
|
|
7
|
+
from phoenix.server.api.types.AnnotatorKind import AnnotatorKind
|
|
8
|
+
|
|
7
9
|
|
|
8
10
|
@strawberry.input
|
|
9
|
-
class
|
|
11
|
+
class CreateTraceAnnotationInput:
|
|
10
12
|
trace_id: GlobalID
|
|
11
13
|
name: str
|
|
12
|
-
annotator_kind:
|
|
14
|
+
annotator_kind: AnnotatorKind
|
|
13
15
|
label: Optional[str] = None
|
|
14
16
|
score: Optional[float] = None
|
|
15
17
|
explanation: Optional[str] = None
|
|
@@ -5,12 +5,14 @@ from strawberry import UNSET
|
|
|
5
5
|
from strawberry.relay import GlobalID
|
|
6
6
|
from strawberry.scalars import JSON
|
|
7
7
|
|
|
8
|
+
from phoenix.server.api.types.AnnotatorKind import AnnotatorKind
|
|
9
|
+
|
|
8
10
|
|
|
9
11
|
@strawberry.input
|
|
10
|
-
class
|
|
12
|
+
class PatchAnnotationInput:
|
|
11
13
|
annotation_id: GlobalID
|
|
12
14
|
name: Optional[str] = UNSET
|
|
13
|
-
annotator_kind: Optional[
|
|
15
|
+
annotator_kind: Optional[AnnotatorKind] = UNSET
|
|
14
16
|
label: Optional[str] = UNSET
|
|
15
17
|
score: Optional[float] = UNSET
|
|
16
18
|
explanation: Optional[str] = UNSET
|
|
@@ -7,9 +7,9 @@ from strawberry.types import Info
|
|
|
7
7
|
|
|
8
8
|
from phoenix.db import models
|
|
9
9
|
from phoenix.server.api.context import Context
|
|
10
|
-
from phoenix.server.api.input_types.
|
|
10
|
+
from phoenix.server.api.input_types.CreateSpanAnnotationInput import CreateSpanAnnotationInput
|
|
11
11
|
from phoenix.server.api.input_types.DeleteAnnotationsInput import DeleteAnnotationsInput
|
|
12
|
-
from phoenix.server.api.input_types.
|
|
12
|
+
from phoenix.server.api.input_types.PatchAnnotationInput import PatchAnnotationInput
|
|
13
13
|
from phoenix.server.api.mutations.auth import IsAuthenticated
|
|
14
14
|
from phoenix.server.api.types.node import from_global_id_with_expected_type
|
|
15
15
|
from phoenix.server.api.types.SpanAnnotation import SpanAnnotation, to_gql_span_annotation
|
|
@@ -24,7 +24,7 @@ class SpanAnnotationMutationPayload:
|
|
|
24
24
|
class SpanAnnotationMutationMixin:
|
|
25
25
|
@strawberry.mutation(permission_classes=[IsAuthenticated]) # type: ignore
|
|
26
26
|
async def create_span_annotations(
|
|
27
|
-
self, info: Info[Context, None], input: List[
|
|
27
|
+
self, info: Info[Context, None], input: List[CreateSpanAnnotationInput]
|
|
28
28
|
) -> SpanAnnotationMutationPayload:
|
|
29
29
|
inserted_annotations: Sequence[models.SpanAnnotation] = []
|
|
30
30
|
async with info.context.db() as session:
|
|
@@ -35,7 +35,7 @@ class SpanAnnotationMutationMixin:
|
|
|
35
35
|
label=annotation.label,
|
|
36
36
|
score=annotation.score,
|
|
37
37
|
explanation=annotation.explanation,
|
|
38
|
-
annotator_kind=annotation.annotator_kind,
|
|
38
|
+
annotator_kind=annotation.annotator_kind.value,
|
|
39
39
|
metadata_=annotation.metadata,
|
|
40
40
|
)
|
|
41
41
|
for annotation in input
|
|
@@ -54,7 +54,7 @@ class SpanAnnotationMutationMixin:
|
|
|
54
54
|
|
|
55
55
|
@strawberry.mutation(permission_classes=[IsAuthenticated]) # type: ignore
|
|
56
56
|
async def patch_span_annotations(
|
|
57
|
-
self, info: Info[Context, None], input: List[
|
|
57
|
+
self, info: Info[Context, None], input: List[PatchAnnotationInput]
|
|
58
58
|
) -> SpanAnnotationMutationPayload:
|
|
59
59
|
patched_annotations = []
|
|
60
60
|
async with info.context.db() as session:
|
|
@@ -66,7 +66,13 @@ class SpanAnnotationMutationMixin:
|
|
|
66
66
|
column.key: patch_value
|
|
67
67
|
for column, patch_value, column_is_nullable in (
|
|
68
68
|
(models.SpanAnnotation.name, annotation.name, False),
|
|
69
|
-
(
|
|
69
|
+
(
|
|
70
|
+
models.SpanAnnotation.annotator_kind,
|
|
71
|
+
annotation.annotator_kind.value
|
|
72
|
+
if annotation.annotator_kind is not None
|
|
73
|
+
else None,
|
|
74
|
+
False,
|
|
75
|
+
),
|
|
70
76
|
(models.SpanAnnotation.label, annotation.label, True),
|
|
71
77
|
(models.SpanAnnotation.score, annotation.score, True),
|
|
72
78
|
(models.SpanAnnotation.explanation, annotation.explanation, True),
|
|
@@ -7,9 +7,9 @@ from strawberry.types import Info
|
|
|
7
7
|
|
|
8
8
|
from phoenix.db import models
|
|
9
9
|
from phoenix.server.api.context import Context
|
|
10
|
-
from phoenix.server.api.input_types.
|
|
10
|
+
from phoenix.server.api.input_types.CreateTraceAnnotationInput import CreateTraceAnnotationInput
|
|
11
11
|
from phoenix.server.api.input_types.DeleteAnnotationsInput import DeleteAnnotationsInput
|
|
12
|
-
from phoenix.server.api.input_types.
|
|
12
|
+
from phoenix.server.api.input_types.PatchAnnotationInput import PatchAnnotationInput
|
|
13
13
|
from phoenix.server.api.mutations.auth import IsAuthenticated
|
|
14
14
|
from phoenix.server.api.types.node import from_global_id_with_expected_type
|
|
15
15
|
from phoenix.server.api.types.TraceAnnotation import TraceAnnotation, to_gql_trace_annotation
|
|
@@ -24,7 +24,7 @@ class TraceAnnotationMutationPayload:
|
|
|
24
24
|
class TraceAnnotationMutationMixin:
|
|
25
25
|
@strawberry.mutation(permission_classes=[IsAuthenticated]) # type: ignore
|
|
26
26
|
async def create_trace_annotations(
|
|
27
|
-
self, info: Info[Context, None], input: List[
|
|
27
|
+
self, info: Info[Context, None], input: List[CreateTraceAnnotationInput]
|
|
28
28
|
) -> TraceAnnotationMutationPayload:
|
|
29
29
|
inserted_annotations: Sequence[models.TraceAnnotation] = []
|
|
30
30
|
async with info.context.db() as session:
|
|
@@ -35,7 +35,7 @@ class TraceAnnotationMutationMixin:
|
|
|
35
35
|
label=annotation.label,
|
|
36
36
|
score=annotation.score,
|
|
37
37
|
explanation=annotation.explanation,
|
|
38
|
-
annotator_kind=annotation.annotator_kind,
|
|
38
|
+
annotator_kind=annotation.annotator_kind.value,
|
|
39
39
|
metadata_=annotation.metadata,
|
|
40
40
|
)
|
|
41
41
|
for annotation in input
|
|
@@ -54,7 +54,7 @@ class TraceAnnotationMutationMixin:
|
|
|
54
54
|
|
|
55
55
|
@strawberry.mutation(permission_classes=[IsAuthenticated]) # type: ignore
|
|
56
56
|
async def patch_trace_annotations(
|
|
57
|
-
self, info: Info[Context, None], input: List[
|
|
57
|
+
self, info: Info[Context, None], input: List[PatchAnnotationInput]
|
|
58
58
|
) -> TraceAnnotationMutationPayload:
|
|
59
59
|
patched_annotations = []
|
|
60
60
|
async with info.context.db() as session:
|
|
@@ -66,7 +66,13 @@ class TraceAnnotationMutationMixin:
|
|
|
66
66
|
column.key: patch_value
|
|
67
67
|
for column, patch_value, column_is_nullable in (
|
|
68
68
|
(models.TraceAnnotation.name, annotation.name, False),
|
|
69
|
-
(
|
|
69
|
+
(
|
|
70
|
+
models.TraceAnnotation.annotator_kind,
|
|
71
|
+
annotation.annotator_kind.value
|
|
72
|
+
if annotation.annotator_kind is not None
|
|
73
|
+
else None,
|
|
74
|
+
False,
|
|
75
|
+
),
|
|
70
76
|
(models.TraceAnnotation.label, annotation.label, True),
|
|
71
77
|
(models.TraceAnnotation.score, annotation.score, True),
|
|
72
78
|
(models.TraceAnnotation.explanation, annotation.explanation, True),
|
|
@@ -104,11 +104,11 @@ class Experiment(Node):
|
|
|
104
104
|
return await info.context.data_loaders.experiment_error_rates.load(self.id_attr)
|
|
105
105
|
|
|
106
106
|
@strawberry.field
|
|
107
|
-
async def average_run_latency_ms(self, info: Info[Context, None]) -> float:
|
|
107
|
+
async def average_run_latency_ms(self, info: Info[Context, None]) -> Optional[float]:
|
|
108
108
|
latency_seconds = await info.context.data_loaders.average_experiment_run_latency.load(
|
|
109
109
|
self.id_attr
|
|
110
110
|
)
|
|
111
|
-
return latency_seconds * 1000
|
|
111
|
+
return latency_seconds * 1000 if latency_seconds is not None else None
|
|
112
112
|
|
|
113
113
|
@strawberry.field
|
|
114
114
|
async def project(self, info: Info[Context, None]) -> Optional[Project]:
|
|
@@ -2,8 +2,7 @@ from datetime import datetime
|
|
|
2
2
|
from typing import Iterable, List, Optional, Set, Union
|
|
3
3
|
|
|
4
4
|
import strawberry
|
|
5
|
-
from strawberry
|
|
6
|
-
from strawberry.unset import UNSET
|
|
5
|
+
from strawberry import ID, UNSET
|
|
7
6
|
|
|
8
7
|
import phoenix.core.model_schema as ms
|
|
9
8
|
from phoenix.core.model_schema import FEATURE, TAG, ScalarDimension
|
|
@@ -2,9 +2,8 @@ import asyncio
|
|
|
2
2
|
from typing import List, Optional
|
|
3
3
|
|
|
4
4
|
import strawberry
|
|
5
|
+
from strawberry import UNSET, Info
|
|
5
6
|
from strawberry.relay import Connection
|
|
6
|
-
from strawberry.types import Info
|
|
7
|
-
from strawberry.unset import UNSET
|
|
8
7
|
from typing_extensions import Annotated
|
|
9
8
|
|
|
10
9
|
from phoenix.config import get_exported_files
|
phoenix/server/app.py
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import contextlib
|
|
2
|
-
from functools import cached_property
|
|
3
2
|
import json
|
|
4
3
|
import logging
|
|
5
4
|
from datetime import datetime
|
|
5
|
+
from functools import cached_property
|
|
6
6
|
from pathlib import Path
|
|
7
7
|
from typing import (
|
|
8
8
|
TYPE_CHECKING,
|
|
@@ -125,12 +125,9 @@ class Static(StaticFiles):
|
|
|
125
125
|
return cast(Dict[str, Any], json.load(f))
|
|
126
126
|
except FileNotFoundError as e:
|
|
127
127
|
if self._app_config.is_development:
|
|
128
|
-
logger.warning(
|
|
129
|
-
f"Web manifest not found at {self._app_config.web_manifest_path}"
|
|
130
|
-
)
|
|
131
128
|
return {}
|
|
132
129
|
raise e
|
|
133
|
-
|
|
130
|
+
|
|
134
131
|
def _sanitize_basename(self, basename: str) -> str:
|
|
135
132
|
return basename[:-1] if basename.endswith("/") else basename
|
|
136
133
|
|
|
@@ -156,7 +153,7 @@ class Static(StaticFiles):
|
|
|
156
153
|
"platform_version": phoenix.__version__,
|
|
157
154
|
"request": request,
|
|
158
155
|
"is_development": self._app_config.is_development,
|
|
159
|
-
"manifest": self._web_manifest
|
|
156
|
+
"manifest": self._web_manifest,
|
|
160
157
|
},
|
|
161
158
|
)
|
|
162
159
|
except Exception as e:
|
|
@@ -172,7 +169,6 @@ class HeadersMiddleware(BaseHTTPMiddleware):
|
|
|
172
169
|
) -> Response:
|
|
173
170
|
response = await call_next(request)
|
|
174
171
|
response.headers["x-colab-notebook-cache-control"] = "no-cache"
|
|
175
|
-
response.headers["Cache-Control"] = "no-store"
|
|
176
172
|
return response
|
|
177
173
|
|
|
178
174
|
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
{
|
|
2
|
-
"_components-
|
|
3
|
-
"file": "assets/components-
|
|
2
|
+
"_components-DeS0YEmv.js": {
|
|
3
|
+
"file": "assets/components-DeS0YEmv.js",
|
|
4
4
|
"name": "components",
|
|
5
5
|
"imports": [
|
|
6
|
-
"_vendor-
|
|
7
|
-
"_vendor-arizeai-
|
|
8
|
-
"_pages-
|
|
6
|
+
"_vendor-DPvSDRn3.js",
|
|
7
|
+
"_vendor-arizeai-CkvPT67c.js",
|
|
8
|
+
"_pages-hdjlFZhO.js",
|
|
9
9
|
"_vendor-three-DwGkEfCM.js",
|
|
10
|
-
"_vendor-codemirror-
|
|
10
|
+
"_vendor-codemirror-Cqwpwlua.js"
|
|
11
11
|
]
|
|
12
12
|
},
|
|
13
|
-
"_pages-
|
|
14
|
-
"file": "assets/pages-
|
|
13
|
+
"_pages-hdjlFZhO.js": {
|
|
14
|
+
"file": "assets/pages-hdjlFZhO.js",
|
|
15
15
|
"name": "pages",
|
|
16
16
|
"imports": [
|
|
17
|
-
"_vendor-
|
|
18
|
-
"_components-
|
|
19
|
-
"_vendor-arizeai-
|
|
20
|
-
"_vendor-recharts-
|
|
21
|
-
"_vendor-codemirror-
|
|
17
|
+
"_vendor-DPvSDRn3.js",
|
|
18
|
+
"_components-DeS0YEmv.js",
|
|
19
|
+
"_vendor-arizeai-CkvPT67c.js",
|
|
20
|
+
"_vendor-recharts-5jlNaZuF.js",
|
|
21
|
+
"_vendor-codemirror-Cqwpwlua.js"
|
|
22
22
|
]
|
|
23
23
|
},
|
|
24
24
|
"_vendor-!~{003}~.js": {
|
|
25
25
|
"file": "assets/vendor-DxkFTwjz.css",
|
|
26
26
|
"src": "_vendor-!~{003}~.js"
|
|
27
27
|
},
|
|
28
|
-
"_vendor-
|
|
29
|
-
"file": "assets/vendor-
|
|
28
|
+
"_vendor-DPvSDRn3.js": {
|
|
29
|
+
"file": "assets/vendor-DPvSDRn3.js",
|
|
30
30
|
"name": "vendor",
|
|
31
31
|
"imports": [
|
|
32
32
|
"_vendor-three-DwGkEfCM.js"
|
|
@@ -35,25 +35,25 @@
|
|
|
35
35
|
"assets/vendor-DxkFTwjz.css"
|
|
36
36
|
]
|
|
37
37
|
},
|
|
38
|
-
"_vendor-arizeai-
|
|
39
|
-
"file": "assets/vendor-arizeai-
|
|
38
|
+
"_vendor-arizeai-CkvPT67c.js": {
|
|
39
|
+
"file": "assets/vendor-arizeai-CkvPT67c.js",
|
|
40
40
|
"name": "vendor-arizeai",
|
|
41
41
|
"imports": [
|
|
42
|
-
"_vendor-
|
|
42
|
+
"_vendor-DPvSDRn3.js"
|
|
43
43
|
]
|
|
44
44
|
},
|
|
45
|
-
"_vendor-codemirror-
|
|
46
|
-
"file": "assets/vendor-codemirror-
|
|
45
|
+
"_vendor-codemirror-Cqwpwlua.js": {
|
|
46
|
+
"file": "assets/vendor-codemirror-Cqwpwlua.js",
|
|
47
47
|
"name": "vendor-codemirror",
|
|
48
48
|
"imports": [
|
|
49
|
-
"_vendor-
|
|
49
|
+
"_vendor-DPvSDRn3.js"
|
|
50
50
|
]
|
|
51
51
|
},
|
|
52
|
-
"_vendor-recharts-
|
|
53
|
-
"file": "assets/vendor-recharts-
|
|
52
|
+
"_vendor-recharts-5jlNaZuF.js": {
|
|
53
|
+
"file": "assets/vendor-recharts-5jlNaZuF.js",
|
|
54
54
|
"name": "vendor-recharts",
|
|
55
55
|
"imports": [
|
|
56
|
-
"_vendor-
|
|
56
|
+
"_vendor-DPvSDRn3.js"
|
|
57
57
|
]
|
|
58
58
|
},
|
|
59
59
|
"_vendor-three-DwGkEfCM.js": {
|
|
@@ -61,18 +61,18 @@
|
|
|
61
61
|
"name": "vendor-three"
|
|
62
62
|
},
|
|
63
63
|
"index.tsx": {
|
|
64
|
-
"file": "assets/index-
|
|
64
|
+
"file": "assets/index-CQgXRwU0.js",
|
|
65
65
|
"name": "index",
|
|
66
66
|
"src": "index.tsx",
|
|
67
67
|
"isEntry": true,
|
|
68
68
|
"imports": [
|
|
69
|
-
"_vendor-
|
|
70
|
-
"_vendor-arizeai-
|
|
71
|
-
"
|
|
72
|
-
"
|
|
69
|
+
"_vendor-DPvSDRn3.js",
|
|
70
|
+
"_vendor-arizeai-CkvPT67c.js",
|
|
71
|
+
"_pages-hdjlFZhO.js",
|
|
72
|
+
"_components-DeS0YEmv.js",
|
|
73
73
|
"_vendor-three-DwGkEfCM.js",
|
|
74
|
-
"_vendor-
|
|
75
|
-
"_vendor-
|
|
74
|
+
"_vendor-recharts-5jlNaZuF.js",
|
|
75
|
+
"_vendor-codemirror-Cqwpwlua.js"
|
|
76
76
|
]
|
|
77
77
|
}
|
|
78
78
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as He,p as xt,d as je,r as p,j as n,R as j,n as Dn,a as xe,C as Ie,b as q,s as St,e as wt,f as re,g as Se,h as Oe,i as Me,k as ge,l as Mt,m as Tt,o as ee,q as It,t as Dt,u as Et,v as s,w as u,x as Ee,$ as E,L as En,y as Ft,z as Pt,A as _t,B as Nt,D as ln,F as Fe,E as oe,G as Vt,H as Rt,I as Fn,S as Ot,J as Kt,Q as on,K as zt,M as At,N as $t,P as Ke,O as Pn,T as Gt,U as Bt,V as Qt,W as Ut,X as Ht,Y as jt,Z as qt,_ as Zt,a0 as Wt,a1 as qe,a2 as B,a3 as Xt,a4 as Jt,a5 as Yt,a6 as ea,a7 as na}from"./vendor-
|
|
1
|
+
import{c as He,p as xt,d as je,r as p,j as n,R as j,n as Dn,a as xe,C as Ie,b as q,s as St,e as wt,f as re,g as Se,h as Oe,i as Me,k as ge,l as Mt,m as Tt,o as ee,q as It,t as Dt,u as Et,v as s,w as u,x as Ee,$ as E,L as En,y as Ft,z as Pt,A as _t,B as Nt,D as ln,F as Fe,E as oe,G as Vt,H as Rt,I as Fn,S as Ot,J as Kt,Q as on,K as zt,M as At,N as $t,P as Ke,O as Pn,T as Gt,U as Bt,V as Qt,W as Ut,X as Ht,Y as jt,Z as qt,_ as Zt,a0 as Wt,a1 as qe,a2 as B,a3 as Xt,a4 as Jt,a5 as Yt,a6 as ea,a7 as na}from"./vendor-DPvSDRn3.js";import{u as ta,_ as te,a as Pe,b as ae,c as R,T as $,F as _n,d as Q,I,e as M,f as H,A as aa,g as Nn,h as k,i as F,j as V,k as ra,l as ia,P as la,R as A,m as _e,n as oa,o as sa,L as Ze,p as Z,q as W,r as Ne,s as ca,t as da,E as ua,v as ma,w as pa,x as ga,y as ha,z as fa}from"./vendor-arizeai-CkvPT67c.js";import{u as ya,T as Vn}from"./pages-hdjlFZhO.js";import{V as va}from"./vendor-three-DwGkEfCM.js";import{j as Rn,E as On,l as Kn,a as zn,R as We,n as Xe,p as ba}from"./vendor-codemirror-Cqwpwlua.js";const La=e=>{const t=a=>({...e,markdownDisplayMode:"text",setMarkdownDisplayMode:r=>{a({markdownDisplayMode:r})}});return He()(xt(je(t),{name:"arize-phoenix-preferences"}))},An=p.createContext(null);function ll({children:e,...t}){const a=p.useRef();return a.current||(a.current=La(t)),n(An.Provider,{value:a.current,children:e})}function sn(e,t){const a=j.useContext(An);if(!a)throw new Error("Missing PreferencesContext.Provider in the tree");return Dn(a,e,t)}var z=(e=>(e.primary="primary",e.reference="reference",e.corpus="corpus",e))(z||{});function P(e){throw new Error("Unreachable")}function Je(e){return typeof e=="number"||e===null}function ka(e){return typeof e=="string"||e===null}function ol(e){return Array.isArray(e)?e.every(t=>typeof t=="string"):!1}function Ca(e){return typeof e=="object"&&e!==null}const Ye=p.createContext(null);function Ve(){const e=j.useContext(Ye);if(e===null)throw new Error("useInferences must be used within a InferencesProvider");return e}function sl(e){return n(Ye.Provider,{value:{primaryInferences:e.primaryInferences,referenceInferences:e.referenceInferences,corpusInferences:e.corpusInferences,getInferencesNameByRole:t=>{var a,r;switch(t){case z.primary:return e.primaryInferences.name;case z.reference:return((a=e.referenceInferences)==null?void 0:a.name)??"reference";case z.corpus:return((r=e.corpusInferences)==null?void 0:r.name)??"corpus";default:P()}}},children:e.children})}const $n=function(){var e={defaultValue:null,kind:"LocalArgument",name:"clusters"},t={defaultValue:null,kind:"LocalArgument",name:"dataQualityMetricColumnName"},a={defaultValue:null,kind:"LocalArgument",name:"fetchDataQualityMetric"},r={defaultValue:null,kind:"LocalArgument",name:"fetchPerformanceMetric"},i={defaultValue:null,kind:"LocalArgument",name:"performanceMetric"},l=[{alias:null,args:null,kind:"ScalarField",name:"primaryValue",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"referenceValue",storageKey:null}],o=[{alias:null,args:[{kind:"Variable",name:"clusters",variableName:"clusters"}],concreteType:"Cluster",kind:"LinkedField",name:"clusters",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"eventIds",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"driftRatio",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"primaryToCorpusRatio",storageKey:null},{condition:"fetchDataQualityMetric",kind:"Condition",passingValue:!0,selections:[{alias:null,args:[{fields:[{kind:"Variable",name:"columnName",variableName:"dataQualityMetricColumnName"},{kind:"Literal",name:"metric",value:"mean"}],kind:"ObjectValue",name:"metric"}],concreteType:"DatasetValues",kind:"LinkedField",name:"dataQualityMetric",plural:!1,selections:l,storageKey:null}]},{condition:"fetchPerformanceMetric",kind:"Condition",passingValue:!0,selections:[{alias:null,args:[{fields:[{kind:"Variable",name:"metric",variableName:"performanceMetric"}],kind:"ObjectValue",name:"metric"}],concreteType:"DatasetValues",kind:"LinkedField",name:"performanceMetric",plural:!1,selections:l,storageKey:null}]}],storageKey:null}];return{fragment:{argumentDefinitions:[e,t,a,r,i],kind:"Fragment",metadata:null,name:"pointCloudStore_clusterMetricsQuery",selections:o,type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[e,a,t,r,i],kind:"Operation",name:"pointCloudStore_clusterMetricsQuery",selections:o},params:{cacheID:"86666967012812887ac0a0149d2d2535",id:null,metadata:{},name:"pointCloudStore_clusterMetricsQuery",operationKind:"query",text:`query pointCloudStore_clusterMetricsQuery(
|
|
2
2
|
$clusters: [ClusterInput!]!
|
|
3
3
|
$fetchDataQualityMetric: Boolean!
|
|
4
4
|
$dataQualityMetricColumnName: String
|
|
@@ -1139,4 +1139,4 @@ fragment ModelEmbeddingsTable_embeddingDimensions_4sIU9C on Query {
|
|
|
1139
1139
|
align-items: center;
|
|
1140
1140
|
color: var(--ac-global-color-primary);
|
|
1141
1141
|
gap: var(--ac-global-dimension-size-50);
|
|
1142
|
-
`,children:[n(I,{svg:n(M.InfoOutline,{})}),n("span",{children:"Click to view evaluator trace"})]})}):null]})]})}function wo({sequenceNumber:e}){return s(Ze,{color:"yellow-1000",children:["#",e]})}export{Ol as $,ke as A,xl as B,Gl as C,Fa as D,Yl as E,fe as F,dt as G,ce as H,Jl as I,Vl as J,nn as K,ir as L,El as M,Rl as N,Kl as O,bl as P,dl as Q,Le as R,ne as S,vl as T,cl as U,ul as V,ml as W,Fl as X,zl as Y,Il as Z,Nl as _,Qa as a,Al as a0,_l as a1,Za as a2,Hl as a3,Xl as a4,lt as a5,Wa as a6,Dl as a7,ye as a8,
|
|
1142
|
+
`,children:[n(I,{svg:n(M.InfoOutline,{})}),n("span",{children:"Click to view evaluator trace"})]})}):null]})]})}function wo({sequenceNumber:e}){return s(Ze,{color:"yellow-1000",children:["#",e]})}export{Ol as $,ke as A,xl as B,Gl as C,Fa as D,Yl as E,fe as F,dt as G,ce as H,Jl as I,Vl as J,nn as K,ir as L,El as M,Rl as N,Kl as O,bl as P,dl as Q,Le as R,ne as S,vl as T,cl as U,ul as V,ml as W,Fl as X,zl as Y,Il as Z,Nl as _,Qa as a,Al as a0,_l as a1,Za as a2,Hl as a3,Xl as a4,lt as a5,Wa as a6,Dl as a7,ye as a8,fl as a9,go as aA,uo as aB,Co as aC,bo as aD,vo as aE,ko as aF,fo as aG,ho as aH,yo as aI,Lo as aJ,pl as aK,sl as aL,co as aM,xo as aN,_a as aO,So as aP,oo as aQ,wl as aR,Yi as aS,Ji as aT,wo as aU,Ja as aV,tr as aW,kl as aX,yl as aY,ll as aZ,gl as a_,or as aa,ja as ab,Sl as ac,so as ad,lo as ae,io as af,Mi as ag,ht as ah,gt as ai,ro as aj,ol as ak,Oi as al,no as am,ao as an,to as ao,eo as ap,Qi as aq,qa as ar,Pl as as,hl as at,Cl as au,mo as av,wi as aw,tt as ax,po as ay,Ki as az,Ll as b,Ml as c,G as d,Ea as e,v as f,Xn as g,P as h,sr as i,jl as j,ql as k,Zl as l,Ql as m,Ul as n,Wl as o,Qe as p,Bl as q,$l as r,bn as s,at as t,Ve as u,Sr as v,wr as w,Un as x,Fr as y,Tl as z};
|