arize-phoenix 5.7.0__py3-none-any.whl → 5.8.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-5.7.0.dist-info → arize_phoenix-5.8.0.dist-info}/METADATA +3 -5
- {arize_phoenix-5.7.0.dist-info → arize_phoenix-5.8.0.dist-info}/RECORD +24 -24
- {arize_phoenix-5.7.0.dist-info → arize_phoenix-5.8.0.dist-info}/WHEEL +1 -1
- phoenix/config.py +19 -3
- phoenix/server/api/helpers/playground_clients.py +123 -36
- phoenix/server/api/helpers/playground_spans.py +173 -76
- phoenix/server/api/input_types/InvocationParameters.py +7 -8
- phoenix/server/api/mutations/chat_mutations.py +46 -65
- phoenix/server/api/subscriptions.py +210 -158
- phoenix/server/api/types/ChatCompletionSubscriptionPayload.py +5 -3
- phoenix/server/app.py +14 -0
- phoenix/server/grpc_server.py +3 -1
- phoenix/server/static/.vite/manifest.json +31 -31
- phoenix/server/static/assets/{components-Csu8UKOs.js → components-MllbfxfJ.js} +168 -150
- phoenix/server/static/assets/{index-Bk5C9EA7.js → index-BVO2YcT1.js} +2 -2
- phoenix/server/static/assets/{pages-UeWaKXNs.js → pages-BHfC6jnL.js} +394 -300
- phoenix/server/static/assets/{vendor-CtqfhlbC.js → vendor-BEuNhfwH.js} +1 -1
- phoenix/server/static/assets/{vendor-arizeai-C_3SBz56.js → vendor-arizeai-Bskhzyjm.js} +1 -1
- phoenix/server/static/assets/{vendor-codemirror-wfdk9cjp.js → vendor-codemirror-DLlXCf0x.js} +1 -1
- phoenix/server/static/assets/{vendor-recharts-BiVnSv90.js → vendor-recharts-CRqhvLYg.js} +1 -1
- phoenix/version.py +1 -1
- {arize_phoenix-5.7.0.dist-info → arize_phoenix-5.8.0.dist-info}/entry_points.txt +0 -0
- {arize_phoenix-5.7.0.dist-info → arize_phoenix-5.8.0.dist-info}/licenses/IP_NOTICE +0 -0
- {arize_phoenix-5.7.0.dist-info → arize_phoenix-5.8.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: arize-phoenix
|
|
3
|
-
Version: 5.
|
|
3
|
+
Version: 5.8.0
|
|
4
4
|
Summary: AI Observability and Evaluation
|
|
5
5
|
Project-URL: Documentation, https://docs.arize.com/phoenix/
|
|
6
6
|
Project-URL: Issues, https://github.com/Arize-ai/phoenix/issues
|
|
7
7
|
Project-URL: Source, https://github.com/Arize-ai/phoenix
|
|
8
8
|
Author-email: Arize AI <phoenix-devs@arize.com>
|
|
9
9
|
License: Elastic-2.0
|
|
10
|
-
License-File: IP_NOTICE
|
|
11
|
-
License-File: LICENSE
|
|
12
10
|
Keywords: Explainability,Monitoring,Observability
|
|
13
11
|
Classifier: Programming Language :: Python
|
|
14
12
|
Classifier: Programming Language :: Python :: 3.9
|
|
@@ -131,7 +129,7 @@ Description-Content-Type: text/markdown
|
|
|
131
129
|
<a href="https://docs.arize.com/phoenix/">
|
|
132
130
|
<img src="https://img.shields.io/static/v1?message=Docs&logo=data:image/png;base64,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&labelColor=grey&color=blue&logoColor=white&label=%20"/>
|
|
133
131
|
</a>
|
|
134
|
-
<a target="_blank" href="https://join.slack.com/t/arize-ai/shared_invite/zt-
|
|
132
|
+
<a target="_blank" href="https://join.slack.com/t/arize-ai/shared_invite/zt-22vj03k4k-MlrNEwv5WeswapTs0kNCBw">
|
|
135
133
|
<img src="https://img.shields.io/static/v1?message=Community&logo=slack&labelColor=grey&color=blue&logoColor=white&label=%20"/>
|
|
136
134
|
</a>
|
|
137
135
|
<a target="_blank" href="https://twitter.com/ArizePhoenix">
|
|
@@ -237,7 +235,7 @@ For details about tracing integrations and example applications, see the [OpenIn
|
|
|
237
235
|
|
|
238
236
|
Join our community to connect with thousands of AI builders.
|
|
239
237
|
|
|
240
|
-
- 🌍 Join our [Slack community](https://join.slack.com/t/arize-ai/shared_invite/zt-
|
|
238
|
+
- 🌍 Join our [Slack community](https://join.slack.com/t/arize-ai/shared_invite/zt-22vj03k4k-MlrNEwv5WeswapTs0kNCBw).
|
|
241
239
|
- 📚 Read our [documentation](https://docs.arize.com/phoenix).
|
|
242
240
|
- 💡 Ask questions and provide feedback in the _#phoenix-support_ channel.
|
|
243
241
|
- 🌟 Leave a star on our [GitHub](https://github.com/Arize-ai/phoenix).
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
phoenix/__init__.py,sha256=X3eUEwd2rG8KKWWYVNNDJoqo08ihfjgHhlP29dcdNJE,5481
|
|
2
2
|
phoenix/auth.py,sha256=JpkwJbis2INlIXWcQ-M_Nk5Ln9LBgHMdWNnaAQp0D2w,10940
|
|
3
|
-
phoenix/config.py,sha256=
|
|
3
|
+
phoenix/config.py,sha256=wmHEfX2npXWSRtTR9-bz8gJUbfacjcs6w7DDSkvosro,24902
|
|
4
4
|
phoenix/datetime_utils.py,sha256=iJzNG6YJ6V7_u8B2iA7P2Z26FyxYbOPtx0dhJ7kNDHA,3398
|
|
5
5
|
phoenix/exceptions.py,sha256=n2L2KKuecrdflB9MsCdAYCiSEvGJptIsfRkXMoJle7A,169
|
|
6
6
|
phoenix/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
7
7
|
phoenix/services.py,sha256=kpW1WL0kiB8XJsO6XycvZVJ-lBkNoenhQ7atCvBoSe8,5365
|
|
8
8
|
phoenix/settings.py,sha256=ht-0oN-sMV6SPXrk7Tu1EZlngpAYkGNLYPhO8DyrdQI,661
|
|
9
|
-
phoenix/version.py,sha256=
|
|
9
|
+
phoenix/version.py,sha256=duDTiv1rL8Ee9_jtzzhpq-j4xkkpVPkUh2Daa_Ou-xA,22
|
|
10
10
|
phoenix/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
11
|
phoenix/core/embedding_dimension.py,sha256=zKGbcvwOXgLf-yrJBpQyKtd-LEOPRKHnUToyAU8Owis,87
|
|
12
12
|
phoenix/core/model.py,sha256=qBFraOtmwCCnWJltKNP18DDG0mULXigytlFsa6YOz6k,4837
|
|
@@ -73,11 +73,11 @@ phoenix/pointcloud/pointcloud.py,sha256=SN_1wXZcwKrtSnHGZLDZGx71orqE1WyVF7E-D58d
|
|
|
73
73
|
phoenix/pointcloud/projectors.py,sha256=TQgwc9cJDjJkin1WZyZzgl3HsYrLLiyWD7Czy4jNW3U,1088
|
|
74
74
|
phoenix/pointcloud/umap_parameters.py,sha256=db_WEPoamuWtopZx7tQfAXPnoE0MS8FkAV0_ThjEx_Q,1735
|
|
75
75
|
phoenix/server/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
76
|
-
phoenix/server/app.py,sha256=
|
|
76
|
+
phoenix/server/app.py,sha256=Nh1CR4YWXnQYULMJuLQPdz4VVt7nwz5E8IDHtR91_GQ,37847
|
|
77
77
|
phoenix/server/bearer_auth.py,sha256=0UudvkAS_dxna5JEJJhGUYwB6Ny-e22ssX5Mm79QwCk,5907
|
|
78
78
|
phoenix/server/dml_event.py,sha256=MjJmVEKytq75chBOSyvYDusUnEbg1pHpIjR3pZkUaJA,2838
|
|
79
79
|
phoenix/server/dml_event_handler.py,sha256=EZLXmCvx4pJrCkz29gxwKwmvmUkTtPCHw6klR-XM8qE,8258
|
|
80
|
-
phoenix/server/grpc_server.py,sha256=
|
|
80
|
+
phoenix/server/grpc_server.py,sha256=SknR-iLIUqU9swiAyLhbCUREA1obOM6w49xgdK1AQDs,3839
|
|
81
81
|
phoenix/server/jwt_store.py,sha256=asxzY4_ZBM2FWAMstHvhvnKUP_0AA3v3xPTL2IOgNqY,16831
|
|
82
82
|
phoenix/server/main.py,sha256=cJaJArrLof5ziFkpB_31TGTaiUK_YCh7_ROZRtrdZ-Q,16310
|
|
83
83
|
phoenix/server/oauth2.py,sha256=EV4wcCwG0N7cJRcfGNURdP5rZgRVCeRDvXyle19A27Y,2064
|
|
@@ -94,7 +94,7 @@ phoenix/server/api/exceptions.py,sha256=TA0JuY2YRnj35qGuMSQ8d0ToHum9gWm9W--3fSKH
|
|
|
94
94
|
phoenix/server/api/interceptor.py,sha256=ykDnoC_apUd-llVli3m1CW18kNSIgjz2qZ6m5JmPDu8,1294
|
|
95
95
|
phoenix/server/api/queries.py,sha256=nOgrAygpl49y1a5V0O_y4SRNJ8dwgv_C7birrgkgRm4,27150
|
|
96
96
|
phoenix/server/api/schema.py,sha256=tHyw2jTbue_-gu0fe9Sw7LUYtzJUCwp9SvccDgOkNPw,1696
|
|
97
|
-
phoenix/server/api/subscriptions.py,sha256=
|
|
97
|
+
phoenix/server/api/subscriptions.py,sha256=Xu1k-UL893Ao1FsGk7OGfxuuyO6A3FzbSK8a2TTSDe4,19692
|
|
98
98
|
phoenix/server/api/utils.py,sha256=quCBRcusc6PUq9tJq7M8PgwFZp7nXgVAxtbw8feribY,833
|
|
99
99
|
phoenix/server/api/dataloaders/__init__.py,sha256=jNYvfXjnZzgA2HWTG7AZdqWGla3ZysBUDUei8Zkz6N8,3290
|
|
100
100
|
phoenix/server/api/dataloaders/annotation_summaries.py,sha256=2sHmIDX7n8tuPeBTs9bMKtlMKWn_Ph9awTZqmwn2Owc,5505
|
|
@@ -125,9 +125,9 @@ phoenix/server/api/dataloaders/cache/__init__.py,sha256=SYoOM9n8FJaMdQarma5d1blu
|
|
|
125
125
|
phoenix/server/api/dataloaders/cache/two_tier_cache.py,sha256=cmo8FUT3E91R139IEzh4yCga-6nTamc5KPXAfMrzNDM,2315
|
|
126
126
|
phoenix/server/api/helpers/__init__.py,sha256=m2-xaSPqUiSs91k62JaRDjFNfl-1byxBfY-m_Vxw16U,272
|
|
127
127
|
phoenix/server/api/helpers/dataset_helpers.py,sha256=14mldZp9to3rr9BdvvoFqEwZHHV_k2e7jPm8q9z2OdQ,6896
|
|
128
|
-
phoenix/server/api/helpers/playground_clients.py,sha256=
|
|
128
|
+
phoenix/server/api/helpers/playground_clients.py,sha256=tgf94esqWmt1AnXEA7QDa2G3THjvtbbS_qLY5xyJd70,29093
|
|
129
129
|
phoenix/server/api/helpers/playground_registry.py,sha256=CPLMziFB2wmr-dfbx7VbzO2f8YIG_k5RftzvGXYGQ1w,2570
|
|
130
|
-
phoenix/server/api/helpers/playground_spans.py,sha256=
|
|
130
|
+
phoenix/server/api/helpers/playground_spans.py,sha256=j7WlFTolCgrpkazwVuXqvTj8JSJ-nf-Gf_VZKCbzAvU,14775
|
|
131
131
|
phoenix/server/api/input_types/AddExamplesToDatasetInput.py,sha256=mIQz0S_z8YdrktKIY6RCvtNJ2yZF9pYvTGgasUsI-54,430
|
|
132
132
|
phoenix/server/api/input_types/AddSpansToDatasetInput.py,sha256=-StSstyMAVrba3tG1U30b-srkKCtu_svflQuSM19iJA,362
|
|
133
133
|
phoenix/server/api/input_types/ChatCompletionInput.py,sha256=g_5ARuwylt-uCVAsGyZPEVtidEQiOhbKakvDQsZumzw,1451
|
|
@@ -150,7 +150,7 @@ phoenix/server/api/input_types/DimensionFilter.py,sha256=eBYcn7ECSJQlEePvbStqkHB
|
|
|
150
150
|
phoenix/server/api/input_types/DimensionInput.py,sha256=Vfx5FmiMKey4-EHDQsQRPzSAMRJMN5oVMLDUl4NKAa8,164
|
|
151
151
|
phoenix/server/api/input_types/GenerativeModelInput.py,sha256=h_9dNkz-LBgOLKQ5_ijch4UNGiDb4x5CCC96WyverSg,551
|
|
152
152
|
phoenix/server/api/input_types/Granularity.py,sha256=PiOFWmSMs_w7ZZMNfEWPzIY6S6guI83Vy4NXXSEewGo,2310
|
|
153
|
-
phoenix/server/api/input_types/InvocationParameters.py,sha256=
|
|
153
|
+
phoenix/server/api/input_types/InvocationParameters.py,sha256=Lg6-SKsx72Lb-jzjJLSfPfmyt8bPz_8JtLpv5-TDcZQ,5154
|
|
154
154
|
phoenix/server/api/input_types/PatchAnnotationInput.py,sha256=NWhkcbcGNPwfOYsN3wm5YFNNrSc5T-8Y5my74RK99HE,520
|
|
155
155
|
phoenix/server/api/input_types/PatchDatasetExamplesInput.py,sha256=_uMqkAInhLDvzUSASl6HgLNulTsekMcYzyd5J6LF90I,884
|
|
156
156
|
phoenix/server/api/input_types/PatchDatasetInput.py,sha256=OURtTVY8Z_oFEDtKwT1LCMaOK5D4QYo5TVQ6mDrex-g,328
|
|
@@ -164,7 +164,7 @@ phoenix/server/api/input_types/UserRoleInput.py,sha256=xxhFe0ITZOgRVEJbVem_W6F1I
|
|
|
164
164
|
phoenix/server/api/input_types/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
165
165
|
phoenix/server/api/mutations/__init__.py,sha256=1wClieLNA3_Tin4Ah67rkrQvwSSZAdPU0EPsRiUxyAA,1103
|
|
166
166
|
phoenix/server/api/mutations/api_key_mutations.py,sha256=OmPipsmlQIb6DKvAgO58mZUwkYJihlJB2N4lTyeUlAA,6164
|
|
167
|
-
phoenix/server/api/mutations/chat_mutations.py,sha256=
|
|
167
|
+
phoenix/server/api/mutations/chat_mutations.py,sha256=MseQk4FEQOjEs-CseGDcD8Qf73GfKsDvcpKjwD4V9A4,13123
|
|
168
168
|
phoenix/server/api/mutations/dataset_mutations.py,sha256=siwsSmozKRIK8ZhPrfWl-GxKCL4lAmRPms862tG2KXY,27064
|
|
169
169
|
phoenix/server/api/mutations/experiment_mutations.py,sha256=p3CoLAa8nFPa3D759Y2A7De_PVJNGOL98mA3HoZBrRQ,3188
|
|
170
170
|
phoenix/server/api/mutations/export_events_mutations.py,sha256=xoDnVWC7eA_8wNQP0-oyiHojyUZ0EhVVSrsAnztetC0,3993
|
|
@@ -196,7 +196,7 @@ phoenix/server/api/types/AnnotatorKind.py,sha256=rPgGdbN1Gvc109sGQ_ZH-gfJbp93V9w
|
|
|
196
196
|
phoenix/server/api/types/ApiKey.py,sha256=76HIkWxyJqL3UjdMesX9l5y6XaD9QphwabXGQVY-MaQ,793
|
|
197
197
|
phoenix/server/api/types/AuthMethod.py,sha256=M25usT6FCNKi-QFMdtMqRjJVGfq1ACnVoSjHXGxfrUk,126
|
|
198
198
|
phoenix/server/api/types/ChatCompletionMessageRole.py,sha256=kmQOilOlVntlmqbaHkqXZuimfljfYaHc3kbo53uK8_0,227
|
|
199
|
-
phoenix/server/api/types/ChatCompletionSubscriptionPayload.py,sha256=
|
|
199
|
+
phoenix/server/api/types/ChatCompletionSubscriptionPayload.py,sha256=G0YsirJzDMFDqEK7I_FCkPmIugAof-8D9fNfFlHdhjY,1031
|
|
200
200
|
phoenix/server/api/types/Cluster.py,sha256=duX0pSC7P3YT1IztduuJtPsRj1x6oOOLfmWf2Y-FdEk,5699
|
|
201
201
|
phoenix/server/api/types/CreateDatasetPayload.py,sha256=R-6zCmuD0f76RU9Giu78xwTHlASQs6Aq8yzvX1Kxc3g,140
|
|
202
202
|
phoenix/server/api/types/DataQualityMetric.py,sha256=zRKsNvHBu-NdcsunuLhqFpZhi6ks-HMqA1PJD27jTak,590
|
|
@@ -273,15 +273,15 @@ phoenix/server/static/apple-touch-icon-76x76.png,sha256=CT_xT12I0u2i0WU8JzBZBuOQ
|
|
|
273
273
|
phoenix/server/static/apple-touch-icon.png,sha256=fOfpjqGpWYbJ0eAurKsyoZP1EAs6ZVooBJ_SGk2ZkDs,3801
|
|
274
274
|
phoenix/server/static/favicon.ico,sha256=bY0vvCKRftemZfPShwZtE93DiiQdaYaozkPGwNFr6H8,34494
|
|
275
275
|
phoenix/server/static/modernizr.js,sha256=mvK-XtkNqjOral-QvzoqsyOMECXIMu5BQwSVN_wcU9c,2564
|
|
276
|
-
phoenix/server/static/.vite/manifest.json,sha256=
|
|
277
|
-
phoenix/server/static/assets/components-
|
|
278
|
-
phoenix/server/static/assets/index-
|
|
279
|
-
phoenix/server/static/assets/pages-
|
|
280
|
-
phoenix/server/static/assets/vendor-
|
|
276
|
+
phoenix/server/static/.vite/manifest.json,sha256=k6i5VszmBt1XcFCELz8c-7e6TP_x3amoTODdfstyDcA,1929
|
|
277
|
+
phoenix/server/static/assets/components-MllbfxfJ.js,sha256=mkB80JoeM-3PN4jY7reEh8NWoCza0xPP89dwgJ0dizc,304177
|
|
278
|
+
phoenix/server/static/assets/index-BVO2YcT1.js,sha256=ChIu9IaqdcdOJ89wC9wtTPQuN4KGw7HarePwximdaLs,7162
|
|
279
|
+
phoenix/server/static/assets/pages-BHfC6jnL.js,sha256=ci7akTAeDEYkrBXLYwU7AtgTbfBn9rPvORPt0e617YQ,602565
|
|
280
|
+
phoenix/server/static/assets/vendor-BEuNhfwH.js,sha256=im6x5624m4r_P-V7JnxGOr2oX7U9-HOCpXFxL570rA0,10898284
|
|
281
281
|
phoenix/server/static/assets/vendor-DxkFTwjz.css,sha256=nZrkr0u6NNElFGvpWHk9GTHeGoibCXCli1bE7mXZGZg,1816
|
|
282
|
-
phoenix/server/static/assets/vendor-arizeai-
|
|
283
|
-
phoenix/server/static/assets/vendor-codemirror-
|
|
284
|
-
phoenix/server/static/assets/vendor-recharts-
|
|
282
|
+
phoenix/server/static/assets/vendor-arizeai-Bskhzyjm.js,sha256=afaoNHydOIeqYuzh_uvsyA-yRVOr6sheR8hyKq7cUlA,307006
|
|
283
|
+
phoenix/server/static/assets/vendor-codemirror-DLlXCf0x.js,sha256=myPIgiviHBKD70ohoYZnBRoy5a7UDyICuyJOqBt7rHc,392705
|
|
284
|
+
phoenix/server/static/assets/vendor-recharts-CRqhvLYg.js,sha256=mX6uPoAPxX1q9_1rJWjmDv1mpk6qgCkd15hzJKfT0Qs,282859
|
|
285
285
|
phoenix/server/static/assets/vendor-three-DwGkEfCM.js,sha256=0D12ZgKzfKCTSdSTKJBFR2RZO_xxeMXrqDp0AszZqHY,620972
|
|
286
286
|
phoenix/server/templates/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
287
287
|
phoenix/server/templates/index.html,sha256=ram6sfy2obf_F053ay35V30v-mnRWZ86rK-PstXLy1c,4457
|
|
@@ -322,9 +322,9 @@ phoenix/utilities/project.py,sha256=auVpARXkDb-JgeX5f2aStyFIkeKvGwN9l7qrFeJMVxI,
|
|
|
322
322
|
phoenix/utilities/re.py,sha256=x8Xbk-Wa6qDMAtUd_7JtZvKtrYEuMY-bchB0n163_5c,2006
|
|
323
323
|
phoenix/utilities/span_store.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
324
324
|
phoenix/utilities/template_formatters.py,sha256=JuOyvukMPLDHa1uVNw0kCFBUnIxy02dwAWNZimdIZU4,2423
|
|
325
|
-
arize_phoenix-5.
|
|
326
|
-
arize_phoenix-5.
|
|
327
|
-
arize_phoenix-5.
|
|
328
|
-
arize_phoenix-5.
|
|
329
|
-
arize_phoenix-5.
|
|
330
|
-
arize_phoenix-5.
|
|
325
|
+
arize_phoenix-5.8.0.dist-info/METADATA,sha256=VALVEFvoQcr28Xiu2cMyzl2a17SLOQoFEkiTmkMnkcs,22613
|
|
326
|
+
arize_phoenix-5.8.0.dist-info/WHEEL,sha256=3U_NnUcV_1B1kPkYaPzN-irRckL5VW_lytn0ytO_kRY,87
|
|
327
|
+
arize_phoenix-5.8.0.dist-info/entry_points.txt,sha256=Pgpn8Upxx9P8z8joPXZWl2LlnAlGc3gcQoVchb06X1Q,94
|
|
328
|
+
arize_phoenix-5.8.0.dist-info/licenses/IP_NOTICE,sha256=JBqyyCYYxGDfzQ0TtsQgjts41IJoa-hiwDrBjCb9gHM,469
|
|
329
|
+
arize_phoenix-5.8.0.dist-info/licenses/LICENSE,sha256=HFkW9REuMOkvKRACuwLPT0hRydHb3zNg-fdFt94td18,3794
|
|
330
|
+
arize_phoenix-5.8.0.dist-info/RECORD,,
|
phoenix/config.py
CHANGED
|
@@ -146,9 +146,10 @@ ENV_PHOENIX_SMTP_VALIDATE_CERTS = "PHOENIX_SMTP_VALIDATE_CERTS"
|
|
|
146
146
|
Whether to validate SMTP server certificates. Defaults to true.
|
|
147
147
|
"""
|
|
148
148
|
|
|
149
|
-
#
|
|
149
|
+
# API extension settings
|
|
150
150
|
ENV_PHOENIX_FASTAPI_MIDDLEWARE_PATHS = "PHOENIX_FASTAPI_MIDDLEWARE_PATHS"
|
|
151
151
|
ENV_PHOENIX_GQL_EXTENSION_PATHS = "PHOENIX_GQL_EXTENSION_PATHS"
|
|
152
|
+
ENV_PHOENIX_GRPC_INTERCEPTOR_PATHS = "PHOENIX_GRPC_INTERCEPTOR_PATHS"
|
|
152
153
|
|
|
153
154
|
|
|
154
155
|
def server_instrumentation_is_enabled() -> bool:
|
|
@@ -656,7 +657,7 @@ def get_env_db_logging_level() -> int:
|
|
|
656
657
|
|
|
657
658
|
|
|
658
659
|
def get_env_fastapi_middleware_paths() -> list[tuple[str, str]]:
|
|
659
|
-
env_value = os.getenv(
|
|
660
|
+
env_value = os.getenv(ENV_PHOENIX_FASTAPI_MIDDLEWARE_PATHS, "")
|
|
660
661
|
paths = []
|
|
661
662
|
for entry in env_value.split(","):
|
|
662
663
|
entry = entry.strip()
|
|
@@ -671,7 +672,7 @@ def get_env_fastapi_middleware_paths() -> list[tuple[str, str]]:
|
|
|
671
672
|
|
|
672
673
|
|
|
673
674
|
def get_env_gql_extension_paths() -> list[tuple[str, str]]:
|
|
674
|
-
env_value = os.getenv(
|
|
675
|
+
env_value = os.getenv(ENV_PHOENIX_GQL_EXTENSION_PATHS, "")
|
|
675
676
|
paths = []
|
|
676
677
|
for entry in env_value.split(","):
|
|
677
678
|
entry = entry.strip()
|
|
@@ -685,6 +686,21 @@ def get_env_gql_extension_paths() -> list[tuple[str, str]]:
|
|
|
685
686
|
return paths
|
|
686
687
|
|
|
687
688
|
|
|
689
|
+
def get_env_grpc_interceptor_paths() -> list[tuple[str, str]]:
|
|
690
|
+
env_value = os.getenv(ENV_PHOENIX_GRPC_INTERCEPTOR_PATHS, "")
|
|
691
|
+
paths = []
|
|
692
|
+
for entry in env_value.split(","):
|
|
693
|
+
entry = entry.strip()
|
|
694
|
+
if entry:
|
|
695
|
+
if ":" not in entry:
|
|
696
|
+
raise ValueError(
|
|
697
|
+
f"Invalid interceptor entry '{entry}'. Expected format 'file_path:ClassName'."
|
|
698
|
+
)
|
|
699
|
+
file_path, object_name = entry.split(":", 1)
|
|
700
|
+
paths.append((file_path.strip(), object_name.strip()))
|
|
701
|
+
return paths
|
|
702
|
+
|
|
703
|
+
|
|
688
704
|
def _get_logging_level(env_var: str, default_level: int) -> int:
|
|
689
705
|
logging_level = os.getenv(env_var)
|
|
690
706
|
if not logging_level:
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
+
import asyncio
|
|
1
2
|
import importlib.util
|
|
3
|
+
import inspect
|
|
4
|
+
import json
|
|
5
|
+
import time
|
|
2
6
|
from abc import ABC, abstractmethod
|
|
3
7
|
from collections.abc import AsyncIterator, Callable, Iterator
|
|
4
|
-
from
|
|
5
|
-
|
|
6
|
-
Any,
|
|
7
|
-
Mapping,
|
|
8
|
-
Optional,
|
|
9
|
-
Union,
|
|
10
|
-
)
|
|
8
|
+
from functools import wraps
|
|
9
|
+
from typing import TYPE_CHECKING, Any, Hashable, Mapping, Optional, Union
|
|
11
10
|
|
|
12
11
|
from openinference.instrumentation import safe_json_dumps
|
|
13
12
|
from openinference.semconv.trace import SpanAttributes
|
|
@@ -15,10 +14,14 @@ from strawberry import UNSET
|
|
|
15
14
|
from strawberry.scalars import JSON as JSONScalarType
|
|
16
15
|
from typing_extensions import TypeAlias, assert_never
|
|
17
16
|
|
|
18
|
-
from phoenix.
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
from phoenix.evals.models.rate_limiters import (
|
|
18
|
+
AsyncCallable,
|
|
19
|
+
GenericType,
|
|
20
|
+
ParameterSpec,
|
|
21
|
+
RateLimiter,
|
|
22
|
+
RateLimitError,
|
|
21
23
|
)
|
|
24
|
+
from phoenix.server.api.helpers.playground_registry import PROVIDER_DEFAULT, register_llm_client
|
|
22
25
|
from phoenix.server.api.input_types.GenerativeModelInput import GenerativeModelInput
|
|
23
26
|
from phoenix.server.api.input_types.InvocationParameters import (
|
|
24
27
|
BoundedFloatInvocationParameter,
|
|
@@ -42,16 +45,99 @@ from phoenix.server.api.types.GenerativeProvider import GenerativeProviderKey
|
|
|
42
45
|
if TYPE_CHECKING:
|
|
43
46
|
from anthropic.types import MessageParam
|
|
44
47
|
from openai.types import CompletionUsage
|
|
45
|
-
from openai.types.chat import
|
|
46
|
-
ChatCompletionMessageParam,
|
|
47
|
-
ChatCompletionMessageToolCallParam,
|
|
48
|
-
)
|
|
48
|
+
from openai.types.chat import ChatCompletionMessageParam, ChatCompletionMessageToolCallParam
|
|
49
49
|
|
|
50
50
|
DependencyName: TypeAlias = str
|
|
51
51
|
SetSpanAttributesFn: TypeAlias = Callable[[Mapping[str, Any]], None]
|
|
52
52
|
ChatCompletionChunk: TypeAlias = Union[TextChunk, ToolCallChunk]
|
|
53
53
|
|
|
54
54
|
|
|
55
|
+
class KeyedSingleton:
|
|
56
|
+
_instances: dict[Hashable, "KeyedSingleton"] = {}
|
|
57
|
+
|
|
58
|
+
def __new__(cls, *args: Any, **kwargs: Any) -> "KeyedSingleton":
|
|
59
|
+
if "singleton_key" in kwargs:
|
|
60
|
+
singleton_key = kwargs.pop("singleton_key")
|
|
61
|
+
elif args:
|
|
62
|
+
singleton_key = args[0]
|
|
63
|
+
args = args[1:]
|
|
64
|
+
else:
|
|
65
|
+
raise ValueError("singleton_key must be provided")
|
|
66
|
+
|
|
67
|
+
instance_key = (cls, singleton_key)
|
|
68
|
+
if instance_key not in cls._instances:
|
|
69
|
+
instance = super().__new__(cls)
|
|
70
|
+
cls._instances[instance_key] = instance
|
|
71
|
+
return cls._instances[instance_key]
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
class PlaygroundRateLimiter(RateLimiter, KeyedSingleton):
|
|
75
|
+
"""
|
|
76
|
+
A rate rate limiter class that will be instantiated once per `singleton_key`.
|
|
77
|
+
"""
|
|
78
|
+
|
|
79
|
+
def __init__(self, singleton_key: Hashable, rate_limit_error: Optional[type[BaseException]]):
|
|
80
|
+
super().__init__(
|
|
81
|
+
rate_limit_error=rate_limit_error,
|
|
82
|
+
max_rate_limit_retries=3,
|
|
83
|
+
initial_per_second_request_rate=2.0,
|
|
84
|
+
maximum_per_second_request_rate=10.0,
|
|
85
|
+
enforcement_window_minutes=1,
|
|
86
|
+
rate_reduction_factor=0.5,
|
|
87
|
+
rate_increase_factor=0.01,
|
|
88
|
+
cooldown_seconds=5,
|
|
89
|
+
verbose=False,
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
# TODO: update the rate limiter class in phoenix.evals to support decorated sync functions
|
|
93
|
+
def _alimit(
|
|
94
|
+
self, fn: Callable[ParameterSpec, GenericType]
|
|
95
|
+
) -> AsyncCallable[ParameterSpec, GenericType]:
|
|
96
|
+
@wraps(fn)
|
|
97
|
+
async def wrapper(*args: Any, **kwargs: Any) -> GenericType:
|
|
98
|
+
self._initialize_async_primitives()
|
|
99
|
+
assert self._rate_limit_handling_lock is not None and isinstance(
|
|
100
|
+
self._rate_limit_handling_lock, asyncio.Lock
|
|
101
|
+
)
|
|
102
|
+
assert self._rate_limit_handling is not None and isinstance(
|
|
103
|
+
self._rate_limit_handling, asyncio.Event
|
|
104
|
+
)
|
|
105
|
+
try:
|
|
106
|
+
try:
|
|
107
|
+
await asyncio.wait_for(self._rate_limit_handling.wait(), 120)
|
|
108
|
+
except asyncio.TimeoutError:
|
|
109
|
+
self._rate_limit_handling.set() # Set the event as a failsafe
|
|
110
|
+
await self._throttler.async_wait_until_ready()
|
|
111
|
+
request_start_time = time.time()
|
|
112
|
+
if inspect.iscoroutinefunction(fn):
|
|
113
|
+
return await fn(*args, **kwargs) # type: ignore
|
|
114
|
+
else:
|
|
115
|
+
return fn(*args, **kwargs)
|
|
116
|
+
except self._rate_limit_error:
|
|
117
|
+
async with self._rate_limit_handling_lock:
|
|
118
|
+
self._rate_limit_handling.clear() # prevent new requests from starting
|
|
119
|
+
self._throttler.on_rate_limit_error(request_start_time, verbose=self._verbose)
|
|
120
|
+
try:
|
|
121
|
+
for _attempt in range(self._max_rate_limit_retries):
|
|
122
|
+
try:
|
|
123
|
+
request_start_time = time.time()
|
|
124
|
+
await self._throttler.async_wait_until_ready()
|
|
125
|
+
if inspect.iscoroutinefunction(fn):
|
|
126
|
+
return await fn(*args, **kwargs) # type: ignore
|
|
127
|
+
else:
|
|
128
|
+
return fn(*args, **kwargs)
|
|
129
|
+
except self._rate_limit_error:
|
|
130
|
+
self._throttler.on_rate_limit_error(
|
|
131
|
+
request_start_time, verbose=self._verbose
|
|
132
|
+
)
|
|
133
|
+
continue
|
|
134
|
+
finally:
|
|
135
|
+
self._rate_limit_handling.set() # allow new requests to start
|
|
136
|
+
raise RateLimitError(f"Exceeded max ({self._max_rate_limit_retries}) retries")
|
|
137
|
+
|
|
138
|
+
return wrapper
|
|
139
|
+
|
|
140
|
+
|
|
55
141
|
class PlaygroundStreamingClient(ABC):
|
|
56
142
|
def __init__(
|
|
57
143
|
self,
|
|
@@ -150,10 +236,12 @@ class OpenAIStreamingClient(PlaygroundStreamingClient):
|
|
|
150
236
|
api_key: Optional[str] = None,
|
|
151
237
|
) -> None:
|
|
152
238
|
from openai import AsyncOpenAI
|
|
239
|
+
from openai import RateLimitError as OpenAIRateLimitError
|
|
153
240
|
|
|
154
241
|
super().__init__(model=model, api_key=api_key)
|
|
155
242
|
self.client = AsyncOpenAI(api_key=api_key)
|
|
156
243
|
self.model_name = model.name
|
|
244
|
+
self.rate_limiter = PlaygroundRateLimiter(model.provider_key, OpenAIRateLimitError)
|
|
157
245
|
|
|
158
246
|
@classmethod
|
|
159
247
|
def dependencies(cls) -> list[DependencyName]:
|
|
@@ -174,19 +262,16 @@ class OpenAIStreamingClient(PlaygroundStreamingClient):
|
|
|
174
262
|
invocation_name="max_tokens",
|
|
175
263
|
canonical_name=CanonicalParameterName.MAX_COMPLETION_TOKENS,
|
|
176
264
|
label="Max Tokens",
|
|
177
|
-
default_value=UNSET,
|
|
178
265
|
),
|
|
179
266
|
BoundedFloatInvocationParameter(
|
|
180
267
|
invocation_name="frequency_penalty",
|
|
181
268
|
label="Frequency Penalty",
|
|
182
|
-
default_value=UNSET,
|
|
183
269
|
min_value=-2.0,
|
|
184
270
|
max_value=2.0,
|
|
185
271
|
),
|
|
186
272
|
BoundedFloatInvocationParameter(
|
|
187
273
|
invocation_name="presence_penalty",
|
|
188
274
|
label="Presence Penalty",
|
|
189
|
-
default_value=UNSET,
|
|
190
275
|
min_value=-2.0,
|
|
191
276
|
max_value=2.0,
|
|
192
277
|
),
|
|
@@ -194,13 +279,11 @@ class OpenAIStreamingClient(PlaygroundStreamingClient):
|
|
|
194
279
|
invocation_name="stop",
|
|
195
280
|
canonical_name=CanonicalParameterName.STOP_SEQUENCES,
|
|
196
281
|
label="Stop Sequences",
|
|
197
|
-
default_value=UNSET,
|
|
198
282
|
),
|
|
199
283
|
BoundedFloatInvocationParameter(
|
|
200
284
|
invocation_name="top_p",
|
|
201
285
|
canonical_name=CanonicalParameterName.TOP_P,
|
|
202
286
|
label="Top P",
|
|
203
|
-
default_value=UNSET,
|
|
204
287
|
min_value=0.0,
|
|
205
288
|
max_value=1.0,
|
|
206
289
|
),
|
|
@@ -208,20 +291,16 @@ class OpenAIStreamingClient(PlaygroundStreamingClient):
|
|
|
208
291
|
invocation_name="seed",
|
|
209
292
|
canonical_name=CanonicalParameterName.RANDOM_SEED,
|
|
210
293
|
label="Seed",
|
|
211
|
-
default_value=UNSET,
|
|
212
294
|
),
|
|
213
295
|
JSONInvocationParameter(
|
|
214
296
|
invocation_name="tool_choice",
|
|
215
297
|
label="Tool Choice",
|
|
216
298
|
canonical_name=CanonicalParameterName.TOOL_CHOICE,
|
|
217
|
-
default_value=UNSET,
|
|
218
|
-
hidden=True,
|
|
219
299
|
),
|
|
220
300
|
JSONInvocationParameter(
|
|
221
301
|
invocation_name="response_format",
|
|
222
302
|
label="Response Format",
|
|
223
303
|
canonical_name=CanonicalParameterName.RESPONSE_FORMAT,
|
|
224
|
-
default_value=UNSET,
|
|
225
304
|
),
|
|
226
305
|
]
|
|
227
306
|
|
|
@@ -240,7 +319,8 @@ class OpenAIStreamingClient(PlaygroundStreamingClient):
|
|
|
240
319
|
openai_messages = [self.to_openai_chat_completion_param(*message) for message in messages]
|
|
241
320
|
tool_call_ids: dict[int, str] = {}
|
|
242
321
|
token_usage: Optional["CompletionUsage"] = None
|
|
243
|
-
|
|
322
|
+
throttled_create = self.rate_limiter.alimit(self.client.chat.completions.create)
|
|
323
|
+
async for chunk in await throttled_create(
|
|
244
324
|
messages=openai_messages,
|
|
245
325
|
model=self.model_name,
|
|
246
326
|
stream=True,
|
|
@@ -370,20 +450,16 @@ class OpenAIO1StreamingClient(OpenAIStreamingClient):
|
|
|
370
450
|
invocation_name="max_completion_tokens",
|
|
371
451
|
canonical_name=CanonicalParameterName.MAX_COMPLETION_TOKENS,
|
|
372
452
|
label="Max Completion Tokens",
|
|
373
|
-
default_value=UNSET,
|
|
374
453
|
),
|
|
375
454
|
IntInvocationParameter(
|
|
376
455
|
invocation_name="seed",
|
|
377
456
|
canonical_name=CanonicalParameterName.RANDOM_SEED,
|
|
378
457
|
label="Seed",
|
|
379
|
-
default_value=UNSET,
|
|
380
458
|
),
|
|
381
459
|
JSONInvocationParameter(
|
|
382
460
|
invocation_name="tool_choice",
|
|
383
461
|
label="Tool Choice",
|
|
384
462
|
canonical_name=CanonicalParameterName.TOOL_CHOICE,
|
|
385
|
-
default_value=UNSET,
|
|
386
|
-
hidden=True,
|
|
387
463
|
),
|
|
388
464
|
]
|
|
389
465
|
|
|
@@ -409,7 +485,8 @@ class OpenAIO1StreamingClient(OpenAIStreamingClient):
|
|
|
409
485
|
|
|
410
486
|
tool_call_ids: dict[int, str] = {}
|
|
411
487
|
|
|
412
|
-
|
|
488
|
+
throttled_create = self.rate_limiter.alimit(self.client.chat.completions.create)
|
|
489
|
+
response = await throttled_create(
|
|
413
490
|
messages=openai_messages,
|
|
414
491
|
model=self.model_name,
|
|
415
492
|
tools=tools or NOT_GIVEN,
|
|
@@ -544,6 +621,7 @@ class AnthropicStreamingClient(PlaygroundStreamingClient):
|
|
|
544
621
|
super().__init__(model=model, api_key=api_key)
|
|
545
622
|
self.client = anthropic.AsyncAnthropic(api_key=api_key)
|
|
546
623
|
self.model_name = model.name
|
|
624
|
+
self.rate_limiter = PlaygroundRateLimiter(model.provider_key, anthropic.RateLimitError)
|
|
547
625
|
|
|
548
626
|
@classmethod
|
|
549
627
|
def dependencies(cls) -> list[DependencyName]:
|
|
@@ -556,14 +634,12 @@ class AnthropicStreamingClient(PlaygroundStreamingClient):
|
|
|
556
634
|
invocation_name="max_tokens",
|
|
557
635
|
canonical_name=CanonicalParameterName.MAX_COMPLETION_TOKENS,
|
|
558
636
|
label="Max Tokens",
|
|
559
|
-
default_value=UNSET,
|
|
560
637
|
required=True,
|
|
561
638
|
),
|
|
562
639
|
BoundedFloatInvocationParameter(
|
|
563
640
|
invocation_name="temperature",
|
|
564
641
|
canonical_name=CanonicalParameterName.TEMPERATURE,
|
|
565
642
|
label="Temperature",
|
|
566
|
-
default_value=UNSET,
|
|
567
643
|
min_value=0.0,
|
|
568
644
|
max_value=1.0,
|
|
569
645
|
),
|
|
@@ -571,13 +647,11 @@ class AnthropicStreamingClient(PlaygroundStreamingClient):
|
|
|
571
647
|
invocation_name="stop_sequences",
|
|
572
648
|
canonical_name=CanonicalParameterName.STOP_SEQUENCES,
|
|
573
649
|
label="Stop Sequences",
|
|
574
|
-
default_value=UNSET,
|
|
575
650
|
),
|
|
576
651
|
BoundedFloatInvocationParameter(
|
|
577
652
|
invocation_name="top_p",
|
|
578
653
|
canonical_name=CanonicalParameterName.TOP_P,
|
|
579
654
|
label="Top P",
|
|
580
|
-
default_value=UNSET,
|
|
581
655
|
min_value=0.0,
|
|
582
656
|
max_value=1.0,
|
|
583
657
|
),
|
|
@@ -585,8 +659,6 @@ class AnthropicStreamingClient(PlaygroundStreamingClient):
|
|
|
585
659
|
invocation_name="tool_choice",
|
|
586
660
|
label="Tool Choice",
|
|
587
661
|
canonical_name=CanonicalParameterName.TOOL_CHOICE,
|
|
588
|
-
default_value=UNSET,
|
|
589
|
-
hidden=True,
|
|
590
662
|
),
|
|
591
663
|
]
|
|
592
664
|
|
|
@@ -608,9 +680,11 @@ class AnthropicStreamingClient(PlaygroundStreamingClient):
|
|
|
608
680
|
"model": self.model_name,
|
|
609
681
|
"system": system_prompt,
|
|
610
682
|
"max_tokens": 1024,
|
|
683
|
+
"tools": tools,
|
|
611
684
|
**invocation_parameters,
|
|
612
685
|
}
|
|
613
|
-
|
|
686
|
+
throttled_stream = self.rate_limiter._alimit(self.client.messages.stream)
|
|
687
|
+
async with await throttled_stream(**anthropic_params) as stream:
|
|
614
688
|
async for event in stream:
|
|
615
689
|
if isinstance(event, anthropic_types.RawMessageStartEvent):
|
|
616
690
|
self._attributes.update(
|
|
@@ -622,6 +696,18 @@ class AnthropicStreamingClient(PlaygroundStreamingClient):
|
|
|
622
696
|
self._attributes.update(
|
|
623
697
|
{LLM_TOKEN_COUNT_COMPLETION: event.message.usage.output_tokens}
|
|
624
698
|
)
|
|
699
|
+
elif (
|
|
700
|
+
isinstance(event, anthropic_streaming.ContentBlockStopEvent)
|
|
701
|
+
and event.content_block.type == "tool_use"
|
|
702
|
+
):
|
|
703
|
+
tool_call_chunk = ToolCallChunk(
|
|
704
|
+
id=event.content_block.id,
|
|
705
|
+
function=FunctionCallChunk(
|
|
706
|
+
name=event.content_block.name,
|
|
707
|
+
arguments=json.dumps(event.content_block.input),
|
|
708
|
+
),
|
|
709
|
+
)
|
|
710
|
+
yield tool_call_chunk
|
|
625
711
|
elif isinstance(
|
|
626
712
|
event,
|
|
627
713
|
(
|
|
@@ -629,6 +715,7 @@ class AnthropicStreamingClient(PlaygroundStreamingClient):
|
|
|
629
715
|
anthropic_types.RawContentBlockDeltaEvent,
|
|
630
716
|
anthropic_types.RawMessageDeltaEvent,
|
|
631
717
|
anthropic_streaming.ContentBlockStopEvent,
|
|
718
|
+
anthropic_streaming.InputJsonEvent,
|
|
632
719
|
),
|
|
633
720
|
):
|
|
634
721
|
# event types emitted by the stream that don't contain useful information
|