@arizeai/phoenix-client 2.0.1 → 2.1.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.
Files changed (37) hide show
  1. package/dist/esm/__generated__/api/v1.d.ts +331 -3
  2. package/dist/esm/__generated__/api/v1.d.ts.map +1 -1
  3. package/dist/esm/prompts/createPrompt.d.ts +5 -1
  4. package/dist/esm/prompts/createPrompt.d.ts.map +1 -1
  5. package/dist/esm/prompts/createPrompt.js +16 -0
  6. package/dist/esm/prompts/createPrompt.js.map +1 -1
  7. package/dist/esm/schemas/llm/anthropic/converters.d.ts +21 -21
  8. package/dist/esm/schemas/llm/constants.d.ts +294 -294
  9. package/dist/esm/schemas/llm/converters.d.ts +1176 -1176
  10. package/dist/esm/schemas/llm/openai/converters.d.ts +168 -168
  11. package/dist/esm/schemas/llm/openai/toolSchemas.d.ts +63 -63
  12. package/dist/esm/schemas/llm/phoenixPrompt/converters.d.ts +21 -21
  13. package/dist/esm/schemas/llm/schemas.d.ts +63 -63
  14. package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
  15. package/dist/esm/utils/formatPromptMessages.d.ts.map +1 -1
  16. package/dist/esm/utils/getPromptBySelector.d.ts +1 -1
  17. package/dist/esm/utils/getPromptBySelector.d.ts.map +1 -1
  18. package/dist/src/__generated__/api/v1.d.ts +331 -3
  19. package/dist/src/__generated__/api/v1.d.ts.map +1 -1
  20. package/dist/src/prompts/createPrompt.d.ts +5 -1
  21. package/dist/src/prompts/createPrompt.d.ts.map +1 -1
  22. package/dist/src/prompts/createPrompt.js +16 -0
  23. package/dist/src/prompts/createPrompt.js.map +1 -1
  24. package/dist/src/schemas/llm/anthropic/converters.d.ts +21 -21
  25. package/dist/src/schemas/llm/constants.d.ts +294 -294
  26. package/dist/src/schemas/llm/converters.d.ts +1176 -1176
  27. package/dist/src/schemas/llm/openai/converters.d.ts +168 -168
  28. package/dist/src/schemas/llm/openai/toolSchemas.d.ts +63 -63
  29. package/dist/src/schemas/llm/phoenixPrompt/converters.d.ts +21 -21
  30. package/dist/src/schemas/llm/schemas.d.ts +63 -63
  31. package/dist/src/utils/formatPromptMessages.d.ts.map +1 -1
  32. package/dist/src/utils/getPromptBySelector.d.ts +1 -1
  33. package/dist/src/utils/getPromptBySelector.d.ts.map +1 -1
  34. package/dist/tsconfig.tsbuildinfo +1 -1
  35. package/package.json +1 -1
  36. package/src/__generated__/api/v1.ts +331 -3
  37. package/src/prompts/createPrompt.ts +23 -1
@@ -317,6 +317,26 @@ export interface paths {
317
317
  patch?: never;
318
318
  trace?: never;
319
319
  };
320
+ "/v1/projects/{project_identifier}/spans/otlpv1": {
321
+ parameters: {
322
+ query?: never;
323
+ header?: never;
324
+ path?: never;
325
+ cookie?: never;
326
+ };
327
+ /**
328
+ * Search spans with simple filters (no DSL)
329
+ * @description Return spans within a project filtered by time range, annotation names, and ordered by start_time. Supports cursor-based pagination.
330
+ */
331
+ get: operations["spanSearch"];
332
+ put?: never;
333
+ post?: never;
334
+ delete?: never;
335
+ options?: never;
336
+ head?: never;
337
+ patch?: never;
338
+ trace?: never;
339
+ };
320
340
  "/v1/span_annotations": {
321
341
  parameters: {
322
342
  query?: never;
@@ -1082,12 +1102,205 @@ export interface components {
1082
1102
  * ModelProvider
1083
1103
  * @enum {string}
1084
1104
  */
1085
- ModelProvider: "OPENAI" | "AZURE_OPENAI" | "ANTHROPIC" | "GOOGLE";
1105
+ ModelProvider: "OPENAI" | "AZURE_OPENAI" | "ANTHROPIC" | "GOOGLE" | "DEEPSEEK";
1086
1106
  /**
1087
1107
  * OptimizationDirection
1088
1108
  * @enum {string}
1089
1109
  */
1090
1110
  OptimizationDirection: "MINIMIZE" | "MAXIMIZE" | "NONE";
1111
+ /** OtlpAnyValue */
1112
+ OtlpAnyValue: {
1113
+ array_value?: components["schemas"]["OtlpArrayValue"] | null;
1114
+ /** Bool Value */
1115
+ bool_value?: boolean | null;
1116
+ /** Bytes Value */
1117
+ bytes_value?: string | null;
1118
+ /** Double Value */
1119
+ double_value?: number | components["schemas"]["OtlpDoubleValue"] | string | null;
1120
+ /** Int Value */
1121
+ int_value?: number | string | null;
1122
+ /** Kvlist Value */
1123
+ kvlist_value?: null;
1124
+ /** String Value */
1125
+ string_value?: string | null;
1126
+ };
1127
+ /** OtlpArrayValue */
1128
+ OtlpArrayValue: {
1129
+ /**
1130
+ * Values
1131
+ * @description Array of values. The array may be empty (contain 0 elements).
1132
+ */
1133
+ values?: components["schemas"]["OtlpAnyValue"][] | null;
1134
+ };
1135
+ /**
1136
+ * OtlpDoubleValue
1137
+ * @enum {string}
1138
+ */
1139
+ OtlpDoubleValue: "Infinity" | "-Infinity" | "NaN";
1140
+ /** OtlpEvent */
1141
+ OtlpEvent: {
1142
+ /**
1143
+ * Attributes
1144
+ * @description attributes is a collection of attribute key/value pairs on the event. Attribute keys MUST be unique (it is not allowed to have more than one attribute with the same key).
1145
+ */
1146
+ attributes?: components["schemas"]["OtlpKeyValue"][] | null;
1147
+ /**
1148
+ * Dropped Attributes Count
1149
+ * @description dropped_attributes_count is the number of dropped attributes. If the value is 0, then no attributes were dropped.
1150
+ */
1151
+ dropped_attributes_count?: number | null;
1152
+ /**
1153
+ * Name
1154
+ * @description name of the event. This field is semantically required to be set to non-empty string.
1155
+ */
1156
+ name?: string | null;
1157
+ /**
1158
+ * Time Unix Nano
1159
+ * @description time_unix_nano is the time the event occurred. Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970.
1160
+ */
1161
+ time_unix_nano?: number | string | null;
1162
+ };
1163
+ /** OtlpKeyValue */
1164
+ OtlpKeyValue: {
1165
+ /** Key */
1166
+ key?: string | null;
1167
+ value?: components["schemas"]["OtlpAnyValue"] | null;
1168
+ };
1169
+ /**
1170
+ * OtlpKind
1171
+ * @enum {string}
1172
+ */
1173
+ OtlpKind: "SPAN_KIND_UNSPECIFIED" | "SPAN_KIND_INTERNAL" | "SPAN_KIND_SERVER" | "SPAN_KIND_CLIENT" | "SPAN_KIND_PRODUCER" | "SPAN_KIND_CONSUMER";
1174
+ /** OtlpSpan */
1175
+ OtlpSpan: {
1176
+ /**
1177
+ * Attributes
1178
+ * @description attributes is a collection of key/value pairs. Note, global attributes like server name can be set using the resource API. Examples of attributes:
1179
+ *
1180
+ * "/http/user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"
1181
+ * "/http/server_latency": 300
1182
+ * "example.com/myattribute": true
1183
+ * "example.com/score": 10.239
1184
+ *
1185
+ * The OpenTelemetry API specification further restricts the allowed value types:
1186
+ * https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/common/README.md#attribute
1187
+ * Attribute keys MUST be unique (it is not allowed to have more than one attribute with the same key).
1188
+ */
1189
+ attributes?: components["schemas"]["OtlpKeyValue"][] | null;
1190
+ /**
1191
+ * Dropped Attributes Count
1192
+ * @description dropped_attributes_count is the number of attributes that were discarded. Attributes can be discarded because their keys are too long or because there are too many attributes. If this value is 0, then no attributes were dropped.
1193
+ */
1194
+ dropped_attributes_count?: number | null;
1195
+ /**
1196
+ * Dropped Events Count
1197
+ * @description dropped_events_count is the number of dropped events. If the value is 0, then no events were dropped.
1198
+ */
1199
+ dropped_events_count?: number | null;
1200
+ /**
1201
+ * Dropped Links Count
1202
+ * @description dropped_links_count is the number of dropped links after the maximum size was enforced. If this value is 0, then no links were dropped.
1203
+ */
1204
+ dropped_links_count?: number | null;
1205
+ /**
1206
+ * End Time Unix Nano
1207
+ * @description end_time_unix_nano is the end time of the span. On the client side, this is the time kept by the local machine where the span execution ends. On the server side, this is the time when the server application handler stops running.
1208
+ * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970.
1209
+ *
1210
+ * This field is semantically required and it is expected that end_time >= start_time.
1211
+ */
1212
+ end_time_unix_nano?: number | string | null;
1213
+ /**
1214
+ * Events
1215
+ * @description events is a collection of Event items. A span with no events is valid.
1216
+ */
1217
+ events?: components["schemas"]["OtlpEvent"][] | null;
1218
+ /**
1219
+ * Flags
1220
+ * @description Flags, a bit field.
1221
+ *
1222
+ * Bits 0-7 (8 least significant bits) are the trace flags as defined in W3C Trace Context specification. To read the 8-bit W3C trace flag, use `flags & SPAN_FLAGS_TRACE_FLAGS_MASK`.
1223
+ *
1224
+ * See https://www.w3.org/TR/trace-context-2/#trace-flags for the flag definitions.
1225
+ *
1226
+ * Bits 8 and 9 represent the 3 states of whether a span's parent is remote. The states are (unknown, is not remote, is remote).
1227
+ * To read whether the value is known, use `(flags & SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK) != 0`.
1228
+ * To read whether the span is remote, use `(flags & SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK) != 0`.
1229
+ *
1230
+ * When creating span messages, if the message is logically forwarded from another source with an equivalent flags fields (i.e., usually another OTLP span message), the field SHOULD be copied as-is. If creating from a source that does not have an equivalent flags field (such as a runtime representation of an OpenTelemetry span), the high 22 bits MUST be set to zero.
1231
+ * Readers MUST NOT assume that bits 10-31 (22 most significant bits) will be zero.
1232
+ *
1233
+ * [Optional].
1234
+ */
1235
+ flags?: number | null;
1236
+ /**
1237
+ * Kind
1238
+ * @description Distinguishes between spans generated in a particular context. For example, two spans with the same name may be distinguished using `CLIENT` (caller) and `SERVER` (callee) to identify queueing latency associated with the span.
1239
+ * @default SPAN_KIND_INTERNAL
1240
+ */
1241
+ kind?: components["schemas"]["OtlpKind"] | number | null;
1242
+ /** Links */
1243
+ links?: null;
1244
+ /**
1245
+ * Name
1246
+ * @description A description of the span's operation.
1247
+ *
1248
+ * For example, the name can be a qualified method name or a file name and a line number where the operation is called. A best practice is to use the same display name at the same call point in an application. This makes it easier to correlate spans in different traces.
1249
+ *
1250
+ * This field is semantically required to be set to non-empty string. Empty value is equivalent to an unknown span name.
1251
+ *
1252
+ * This field is required.
1253
+ */
1254
+ name?: string | null;
1255
+ /**
1256
+ * Parent Span Id
1257
+ * @description The `span_id` of this span's parent span. If this is a root span, then this field must be empty. The ID is an 8-byte array.
1258
+ */
1259
+ parent_span_id?: string | null;
1260
+ /**
1261
+ * Span Id
1262
+ * @description A unique identifier for a span within a trace, assigned when the span is created. The ID is an 8-byte array. An ID with all zeroes OR of length other than 8 bytes is considered invalid (empty string in OTLP/JSON is zero-length and thus is also invalid).
1263
+ *
1264
+ * This field is required.
1265
+ */
1266
+ span_id?: string | null;
1267
+ /**
1268
+ * Start Time Unix Nano
1269
+ * @description start_time_unix_nano is the start time of the span. On the client side, this is the time kept by the local machine where the span execution starts. On the server side, this is the time when the server's application handler starts running.
1270
+ * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970.
1271
+ *
1272
+ * This field is semantically required and it is expected that end_time >= start_time.
1273
+ */
1274
+ start_time_unix_nano?: number | string | null;
1275
+ /** @description An optional final status for this span. Semantically when Status isn't set, it means span's status code is unset, i.e. assume STATUS_CODE_UNSET (code = 0). */
1276
+ status?: components["schemas"]["OtlpStatus"] | null;
1277
+ /**
1278
+ * Trace Id
1279
+ * @description A unique identifier for a trace. All spans from the same trace share the same `trace_id`. The ID is a 16-byte array. An ID with all zeroes OR of length other than 16 bytes is considered invalid (empty string in OTLP/JSON is zero-length and thus is also invalid).
1280
+ *
1281
+ * This field is required.
1282
+ */
1283
+ trace_id?: string | null;
1284
+ /**
1285
+ * Trace State
1286
+ * @description trace_state conveys information about request position in multiple distributed tracing graphs. It is a trace_state in w3c-trace-context format: https://www.w3.org/TR/trace-context/#tracestate-header
1287
+ * See also https://github.com/w3c/distributed-tracing for more details about this field.
1288
+ */
1289
+ trace_state?: string | null;
1290
+ };
1291
+ /** OtlpStatus */
1292
+ OtlpStatus: {
1293
+ /**
1294
+ * Code
1295
+ * @description The status code.
1296
+ */
1297
+ code?: number | null;
1298
+ /**
1299
+ * Message
1300
+ * @description A developer-facing human readable error message.
1301
+ */
1302
+ message?: string | null;
1303
+ };
1091
1304
  /** Project */
1092
1305
  Project: {
1093
1306
  /** Name */
@@ -1196,6 +1409,37 @@ export interface components {
1196
1409
  /** Source Prompt Id */
1197
1410
  source_prompt_id?: string | null;
1198
1411
  };
1412
+ /** PromptDeepSeekInvocationParameters */
1413
+ PromptDeepSeekInvocationParameters: {
1414
+ /**
1415
+ * @description discriminator enum property added by openapi-typescript
1416
+ * @enum {string}
1417
+ */
1418
+ type: "deepseek";
1419
+ deepseek: components["schemas"]["PromptDeepSeekInvocationParametersContent"];
1420
+ };
1421
+ /** PromptDeepSeekInvocationParametersContent */
1422
+ PromptDeepSeekInvocationParametersContent: {
1423
+ /** Temperature */
1424
+ temperature?: number;
1425
+ /** Max Tokens */
1426
+ max_tokens?: number;
1427
+ /** Max Completion Tokens */
1428
+ max_completion_tokens?: number;
1429
+ /** Frequency Penalty */
1430
+ frequency_penalty?: number;
1431
+ /** Presence Penalty */
1432
+ presence_penalty?: number;
1433
+ /** Top P */
1434
+ top_p?: number;
1435
+ /** Seed */
1436
+ seed?: number;
1437
+ /**
1438
+ * Reasoning Effort
1439
+ * @enum {string}
1440
+ */
1441
+ reasoning_effort?: "low" | "medium" | "high";
1442
+ };
1199
1443
  /** PromptGoogleInvocationParameters */
1200
1444
  PromptGoogleInvocationParameters: {
1201
1445
  /**
@@ -1387,7 +1631,7 @@ export interface components {
1387
1631
  template_type: components["schemas"]["PromptTemplateType"];
1388
1632
  template_format: components["schemas"]["PromptTemplateFormat"];
1389
1633
  /** Invocation Parameters */
1390
- invocation_parameters: components["schemas"]["PromptOpenAIInvocationParameters"] | components["schemas"]["PromptAzureOpenAIInvocationParameters"] | components["schemas"]["PromptAnthropicInvocationParameters"] | components["schemas"]["PromptGoogleInvocationParameters"];
1634
+ invocation_parameters: components["schemas"]["PromptOpenAIInvocationParameters"] | components["schemas"]["PromptAzureOpenAIInvocationParameters"] | components["schemas"]["PromptAnthropicInvocationParameters"] | components["schemas"]["PromptGoogleInvocationParameters"] | components["schemas"]["PromptDeepSeekInvocationParameters"];
1391
1635
  tools?: components["schemas"]["PromptTools"] | null;
1392
1636
  /** Response Format */
1393
1637
  response_format?: components["schemas"]["PromptResponseFormatJSONSchema"] | null;
@@ -1406,7 +1650,7 @@ export interface components {
1406
1650
  template_type: components["schemas"]["PromptTemplateType"];
1407
1651
  template_format: components["schemas"]["PromptTemplateFormat"];
1408
1652
  /** Invocation Parameters */
1409
- invocation_parameters: components["schemas"]["PromptOpenAIInvocationParameters"] | components["schemas"]["PromptAzureOpenAIInvocationParameters"] | components["schemas"]["PromptAnthropicInvocationParameters"] | components["schemas"]["PromptGoogleInvocationParameters"];
1653
+ invocation_parameters: components["schemas"]["PromptOpenAIInvocationParameters"] | components["schemas"]["PromptAzureOpenAIInvocationParameters"] | components["schemas"]["PromptAnthropicInvocationParameters"] | components["schemas"]["PromptGoogleInvocationParameters"] | components["schemas"]["PromptDeepSeekInvocationParameters"];
1410
1654
  tools?: components["schemas"]["PromptTools"] | null;
1411
1655
  /** Response Format */
1412
1656
  response_format?: components["schemas"]["PromptResponseFormatJSONSchema"] | null;
@@ -1537,6 +1781,16 @@ export interface components {
1537
1781
  /** Next Cursor */
1538
1782
  next_cursor: string | null;
1539
1783
  };
1784
+ /**
1785
+ * SpanSearchResponseBody
1786
+ * @description Paginated response where each span follows OTLP JSON structure.
1787
+ */
1788
+ SpanSearchResponseBody: {
1789
+ /** Data */
1790
+ data: components["schemas"]["OtlpSpan"][];
1791
+ /** Next Cursor */
1792
+ next_cursor: string | null;
1793
+ };
1540
1794
  /** TextContentPart */
1541
1795
  TextContentPart: {
1542
1796
  /**
@@ -1603,6 +1857,8 @@ export interface components {
1603
1857
  UploadDatasetData: {
1604
1858
  /** Dataset Id */
1605
1859
  dataset_id: string;
1860
+ /** Version Id */
1861
+ version_id: string;
1606
1862
  };
1607
1863
  /** UploadDatasetResponseBody */
1608
1864
  UploadDatasetResponseBody: {
@@ -2727,6 +2983,15 @@ export interface operations {
2727
2983
  "text/plain": string;
2728
2984
  };
2729
2985
  };
2986
+ /** @description This experiment run has already been submitted */
2987
+ 409: {
2988
+ headers: {
2989
+ [name: string]: unknown;
2990
+ };
2991
+ content: {
2992
+ "text/plain": string;
2993
+ };
2994
+ };
2730
2995
  /** @description Validation Error */
2731
2996
  422: {
2732
2997
  headers: {
@@ -2789,6 +3054,69 @@ export interface operations {
2789
3054
  };
2790
3055
  };
2791
3056
  };
3057
+ spanSearch: {
3058
+ parameters: {
3059
+ query?: {
3060
+ /** @description Pagination cursor (GlobalID of Span) */
3061
+ cursor?: string | null;
3062
+ /** @description Maximum number of spans to return */
3063
+ limit?: number;
3064
+ /** @description Sort direction for the sort field */
3065
+ sort_direction?: "asc" | "desc";
3066
+ /** @description Inclusive lower bound time */
3067
+ start_time?: string | null;
3068
+ /** @description Exclusive upper bound time */
3069
+ end_time?: string | null;
3070
+ /** @description If provided, only include spans that have at least one annotation with one of these names. */
3071
+ annotationNames?: string[] | null;
3072
+ };
3073
+ header?: never;
3074
+ path: {
3075
+ /** @description The project identifier: either project ID or project name. If using a project name, it cannot contain slash (/), question mark (?), or pound sign (#) characters. */
3076
+ project_identifier: string;
3077
+ };
3078
+ cookie?: never;
3079
+ };
3080
+ requestBody?: never;
3081
+ responses: {
3082
+ /** @description Successful Response */
3083
+ 200: {
3084
+ headers: {
3085
+ [name: string]: unknown;
3086
+ };
3087
+ content: {
3088
+ "application/json": components["schemas"]["SpanSearchResponseBody"];
3089
+ };
3090
+ };
3091
+ /** @description Forbidden */
3092
+ 403: {
3093
+ headers: {
3094
+ [name: string]: unknown;
3095
+ };
3096
+ content: {
3097
+ "text/plain": string;
3098
+ };
3099
+ };
3100
+ /** @description Not Found */
3101
+ 404: {
3102
+ headers: {
3103
+ [name: string]: unknown;
3104
+ };
3105
+ content: {
3106
+ "text/plain": string;
3107
+ };
3108
+ };
3109
+ /** @description Unprocessable Entity */
3110
+ 422: {
3111
+ headers: {
3112
+ [name: string]: unknown;
3113
+ };
3114
+ content: {
3115
+ "text/plain": string;
3116
+ };
3117
+ };
3118
+ };
3119
+ };
2792
3120
  annotateSpans: {
2793
3121
  parameters: {
2794
3122
  query?: {