@arizeai/phoenix-client 7.7.0 → 7.8.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 +12 -0
- package/dist/esm/__generated__/api/v1.d.ts +127 -6
- package/dist/esm/__generated__/api/v1.d.ts.map +1 -1
- package/dist/esm/experiments/resumeEvaluation.d.ts +0 -60
- package/dist/esm/experiments/resumeEvaluation.d.ts.map +1 -1
- package/dist/esm/experiments/resumeEvaluation.js +44 -37
- package/dist/esm/experiments/resumeEvaluation.js.map +1 -1
- package/dist/esm/experiments/resumeExperiment.d.ts +0 -52
- package/dist/esm/experiments/resumeExperiment.d.ts.map +1 -1
- package/dist/esm/experiments/resumeExperiment.js +42 -35
- package/dist/esm/experiments/resumeExperiment.js.map +1 -1
- package/dist/esm/experiments/runExperiment.d.ts.map +1 -1
- package/dist/esm/experiments/runExperiment.js +152 -123
- package/dist/esm/experiments/runExperiment.js.map +1 -1
- package/dist/esm/prompts/constants.d.ts.map +1 -1
- package/dist/esm/prompts/constants.js +1 -0
- package/dist/esm/prompts/constants.js.map +1 -1
- package/dist/esm/prompts/sdks/toOpenAI.d.ts.map +1 -1
- package/dist/esm/prompts/sdks/toOpenAI.js +51 -58
- package/dist/esm/prompts/sdks/toOpenAI.js.map +1 -1
- package/dist/esm/sessions/sessionUtils.d.ts.map +1 -1
- package/dist/esm/sessions/sessionUtils.js +3 -0
- package/dist/esm/sessions/sessionUtils.js.map +1 -1
- package/dist/esm/spans/getSpans.d.ts +0 -70
- package/dist/esm/spans/getSpans.d.ts.map +1 -1
- package/dist/esm/spans/getSpans.js +42 -93
- package/dist/esm/spans/getSpans.js.map +1 -1
- package/dist/esm/testing/phoenix-test-tracking.d.ts.map +1 -1
- package/dist/esm/testing/phoenix-test-tracking.js +109 -78
- package/dist/esm/testing/phoenix-test-tracking.js.map +1 -1
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/esm/types/prompts.d.ts +1 -1
- package/dist/esm/types/prompts.d.ts.map +1 -1
- package/dist/esm/types/prompts.js.map +1 -1
- package/dist/esm/types/sessions.d.ts +6 -0
- package/dist/esm/types/sessions.d.ts.map +1 -1
- package/dist/esm/utils/getPromptBySelector.d.ts +1 -1
- package/dist/src/__generated__/api/v1.d.ts +127 -6
- package/dist/src/__generated__/api/v1.d.ts.map +1 -1
- package/dist/src/experiments/resumeEvaluation.d.ts +0 -60
- package/dist/src/experiments/resumeEvaluation.d.ts.map +1 -1
- package/dist/src/experiments/resumeEvaluation.js +44 -37
- package/dist/src/experiments/resumeEvaluation.js.map +1 -1
- package/dist/src/experiments/resumeExperiment.d.ts +0 -52
- package/dist/src/experiments/resumeExperiment.d.ts.map +1 -1
- package/dist/src/experiments/resumeExperiment.js +42 -35
- package/dist/src/experiments/resumeExperiment.js.map +1 -1
- package/dist/src/experiments/runExperiment.d.ts.map +1 -1
- package/dist/src/experiments/runExperiment.js +148 -116
- package/dist/src/experiments/runExperiment.js.map +1 -1
- package/dist/src/prompts/constants.d.ts.map +1 -1
- package/dist/src/prompts/constants.js +1 -0
- package/dist/src/prompts/constants.js.map +1 -1
- package/dist/src/prompts/sdks/toOpenAI.d.ts.map +1 -1
- package/dist/src/prompts/sdks/toOpenAI.js +58 -63
- package/dist/src/prompts/sdks/toOpenAI.js.map +1 -1
- package/dist/src/sessions/sessionUtils.d.ts.map +1 -1
- package/dist/src/sessions/sessionUtils.js +3 -0
- package/dist/src/sessions/sessionUtils.js.map +1 -1
- package/dist/src/spans/getSpans.d.ts +0 -70
- package/dist/src/spans/getSpans.d.ts.map +1 -1
- package/dist/src/spans/getSpans.js +43 -94
- package/dist/src/spans/getSpans.js.map +1 -1
- package/dist/src/testing/phoenix-test-tracking.d.ts.map +1 -1
- package/dist/src/testing/phoenix-test-tracking.js +117 -84
- package/dist/src/testing/phoenix-test-tracking.js.map +1 -1
- package/dist/src/types/prompts.d.ts +1 -1
- package/dist/src/types/prompts.d.ts.map +1 -1
- package/dist/src/types/prompts.js.map +1 -1
- package/dist/src/types/sessions.d.ts +6 -0
- package/dist/src/types/sessions.d.ts.map +1 -1
- package/dist/src/utils/getPromptBySelector.d.ts +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/docs/sessions.mdx +10 -1
- package/package.json +1 -1
- package/src/__generated__/api/v1.ts +127 -6
- package/src/experiments/resumeEvaluation.ts +78 -48
- package/src/experiments/resumeExperiment.ts +73 -46
- package/src/experiments/runExperiment.ts +235 -129
- package/src/prompts/constants.ts +1 -0
- package/src/prompts/sdks/toOpenAI.ts +60 -61
- package/src/sessions/sessionUtils.ts +3 -0
- package/src/spans/getSpans.ts +84 -48
- package/src/testing/phoenix-test-tracking.ts +154 -90
- package/src/types/prompts.ts +2 -1
- package/src/types/sessions.ts +6 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @arizeai/phoenix-client
|
|
2
2
|
|
|
3
|
+
## 7.8.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 58b7017: Add Z.ai (GLM models) as a built-in OpenAI-compatible model provider (`ZAI`).
|
|
8
|
+
|
|
9
|
+
## 7.7.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 1cdff14: Expose cumulative prompt, completion, and total token counts on the high-level `Session` objects returned by `getSession` and `listSessions`.
|
|
14
|
+
|
|
3
15
|
## 7.7.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
@@ -760,7 +760,11 @@ export interface paths {
|
|
|
760
760
|
get: operations["listProjectTraces"];
|
|
761
761
|
put?: never;
|
|
762
762
|
post?: never;
|
|
763
|
-
|
|
763
|
+
/**
|
|
764
|
+
* Delete traces from a project
|
|
765
|
+
* @description Delete traces from a project without deleting the project or its configuration. Only traces whose start time is within the required `[start_time, end_time)` interval are deleted. Associated spans are cascade deleted, and project sessions left with no remaining traces are also deleted. Naive datetimes are interpreted as UTC.
|
|
766
|
+
*/
|
|
767
|
+
delete: operations["deleteProjectTraces"];
|
|
764
768
|
options?: never;
|
|
765
769
|
head?: never;
|
|
766
770
|
patch?: never;
|
|
@@ -1567,7 +1571,7 @@ export interface paths {
|
|
|
1567
1571
|
put?: never;
|
|
1568
1572
|
/**
|
|
1569
1573
|
* OpenAI-compatible chat completions
|
|
1570
|
-
* @description Creates a chat completion using the OpenAI wire format, proxying to the selected provider with credentials resolved on the server (secret store first, environment second) — callers never handle provider API keys. Model must be '{provider}:{model_name}' for a built-in provider (one of anthropic, aws, azure_openai, cerebras, deepseek, fireworks, google, groq, moonshot, ollama, openai, perplexity, together, xai) or 'custom:{provider_id}:{model_name}' for a stored custom provider, e.g. 'openai:gpt-4o' or 'anthropic:claude-sonnet-4-5'. Set `stream: true` for server-sent events of `chat.completion.chunk` payloads terminated by `data: [DONE]`. Tool calling is not supported.
|
|
1574
|
+
* @description Creates a chat completion using the OpenAI wire format, proxying to the selected provider with credentials resolved on the server (secret store first, environment second) — callers never handle provider API keys. Model must be '{provider}:{model_name}' for a built-in provider (one of anthropic, aws, azure_openai, cerebras, deepseek, fireworks, google, groq, moonshot, ollama, openai, perplexity, together, xai, zai) or 'custom:{provider_id}:{model_name}' for a stored custom provider, e.g. 'openai:gpt-4o' or 'anthropic:claude-sonnet-4-5'. Set `stream: true` for server-sent events of `chat.completion.chunk` payloads terminated by `data: [DONE]`. Tool calling is not supported.
|
|
1571
1575
|
*
|
|
1572
1576
|
* **Phoenix is not an AI gateway.** The same server also takes on trace ingestion traffic, so routing production LLM calls through it competes with ingestion. Use this endpoint only to quickly try out different models in non-production environments.
|
|
1573
1577
|
*/
|
|
@@ -2423,6 +2427,11 @@ export interface components {
|
|
|
2423
2427
|
* @description The id of the last transcript message the client has rendered, used for optimistic concurrency. Omit when the session has no messages; required (and validated against the persisted transcript) once it does. On mismatch the server rejects the send with HTTP 409 and code ``agent_session_messages_stale`` — the client should refetch the session before retrying.
|
|
2424
2428
|
*/
|
|
2425
2429
|
lastMessageId?: string | null;
|
|
2430
|
+
/**
|
|
2431
|
+
* Credentials
|
|
2432
|
+
* @description Client-held credentials for optional integrations (e.g. the user's own GitHub personal access token under the key ``GITHUB_PERSONAL_ACCESS_TOKEN``), used only for the duration of the turn and never persisted. Unknown keys are rejected.
|
|
2433
|
+
*/
|
|
2434
|
+
credentials?: components["schemas"]["ChatRequestCredential"][];
|
|
2426
2435
|
/**
|
|
2427
2436
|
* Recordlocaltraces
|
|
2428
2437
|
* @default false
|
|
@@ -2440,6 +2449,28 @@ export interface components {
|
|
|
2440
2449
|
*/
|
|
2441
2450
|
instrumentUserId?: boolean;
|
|
2442
2451
|
};
|
|
2452
|
+
/**
|
|
2453
|
+
* ChatRequestCredential
|
|
2454
|
+
* @description One client-held credential riding the request for the duration of a turn.
|
|
2455
|
+
*
|
|
2456
|
+
* The value is ephemeral: it is injected server-side as transport auth for
|
|
2457
|
+
* the matching integration and is never persisted, traced, or echoed. It is
|
|
2458
|
+
* top-level on the request body — never part of the message — so it cannot
|
|
2459
|
+
* reach the session transcript.
|
|
2460
|
+
*/
|
|
2461
|
+
ChatRequestCredential: {
|
|
2462
|
+
/**
|
|
2463
|
+
* Key
|
|
2464
|
+
* @description The credential's secret-key name.
|
|
2465
|
+
* @constant
|
|
2466
|
+
*/
|
|
2467
|
+
key: "GITHUB_PERSONAL_ACCESS_TOKEN";
|
|
2468
|
+
/**
|
|
2469
|
+
* Value
|
|
2470
|
+
* Format: password
|
|
2471
|
+
*/
|
|
2472
|
+
value: string;
|
|
2473
|
+
};
|
|
2443
2474
|
/** CodeEvaluatorUIContext */
|
|
2444
2475
|
CodeEvaluatorUIContext: {
|
|
2445
2476
|
/**
|
|
@@ -2560,7 +2591,7 @@ export interface components {
|
|
|
2560
2591
|
CreateChatCompletionRequestBody: {
|
|
2561
2592
|
/**
|
|
2562
2593
|
* Model
|
|
2563
|
-
* @description Model must be '{provider}:{model_name}' for a built-in provider (one of anthropic, aws, azure_openai, cerebras, deepseek, fireworks, google, groq, moonshot, ollama, openai, perplexity, together, xai) or 'custom:{provider_id}:{model_name}' for a stored custom provider, e.g. 'openai:gpt-4o' or 'anthropic:claude-sonnet-4-5'.
|
|
2594
|
+
* @description Model must be '{provider}:{model_name}' for a built-in provider (one of anthropic, aws, azure_openai, cerebras, deepseek, fireworks, google, groq, moonshot, ollama, openai, perplexity, together, xai, zai) or 'custom:{provider_id}:{model_name}' for a stored custom provider, e.g. 'openai:gpt-4o' or 'anthropic:claude-sonnet-4-5'.
|
|
2564
2595
|
*/
|
|
2565
2596
|
model: string;
|
|
2566
2597
|
/** Messages */
|
|
@@ -4056,7 +4087,7 @@ export interface components {
|
|
|
4056
4087
|
* ModelProvider
|
|
4057
4088
|
* @enum {string}
|
|
4058
4089
|
*/
|
|
4059
|
-
ModelProvider: "OPENAI" | "AZURE_OPENAI" | "ANTHROPIC" | "GOOGLE" | "DEEPSEEK" | "XAI" | "OLLAMA" | "AWS" | "CEREBRAS" | "FIREWORKS" | "GROQ" | "MOONSHOT" | "PERPLEXITY" | "TOGETHER";
|
|
4090
|
+
ModelProvider: "OPENAI" | "AZURE_OPENAI" | "ANTHROPIC" | "GOOGLE" | "DEEPSEEK" | "XAI" | "OLLAMA" | "AWS" | "CEREBRAS" | "FIREWORKS" | "GROQ" | "MOONSHOT" | "PERPLEXITY" | "TOGETHER" | "ZAI";
|
|
4060
4091
|
/** OAuth2User */
|
|
4061
4092
|
OAuth2User: {
|
|
4062
4093
|
/** Id */
|
|
@@ -5235,7 +5266,7 @@ export interface components {
|
|
|
5235
5266
|
template_type: components["schemas"]["PromptTemplateType"];
|
|
5236
5267
|
template_format: components["schemas"]["PromptTemplateFormat"];
|
|
5237
5268
|
/** Invocation Parameters */
|
|
5238
|
-
invocation_parameters: components["schemas"]["PromptOpenAIInvocationParameters"] | components["schemas"]["PromptAzureOpenAIInvocationParameters"] | components["schemas"]["PromptAnthropicInvocationParameters"] | components["schemas"]["PromptGoogleInvocationParameters"] | components["schemas"]["PromptDeepSeekInvocationParameters"] | components["schemas"]["PromptXAIInvocationParameters"] | components["schemas"]["PromptOllamaInvocationParameters"] | components["schemas"]["PromptAwsInvocationParameters"] | components["schemas"]["PromptCerebrasInvocationParameters"] | components["schemas"]["PromptFireworksInvocationParameters"] | components["schemas"]["PromptGroqInvocationParameters"] | components["schemas"]["PromptMoonshotInvocationParameters"] | components["schemas"]["PromptPerplexityInvocationParameters"] | components["schemas"]["PromptTogetherInvocationParameters"];
|
|
5269
|
+
invocation_parameters: components["schemas"]["PromptOpenAIInvocationParameters"] | components["schemas"]["PromptAzureOpenAIInvocationParameters"] | components["schemas"]["PromptAnthropicInvocationParameters"] | components["schemas"]["PromptGoogleInvocationParameters"] | components["schemas"]["PromptDeepSeekInvocationParameters"] | components["schemas"]["PromptXAIInvocationParameters"] | components["schemas"]["PromptOllamaInvocationParameters"] | components["schemas"]["PromptAwsInvocationParameters"] | components["schemas"]["PromptCerebrasInvocationParameters"] | components["schemas"]["PromptFireworksInvocationParameters"] | components["schemas"]["PromptGroqInvocationParameters"] | components["schemas"]["PromptMoonshotInvocationParameters"] | components["schemas"]["PromptPerplexityInvocationParameters"] | components["schemas"]["PromptTogetherInvocationParameters"] | components["schemas"]["PromptZAIInvocationParameters"];
|
|
5239
5270
|
tools?: components["schemas"]["PromptTools"] | null;
|
|
5240
5271
|
/** Response Format */
|
|
5241
5272
|
response_format?: components["schemas"]["PromptResponseFormatJSONSchema"] | null;
|
|
@@ -5254,7 +5285,7 @@ export interface components {
|
|
|
5254
5285
|
template_type: components["schemas"]["PromptTemplateType"];
|
|
5255
5286
|
template_format: components["schemas"]["PromptTemplateFormat"];
|
|
5256
5287
|
/** Invocation Parameters */
|
|
5257
|
-
invocation_parameters: components["schemas"]["PromptOpenAIInvocationParameters"] | components["schemas"]["PromptAzureOpenAIInvocationParameters"] | components["schemas"]["PromptAnthropicInvocationParameters"] | components["schemas"]["PromptGoogleInvocationParameters"] | components["schemas"]["PromptDeepSeekInvocationParameters"] | components["schemas"]["PromptXAIInvocationParameters"] | components["schemas"]["PromptOllamaInvocationParameters"] | components["schemas"]["PromptAwsInvocationParameters"] | components["schemas"]["PromptCerebrasInvocationParameters"] | components["schemas"]["PromptFireworksInvocationParameters"] | components["schemas"]["PromptGroqInvocationParameters"] | components["schemas"]["PromptMoonshotInvocationParameters"] | components["schemas"]["PromptPerplexityInvocationParameters"] | components["schemas"]["PromptTogetherInvocationParameters"];
|
|
5288
|
+
invocation_parameters: components["schemas"]["PromptOpenAIInvocationParameters"] | components["schemas"]["PromptAzureOpenAIInvocationParameters"] | components["schemas"]["PromptAnthropicInvocationParameters"] | components["schemas"]["PromptGoogleInvocationParameters"] | components["schemas"]["PromptDeepSeekInvocationParameters"] | components["schemas"]["PromptXAIInvocationParameters"] | components["schemas"]["PromptOllamaInvocationParameters"] | components["schemas"]["PromptAwsInvocationParameters"] | components["schemas"]["PromptCerebrasInvocationParameters"] | components["schemas"]["PromptFireworksInvocationParameters"] | components["schemas"]["PromptGroqInvocationParameters"] | components["schemas"]["PromptMoonshotInvocationParameters"] | components["schemas"]["PromptPerplexityInvocationParameters"] | components["schemas"]["PromptTogetherInvocationParameters"] | components["schemas"]["PromptZAIInvocationParameters"];
|
|
5258
5289
|
tools?: components["schemas"]["PromptTools"] | null;
|
|
5259
5290
|
/** Response Format */
|
|
5260
5291
|
response_format?: components["schemas"]["PromptResponseFormatJSONSchema"] | null;
|
|
@@ -5322,6 +5353,43 @@ export interface components {
|
|
|
5322
5353
|
[key: string]: unknown;
|
|
5323
5354
|
};
|
|
5324
5355
|
};
|
|
5356
|
+
/** PromptZAIInvocationParameters */
|
|
5357
|
+
PromptZAIInvocationParameters: {
|
|
5358
|
+
/**
|
|
5359
|
+
* @description discriminator enum property added by openapi-typescript
|
|
5360
|
+
* @enum {string}
|
|
5361
|
+
*/
|
|
5362
|
+
type: "zai";
|
|
5363
|
+
zai: components["schemas"]["PromptZAIInvocationParametersContent"];
|
|
5364
|
+
};
|
|
5365
|
+
/** PromptZAIInvocationParametersContent */
|
|
5366
|
+
PromptZAIInvocationParametersContent: {
|
|
5367
|
+
/** Temperature */
|
|
5368
|
+
temperature?: number;
|
|
5369
|
+
/** Max Tokens */
|
|
5370
|
+
max_tokens?: number;
|
|
5371
|
+
/** Max Completion Tokens */
|
|
5372
|
+
max_completion_tokens?: number;
|
|
5373
|
+
/** Frequency Penalty */
|
|
5374
|
+
frequency_penalty?: number;
|
|
5375
|
+
/** Presence Penalty */
|
|
5376
|
+
presence_penalty?: number;
|
|
5377
|
+
/** Top P */
|
|
5378
|
+
top_p?: number;
|
|
5379
|
+
/** Seed */
|
|
5380
|
+
seed?: number;
|
|
5381
|
+
/** Stop */
|
|
5382
|
+
stop?: string[];
|
|
5383
|
+
/**
|
|
5384
|
+
* Reasoning Effort
|
|
5385
|
+
* @enum {string}
|
|
5386
|
+
*/
|
|
5387
|
+
reasoning_effort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh";
|
|
5388
|
+
/** Extra Body */
|
|
5389
|
+
extra_body?: {
|
|
5390
|
+
[key: string]: unknown;
|
|
5391
|
+
};
|
|
5392
|
+
};
|
|
5325
5393
|
/**
|
|
5326
5394
|
* PydanticAIMessageMetadata
|
|
5327
5395
|
* @description Local pin of pydantic-ai's message-level ``pydantic_ai`` metadata
|
|
@@ -10040,6 +10108,59 @@ export interface operations {
|
|
|
10040
10108
|
};
|
|
10041
10109
|
};
|
|
10042
10110
|
};
|
|
10111
|
+
deleteProjectTraces: {
|
|
10112
|
+
parameters: {
|
|
10113
|
+
query: {
|
|
10114
|
+
/** @description Required inclusive lower bound on trace start time (ISO 8601). */
|
|
10115
|
+
start_time: string;
|
|
10116
|
+
/** @description Required exclusive upper bound on trace start time (ISO 8601). */
|
|
10117
|
+
end_time: string;
|
|
10118
|
+
};
|
|
10119
|
+
header?: never;
|
|
10120
|
+
path: {
|
|
10121
|
+
/** @description The project identifier: either project ID or project name. */
|
|
10122
|
+
project_identifier: string;
|
|
10123
|
+
};
|
|
10124
|
+
cookie?: never;
|
|
10125
|
+
};
|
|
10126
|
+
requestBody?: never;
|
|
10127
|
+
responses: {
|
|
10128
|
+
/** @description No content returned after the matching traces are deleted */
|
|
10129
|
+
204: {
|
|
10130
|
+
headers: {
|
|
10131
|
+
[name: string]: unknown;
|
|
10132
|
+
};
|
|
10133
|
+
content?: never;
|
|
10134
|
+
};
|
|
10135
|
+
/** @description Forbidden */
|
|
10136
|
+
403: {
|
|
10137
|
+
headers: {
|
|
10138
|
+
[name: string]: unknown;
|
|
10139
|
+
};
|
|
10140
|
+
content: {
|
|
10141
|
+
"text/plain": string;
|
|
10142
|
+
};
|
|
10143
|
+
};
|
|
10144
|
+
/** @description Not Found */
|
|
10145
|
+
404: {
|
|
10146
|
+
headers: {
|
|
10147
|
+
[name: string]: unknown;
|
|
10148
|
+
};
|
|
10149
|
+
content: {
|
|
10150
|
+
"text/plain": string;
|
|
10151
|
+
};
|
|
10152
|
+
};
|
|
10153
|
+
/** @description Unprocessable Entity */
|
|
10154
|
+
422: {
|
|
10155
|
+
headers: {
|
|
10156
|
+
[name: string]: unknown;
|
|
10157
|
+
};
|
|
10158
|
+
content: {
|
|
10159
|
+
"text/plain": string;
|
|
10160
|
+
};
|
|
10161
|
+
};
|
|
10162
|
+
};
|
|
10163
|
+
};
|
|
10043
10164
|
annotateTraces: {
|
|
10044
10165
|
parameters: {
|
|
10045
10166
|
query?: {
|