@arizeai/phoenix-client 7.5.0 → 7.7.0
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.
- package/CHANGELOG.md +781 -0
- package/README.md +27 -3
- package/dist/esm/__generated__/api/v1.d.ts +749 -203
- package/dist/esm/__generated__/api/v1.d.ts.map +1 -1
- package/dist/esm/constants/serverRequirements.d.ts +2 -0
- package/dist/esm/constants/serverRequirements.d.ts.map +1 -1
- package/dist/esm/constants/serverRequirements.js +14 -0
- package/dist/esm/constants/serverRequirements.js.map +1 -1
- package/dist/esm/projects/index.d.ts +1 -0
- package/dist/esm/projects/index.d.ts.map +1 -1
- package/dist/esm/projects/index.js +1 -0
- package/dist/esm/projects/index.js.map +1 -1
- package/dist/esm/projects/setProjectRetentionPolicy.d.ts +49 -0
- package/dist/esm/projects/setProjectRetentionPolicy.d.ts.map +1 -0
- package/dist/esm/projects/setProjectRetentionPolicy.js +52 -0
- package/dist/esm/projects/setProjectRetentionPolicy.js.map +1 -0
- package/dist/esm/prompts/deletePrompt.d.ts +39 -0
- package/dist/esm/prompts/deletePrompt.d.ts.map +1 -0
- package/dist/esm/prompts/deletePrompt.js +52 -0
- package/dist/esm/prompts/deletePrompt.js.map +1 -0
- package/dist/esm/prompts/index.d.ts +1 -0
- package/dist/esm/prompts/index.d.ts.map +1 -1
- package/dist/esm/prompts/index.js +1 -0
- package/dist/esm/prompts/index.js.map +1 -1
- package/dist/esm/testing/reporter-format.d.ts.map +1 -1
- package/dist/esm/testing/reporter-format.js +13 -3
- package/dist/esm/testing/reporter-format.js.map +1 -1
- package/dist/esm/traces/getTraces.d.ts +1 -1
- package/dist/esm/traces/getTraces.d.ts.map +1 -1
- package/dist/esm/traces/index.d.ts +1 -0
- package/dist/esm/traces/index.d.ts.map +1 -1
- package/dist/esm/traces/index.js +1 -0
- package/dist/esm/traces/index.js.map +1 -1
- package/dist/esm/traces/transferTraces.d.ts +56 -0
- package/dist/esm/traces/transferTraces.d.ts.map +1 -0
- package/dist/esm/traces/transferTraces.js +56 -0
- package/dist/esm/traces/transferTraces.js.map +1 -0
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/esm/types/prompts.d.ts +9 -0
- package/dist/esm/types/prompts.d.ts.map +1 -1
- package/dist/esm/types/prompts.js.map +1 -1
- package/dist/esm/users/getCurrentUser.d.ts +25 -0
- package/dist/esm/users/getCurrentUser.d.ts.map +1 -0
- package/dist/esm/users/getCurrentUser.js +30 -0
- package/dist/esm/users/getCurrentUser.js.map +1 -0
- package/dist/esm/users/index.d.ts +2 -0
- package/dist/esm/users/index.d.ts.map +1 -0
- package/dist/esm/users/index.js +2 -0
- package/dist/esm/users/index.js.map +1 -0
- package/dist/esm/utils/resolvePromptIdentifier.d.ts +17 -0
- package/dist/esm/utils/resolvePromptIdentifier.d.ts.map +1 -0
- package/dist/esm/utils/resolvePromptIdentifier.js +36 -0
- package/dist/esm/utils/resolvePromptIdentifier.js.map +1 -0
- package/dist/src/__generated__/api/v1.d.ts +749 -203
- package/dist/src/__generated__/api/v1.d.ts.map +1 -1
- package/dist/src/constants/serverRequirements.d.ts +2 -0
- package/dist/src/constants/serverRequirements.d.ts.map +1 -1
- package/dist/src/constants/serverRequirements.js +15 -1
- package/dist/src/constants/serverRequirements.js.map +1 -1
- package/dist/src/projects/index.d.ts +1 -0
- package/dist/src/projects/index.d.ts.map +1 -1
- package/dist/src/projects/index.js +1 -0
- package/dist/src/projects/index.js.map +1 -1
- package/dist/src/projects/setProjectRetentionPolicy.d.ts +49 -0
- package/dist/src/projects/setProjectRetentionPolicy.d.ts.map +1 -0
- package/dist/src/projects/setProjectRetentionPolicy.js +59 -0
- package/dist/src/projects/setProjectRetentionPolicy.js.map +1 -0
- package/dist/src/prompts/deletePrompt.d.ts +39 -0
- package/dist/src/prompts/deletePrompt.d.ts.map +1 -0
- package/dist/src/prompts/deletePrompt.js +55 -0
- package/dist/src/prompts/deletePrompt.js.map +1 -0
- package/dist/src/prompts/index.d.ts +1 -0
- package/dist/src/prompts/index.d.ts.map +1 -1
- package/dist/src/prompts/index.js +1 -0
- package/dist/src/prompts/index.js.map +1 -1
- package/dist/src/testing/reporter-format.d.ts.map +1 -1
- package/dist/src/testing/reporter-format.js +13 -3
- package/dist/src/testing/reporter-format.js.map +1 -1
- package/dist/src/traces/getTraces.d.ts +1 -1
- package/dist/src/traces/getTraces.d.ts.map +1 -1
- package/dist/src/traces/index.d.ts +1 -0
- package/dist/src/traces/index.d.ts.map +1 -1
- package/dist/src/traces/index.js +1 -0
- package/dist/src/traces/index.js.map +1 -1
- package/dist/src/traces/transferTraces.d.ts +56 -0
- package/dist/src/traces/transferTraces.d.ts.map +1 -0
- package/dist/src/traces/transferTraces.js +59 -0
- package/dist/src/traces/transferTraces.js.map +1 -0
- package/dist/src/types/prompts.d.ts +9 -0
- package/dist/src/types/prompts.d.ts.map +1 -1
- package/dist/src/types/prompts.js.map +1 -1
- package/dist/src/users/getCurrentUser.d.ts +25 -0
- package/dist/src/users/getCurrentUser.d.ts.map +1 -0
- package/dist/src/users/getCurrentUser.js +36 -0
- package/dist/src/users/getCurrentUser.js.map +1 -0
- package/dist/src/users/index.d.ts +2 -0
- package/dist/src/users/index.d.ts.map +1 -0
- package/dist/src/users/index.js +18 -0
- package/dist/src/users/index.js.map +1 -0
- package/dist/src/utils/resolvePromptIdentifier.d.ts +17 -0
- package/dist/src/utils/resolvePromptIdentifier.d.ts.map +1 -0
- package/dist/src/utils/resolvePromptIdentifier.js +39 -0
- package/dist/src/utils/resolvePromptIdentifier.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/docs/overview.mdx +8 -4
- package/docs/projects.mdx +71 -0
- package/docs/prompts.mdx +19 -1
- package/docs/traces.mdx +28 -2
- package/docs/users.mdx +44 -0
- package/package.json +16 -12
- package/src/__generated__/api/v1.ts +749 -203
- package/src/constants/serverRequirements.ts +16 -0
- package/src/projects/index.ts +1 -0
- package/src/projects/setProjectRetentionPolicy.ts +80 -0
- package/src/prompts/deletePrompt.ts +70 -0
- package/src/prompts/index.ts +1 -0
- package/src/testing/reporter-format.ts +13 -3
- package/src/traces/getTraces.ts +1 -1
- package/src/traces/index.ts +1 -0
- package/src/traces/transferTraces.ts +89 -0
- package/src/types/prompts.ts +10 -0
- package/src/users/getCurrentUser.ts +39 -0
- package/src/users/index.ts +1 -0
- package/src/utils/resolvePromptIdentifier.ts +41 -0
package/docs/overview.mdx
CHANGED
|
@@ -3,7 +3,7 @@ title: "Overview"
|
|
|
3
3
|
description: "Typed TypeScript client for Phoenix platform APIs"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
`@arizeai/phoenix-client` is the typed TypeScript client for Phoenix platform APIs. It ships a small root REST client plus focused module entrypoints for prompts, datasets, experiments, spans, sessions, traces, and CI-friendly dataset-backed eval tests.
|
|
6
|
+
`@arizeai/phoenix-client` is the typed TypeScript client for Phoenix platform APIs. It ships a small root REST client plus focused module entrypoints for projects, prompts, datasets, experiments, spans, sessions, traces, users, and CI-friendly dataset-backed eval tests.
|
|
7
7
|
|
|
8
8
|
## Install
|
|
9
9
|
|
|
@@ -37,12 +37,14 @@ That gives the agent version-matched docs plus the exact implementation and gene
|
|
|
37
37
|
| Import | Purpose |
|
|
38
38
|
|--------|---------|
|
|
39
39
|
| `@arizeai/phoenix-client` | `createClient`, generated OpenAPI types, config helpers |
|
|
40
|
+
| `@arizeai/phoenix-client/projects` | Project listing and retention-policy assignment |
|
|
40
41
|
| `@arizeai/phoenix-client/prompts` | Prompt CRUD plus `toSDK` conversion |
|
|
41
42
|
| `@arizeai/phoenix-client/datasets` | Dataset creation and retrieval |
|
|
42
43
|
| `@arizeai/phoenix-client/experiments` | Experiment execution and lifecycle |
|
|
43
44
|
| `@arizeai/phoenix-client/spans` | Span search, notes, and span/document annotations |
|
|
44
45
|
| `@arizeai/phoenix-client/sessions` | Session listing, retrieval, and session annotations |
|
|
45
|
-
| `@arizeai/phoenix-client/traces` | Project trace retrieval and trace annotations |
|
|
46
|
+
| `@arizeai/phoenix-client/traces` | Project trace retrieval, transfers, and trace annotations |
|
|
47
|
+
| `@arizeai/phoenix-client/users` | Current authenticated user retrieval |
|
|
46
48
|
| `@arizeai/phoenix-client/vitest` | Vitest entrypoint for dataset-backed eval tests |
|
|
47
49
|
| `@arizeai/phoenix-client/vitest/reporter` | Vitest reporter for Phoenix eval summaries |
|
|
48
50
|
| `@arizeai/phoenix-client/jest` | Jest entrypoint for dataset-backed eval tests |
|
|
@@ -158,10 +160,10 @@ Prefer this layer when:
|
|
|
158
160
|
|
|
159
161
|
## Where To Start
|
|
160
162
|
|
|
161
|
-
- [Prompts](./prompts), [Datasets](./datasets), [Experiments](./experiments) — higher-level workflows
|
|
163
|
+
- [Projects](./projects), [Prompts](./prompts), [Datasets](./datasets), [Experiments](./experiments) — higher-level workflows
|
|
162
164
|
- [Annotations](./annotations) — annotation concepts, then [Span](./span-annotations), [Document](./document-annotations), and [Session](./session-annotations) annotations for detailed usage
|
|
163
165
|
- [CI Eval Tests](./ci-evals) — Vitest/Jest eval suites backed by Phoenix datasets and experiments
|
|
164
|
-
- [Spans](./spans), [Sessions](./sessions), [Traces](./traces) — retrieval and maintenance
|
|
166
|
+
- [Spans](./spans), [Sessions](./sessions), [Traces](./traces), [Users](./users) — retrieval and maintenance
|
|
165
167
|
|
|
166
168
|
<section className="hidden" data-agent-context="source-map" aria-label="Source map">
|
|
167
169
|
<h2>Source Map</h2>
|
|
@@ -171,12 +173,14 @@ Prefer this layer when:
|
|
|
171
173
|
<li><code>src/config.ts</code></li>
|
|
172
174
|
<li><code>src/__generated__/api/v1.ts</code></li>
|
|
173
175
|
<li><code>src/types/core.ts</code></li>
|
|
176
|
+
<li><code>src/projects/</code></li>
|
|
174
177
|
<li><code>src/prompts/</code></li>
|
|
175
178
|
<li><code>src/datasets/</code></li>
|
|
176
179
|
<li><code>src/experiments/</code></li>
|
|
177
180
|
<li><code>src/spans/</code></li>
|
|
178
181
|
<li><code>src/sessions/</code></li>
|
|
179
182
|
<li><code>src/traces/</code></li>
|
|
183
|
+
<li><code>src/users/</code></li>
|
|
180
184
|
<li><code>src/vitest/</code></li>
|
|
181
185
|
<li><code>src/jest/</code></li>
|
|
182
186
|
<li><code>src/testing/</code></li>
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Projects"
|
|
3
|
+
description: "List projects and manage project retention-policy assignments"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
The projects module lists Phoenix projects and assigns existing trace retention policies to them.
|
|
7
|
+
|
|
8
|
+
<section className="hidden" data-agent-context="relevant-source-files" aria-label="Relevant source files">
|
|
9
|
+
<h2>Relevant Source Files</h2>
|
|
10
|
+
<ul>
|
|
11
|
+
<li><code>src/projects/getProjects.ts</code></li>
|
|
12
|
+
<li><code>src/projects/setProjectRetentionPolicy.ts</code></li>
|
|
13
|
+
<li><code>src/types/projects.ts</code></li>
|
|
14
|
+
</ul>
|
|
15
|
+
</section>
|
|
16
|
+
|
|
17
|
+
## List Projects
|
|
18
|
+
|
|
19
|
+
`getProjects` handles cursor pagination automatically. Use `nameContains` for a case-insensitive, server-side substring filter.
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
import { getProjects } from "@arizeai/phoenix-client/projects";
|
|
23
|
+
|
|
24
|
+
const projects = await getProjects({ nameContains: "support" });
|
|
25
|
+
|
|
26
|
+
for (const project of projects) {
|
|
27
|
+
console.log(`${project.name} (${project.id})`);
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Assign A Retention Policy
|
|
32
|
+
|
|
33
|
+
`setProjectRetentionPolicy` accepts a project name or project GlobalID and the GlobalID of an existing trace retention policy.
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
import { setProjectRetentionPolicy } from "@arizeai/phoenix-client/projects";
|
|
37
|
+
|
|
38
|
+
const assignment = await setProjectRetentionPolicy({
|
|
39
|
+
projectName: "support-bot",
|
|
40
|
+
policyId: "UHJvamVjdFRyYWNlUmV0ZW50aW9uUG9saWN5OjI=",
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
console.log(assignment.project_id, assignment.policy_id);
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
You can select the project with `projectName`, `projectId`, or the shorthand `project`. `projectId` must be the project's GlobalID.
|
|
47
|
+
|
|
48
|
+
This helper only changes which existing retention policy the project uses. It does not create, read, update, or delete retention policies; policy CRUD is outside the TypeScript client's projects helper.
|
|
49
|
+
|
|
50
|
+
## Reset To The Default Policy
|
|
51
|
+
|
|
52
|
+
Pass `null` as `policyId` to remove the explicit assignment and return the project to Phoenix's default retention policy.
|
|
53
|
+
|
|
54
|
+
```ts
|
|
55
|
+
await setProjectRetentionPolicy({
|
|
56
|
+
projectId: "UHJvamVjdDox",
|
|
57
|
+
policyId: null,
|
|
58
|
+
});
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Assigning or resetting a retention policy requires an admin when authentication is enabled. Invalid policy GlobalIDs produce a `422` response, while callers without permission receive `403`; both are surfaced as `HttpError` instances by the client.
|
|
62
|
+
|
|
63
|
+
<section className="hidden" data-agent-context="source-map" aria-label="Source map">
|
|
64
|
+
<h2>Source Map</h2>
|
|
65
|
+
<ul>
|
|
66
|
+
<li><code>src/projects/getProjects.ts</code></li>
|
|
67
|
+
<li><code>src/projects/setProjectRetentionPolicy.ts</code></li>
|
|
68
|
+
<li><code>src/projects/index.ts</code></li>
|
|
69
|
+
<li><code>src/types/projects.ts</code></li>
|
|
70
|
+
</ul>
|
|
71
|
+
</section>
|
package/docs/prompts.mdx
CHANGED
|
@@ -3,7 +3,7 @@ title: "Prompts"
|
|
|
3
3
|
description: "Manage prompts with @arizeai/phoenix-client"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
The prompts module lets you create prompt versions in Phoenix, fetch them back by selector, list prompts, update a prompt's description and metadata, and adapt prompt versions to supported provider SDKs.
|
|
6
|
+
The prompts module lets you create prompt versions in Phoenix, fetch them back by selector, list prompts, update a prompt's description and metadata, delete a prompt, and adapt prompt versions to supported provider SDKs.
|
|
7
7
|
|
|
8
8
|
<section className="hidden" data-agent-context="relevant-source-files" aria-label="Relevant source files">
|
|
9
9
|
<h2>Relevant Source Files</h2>
|
|
@@ -59,6 +59,23 @@ await updatePrompt({
|
|
|
59
59
|
|
|
60
60
|
Requires a Phoenix server on 19.18.0 or later.
|
|
61
61
|
|
|
62
|
+
## Delete A Prompt
|
|
63
|
+
|
|
64
|
+
```ts
|
|
65
|
+
import { deletePrompt } from "@arizeai/phoenix-client/prompts";
|
|
66
|
+
|
|
67
|
+
await deletePrompt({ prompt: { name: "support-response" } });
|
|
68
|
+
|
|
69
|
+
// Or by prompt id
|
|
70
|
+
await deletePrompt({ prompt: { promptId: "UHJvbXB0OjE=" } });
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
`prompt` takes the same selector style as `getPrompt`, narrowed to the two selectors that identify a prompt rather than one of its versions: `{ name }` and `{ promptId }`. Passing a version selector — `{ versionId }`, or `{ name, tag }` — rejects instead of falling back to the whole prompt, so a variable holding a version never deletes more than you named.
|
|
74
|
+
|
|
75
|
+
Deletion cascades: every version of the prompt, along with its version tags and labels, is removed with it, and the deletion cannot be undone. A prompt that does not exist rejects with `Prompt not found: <identifier>`.
|
|
76
|
+
|
|
77
|
+
Requires a Phoenix server on 13.20.0 or later.
|
|
78
|
+
|
|
62
79
|
## Convert To Another SDK
|
|
63
80
|
|
|
64
81
|
```ts
|
|
@@ -81,6 +98,7 @@ Supported `sdk` targets:
|
|
|
81
98
|
<h2>Source Map</h2>
|
|
82
99
|
<ul>
|
|
83
100
|
<li><code>src/prompts/createPrompt.ts</code></li>
|
|
101
|
+
<li><code>src/prompts/deletePrompt.ts</code></li>
|
|
84
102
|
<li><code>src/prompts/getPrompt.ts</code></li>
|
|
85
103
|
<li><code>src/prompts/listPrompts.ts</code></li>
|
|
86
104
|
<li><code>src/prompts/updatePrompt.ts</code></li>
|
package/docs/traces.mdx
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "Traces"
|
|
3
|
-
description: "Retrieve
|
|
3
|
+
description: "Retrieve, move, and annotate traces with @arizeai/phoenix-client"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
The traces module provides trace retrieval and trace-level annotation functions.
|
|
6
|
+
The traces module provides trace retrieval, project transfer, and trace-level annotation functions.
|
|
7
7
|
|
|
8
8
|
<section className="hidden" data-agent-context="relevant-source-files" aria-label="Relevant source files">
|
|
9
9
|
<h2>Relevant Source Files</h2>
|
|
@@ -18,6 +18,9 @@ The traces module provides trace retrieval and trace-level annotation functions.
|
|
|
18
18
|
<li>
|
|
19
19
|
<code>src/traces/logTraceAnnotations.ts</code> for batched annotation writes
|
|
20
20
|
</li>
|
|
21
|
+
<li>
|
|
22
|
+
<code>src/traces/transferTraces.ts</code> for moving traces between projects
|
|
23
|
+
</li>
|
|
21
24
|
<li>
|
|
22
25
|
<code>src/traces/types.ts</code> for the <code>TraceAnnotation</code> type
|
|
23
26
|
</li>
|
|
@@ -65,6 +68,28 @@ console.log(result.nextCursor);
|
|
|
65
68
|
- Set `includeSpans` when you need a trace-centric fetch that also contains span details
|
|
66
69
|
- `project` accepts `{ project }`, `{ projectId }`, or `{ projectName }`
|
|
67
70
|
|
|
71
|
+
## Move Traces To Another Project
|
|
72
|
+
|
|
73
|
+
Use `transferTraces` to move one or more traces from their current project to a destination project. This operation **moves rather than copies** the traces: after a successful transfer, they no longer appear in the source project.
|
|
74
|
+
|
|
75
|
+
All traces in one call must currently belong to the same source project. Each trace identifier can be either an OpenTelemetry trace ID or a Phoenix trace GlobalID, and the destination can be either a project name or project GlobalID.
|
|
76
|
+
|
|
77
|
+
```ts
|
|
78
|
+
import { transferTraces } from "@arizeai/phoenix-client/traces";
|
|
79
|
+
|
|
80
|
+
const result = await transferTraces({
|
|
81
|
+
traceIdentifiers: ["8f3a...", "VHJhY2U6Mg=="],
|
|
82
|
+
destinationProjectIdentifier: "production",
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
console.log(`Moved ${result.transferredTraceCount} traces`);
|
|
86
|
+
console.log(`Destination project: ${result.destinationProjectId}`);
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
The result contains the number of distinct traces moved and the resolved GlobalID of the destination project. Phoenix rejects an empty list, trace or project identifiers that do not resolve, and requests that combine traces from multiple source projects.
|
|
90
|
+
|
|
91
|
+
`transferTraces` requires Phoenix server 20.4.0 or newer.
|
|
92
|
+
|
|
68
93
|
## Annotate a Single Trace
|
|
69
94
|
|
|
70
95
|
Use `addTraceAnnotation` to attach a label, score, or explanation to one trace. If you supply an `identifier`, Phoenix upserts the annotation when an annotation with that identifier already exists.
|
|
@@ -128,6 +153,7 @@ for (const r of results) {
|
|
|
128
153
|
<li><code>src/traces/getTraces.ts</code></li>
|
|
129
154
|
<li><code>src/traces/addTraceAnnotation.ts</code></li>
|
|
130
155
|
<li><code>src/traces/logTraceAnnotations.ts</code></li>
|
|
156
|
+
<li><code>src/traces/transferTraces.ts</code></li>
|
|
131
157
|
<li><code>src/traces/types.ts</code></li>
|
|
132
158
|
<li><code>src/types/projects.ts</code></li>
|
|
133
159
|
</ul>
|
package/docs/users.mdx
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Users"
|
|
3
|
+
description: "Get the current Phoenix user with @arizeai/phoenix-client"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
The users module identifies the user associated with the client's current credentials.
|
|
7
|
+
|
|
8
|
+
## Get The Current User
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import { getCurrentUser } from "@arizeai/phoenix-client/users";
|
|
12
|
+
|
|
13
|
+
const user = await getCurrentUser();
|
|
14
|
+
|
|
15
|
+
if (user.auth_method === "ANONYMOUS") {
|
|
16
|
+
console.log("Authentication is disabled");
|
|
17
|
+
} else {
|
|
18
|
+
console.log(`${user.username} has the ${user.role} role`);
|
|
19
|
+
}
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
`getCurrentUser()` returns the generated Phoenix API user union. Authenticated deployments return a local, OAuth 2, or LDAP user profile. When authentication is disabled, it returns `{ auth_method: "ANONYMOUS" }`. Invalid credentials reject with an `HttpError` whose `status` is `401`; other authorization failures retain their HTTP status as well.
|
|
23
|
+
|
|
24
|
+
Pass a client explicitly when you need custom configuration:
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
import { createClient } from "@arizeai/phoenix-client";
|
|
28
|
+
import { getCurrentUser } from "@arizeai/phoenix-client/users";
|
|
29
|
+
|
|
30
|
+
const client = createClient({
|
|
31
|
+
options: { baseUrl: "https://phoenix.example.com" },
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
const user = await getCurrentUser({ client });
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
<section className="hidden" data-agent-context="source-map" aria-label="Source map">
|
|
38
|
+
<h2>Source Map</h2>
|
|
39
|
+
<ul>
|
|
40
|
+
<li><code>src/users/getCurrentUser.ts</code></li>
|
|
41
|
+
<li><code>src/users/index.ts</code></li>
|
|
42
|
+
<li><code>src/__generated__/api/v1.ts</code></li>
|
|
43
|
+
</ul>
|
|
44
|
+
</section>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arizeai/phoenix-client",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.7.0",
|
|
4
4
|
"description": "A client for the Phoenix API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"arize",
|
|
@@ -57,6 +57,10 @@
|
|
|
57
57
|
"import": "./dist/esm/projects/index.js",
|
|
58
58
|
"require": "./dist/src/projects/index.js"
|
|
59
59
|
},
|
|
60
|
+
"./users": {
|
|
61
|
+
"import": "./dist/esm/users/index.js",
|
|
62
|
+
"require": "./dist/src/users/index.js"
|
|
63
|
+
},
|
|
60
64
|
"./traces": {
|
|
61
65
|
"import": "./dist/esm/traces/index.js",
|
|
62
66
|
"require": "./dist/src/traces/index.js"
|
|
@@ -100,36 +104,36 @@
|
|
|
100
104
|
},
|
|
101
105
|
"dependencies": {
|
|
102
106
|
"@arizeai/openinference-semantic-conventions": "^2.7.0",
|
|
107
|
+
"@arizeai/phoenix-config": "0.5.0",
|
|
108
|
+
"@arizeai/phoenix-otel": "2.2.0",
|
|
103
109
|
"async": "^3.2.6",
|
|
104
110
|
"openapi-fetch": "^0.17.0",
|
|
105
111
|
"tiny-invariant": "^1.3.3",
|
|
106
|
-
"zod": "^4.4.3"
|
|
107
|
-
"@arizeai/phoenix-config": "0.5.0",
|
|
108
|
-
"@arizeai/phoenix-otel": "2.2.0"
|
|
112
|
+
"zod": "^4.4.3"
|
|
109
113
|
},
|
|
110
114
|
"devDependencies": {
|
|
111
|
-
"@ai-sdk/openai": "^4.0.
|
|
112
|
-
"@ai-sdk/otel": "^1.0.
|
|
115
|
+
"@ai-sdk/openai": "^4.0.46",
|
|
116
|
+
"@ai-sdk/otel": "^1.0.77",
|
|
113
117
|
"@anthropic-ai/sdk": "^0.111.0",
|
|
118
|
+
"@arizeai/phoenix-evals": "2.4.0",
|
|
119
|
+
"@arizeai/phoenix-testing": "0.0.0",
|
|
114
120
|
"@opentelemetry/api": "^1.9.1",
|
|
115
121
|
"@opentelemetry/sdk-trace-node": "^2.10.0",
|
|
116
122
|
"@types/async": "^3.2.25",
|
|
117
123
|
"@types/node": "^26.2.0",
|
|
118
|
-
"ai": "^7.0.
|
|
124
|
+
"ai": "^7.0.77",
|
|
119
125
|
"dotenv": "^17.4.2",
|
|
120
126
|
"jest": "^30.4.2",
|
|
121
127
|
"openai": "^6.49.0",
|
|
122
128
|
"openapi-typescript": "^7.13.0",
|
|
123
|
-
"tsx": "^4.23.
|
|
124
|
-
"vitest": "^4.1.
|
|
125
|
-
"@arizeai/phoenix-evals": "2.2.0",
|
|
126
|
-
"@arizeai/phoenix-testing": "0.0.0"
|
|
129
|
+
"tsx": "^4.23.12",
|
|
130
|
+
"vitest": "^4.1.11"
|
|
127
131
|
},
|
|
128
132
|
"peerDependencies": {
|
|
129
133
|
"@anthropic-ai/sdk": "^0.35.0",
|
|
130
134
|
"ai": "^7.0.0",
|
|
131
135
|
"jest": ">=27",
|
|
132
|
-
"openai": "^6.10.0",
|
|
136
|
+
"openai": "^6.10.0 || ^7.0.0",
|
|
133
137
|
"vitest": ">=1"
|
|
134
138
|
},
|
|
135
139
|
"peerDependenciesMeta": {
|