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

phoenix/server/main.py CHANGED
@@ -11,6 +11,7 @@ from time import sleep, time
11
11
  from typing import List, Optional
12
12
  from urllib.parse import urljoin
13
13
 
14
+ from jinja2 import BaseLoader, Environment
14
15
  from uvicorn import Config, Server
15
16
 
16
17
  import phoenix.trace.v1 as pb
@@ -18,6 +19,7 @@ from phoenix.config import (
18
19
  EXPORT_DIR,
19
20
  get_auth_settings,
20
21
  get_env_database_connection_str,
22
+ get_env_database_schema,
21
23
  get_env_enable_prometheus,
22
24
  get_env_grpc_port,
23
25
  get_env_host,
@@ -37,6 +39,7 @@ from phoenix.pointcloud.umap_parameters import (
37
39
  UMAPParameters,
38
40
  )
39
41
  from phoenix.server.app import (
42
+ ScaffolderConfig,
40
43
  _db,
41
44
  create_app,
42
45
  create_engine_and_run_migrations,
@@ -59,14 +62,14 @@ from phoenix.trace.schemas import Span
59
62
  logger = logging.getLogger(__name__)
60
63
  logger.addHandler(logging.NullHandler())
61
64
 
62
- _WELCOME_MESSAGE = """
65
+ _WELCOME_MESSAGE = Environment(loader=BaseLoader()).from_string("""
63
66
 
64
67
  ██████╗ ██╗ ██╗ ██████╗ ███████╗███╗ ██╗██╗██╗ ██╗
65
68
  ██╔══██╗██║ ██║██╔═══██╗██╔════╝████╗ ██║██║╚██╗██╔╝
66
69
  ██████╔╝███████║██║ ██║█████╗ ██╔██╗ ██║██║ ╚███╔╝
67
70
  ██╔═══╝ ██╔══██║██║ ██║██╔══╝ ██║╚██╗██║██║ ██╔██╗
68
71
  ██║ ██║ ██║╚██████╔╝███████╗██║ ╚████║██║██╔╝ ██╗
69
- ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═══╝╚═╝╚═╝ ╚═╝ v{version}
72
+ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═══╝╚═╝╚═╝ ╚═╝ v{{ version }}
70
73
 
71
74
  |
72
75
  | 🌎 Join our Community 🌎
@@ -79,12 +82,15 @@ _WELCOME_MESSAGE = """
79
82
  | https://docs.arize.com/phoenix
80
83
  |
81
84
  | 🚀 Phoenix Server 🚀
82
- | Phoenix UI: {ui_path}
85
+ | Phoenix UI: {{ ui_path }}
83
86
  | Log traces:
84
- | - gRPC: {grpc_path}
85
- | - HTTP: {http_path}
86
- | Storage: {storage}
87
- """
87
+ | - gRPC: {{ grpc_path }}
88
+ | - HTTP: {{ http_path }}
89
+ | Storage: {{ storage }}
90
+ {% if schema -%}
91
+ | - Schema: {{ schema }}
92
+ {% endif -%}
93
+ """)
88
94
 
89
95
  _EXPERIMENTAL_WARNING = """
90
96
  🚨 WARNING: Phoenix is running in experimental mode. 🚨
@@ -228,6 +234,7 @@ if __name__ == "__main__":
228
234
 
229
235
  force_fixture_ingestion = False
230
236
  scaffold_datasets = False
237
+ tracing_fixture_names = set()
231
238
  if args.command == "datasets":
232
239
  primary_inferences_name = args.primary
233
240
  reference_inferences_name = args.reference
@@ -264,7 +271,6 @@ if __name__ == "__main__":
264
271
  simulate_streaming = args.simulate_streaming
265
272
  elif args.command == "serve":
266
273
  # We use sets to avoid duplicates
267
- tracing_fixture_names = set()
268
274
  if args.with_fixture:
269
275
  primary_inferences, reference_inferences, corpus_inferences = get_inferences(
270
276
  str(args.with_fixture),
@@ -344,17 +350,26 @@ if __name__ == "__main__":
344
350
  None if corpus_inferences is None else create_model_from_inferences(corpus_inferences)
345
351
  )
346
352
  # Print information about the server
347
- msg = _WELCOME_MESSAGE.format(
353
+ root_path = urljoin(f"http://{host}:{port}", host_root_path)
354
+ msg = _WELCOME_MESSAGE.render(
348
355
  version=version("arize-phoenix"),
349
- ui_path=urljoin(f"http://{host}:{port}", host_root_path),
356
+ ui_path=root_path,
350
357
  grpc_path=f"http://{host}:{get_env_grpc_port()}",
351
- http_path=urljoin(urljoin(f"http://{host}:{port}", host_root_path), "v1/traces"),
358
+ http_path=urljoin(root_path, "v1/traces"),
352
359
  storage=get_printable_db_url(db_connection_str),
360
+ schema=get_env_database_schema(),
353
361
  )
354
362
  if authentication_enabled:
355
363
  msg += _EXPERIMENTAL_WARNING.format(auth_enabled=True)
356
364
  if sys.platform.startswith("win"):
357
365
  msg = codecs.encode(msg, "ascii", errors="ignore").decode("ascii").strip()
366
+ scaffolder_config = ScaffolderConfig(
367
+ db=factory,
368
+ tracing_fixture_names=tracing_fixture_names,
369
+ force_fixture_ingestion=force_fixture_ingestion,
370
+ scaffold_datasets=scaffold_datasets,
371
+ phoenix_url=root_path,
372
+ )
358
373
  app = create_app(
359
374
  db=factory,
360
375
  export_path=export_path,
@@ -372,9 +387,7 @@ if __name__ == "__main__":
372
387
  startup_callbacks=[lambda: print(msg)],
373
388
  shutdown_callbacks=instrumentation_cleanups,
374
389
  secret=secret,
375
- tracing_fixture_names=tracing_fixture_names,
376
- force_fixture_ingestion=force_fixture_ingestion,
377
- scaffold_datasets=scaffold_datasets,
390
+ scaffolder_config=scaffolder_config,
378
391
  )
379
392
  server = Server(config=Config(app, host=host, port=port, root_path=host_root_path)) # type: ignore
380
393
  Thread(target=_write_pid_file_when_ready, args=(server,), daemon=True).start()
@@ -1,32 +1,32 @@
1
1
  {
2
- "_components-CEsu6itL.js": {
3
- "file": "assets/components-CEsu6itL.js",
2
+ "_components-CPHugqwr.js": {
3
+ "file": "assets/components-CPHugqwr.js",
4
4
  "name": "components",
5
5
  "imports": [
6
- "_vendor-DsnEJuEV.js",
7
- "_vendor-arizeai-DtynTLNi.js",
8
- "_pages-eeRVG3GZ.js",
6
+ "_vendor-Dpio9q2e.js",
7
+ "_vendor-arizeai-DDzwX9A6.js",
8
+ "_pages-Ds3nQwKE.js",
9
9
  "_vendor-three-DwGkEfCM.js",
10
- "_vendor-codemirror-C5to5cK4.js"
10
+ "_vendor-codemirror-xRvQKK1G.js"
11
11
  ]
12
12
  },
13
- "_pages-eeRVG3GZ.js": {
14
- "file": "assets/pages-eeRVG3GZ.js",
13
+ "_pages-Ds3nQwKE.js": {
14
+ "file": "assets/pages-Ds3nQwKE.js",
15
15
  "name": "pages",
16
16
  "imports": [
17
- "_vendor-DsnEJuEV.js",
18
- "_components-CEsu6itL.js",
19
- "_vendor-arizeai-DtynTLNi.js",
20
- "_vendor-recharts-reihe2SJ.js",
21
- "_vendor-codemirror-C5to5cK4.js"
17
+ "_vendor-Dpio9q2e.js",
18
+ "_components-CPHugqwr.js",
19
+ "_vendor-arizeai-DDzwX9A6.js",
20
+ "_vendor-recharts-DoxlB_Wo.js",
21
+ "_vendor-codemirror-xRvQKK1G.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-DsnEJuEV.js": {
29
- "file": "assets/vendor-DsnEJuEV.js",
28
+ "_vendor-Dpio9q2e.js": {
29
+ "file": "assets/vendor-Dpio9q2e.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-DtynTLNi.js": {
39
- "file": "assets/vendor-arizeai-DtynTLNi.js",
38
+ "_vendor-arizeai-DDzwX9A6.js": {
39
+ "file": "assets/vendor-arizeai-DDzwX9A6.js",
40
40
  "name": "vendor-arizeai",
41
41
  "imports": [
42
- "_vendor-DsnEJuEV.js"
42
+ "_vendor-Dpio9q2e.js"
43
43
  ]
44
44
  },
45
- "_vendor-codemirror-C5to5cK4.js": {
46
- "file": "assets/vendor-codemirror-C5to5cK4.js",
45
+ "_vendor-codemirror-xRvQKK1G.js": {
46
+ "file": "assets/vendor-codemirror-xRvQKK1G.js",
47
47
  "name": "vendor-codemirror",
48
48
  "imports": [
49
- "_vendor-DsnEJuEV.js"
49
+ "_vendor-Dpio9q2e.js"
50
50
  ]
51
51
  },
52
- "_vendor-recharts-reihe2SJ.js": {
53
- "file": "assets/vendor-recharts-reihe2SJ.js",
52
+ "_vendor-recharts-DoxlB_Wo.js": {
53
+ "file": "assets/vendor-recharts-DoxlB_Wo.js",
54
54
  "name": "vendor-recharts",
55
55
  "imports": [
56
- "_vendor-DsnEJuEV.js"
56
+ "_vendor-Dpio9q2e.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-Cuxn1Qdi.js",
64
+ "file": "assets/index-U9TnafOn.js",
65
65
  "name": "index",
66
66
  "src": "index.tsx",
67
67
  "isEntry": true,
68
68
  "imports": [
69
- "_vendor-DsnEJuEV.js",
70
- "_vendor-arizeai-DtynTLNi.js",
71
- "_pages-eeRVG3GZ.js",
72
- "_components-CEsu6itL.js",
69
+ "_vendor-Dpio9q2e.js",
70
+ "_vendor-arizeai-DDzwX9A6.js",
71
+ "_pages-Ds3nQwKE.js",
72
+ "_components-CPHugqwr.js",
73
73
  "_vendor-three-DwGkEfCM.js",
74
- "_vendor-recharts-reihe2SJ.js",
75
- "_vendor-codemirror-C5to5cK4.js"
74
+ "_vendor-recharts-DoxlB_Wo.js",
75
+ "_vendor-codemirror-xRvQKK1G.js"
76
76
  ]
77
77
  }
78
78
  }