arize-phoenix 3.25.0__py3-none-any.whl → 4.0.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-3.25.0.dist-info → arize_phoenix-4.0.1.dist-info}/METADATA +26 -4
- {arize_phoenix-3.25.0.dist-info → arize_phoenix-4.0.1.dist-info}/RECORD +80 -75
- phoenix/__init__.py +9 -5
- phoenix/config.py +109 -53
- phoenix/datetime_utils.py +18 -1
- phoenix/db/README.md +25 -0
- phoenix/db/__init__.py +4 -0
- phoenix/db/alembic.ini +119 -0
- phoenix/db/bulk_inserter.py +206 -0
- phoenix/db/engines.py +152 -0
- phoenix/db/helpers.py +47 -0
- phoenix/db/insertion/evaluation.py +209 -0
- phoenix/db/insertion/helpers.py +51 -0
- phoenix/db/insertion/span.py +142 -0
- phoenix/db/migrate.py +71 -0
- phoenix/db/migrations/env.py +121 -0
- phoenix/db/migrations/script.py.mako +26 -0
- phoenix/db/migrations/versions/cf03bd6bae1d_init.py +280 -0
- phoenix/db/models.py +371 -0
- phoenix/exceptions.py +5 -1
- phoenix/server/api/context.py +40 -3
- phoenix/server/api/dataloaders/__init__.py +97 -0
- phoenix/server/api/dataloaders/cache/__init__.py +3 -0
- phoenix/server/api/dataloaders/cache/two_tier_cache.py +67 -0
- phoenix/server/api/dataloaders/document_evaluation_summaries.py +152 -0
- phoenix/server/api/dataloaders/document_evaluations.py +37 -0
- phoenix/server/api/dataloaders/document_retrieval_metrics.py +98 -0
- phoenix/server/api/dataloaders/evaluation_summaries.py +151 -0
- phoenix/server/api/dataloaders/latency_ms_quantile.py +198 -0
- phoenix/server/api/dataloaders/min_start_or_max_end_times.py +93 -0
- phoenix/server/api/dataloaders/record_counts.py +125 -0
- phoenix/server/api/dataloaders/span_descendants.py +64 -0
- phoenix/server/api/dataloaders/span_evaluations.py +37 -0
- phoenix/server/api/dataloaders/token_counts.py +138 -0
- phoenix/server/api/dataloaders/trace_evaluations.py +37 -0
- phoenix/server/api/input_types/SpanSort.py +138 -68
- phoenix/server/api/routers/v1/__init__.py +11 -0
- phoenix/server/api/routers/v1/evaluations.py +275 -0
- phoenix/server/api/routers/v1/spans.py +126 -0
- phoenix/server/api/routers/v1/traces.py +82 -0
- phoenix/server/api/schema.py +112 -48
- phoenix/server/api/types/DocumentEvaluationSummary.py +1 -1
- phoenix/server/api/types/Evaluation.py +29 -12
- phoenix/server/api/types/EvaluationSummary.py +29 -44
- phoenix/server/api/types/MimeType.py +2 -2
- phoenix/server/api/types/Model.py +9 -9
- phoenix/server/api/types/Project.py +240 -171
- phoenix/server/api/types/Span.py +87 -131
- phoenix/server/api/types/Trace.py +29 -20
- phoenix/server/api/types/pagination.py +151 -10
- phoenix/server/app.py +263 -35
- phoenix/server/grpc_server.py +93 -0
- phoenix/server/main.py +75 -60
- phoenix/server/openapi/docs.py +218 -0
- phoenix/server/prometheus.py +23 -7
- phoenix/server/static/index.js +662 -643
- phoenix/server/telemetry.py +68 -0
- phoenix/services.py +4 -0
- phoenix/session/client.py +34 -30
- phoenix/session/data_extractor.py +8 -3
- phoenix/session/session.py +176 -155
- phoenix/settings.py +13 -0
- phoenix/trace/attributes.py +349 -0
- phoenix/trace/dsl/README.md +116 -0
- phoenix/trace/dsl/filter.py +660 -192
- phoenix/trace/dsl/helpers.py +24 -5
- phoenix/trace/dsl/query.py +562 -185
- phoenix/trace/fixtures.py +69 -7
- phoenix/trace/otel.py +44 -200
- phoenix/trace/schemas.py +14 -8
- phoenix/trace/span_evaluations.py +5 -2
- phoenix/utilities/__init__.py +0 -26
- phoenix/utilities/span_store.py +0 -23
- phoenix/version.py +1 -1
- phoenix/core/project.py +0 -773
- phoenix/core/traces.py +0 -96
- phoenix/datasets/dataset.py +0 -214
- phoenix/datasets/fixtures.py +0 -24
- phoenix/datasets/schema.py +0 -31
- phoenix/experimental/evals/__init__.py +0 -73
- phoenix/experimental/evals/evaluators.py +0 -413
- phoenix/experimental/evals/functions/__init__.py +0 -4
- phoenix/experimental/evals/functions/classify.py +0 -453
- phoenix/experimental/evals/functions/executor.py +0 -353
- phoenix/experimental/evals/functions/generate.py +0 -138
- phoenix/experimental/evals/functions/processing.py +0 -76
- phoenix/experimental/evals/models/__init__.py +0 -14
- phoenix/experimental/evals/models/anthropic.py +0 -175
- phoenix/experimental/evals/models/base.py +0 -170
- phoenix/experimental/evals/models/bedrock.py +0 -221
- phoenix/experimental/evals/models/litellm.py +0 -134
- phoenix/experimental/evals/models/openai.py +0 -453
- phoenix/experimental/evals/models/rate_limiters.py +0 -246
- phoenix/experimental/evals/models/vertex.py +0 -173
- phoenix/experimental/evals/models/vertexai.py +0 -186
- phoenix/experimental/evals/retrievals.py +0 -96
- phoenix/experimental/evals/templates/__init__.py +0 -50
- phoenix/experimental/evals/templates/default_templates.py +0 -472
- phoenix/experimental/evals/templates/template.py +0 -195
- phoenix/experimental/evals/utils/__init__.py +0 -172
- phoenix/experimental/evals/utils/threads.py +0 -27
- phoenix/server/api/routers/evaluation_handler.py +0 -110
- phoenix/server/api/routers/span_handler.py +0 -70
- phoenix/server/api/routers/trace_handler.py +0 -60
- phoenix/storage/span_store/__init__.py +0 -23
- phoenix/storage/span_store/text_file.py +0 -85
- phoenix/trace/dsl/missing.py +0 -60
- {arize_phoenix-3.25.0.dist-info → arize_phoenix-4.0.1.dist-info}/WHEEL +0 -0
- {arize_phoenix-3.25.0.dist-info → arize_phoenix-4.0.1.dist-info}/licenses/IP_NOTICE +0 -0
- {arize_phoenix-3.25.0.dist-info → arize_phoenix-4.0.1.dist-info}/licenses/LICENSE +0 -0
- /phoenix/{datasets → db/insertion}/__init__.py +0 -0
- /phoenix/{experimental → db/migrations}/__init__.py +0 -0
- /phoenix/{storage → server/openapi}/__init__.py +0 -0
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import weakref
|
|
2
|
-
from base64 import urlsafe_b64decode, urlsafe_b64encode
|
|
3
|
-
from pathlib import Path
|
|
4
|
-
from queue import SimpleQueue
|
|
5
|
-
from threading import Thread
|
|
6
|
-
from typing import Iterator, Optional, Tuple
|
|
7
|
-
|
|
8
|
-
from opentelemetry.proto.trace.v1.trace_pb2 import TracesData
|
|
9
|
-
from typing_extensions import TypeAlias
|
|
10
|
-
|
|
11
|
-
from phoenix.utilities.project import get_project_name
|
|
12
|
-
|
|
13
|
-
_Queue: TypeAlias = "SimpleQueue[Optional[TracesData]]"
|
|
14
|
-
|
|
15
|
-
_END_OF_QUEUE = None
|
|
16
|
-
_DIR_PREFIX = "project."
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
class TextFileSpanStoreImpl:
|
|
20
|
-
def __init__(self, root: Path) -> None:
|
|
21
|
-
self._root = root
|
|
22
|
-
self._projects = dict(_load_projects(self._root))
|
|
23
|
-
|
|
24
|
-
def save(self, traces_data: TracesData) -> None:
|
|
25
|
-
for resource_spans in traces_data.resource_spans:
|
|
26
|
-
name = get_project_name(resource_spans.resource.attributes)
|
|
27
|
-
if (project := self._projects.get(name)) is None:
|
|
28
|
-
self._projects[name] = project = _Project(name, self._root)
|
|
29
|
-
project.save(TracesData(resource_spans=[resource_spans]))
|
|
30
|
-
|
|
31
|
-
def load(self) -> Iterator[TracesData]:
|
|
32
|
-
queue: _Queue = SimpleQueue()
|
|
33
|
-
Thread(target=self._load_traces_data, args=(queue,)).start()
|
|
34
|
-
while (item := queue.get()) is not _END_OF_QUEUE:
|
|
35
|
-
yield item
|
|
36
|
-
|
|
37
|
-
def _load_traces_data(self, queue: _Queue) -> None:
|
|
38
|
-
"""Load traces data from all projects into the queue"""
|
|
39
|
-
for project in self._projects.values():
|
|
40
|
-
project.load(queue)
|
|
41
|
-
queue.put(_END_OF_QUEUE)
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
class _Project:
|
|
45
|
-
def __init__(self, name: str, root: Path) -> None:
|
|
46
|
-
self._path = root / f"project.{_b64encode(name.encode())}"
|
|
47
|
-
spans_path = self._path / "spans"
|
|
48
|
-
spans_path.mkdir(parents=True, exist_ok=True)
|
|
49
|
-
self._spans = _Spans(spans_path / "spans.txt")
|
|
50
|
-
|
|
51
|
-
def save(self, traces_data: TracesData) -> None:
|
|
52
|
-
self._spans.save(traces_data)
|
|
53
|
-
|
|
54
|
-
def load(self, queue: _Queue) -> None:
|
|
55
|
-
self._spans.load(queue)
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
class _Spans:
|
|
59
|
-
def __init__(self, file_path: Path):
|
|
60
|
-
self._path = file_path
|
|
61
|
-
self._file = self._path.open("a")
|
|
62
|
-
weakref.finalize(self, self._file.close)
|
|
63
|
-
|
|
64
|
-
def save(self, traces_data: TracesData) -> None:
|
|
65
|
-
self._file.write(_b64encode(traces_data.SerializeToString()))
|
|
66
|
-
self._file.write("\n")
|
|
67
|
-
|
|
68
|
-
def load(self, queue: _Queue) -> None:
|
|
69
|
-
with self._path.open("r") as f:
|
|
70
|
-
while line := f.readline():
|
|
71
|
-
queue.put(TracesData.FromString(_b64decode(line)))
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
def _load_projects(root: Path) -> Iterator[Tuple[str, _Project]]:
|
|
75
|
-
for dir_path in root.glob(f"{_DIR_PREFIX}*/"):
|
|
76
|
-
name = _b64decode(dir_path.name[len(_DIR_PREFIX) :]).decode()
|
|
77
|
-
yield name, _Project(name, root)
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
def _b64encode(s: bytes) -> str:
|
|
81
|
-
return urlsafe_b64encode(s).decode()
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
def _b64decode(name: str) -> bytes:
|
|
85
|
-
return urlsafe_b64decode(name.encode())
|
phoenix/trace/dsl/missing.py
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
from typing import Any
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class _Missing:
|
|
5
|
-
"""
|
|
6
|
-
Falsify all comparisons except those with self; return self when getattr()
|
|
7
|
-
is called. Also, self is callable returning self. All this may seem peculiar
|
|
8
|
-
but is useful for getting the desired (and intuitive) behavior from any
|
|
9
|
-
boolean (i.e. comparative) expression without needing error handling when
|
|
10
|
-
missing values are encountered. `_Missing()` is intended to be a (fancier)
|
|
11
|
-
replacement for `None`.
|
|
12
|
-
"""
|
|
13
|
-
|
|
14
|
-
def __lt__(self, _: Any) -> bool:
|
|
15
|
-
return False
|
|
16
|
-
|
|
17
|
-
def __le__(self, _: Any) -> bool:
|
|
18
|
-
return False
|
|
19
|
-
|
|
20
|
-
def __gt__(self, _: Any) -> bool:
|
|
21
|
-
return False
|
|
22
|
-
|
|
23
|
-
def __ge__(self, _: Any) -> bool:
|
|
24
|
-
return False
|
|
25
|
-
|
|
26
|
-
def __eq__(self, other: Any) -> bool:
|
|
27
|
-
return isinstance(other, _Missing)
|
|
28
|
-
|
|
29
|
-
def __ne__(self, _: Any) -> bool:
|
|
30
|
-
return False
|
|
31
|
-
|
|
32
|
-
def __len__(self) -> int:
|
|
33
|
-
return 0
|
|
34
|
-
|
|
35
|
-
def __iter__(self) -> Any:
|
|
36
|
-
return self
|
|
37
|
-
|
|
38
|
-
def __next__(self) -> Any:
|
|
39
|
-
raise StopIteration()
|
|
40
|
-
|
|
41
|
-
def __contains__(self, _: Any) -> bool:
|
|
42
|
-
return False
|
|
43
|
-
|
|
44
|
-
def __str__(self) -> str:
|
|
45
|
-
return ""
|
|
46
|
-
|
|
47
|
-
def __float__(self) -> float:
|
|
48
|
-
return float("nan")
|
|
49
|
-
|
|
50
|
-
def __bool__(self) -> bool:
|
|
51
|
-
return False
|
|
52
|
-
|
|
53
|
-
def __getattr__(self, _: Any) -> "_Missing":
|
|
54
|
-
return self
|
|
55
|
-
|
|
56
|
-
def __call__(self, *_: Any, **__: Any) -> "_Missing":
|
|
57
|
-
return self
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
MISSING: Any = _Missing()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|