arize-phoenix 3.4.0__py3-none-any.whl → 3.5.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.

Files changed (39) hide show
  1. {arize_phoenix-3.4.0.dist-info → arize_phoenix-3.5.0.dist-info}/METADATA +31 -31
  2. {arize_phoenix-3.4.0.dist-info → arize_phoenix-3.5.0.dist-info}/RECORD +39 -38
  3. phoenix/core/evals.py +9 -9
  4. phoenix/core/model.py +18 -18
  5. phoenix/core/model_schema.py +22 -44
  6. phoenix/experimental/evals/functions/executor.py +1 -2
  7. phoenix/experimental/evals/functions/processing.py +33 -1
  8. phoenix/experimental/evals/models/base.py +4 -8
  9. phoenix/experimental/evals/models/litellm.py +1 -1
  10. phoenix/experimental/evals/models/rate_limiters.py +1 -2
  11. phoenix/metrics/__init__.py +2 -4
  12. phoenix/metrics/binning.py +3 -6
  13. phoenix/metrics/mixins.py +1 -0
  14. phoenix/metrics/wrappers.py +1 -0
  15. phoenix/pointcloud/pointcloud.py +2 -4
  16. phoenix/server/api/input_types/SpanSort.py +1 -2
  17. phoenix/server/api/interceptor.py +1 -2
  18. phoenix/server/api/routers/trace_handler.py +1 -2
  19. phoenix/server/api/schema.py +20 -3
  20. phoenix/server/api/types/Project.py +72 -0
  21. phoenix/server/api/types/Segments.py +2 -4
  22. phoenix/server/api/types/Span.py +18 -0
  23. phoenix/server/app.py +4 -0
  24. phoenix/server/main.py +35 -2
  25. phoenix/server/static/index.js +534 -494
  26. phoenix/server/templates/index.html +2 -1
  27. phoenix/session/data_extractor.py +2 -4
  28. phoenix/session/evaluation.py +1 -0
  29. phoenix/trace/dsl/filter.py +1 -2
  30. phoenix/trace/dsl/helpers.py +3 -2
  31. phoenix/trace/dsl/query.py +3 -7
  32. phoenix/trace/langchain/tracer.py +1 -0
  33. phoenix/trace/span_evaluations.py +1 -2
  34. phoenix/trace/span_json_encoder.py +13 -3
  35. phoenix/trace/tracer.py +2 -2
  36. phoenix/version.py +1 -1
  37. {arize_phoenix-3.4.0.dist-info → arize_phoenix-3.5.0.dist-info}/WHEEL +0 -0
  38. {arize_phoenix-3.4.0.dist-info → arize_phoenix-3.5.0.dist-info}/licenses/IP_NOTICE +0 -0
  39. {arize_phoenix-3.4.0.dist-info → arize_phoenix-3.5.0.dist-info}/licenses/LICENSE +0 -0
@@ -31,7 +31,8 @@
31
31
  // injected into the client before React runs
32
32
  value: Object.freeze({
33
33
  basename: "{{basename}}",
34
- hasCorpus: Boolean("{{has_corpus}}"),
34
+ hasInferences: Boolean("{{has_inferences}}" == "True"),
35
+ hasCorpus: Boolean("{{has_corpus}}" == "True"),
35
36
  UMAP: {
36
37
  minDist: parseFloat("{{min_dist}}"),
37
38
  nNeighbors: parseInt("{{n_neighbors}}"),
@@ -22,8 +22,7 @@ class TraceDataExtractor(ABC):
22
22
  start_time: Optional[datetime] = None,
23
23
  stop_time: Optional[datetime] = None,
24
24
  root_spans_only: Optional[bool] = None,
25
- ) -> Optional[Union[pd.DataFrame, List[pd.DataFrame]]]:
26
- ...
25
+ ) -> Optional[Union[pd.DataFrame, List[pd.DataFrame]]]: ...
27
26
 
28
27
  def get_spans_dataframe(
29
28
  self,
@@ -44,8 +43,7 @@ class TraceDataExtractor(ABC):
44
43
  )
45
44
 
46
45
  @abstractmethod
47
- def get_evaluations(self) -> List[Evaluations]:
48
- ...
46
+ def get_evaluations(self) -> List[Evaluations]: ...
49
47
 
50
48
  def get_trace_dataset(self) -> Optional[TraceDataset]:
51
49
  if (dataframe := self.get_spans_dataframe()) is None:
@@ -5,6 +5,7 @@ A set of **highly experimental** helper functions to
5
5
  indexed by `context.span_id` and `document_position`
6
6
  - ingest evaluation results into Phoenix via HttpExporter
7
7
  """
8
+
8
9
  import logging
9
10
  import math
10
11
  from typing import (
@@ -29,8 +29,7 @@ _VALID_EVAL_ATTRIBUTES: Tuple[str, ...] = tuple(
29
29
 
30
30
 
31
31
  class SupportsGetSpanEvaluation(Protocol):
32
- def get_span_evaluation(self, span_id: SpanID, name: str) -> Optional[pb.Evaluation]:
33
- ...
32
+ def get_span_evaluation(self, span_id: SpanID, name: str) -> Optional[pb.Evaluation]: ...
34
33
 
35
34
 
36
35
  @dataclass(frozen=True)
@@ -21,8 +21,9 @@ IS_RETRIEVER = "span_kind == 'RETRIEVER'"
21
21
 
22
22
 
23
23
  class CanQuerySpans(Protocol):
24
- def query_spans(self, *query: SpanQuery) -> Optional[Union[pd.DataFrame, List[pd.DataFrame]]]:
25
- ...
24
+ def query_spans(
25
+ self, *query: SpanQuery
26
+ ) -> Optional[Union[pd.DataFrame, List[pd.DataFrame]]]: ...
26
27
 
27
28
 
28
29
  def get_retrieved_documents(obj: CanQuerySpans) -> pd.DataFrame:
@@ -38,13 +38,9 @@ _ALIASES = {
38
38
  "trace_id": "context.trace_id",
39
39
  }
40
40
 
41
- # Because UUIDs is not convertible to Parquet,
42
- # they need to be converted to string.
43
- _CONVERT_TO_STRING = (
44
- "context.span_id",
45
- "context.trace_id",
46
- "parent_id",
47
- )
41
+ # Because span_kind is an enum, it needs to be converted to string,
42
+ # so it's serializable by pyarrow.
43
+ _CONVERT_TO_STRING = ("span_kind",)
48
44
 
49
45
 
50
46
  def _unalias(key: str) -> str:
@@ -2,6 +2,7 @@
2
2
  This module is defunct and will be removed in the future. It's currently
3
3
  maintaining a dummy class to avoid breaking any import code.
4
4
  """
5
+
5
6
  import logging
6
7
  import sys
7
8
  from typing import Any, Iterator
@@ -323,8 +323,7 @@ class DocumentEvaluations(
323
323
  class TraceEvaluations(
324
324
  Evaluations,
325
325
  index_names=MappingProxyType({("context.trace_id", "trace_id"): is_string_dtype}),
326
- ):
327
- ...
326
+ ): ...
328
327
 
329
328
 
330
329
  def _parse_schema_metadata(schema: Schema) -> Tuple[UUID, str, Type[Evaluations]]:
@@ -2,10 +2,16 @@ import json
2
2
  from dataclasses import asdict
3
3
  from datetime import datetime
4
4
  from enum import Enum
5
- from typing import Any, List
5
+ from typing import Any, Dict, List, Mapping
6
6
  from uuid import UUID
7
7
 
8
- from phoenix.trace.schemas import Span, SpanContext, SpanConversationAttributes, SpanEvent
8
+ from phoenix.trace.schemas import (
9
+ COMPUTED_PREFIX,
10
+ Span,
11
+ SpanContext,
12
+ SpanConversationAttributes,
13
+ SpanEvent,
14
+ )
9
15
 
10
16
 
11
17
  class SpanJSONEncoder(json.JSONEncoder):
@@ -34,7 +40,7 @@ class SpanJSONEncoder(json.JSONEncoder):
34
40
  "end_time": obj.end_time,
35
41
  "status_code": obj.status_code,
36
42
  "status_message": obj.status_message,
37
- "attributes": obj.attributes,
43
+ "attributes": _remove_computed_attributes(obj.attributes),
38
44
  "events": [self.default(event) for event in obj.events],
39
45
  "conversation": obj.conversation,
40
46
  }
@@ -49,3 +55,7 @@ def span_to_json(span: Span) -> str:
49
55
 
50
56
  def spans_to_jsonl(spans: List[Span]) -> str:
51
57
  return "\n".join(span_to_json(span) for span in spans)
58
+
59
+
60
+ def _remove_computed_attributes(attributes: Mapping[str, Any]) -> Dict[str, Any]:
61
+ return {key: value for key, value in attributes.items() if not key.startswith(COMPUTED_PREFIX)}
phoenix/trace/tracer.py CHANGED
@@ -2,6 +2,7 @@
2
2
  This module is defunct and will be removed in the future. It's currently
3
3
  maintaining a dummy class to avoid breaking any import code.
4
4
  """
5
+
5
6
  import logging
6
7
  import sys
7
8
  from typing import Any, Iterator, Protocol
@@ -12,8 +13,7 @@ logger = logging.getLogger(__name__)
12
13
 
13
14
 
14
15
  class SpanExporter(Protocol):
15
- def export(self, _: Any) -> None:
16
- ...
16
+ def export(self, _: Any) -> None: ...
17
17
 
18
18
 
19
19
  _DEFUNCT_MSG = (
phoenix/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "3.4.0"
1
+ __version__ = "3.5.0"