arize-phoenix 4.8.1__py3-none-any.whl → 4.10.0__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.8.1.dist-info → arize_phoenix-4.10.0.dist-info}/METADATA +1 -1
- {arize_phoenix-4.8.1.dist-info → arize_phoenix-4.10.0.dist-info}/RECORD +32 -24
- phoenix/db/insertion/evaluation.py +7 -25
- phoenix/db/insertion/helpers.py +54 -13
- phoenix/db/insertion/span.py +12 -16
- phoenix/inferences/inferences.py +16 -4
- phoenix/pointcloud/umap_parameters.py +52 -52
- phoenix/server/api/input_types/CreateSpanAnnotationsInput.py +16 -0
- phoenix/server/api/input_types/CreateTraceAnnotationsInput.py +16 -0
- phoenix/server/api/input_types/DeleteAnnotationsInput.py +9 -0
- phoenix/server/api/input_types/PatchAnnotationsInput.py +17 -0
- phoenix/server/api/mutations/__init__.py +8 -1
- phoenix/server/api/mutations/project_mutations.py +1 -1
- phoenix/server/api/mutations/span_annotations_mutations.py +108 -0
- phoenix/server/api/mutations/trace_annotations_mutations.py +108 -0
- phoenix/server/api/queries.py +1 -0
- phoenix/server/api/routers/v1/__init__.py +2 -0
- phoenix/server/api/routers/v1/experiment_evaluations.py +3 -10
- phoenix/server/api/routers/v1/experiments.py +4 -5
- phoenix/server/api/routers/v1/spans.py +147 -2
- phoenix/server/api/routers/v1/traces.py +150 -1
- phoenix/server/api/types/AnnotatorKind.py +7 -1
- phoenix/server/api/types/ExperimentRunAnnotation.py +3 -3
- phoenix/server/api/types/SpanAnnotation.py +45 -0
- phoenix/server/api/types/TraceAnnotation.py +45 -0
- phoenix/server/static/index.js +532 -524
- phoenix/session/client.py +10 -8
- phoenix/trace/trace_dataset.py +23 -15
- phoenix/version.py +1 -1
- {arize_phoenix-4.8.1.dist-info → arize_phoenix-4.10.0.dist-info}/WHEEL +0 -0
- {arize_phoenix-4.8.1.dist-info → arize_phoenix-4.10.0.dist-info}/licenses/IP_NOTICE +0 -0
- {arize_phoenix-4.8.1.dist-info → arize_phoenix-4.10.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
3
|
+
import strawberry
|
|
4
|
+
from strawberry import Private
|
|
5
|
+
from strawberry.relay import GlobalID, Node, NodeID
|
|
6
|
+
from strawberry.scalars import JSON
|
|
7
|
+
|
|
8
|
+
from phoenix.db import models
|
|
9
|
+
from phoenix.server.api.types.AnnotatorKind import AnnotatorKind
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@strawberry.type
|
|
13
|
+
class SpanAnnotation(Node):
|
|
14
|
+
id_attr: NodeID[int]
|
|
15
|
+
name: str
|
|
16
|
+
annotator_kind: AnnotatorKind
|
|
17
|
+
label: Optional[str]
|
|
18
|
+
score: Optional[float]
|
|
19
|
+
explanation: Optional[str]
|
|
20
|
+
metadata: JSON
|
|
21
|
+
span_rowid: Private[Optional[int]]
|
|
22
|
+
|
|
23
|
+
@strawberry.field
|
|
24
|
+
async def span_id(self) -> GlobalID:
|
|
25
|
+
from phoenix.server.api.types.Span import Span
|
|
26
|
+
|
|
27
|
+
return GlobalID(type_name=Span.__name__, node_id=str(self.span_rowid))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def to_gql_span_annotation(
|
|
31
|
+
annotation: models.SpanAnnotation,
|
|
32
|
+
) -> SpanAnnotation:
|
|
33
|
+
"""
|
|
34
|
+
Converts an ORM span annotation to a GraphQL SpanAnnotation.
|
|
35
|
+
"""
|
|
36
|
+
return SpanAnnotation(
|
|
37
|
+
id_attr=annotation.id,
|
|
38
|
+
span_rowid=annotation.span_rowid,
|
|
39
|
+
name=annotation.name,
|
|
40
|
+
annotator_kind=AnnotatorKind(annotation.annotator_kind),
|
|
41
|
+
label=annotation.label,
|
|
42
|
+
score=annotation.score,
|
|
43
|
+
explanation=annotation.explanation,
|
|
44
|
+
metadata=annotation.metadata_,
|
|
45
|
+
)
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
3
|
+
import strawberry
|
|
4
|
+
from strawberry import Private
|
|
5
|
+
from strawberry.relay import GlobalID, Node, NodeID
|
|
6
|
+
from strawberry.scalars import JSON
|
|
7
|
+
|
|
8
|
+
from phoenix.db import models
|
|
9
|
+
from phoenix.server.api.types.AnnotatorKind import AnnotatorKind
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@strawberry.type
|
|
13
|
+
class TraceAnnotation(Node):
|
|
14
|
+
id_attr: NodeID[int]
|
|
15
|
+
name: str
|
|
16
|
+
annotator_kind: AnnotatorKind
|
|
17
|
+
label: Optional[str]
|
|
18
|
+
score: Optional[float]
|
|
19
|
+
explanation: Optional[str]
|
|
20
|
+
metadata: JSON
|
|
21
|
+
trace_rowid: Private[Optional[int]]
|
|
22
|
+
|
|
23
|
+
@strawberry.field
|
|
24
|
+
async def trace_id(self) -> GlobalID:
|
|
25
|
+
from phoenix.server.api.types.Trace import Trace
|
|
26
|
+
|
|
27
|
+
return GlobalID(type_name=Trace.__name__, node_id=str(self.trace_rowid))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def to_gql_trace_annotation(
|
|
31
|
+
annotation: models.TraceAnnotation,
|
|
32
|
+
) -> TraceAnnotation:
|
|
33
|
+
"""
|
|
34
|
+
Converts an ORM trace annotation to a GraphQL TraceAnnotation.
|
|
35
|
+
"""
|
|
36
|
+
return TraceAnnotation(
|
|
37
|
+
id_attr=annotation.id,
|
|
38
|
+
trace_rowid=annotation.trace_rowid,
|
|
39
|
+
name=annotation.name,
|
|
40
|
+
annotator_kind=AnnotatorKind(annotation.annotator_kind),
|
|
41
|
+
label=annotation.label,
|
|
42
|
+
score=annotation.score,
|
|
43
|
+
explanation=annotation.explanation,
|
|
44
|
+
metadata=annotation.metadata_,
|
|
45
|
+
)
|