@arizeai/phoenix-client 7.10.0 → 7.11.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 +6 -0
- package/dist/esm/__generated__/api/v1.d.ts +14 -0
- package/dist/esm/__generated__/api/v1.d.ts.map +1 -1
- package/dist/esm/prompts/createPrompt.d.ts +5 -0
- package/dist/esm/prompts/createPrompt.d.ts.map +1 -1
- package/dist/esm/prompts/createPrompt.js +27 -121
- package/dist/esm/prompts/createPrompt.js.map +1 -1
- package/dist/esm/schemas/llm/converters.d.ts +4 -4
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/esm/utils/getPromptBySelector.d.ts +3 -0
- package/dist/esm/utils/getPromptBySelector.d.ts.map +1 -1
- package/dist/src/__generated__/api/v1.d.ts +14 -0
- package/dist/src/__generated__/api/v1.d.ts.map +1 -1
- package/dist/src/prompts/createPrompt.d.ts +5 -0
- package/dist/src/prompts/createPrompt.d.ts.map +1 -1
- package/dist/src/prompts/createPrompt.js +20 -121
- package/dist/src/prompts/createPrompt.js.map +1 -1
- package/dist/src/schemas/llm/converters.d.ts +4 -4
- package/dist/src/utils/getPromptBySelector.d.ts +3 -0
- package/dist/src/utils/getPromptBySelector.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +11 -11
- package/src/__generated__/api/v1.ts +14 -0
- package/src/prompts/createPrompt.ts +35 -121
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arizeai/phoenix-client",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.11.0",
|
|
4
4
|
"description": "A client for the Phoenix API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"arize",
|
|
@@ -103,30 +103,30 @@
|
|
|
103
103
|
}
|
|
104
104
|
},
|
|
105
105
|
"dependencies": {
|
|
106
|
-
"@arizeai/openinference-semantic-conventions": "^2.
|
|
106
|
+
"@arizeai/openinference-semantic-conventions": "^2.9.0",
|
|
107
107
|
"@arizeai/phoenix-config": "0.5.0",
|
|
108
108
|
"@arizeai/phoenix-otel": "2.2.0",
|
|
109
109
|
"async": "^3.2.6",
|
|
110
110
|
"openapi-fetch": "^0.17.0",
|
|
111
111
|
"tiny-invariant": "^1.3.3",
|
|
112
|
-
"zod": "^4.4
|
|
112
|
+
"zod": "^4.5.4"
|
|
113
113
|
},
|
|
114
114
|
"devDependencies": {
|
|
115
|
-
"@ai-sdk/openai": "^4.0.
|
|
116
|
-
"@ai-sdk/otel": "^1.0.
|
|
115
|
+
"@ai-sdk/openai": "^4.0.60",
|
|
116
|
+
"@ai-sdk/otel": "^1.0.93",
|
|
117
117
|
"@anthropic-ai/sdk": "^0.111.0",
|
|
118
|
-
"@arizeai/phoenix-evals": "2.
|
|
118
|
+
"@arizeai/phoenix-evals": "2.5.0",
|
|
119
119
|
"@arizeai/phoenix-testing": "0.0.0",
|
|
120
120
|
"@opentelemetry/api": "^1.9.1",
|
|
121
|
-
"@opentelemetry/sdk-trace-node": "^2.
|
|
121
|
+
"@opentelemetry/sdk-trace-node": "^2.11.0",
|
|
122
122
|
"@types/async": "^3.2.25",
|
|
123
|
-
"@types/node": "^26.
|
|
124
|
-
"ai": "^7.0.
|
|
123
|
+
"@types/node": "^26.4.1",
|
|
124
|
+
"ai": "^7.0.93",
|
|
125
125
|
"dotenv": "^17.4.2",
|
|
126
|
-
"jest": "^30.
|
|
126
|
+
"jest": "^30.5.1",
|
|
127
127
|
"openai": "^6.49.0",
|
|
128
128
|
"openapi-typescript": "^7.13.0",
|
|
129
|
-
"tsx": "^4.23.
|
|
129
|
+
"tsx": "^4.23.13",
|
|
130
130
|
"vitest": "^5.0.0"
|
|
131
131
|
},
|
|
132
132
|
"peerDependencies": {
|
|
@@ -5296,6 +5296,13 @@ export interface components {
|
|
|
5296
5296
|
PromptVersion: {
|
|
5297
5297
|
/** Description */
|
|
5298
5298
|
description?: string | null;
|
|
5299
|
+
/**
|
|
5300
|
+
* Metadata
|
|
5301
|
+
* @description Arbitrary JSON metadata for the prompt version.
|
|
5302
|
+
*/
|
|
5303
|
+
metadata?: {
|
|
5304
|
+
[key: string]: unknown;
|
|
5305
|
+
};
|
|
5299
5306
|
model_provider: components["schemas"]["ModelProvider"];
|
|
5300
5307
|
/** Model Name */
|
|
5301
5308
|
model_name: string;
|
|
@@ -5315,6 +5322,13 @@ export interface components {
|
|
|
5315
5322
|
PromptVersionData: {
|
|
5316
5323
|
/** Description */
|
|
5317
5324
|
description?: string | null;
|
|
5325
|
+
/**
|
|
5326
|
+
* Metadata
|
|
5327
|
+
* @description Arbitrary JSON metadata for the prompt version.
|
|
5328
|
+
*/
|
|
5329
|
+
metadata?: {
|
|
5330
|
+
[key: string]: unknown;
|
|
5331
|
+
};
|
|
5318
5332
|
model_provider: components["schemas"]["ModelProvider"];
|
|
5319
5333
|
/** Model Name */
|
|
5320
5334
|
model_name: string;
|
|
@@ -84,6 +84,11 @@ interface PromptVersionInputBase {
|
|
|
84
84
|
* The description of the prompt version.
|
|
85
85
|
*/
|
|
86
86
|
description?: string;
|
|
87
|
+
/**
|
|
88
|
+
* Optional metadata for the prompt version as a JSON object.
|
|
89
|
+
* @example { "agent": "support", "dependencies": ["retriever"] }
|
|
90
|
+
*/
|
|
91
|
+
metadata?: PromptVersionData["metadata"];
|
|
87
92
|
/**
|
|
88
93
|
* The name of the model to use for the prompt version.
|
|
89
94
|
*/
|
|
@@ -165,142 +170,51 @@ export type PromptVersionInput =
|
|
|
165
170
|
export function promptVersion(params: PromptVersionInput): PromptVersionData {
|
|
166
171
|
const {
|
|
167
172
|
description = "",
|
|
173
|
+
metadata,
|
|
168
174
|
modelProvider: model_provider,
|
|
169
175
|
modelName: model_name,
|
|
170
176
|
template: templateMessages,
|
|
171
177
|
templateFormat: template_format = "MUSTACHE",
|
|
172
|
-
invocationParameters: invocation_parameters,
|
|
173
178
|
} = params;
|
|
174
|
-
|
|
179
|
+
return {
|
|
180
|
+
description,
|
|
181
|
+
...(metadata ? { metadata } : {}),
|
|
182
|
+
model_provider,
|
|
183
|
+
model_name,
|
|
184
|
+
template_type: "CHAT",
|
|
185
|
+
template_format,
|
|
186
|
+
template: {
|
|
187
|
+
type: "chat",
|
|
188
|
+
messages: templateMessages,
|
|
189
|
+
},
|
|
190
|
+
invocation_parameters: toInvocationParameters(params),
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
function toInvocationParameters(
|
|
195
|
+
params: PromptVersionInput
|
|
196
|
+
): PromptVersionData["invocation_parameters"] {
|
|
197
|
+
switch (params.modelProvider) {
|
|
175
198
|
case "OPENAI":
|
|
176
|
-
return {
|
|
177
|
-
description,
|
|
178
|
-
model_provider,
|
|
179
|
-
model_name,
|
|
180
|
-
template_type: "CHAT",
|
|
181
|
-
template_format,
|
|
182
|
-
template: {
|
|
183
|
-
type: "chat",
|
|
184
|
-
messages: templateMessages,
|
|
185
|
-
},
|
|
186
|
-
invocation_parameters: {
|
|
187
|
-
type: "openai",
|
|
188
|
-
openai: invocation_parameters ?? {},
|
|
189
|
-
},
|
|
190
|
-
};
|
|
199
|
+
return { type: "openai", openai: params.invocationParameters ?? {} };
|
|
191
200
|
case "AZURE_OPENAI":
|
|
192
201
|
return {
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
model_name,
|
|
196
|
-
template_type: "CHAT",
|
|
197
|
-
template_format,
|
|
198
|
-
template: {
|
|
199
|
-
type: "chat",
|
|
200
|
-
messages: templateMessages,
|
|
201
|
-
},
|
|
202
|
-
invocation_parameters: {
|
|
203
|
-
type: "azure_openai",
|
|
204
|
-
azure_openai: invocation_parameters ?? {},
|
|
205
|
-
},
|
|
202
|
+
type: "azure_openai",
|
|
203
|
+
azure_openai: params.invocationParameters ?? {},
|
|
206
204
|
};
|
|
207
205
|
case "ANTHROPIC":
|
|
208
|
-
return {
|
|
209
|
-
description,
|
|
210
|
-
model_provider,
|
|
211
|
-
model_name,
|
|
212
|
-
template_type: "CHAT",
|
|
213
|
-
template_format,
|
|
214
|
-
template: {
|
|
215
|
-
type: "chat",
|
|
216
|
-
messages: templateMessages,
|
|
217
|
-
},
|
|
218
|
-
invocation_parameters: {
|
|
219
|
-
type: "anthropic",
|
|
220
|
-
anthropic: invocation_parameters,
|
|
221
|
-
},
|
|
222
|
-
};
|
|
206
|
+
return { type: "anthropic", anthropic: params.invocationParameters };
|
|
223
207
|
case "GOOGLE":
|
|
224
|
-
return {
|
|
225
|
-
description,
|
|
226
|
-
model_provider,
|
|
227
|
-
model_name,
|
|
228
|
-
template_type: "CHAT",
|
|
229
|
-
template_format,
|
|
230
|
-
template: {
|
|
231
|
-
type: "chat",
|
|
232
|
-
messages: templateMessages,
|
|
233
|
-
},
|
|
234
|
-
invocation_parameters: {
|
|
235
|
-
type: "google",
|
|
236
|
-
google: invocation_parameters ?? {},
|
|
237
|
-
},
|
|
238
|
-
};
|
|
208
|
+
return { type: "google", google: params.invocationParameters ?? {} };
|
|
239
209
|
case "DEEPSEEK":
|
|
240
|
-
return {
|
|
241
|
-
description,
|
|
242
|
-
model_provider,
|
|
243
|
-
model_name,
|
|
244
|
-
template_type: "CHAT",
|
|
245
|
-
template_format,
|
|
246
|
-
template: {
|
|
247
|
-
type: "chat",
|
|
248
|
-
messages: templateMessages,
|
|
249
|
-
},
|
|
250
|
-
invocation_parameters: {
|
|
251
|
-
type: "deepseek",
|
|
252
|
-
deepseek: invocation_parameters ?? {},
|
|
253
|
-
},
|
|
254
|
-
};
|
|
210
|
+
return { type: "deepseek", deepseek: params.invocationParameters ?? {} };
|
|
255
211
|
case "XAI":
|
|
256
|
-
return {
|
|
257
|
-
description,
|
|
258
|
-
model_provider,
|
|
259
|
-
model_name,
|
|
260
|
-
template_type: "CHAT",
|
|
261
|
-
template_format,
|
|
262
|
-
template: {
|
|
263
|
-
type: "chat",
|
|
264
|
-
messages: templateMessages,
|
|
265
|
-
},
|
|
266
|
-
invocation_parameters: {
|
|
267
|
-
type: "xai",
|
|
268
|
-
xai: invocation_parameters ?? {},
|
|
269
|
-
},
|
|
270
|
-
};
|
|
212
|
+
return { type: "xai", xai: params.invocationParameters ?? {} };
|
|
271
213
|
case "OLLAMA":
|
|
272
|
-
return {
|
|
273
|
-
description,
|
|
274
|
-
model_provider,
|
|
275
|
-
model_name,
|
|
276
|
-
template_type: "CHAT",
|
|
277
|
-
template_format,
|
|
278
|
-
template: {
|
|
279
|
-
type: "chat",
|
|
280
|
-
messages: templateMessages,
|
|
281
|
-
},
|
|
282
|
-
invocation_parameters: {
|
|
283
|
-
type: "ollama",
|
|
284
|
-
ollama: invocation_parameters ?? {},
|
|
285
|
-
},
|
|
286
|
-
};
|
|
214
|
+
return { type: "ollama", ollama: params.invocationParameters ?? {} };
|
|
287
215
|
case "AWS":
|
|
288
|
-
return {
|
|
289
|
-
description,
|
|
290
|
-
model_provider,
|
|
291
|
-
model_name,
|
|
292
|
-
template_type: "CHAT",
|
|
293
|
-
template_format,
|
|
294
|
-
template: {
|
|
295
|
-
type: "chat",
|
|
296
|
-
messages: templateMessages,
|
|
297
|
-
},
|
|
298
|
-
invocation_parameters: {
|
|
299
|
-
type: "aws",
|
|
300
|
-
aws: invocation_parameters ?? {},
|
|
301
|
-
},
|
|
302
|
-
};
|
|
216
|
+
return { type: "aws", aws: params.invocationParameters ?? {} };
|
|
303
217
|
default:
|
|
304
|
-
return assertUnreachable(
|
|
218
|
+
return assertUnreachable(params);
|
|
305
219
|
}
|
|
306
220
|
}
|