arize-phoenix 0.0.36__py3-none-any.whl → 0.0.38__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-0.0.38.dist-info/METADATA +445 -0
- {arize_phoenix-0.0.36.dist-info → arize_phoenix-0.0.38.dist-info}/RECORD +23 -22
- phoenix/__init__.py +1 -1
- phoenix/server/api/schema.py +4 -6
- phoenix/server/api/types/DataQualityMetric.py +1 -10
- phoenix/server/api/types/ExportEventsMutation.py +1 -4
- phoenix/server/api/types/Segments.py +6 -5
- phoenix/server/api/types/Span.py +20 -2
- phoenix/server/api/types/TimeSeries.py +1 -8
- phoenix/server/static/index.js +498 -471
- phoenix/session/session.py +5 -2
- phoenix/trace/fixtures.py +22 -1
- phoenix/trace/langchain/__init__.py +3 -0
- phoenix/{experimental/callbacks/langchain_tracer.py → trace/langchain/tracer.py} +102 -2
- phoenix/trace/llama_index/__init__.py +3 -0
- phoenix/{experimental/callbacks/llama_index_trace_callback_handler.py → trace/llama_index/callback.py} +35 -16
- phoenix/trace/semantic_conventions.py +2 -2
- phoenix/trace/span_json_decoder.py +0 -12
- phoenix/trace/trace_dataset.py +6 -1
- phoenix/trace/utils.py +1 -1
- arize_phoenix-0.0.36.dist-info/METADATA +0 -219
- phoenix/experimental/callbacks/__init__.py +0 -0
- {arize_phoenix-0.0.36.dist-info → arize_phoenix-0.0.38.dist-info}/WHEEL +0 -0
- {arize_phoenix-0.0.36.dist-info → arize_phoenix-0.0.38.dist-info}/licenses/IP_NOTICE +0 -0
- {arize_phoenix-0.0.36.dist-info → arize_phoenix-0.0.38.dist-info}/licenses/LICENSE +0 -0
phoenix/server/api/types/Span.py
CHANGED
|
@@ -2,7 +2,7 @@ import json
|
|
|
2
2
|
from collections import defaultdict
|
|
3
3
|
from datetime import datetime
|
|
4
4
|
from enum import Enum
|
|
5
|
-
from typing import Any, DefaultDict, List, Mapping, Optional, cast
|
|
5
|
+
from typing import Any, DefaultDict, Dict, List, Mapping, Optional, cast
|
|
6
6
|
|
|
7
7
|
import strawberry
|
|
8
8
|
from strawberry import ID
|
|
@@ -19,6 +19,8 @@ from phoenix.server.api.context import Context
|
|
|
19
19
|
from phoenix.server.api.types.MimeType import MimeType
|
|
20
20
|
from phoenix.trace.schemas import SpanID
|
|
21
21
|
from phoenix.trace.semantic_conventions import (
|
|
22
|
+
EMBEDDING_EMBEDDINGS,
|
|
23
|
+
EMBEDDING_VECTOR,
|
|
22
24
|
EXCEPTION_MESSAGE,
|
|
23
25
|
INPUT_MIME_TYPE,
|
|
24
26
|
INPUT_VALUE,
|
|
@@ -159,7 +161,7 @@ def to_gql_span(span: trace_schema.Span) -> "Span":
|
|
|
159
161
|
span_id=cast(ID, span.context.span_id),
|
|
160
162
|
),
|
|
161
163
|
attributes=json.dumps(
|
|
162
|
-
_nested_attributes(span.attributes),
|
|
164
|
+
_nested_attributes(_hide_embedding_vectors(span.attributes)),
|
|
163
165
|
default=_json_encode,
|
|
164
166
|
),
|
|
165
167
|
token_count_total=cast(
|
|
@@ -227,3 +229,19 @@ def _nested_attributes(
|
|
|
227
229
|
trie = trie[key]
|
|
228
230
|
trie[keys[-1]] = attribute_value
|
|
229
231
|
return nested_attributes
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
def _hide_embedding_vectors(
|
|
235
|
+
attributes: Mapping[str, Any],
|
|
236
|
+
) -> Dict[str, Any]:
|
|
237
|
+
_attributes = dict(attributes)
|
|
238
|
+
if not (embeddings := _attributes.get(EMBEDDING_EMBEDDINGS)):
|
|
239
|
+
return _attributes
|
|
240
|
+
_embeddings = []
|
|
241
|
+
for embedding in embeddings:
|
|
242
|
+
_embedding = dict(embedding)
|
|
243
|
+
if vector := _embedding.get(EMBEDDING_VECTOR):
|
|
244
|
+
_embedding[EMBEDDING_VECTOR] = f"<{len(vector)} dimensional vector>"
|
|
245
|
+
_embeddings.append(_embedding)
|
|
246
|
+
_attributes[EMBEDDING_EMBEDDINGS] = _embeddings
|
|
247
|
+
return _attributes
|
|
@@ -7,14 +7,7 @@ import pandas as pd
|
|
|
7
7
|
import strawberry
|
|
8
8
|
from strawberry import UNSET
|
|
9
9
|
|
|
10
|
-
from phoenix.core.model_schema import
|
|
11
|
-
CONTINUOUS,
|
|
12
|
-
PRIMARY,
|
|
13
|
-
REFERENCE,
|
|
14
|
-
Column,
|
|
15
|
-
Dataset,
|
|
16
|
-
Dimension,
|
|
17
|
-
)
|
|
10
|
+
from phoenix.core.model_schema import CONTINUOUS, PRIMARY, REFERENCE, Column, Dataset, Dimension
|
|
18
11
|
from phoenix.metrics import Metric, binning
|
|
19
12
|
from phoenix.metrics.mixins import UnaryOperator
|
|
20
13
|
from phoenix.metrics.timeseries import timeseries
|