@arizeai/phoenix-client 2.1.1 → 2.2.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/dist/esm/__generated__/api/v1.d.ts +331 -16
- package/dist/esm/__generated__/api/v1.d.ts.map +1 -1
- package/dist/esm/prompts/constants.d.ts.map +1 -1
- package/dist/esm/prompts/constants.js +4 -0
- package/dist/esm/prompts/constants.js.map +1 -1
- package/dist/esm/prompts/createPrompt.d.ts +12 -4
- package/dist/esm/prompts/createPrompt.d.ts.map +1 -1
- package/dist/esm/prompts/createPrompt.js +32 -0
- package/dist/esm/prompts/createPrompt.js.map +1 -1
- package/dist/esm/spans/getSpanAnnotations.d.ts +78 -0
- package/dist/esm/spans/getSpanAnnotations.d.ts.map +1 -0
- package/dist/esm/spans/getSpanAnnotations.js +83 -0
- package/dist/esm/spans/getSpanAnnotations.js.map +1 -0
- package/dist/esm/spans/getSpans.d.ts +78 -0
- package/dist/esm/spans/getSpans.d.ts.map +1 -0
- package/dist/esm/spans/getSpans.js +85 -0
- package/dist/esm/spans/getSpans.js.map +1 -0
- package/dist/esm/spans/index.d.ts +2 -0
- package/dist/esm/spans/index.d.ts.map +1 -1
- package/dist/esm/spans/index.js +2 -0
- package/dist/esm/spans/index.js.map +1 -1
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/esm/types/projects.d.ts +10 -0
- package/dist/esm/types/projects.d.ts.map +1 -0
- package/dist/esm/types/projects.js +2 -0
- package/dist/esm/types/projects.js.map +1 -0
- package/dist/esm/types/prompts.d.ts +17 -1
- package/dist/esm/types/prompts.d.ts.map +1 -1
- package/dist/esm/utils/formatPromptMessages.d.ts.map +1 -1
- package/dist/esm/utils/getPromptBySelector.d.ts +1 -1
- package/dist/esm/utils/getPromptBySelector.d.ts.map +1 -1
- package/dist/src/__generated__/api/v1.d.ts +331 -16
- package/dist/src/__generated__/api/v1.d.ts.map +1 -1
- package/dist/src/prompts/constants.d.ts.map +1 -1
- package/dist/src/prompts/constants.js +4 -0
- package/dist/src/prompts/constants.js.map +1 -1
- package/dist/src/prompts/createPrompt.d.ts +12 -4
- package/dist/src/prompts/createPrompt.d.ts.map +1 -1
- package/dist/src/prompts/createPrompt.js +32 -0
- package/dist/src/prompts/createPrompt.js.map +1 -1
- package/dist/src/spans/getSpanAnnotations.d.ts +78 -0
- package/dist/src/spans/getSpanAnnotations.d.ts.map +1 -0
- package/dist/src/spans/getSpanAnnotations.js +98 -0
- package/dist/src/spans/getSpanAnnotations.js.map +1 -0
- package/dist/src/spans/getSpans.d.ts +78 -0
- package/dist/src/spans/getSpans.d.ts.map +1 -0
- package/dist/src/spans/getSpans.js +100 -0
- package/dist/src/spans/getSpans.js.map +1 -0
- package/dist/src/spans/index.d.ts +2 -0
- package/dist/src/spans/index.d.ts.map +1 -1
- package/dist/src/spans/index.js +2 -0
- package/dist/src/spans/index.js.map +1 -1
- package/dist/src/types/projects.d.ts +10 -0
- package/dist/src/types/projects.d.ts.map +1 -0
- package/dist/src/types/projects.js +3 -0
- package/dist/src/types/projects.js.map +1 -0
- package/dist/src/types/prompts.d.ts +17 -1
- package/dist/src/types/prompts.d.ts.map +1 -1
- package/dist/src/utils/formatPromptMessages.d.ts.map +1 -1
- package/dist/src/utils/getPromptBySelector.d.ts +1 -1
- package/dist/src/utils/getPromptBySelector.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/__generated__/api/v1.ts +331 -16
- package/src/prompts/constants.ts +4 -0
- package/src/prompts/createPrompt.ts +51 -3
- package/src/spans/getSpanAnnotations.ts +131 -0
- package/src/spans/getSpans.ts +127 -0
- package/src/spans/index.ts +2 -0
- package/src/types/projects.ts +5 -0
- package/src/types/prompts.ts +29 -1
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.getSpanAnnotations = getSpanAnnotations;
|
|
13
|
+
const client_1 = require("../client");
|
|
14
|
+
/**
|
|
15
|
+
* Get span annotations for a list of span IDs.
|
|
16
|
+
*
|
|
17
|
+
* This method allows you to retrieve annotations for specific spans within a project.
|
|
18
|
+
* You can filter annotations by name and support cursor-based pagination.
|
|
19
|
+
*
|
|
20
|
+
* @experimental this function is experimental and may change in the future
|
|
21
|
+
*
|
|
22
|
+
* @param params - The parameters to get span annotations
|
|
23
|
+
* @returns A paginated response containing annotations and optional next cursor
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* // Get annotations for specific spans
|
|
28
|
+
* const result = await getSpanAnnotations({
|
|
29
|
+
* client,
|
|
30
|
+
* project: { projectName: "my-project" },
|
|
31
|
+
* spanIds: ["span1", "span2", "span3"],
|
|
32
|
+
* limit: 50
|
|
33
|
+
* });
|
|
34
|
+
*
|
|
35
|
+
* // Get specific annotation types
|
|
36
|
+
* const result = await getSpanAnnotations({
|
|
37
|
+
* client,
|
|
38
|
+
* project: { projectName: "my-project" },
|
|
39
|
+
* spanIds: ["span1"],
|
|
40
|
+
* includeAnnotationNames: ["quality_score", "sentiment"],
|
|
41
|
+
* limit: 100
|
|
42
|
+
* });
|
|
43
|
+
*
|
|
44
|
+
* // Paginate through results
|
|
45
|
+
* let cursor: string | undefined;
|
|
46
|
+
* do {
|
|
47
|
+
* const result = await getSpanAnnotations({
|
|
48
|
+
* client,
|
|
49
|
+
* project: { projectName: "my-project" },
|
|
50
|
+
* spanIds: ["span1"],
|
|
51
|
+
* cursor,
|
|
52
|
+
* limit: 100
|
|
53
|
+
* });
|
|
54
|
+
*
|
|
55
|
+
* // Process annotations
|
|
56
|
+
* result.annotations.forEach(annotation => {
|
|
57
|
+
* console.log(`Annotation: ${annotation.name}, Label: ${annotation.result.label}`);
|
|
58
|
+
* });
|
|
59
|
+
*
|
|
60
|
+
* cursor = result.nextCursor || undefined;
|
|
61
|
+
* } while (cursor);
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
function getSpanAnnotations(_a) {
|
|
65
|
+
return __awaiter(this, arguments, void 0, function* ({ client: _client, project, spanIds, includeAnnotationNames, excludeAnnotationNames, cursor, limit = 100, }) {
|
|
66
|
+
var _b, _c;
|
|
67
|
+
const client = _client !== null && _client !== void 0 ? _client : (0, client_1.createClient)();
|
|
68
|
+
const projectIdentifier = "projectId" in project ? project.projectId : project.projectName;
|
|
69
|
+
const params = {
|
|
70
|
+
span_ids: spanIds,
|
|
71
|
+
limit,
|
|
72
|
+
};
|
|
73
|
+
if (cursor) {
|
|
74
|
+
params.cursor = cursor;
|
|
75
|
+
}
|
|
76
|
+
if (includeAnnotationNames !== undefined) {
|
|
77
|
+
params.include_annotation_names = includeAnnotationNames;
|
|
78
|
+
}
|
|
79
|
+
if (excludeAnnotationNames !== undefined) {
|
|
80
|
+
params.exclude_annotation_names = excludeAnnotationNames;
|
|
81
|
+
}
|
|
82
|
+
const { data, error } = yield client.GET("/v1/projects/{project_identifier}/span_annotations", {
|
|
83
|
+
params: {
|
|
84
|
+
path: {
|
|
85
|
+
project_identifier: projectIdentifier,
|
|
86
|
+
},
|
|
87
|
+
query: params,
|
|
88
|
+
},
|
|
89
|
+
});
|
|
90
|
+
if (error)
|
|
91
|
+
throw error;
|
|
92
|
+
return {
|
|
93
|
+
annotations: (_b = data === null || data === void 0 ? void 0 : data.data) !== null && _b !== void 0 ? _b : [],
|
|
94
|
+
nextCursor: (_c = data === null || data === void 0 ? void 0 : data.next_cursor) !== null && _c !== void 0 ? _c : null,
|
|
95
|
+
};
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=getSpanAnnotations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getSpanAnnotations.js","sourceRoot":"","sources":["../../../src/spans/getSpanAnnotations.ts"],"names":[],"mappings":";;;;;;;;;;;AAiFA,gDAiDC;AAlID,sCAAyC;AA+BzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,SAAsB,kBAAkB;yDAAC,EACvC,MAAM,EAAE,OAAO,EACf,OAAO,EACP,OAAO,EACP,sBAAsB,EACtB,sBAAsB,EACtB,MAAM,EACN,KAAK,GAAG,GAAG,GACc;;QACzB,MAAM,MAAM,GAAG,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,IAAA,qBAAY,GAAE,CAAC;QACzC,MAAM,iBAAiB,GACrB,WAAW,IAAI,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC;QAEnE,MAAM,MAAM,GAER;YACF,QAAQ,EAAE,OAAO;YACjB,KAAK;SACN,CAAC;QAEF,IAAI,MAAM,EAAE,CAAC;YACX,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC;QACzB,CAAC;QAED,IAAI,sBAAsB,KAAK,SAAS,EAAE,CAAC;YACzC,MAAM,CAAC,wBAAwB,GAAG,sBAAsB,CAAC;QAC3D,CAAC;QAED,IAAI,sBAAsB,KAAK,SAAS,EAAE,CAAC;YACzC,MAAM,CAAC,wBAAwB,GAAG,sBAAsB,CAAC;QAC3D,CAAC;QAED,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,MAAM,CAAC,GAAG,CACtC,oDAAoD,EACpD;YACE,MAAM,EAAE;gBACN,IAAI,EAAE;oBACJ,kBAAkB,EAAE,iBAAiB;iBACtC;gBACD,KAAK,EAAE,MAAM;aACd;SACF,CACF,CAAC;QAEF,IAAI,KAAK;YAAE,MAAM,KAAK,CAAC;QACvB,OAAO;YACL,WAAW,EAAE,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,IAAI,mCAAI,EAAE;YAC7B,UAAU,EAAE,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,WAAW,mCAAI,IAAI;SACtC,CAAC;IACJ,CAAC;CAAA"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { ClientFn } from "../types/core";
|
|
2
|
+
import { operations } from "../__generated__/api/v1";
|
|
3
|
+
import { ProjectSelector } from "../types/projects";
|
|
4
|
+
/**
|
|
5
|
+
* Parameters to get spans from a project using auto-generated types
|
|
6
|
+
*/
|
|
7
|
+
interface GetSpansParams extends ClientFn {
|
|
8
|
+
/** The project to get spans from */
|
|
9
|
+
project: ProjectSelector;
|
|
10
|
+
/** Inclusive lower bound time. Must be a valid ISO 8601 string or Date object. */
|
|
11
|
+
startTime?: Date | string | null;
|
|
12
|
+
/** Exclusive upper bound time. Must be a valid ISO 8601 string or Date object. */
|
|
13
|
+
endTime?: Date | string | null;
|
|
14
|
+
/** Pagination cursor (Span Global ID) */
|
|
15
|
+
cursor?: string | null;
|
|
16
|
+
/** Maximum number of spans to return */
|
|
17
|
+
limit?: number;
|
|
18
|
+
}
|
|
19
|
+
type GetSpansResponse = operations["getSpans"]["responses"]["200"];
|
|
20
|
+
export type GetSpansResult = {
|
|
21
|
+
spans: GetSpansResponse["content"]["application/json"]["data"];
|
|
22
|
+
nextCursor: GetSpansResponse["content"]["application/json"]["next_cursor"];
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Get spans from a project with filtering criteria.
|
|
26
|
+
*
|
|
27
|
+
* This method allows you to search for spans within a project using various filters
|
|
28
|
+
* such as time range and supports cursor-based pagination.
|
|
29
|
+
* The spans are returned in Phoenix's standard format with human-readable timestamps
|
|
30
|
+
* and simplified attribute structures.
|
|
31
|
+
*
|
|
32
|
+
* @experimental this function is experimental and may change in the future
|
|
33
|
+
*
|
|
34
|
+
* @param params - The parameters to search for spans
|
|
35
|
+
* @returns A paginated response containing spans and optional next cursor
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* // Get recent spans from a project
|
|
40
|
+
* const result = await getSpans({
|
|
41
|
+
* client,
|
|
42
|
+
* project: { projectName: "my-project" },
|
|
43
|
+
* limit: 50
|
|
44
|
+
* });
|
|
45
|
+
*
|
|
46
|
+
* // Get spans in a time range
|
|
47
|
+
|
|
48
|
+
* const result = await getSpans({
|
|
49
|
+
* client,
|
|
50
|
+
* project: { projectName: "my-project" },
|
|
51
|
+
* startTime: new Date("2024-01-01"),
|
|
52
|
+
* endTime: new Date("2024-01-02"),
|
|
53
|
+
* limit: 100
|
|
54
|
+
* });
|
|
55
|
+
|
|
56
|
+
*
|
|
57
|
+
* // Paginate through results
|
|
58
|
+
* let cursor: string | undefined;
|
|
59
|
+
* do {
|
|
60
|
+
* const result = await getSpans({
|
|
61
|
+
* client,
|
|
62
|
+
* project: { projectName: "my-project" },
|
|
63
|
+
* cursor,
|
|
64
|
+
* limit: 100
|
|
65
|
+
* });
|
|
66
|
+
*
|
|
67
|
+
* // Process spans
|
|
68
|
+
* result.spans.forEach(span => {
|
|
69
|
+
* console.log(`Span: ${span.name}, Trace: ${span.context.trace_id}`);
|
|
70
|
+
* });
|
|
71
|
+
*
|
|
72
|
+
* cursor = result.nextCursor || undefined;
|
|
73
|
+
* } while (cursor);
|
|
74
|
+
* ```
|
|
75
|
+
*/
|
|
76
|
+
export declare function getSpans({ client: _client, project, cursor, limit, startTime, endTime, }: GetSpansParams): Promise<GetSpansResult>;
|
|
77
|
+
export {};
|
|
78
|
+
//# sourceMappingURL=getSpans.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
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.getSpans = getSpans;
|
|
13
|
+
const client_1 = require("../client");
|
|
14
|
+
/**
|
|
15
|
+
* Get spans from a project with filtering criteria.
|
|
16
|
+
*
|
|
17
|
+
* This method allows you to search for spans within a project using various filters
|
|
18
|
+
* such as time range and supports cursor-based pagination.
|
|
19
|
+
* The spans are returned in Phoenix's standard format with human-readable timestamps
|
|
20
|
+
* and simplified attribute structures.
|
|
21
|
+
*
|
|
22
|
+
* @experimental this function is experimental and may change in the future
|
|
23
|
+
*
|
|
24
|
+
* @param params - The parameters to search for spans
|
|
25
|
+
* @returns A paginated response containing spans and optional next cursor
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* // Get recent spans from a project
|
|
30
|
+
* const result = await getSpans({
|
|
31
|
+
* client,
|
|
32
|
+
* project: { projectName: "my-project" },
|
|
33
|
+
* limit: 50
|
|
34
|
+
* });
|
|
35
|
+
*
|
|
36
|
+
* // Get spans in a time range
|
|
37
|
+
|
|
38
|
+
* const result = await getSpans({
|
|
39
|
+
* client,
|
|
40
|
+
* project: { projectName: "my-project" },
|
|
41
|
+
* startTime: new Date("2024-01-01"),
|
|
42
|
+
* endTime: new Date("2024-01-02"),
|
|
43
|
+
* limit: 100
|
|
44
|
+
* });
|
|
45
|
+
|
|
46
|
+
*
|
|
47
|
+
* // Paginate through results
|
|
48
|
+
* let cursor: string | undefined;
|
|
49
|
+
* do {
|
|
50
|
+
* const result = await getSpans({
|
|
51
|
+
* client,
|
|
52
|
+
* project: { projectName: "my-project" },
|
|
53
|
+
* cursor,
|
|
54
|
+
* limit: 100
|
|
55
|
+
* });
|
|
56
|
+
*
|
|
57
|
+
* // Process spans
|
|
58
|
+
* result.spans.forEach(span => {
|
|
59
|
+
* console.log(`Span: ${span.name}, Trace: ${span.context.trace_id}`);
|
|
60
|
+
* });
|
|
61
|
+
*
|
|
62
|
+
* cursor = result.nextCursor || undefined;
|
|
63
|
+
* } while (cursor);
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
function getSpans(_a) {
|
|
67
|
+
return __awaiter(this, arguments, void 0, function* ({ client: _client, project, cursor, limit = 100, startTime, endTime, }) {
|
|
68
|
+
var _b, _c;
|
|
69
|
+
const client = _client !== null && _client !== void 0 ? _client : (0, client_1.createClient)();
|
|
70
|
+
const projectIdentifier = "projectId" in project ? project.projectId : project.projectName;
|
|
71
|
+
const params = {
|
|
72
|
+
limit,
|
|
73
|
+
};
|
|
74
|
+
if (cursor) {
|
|
75
|
+
params.cursor = cursor;
|
|
76
|
+
}
|
|
77
|
+
if (startTime) {
|
|
78
|
+
params.start_time =
|
|
79
|
+
startTime instanceof Date ? startTime.toISOString() : startTime;
|
|
80
|
+
}
|
|
81
|
+
if (endTime) {
|
|
82
|
+
params.end_time = endTime instanceof Date ? endTime.toISOString() : endTime;
|
|
83
|
+
}
|
|
84
|
+
const { data, error } = yield client.GET("/v1/projects/{project_identifier}/spans", {
|
|
85
|
+
params: {
|
|
86
|
+
path: {
|
|
87
|
+
project_identifier: projectIdentifier,
|
|
88
|
+
},
|
|
89
|
+
query: params,
|
|
90
|
+
},
|
|
91
|
+
});
|
|
92
|
+
if (error)
|
|
93
|
+
throw error;
|
|
94
|
+
return {
|
|
95
|
+
spans: (_b = data === null || data === void 0 ? void 0 : data.data) !== null && _b !== void 0 ? _b : [],
|
|
96
|
+
nextCursor: (_c = data === null || data === void 0 ? void 0 : data.next_cursor) !== null && _c !== void 0 ? _c : null,
|
|
97
|
+
};
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=getSpans.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getSpans.js","sourceRoot":"","sources":["../../../src/spans/getSpans.ts"],"names":[],"mappings":";;;;;;;;;;;AAgFA,4BA8CC;AA9HD,sCAAyC;AA4BzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,SAAsB,QAAQ;yDAAC,EAC7B,MAAM,EAAE,OAAO,EACf,OAAO,EACP,MAAM,EACN,KAAK,GAAG,GAAG,EACX,SAAS,EACT,OAAO,GACQ;;QACf,MAAM,MAAM,GAAG,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,IAAA,qBAAY,GAAE,CAAC;QACzC,MAAM,iBAAiB,GACrB,WAAW,IAAI,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC;QAEnE,MAAM,MAAM,GAA+D;YACzE,KAAK;SACN,CAAC;QAEF,IAAI,MAAM,EAAE,CAAC;YACX,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC;QACzB,CAAC;QAED,IAAI,SAAS,EAAE,CAAC;YACd,MAAM,CAAC,UAAU;gBACf,SAAS,YAAY,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;QACpE,CAAC;QAED,IAAI,OAAO,EAAE,CAAC;YACZ,MAAM,CAAC,QAAQ,GAAG,OAAO,YAAY,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;QAC9E,CAAC;QAED,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,MAAM,CAAC,GAAG,CACtC,yCAAyC,EACzC;YACE,MAAM,EAAE;gBACN,IAAI,EAAE;oBACJ,kBAAkB,EAAE,iBAAiB;iBACtC;gBACD,KAAK,EAAE,MAAM;aACd;SACF,CACF,CAAC;QAEF,IAAI,KAAK;YAAE,MAAM,KAAK,CAAC;QACvB,OAAO;YACL,KAAK,EAAE,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,IAAI,mCAAI,EAAE;YACvB,UAAU,EAAE,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,WAAW,mCAAI,IAAI;SACtC,CAAC;IACJ,CAAC;CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/spans/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/spans/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC"}
|
package/dist/src/spans/index.js
CHANGED
|
@@ -16,4 +16,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./addSpanAnnotation"), exports);
|
|
18
18
|
__exportStar(require("./logSpanAnnotations"), exports);
|
|
19
|
+
__exportStar(require("./getSpans"), exports);
|
|
20
|
+
__exportStar(require("./getSpanAnnotations"), exports);
|
|
19
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/spans/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,uDAAqC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/spans/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,uDAAqC;AACrC,6CAA2B;AAC3B,uDAAqC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A project can be identified by its projectId or projectName
|
|
3
|
+
* In the case of a projectName, the name must be url encodable
|
|
4
|
+
*/
|
|
5
|
+
export type ProjectSelector = {
|
|
6
|
+
projectId: string;
|
|
7
|
+
} | {
|
|
8
|
+
projectName: string;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=projects.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../../../src/types/projects.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projects.js","sourceRoot":"","sources":["../../../src/types/projects.ts"],"names":[],"mappings":""}
|
|
@@ -2,7 +2,7 @@ import { components } from "../__generated__/api/v1";
|
|
|
2
2
|
/**
|
|
3
3
|
* Supported prompt model providers
|
|
4
4
|
*/
|
|
5
|
-
export type PromptModelProvider = "OPENAI" | "AZURE_OPENAI" | "ANTHROPIC" | "GOOGLE";
|
|
5
|
+
export type PromptModelProvider = "OPENAI" | "AZURE_OPENAI" | "ANTHROPIC" | "GOOGLE" | "DEEPSEEK" | "XAI" | "OLLAMA" | "AWS";
|
|
6
6
|
/**
|
|
7
7
|
* Supported prompt provider SDKs
|
|
8
8
|
*
|
|
@@ -74,6 +74,22 @@ export type AnthropicInvocationParameters = components["schemas"]["PromptAnthrop
|
|
|
74
74
|
* The invocation parameters for a prompt version for Google.
|
|
75
75
|
*/
|
|
76
76
|
export type GoogleInvocationParameters = components["schemas"]["PromptGoogleInvocationParametersContent"];
|
|
77
|
+
/**
|
|
78
|
+
* The invocation parameters for a prompt version for DeepSeek.
|
|
79
|
+
*/
|
|
80
|
+
export type DeepSeekInvocationParameters = components["schemas"]["PromptDeepSeekInvocationParametersContent"];
|
|
81
|
+
/**
|
|
82
|
+
* The invocation parameters for a prompt version for xAI.
|
|
83
|
+
*/
|
|
84
|
+
export type XAIInvocationParameters = components["schemas"]["PromptXAIInvocationParametersContent"];
|
|
85
|
+
/**
|
|
86
|
+
* The invocation parameters for a prompt version for Ollama.
|
|
87
|
+
*/
|
|
88
|
+
export type OllamaInvocationParameters = components["schemas"]["PromptOllamaInvocationParametersContent"];
|
|
89
|
+
/**
|
|
90
|
+
* The invocation parameters for a prompt version for AWS.
|
|
91
|
+
*/
|
|
92
|
+
export type AwsInvocationParameters = components["schemas"]["PromptAwsInvocationParametersContent"];
|
|
77
93
|
/**
|
|
78
94
|
* The format of the prompt template message(s).
|
|
79
95
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../../src/types/prompts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAC3B,QAAQ,GACR,cAAc,GACd,WAAW,GACX,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../../src/types/prompts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAC3B,QAAQ,GACR,cAAc,GACd,WAAW,GACX,QAAQ,GACR,UAAU,GACV,KAAK,GACL,QAAQ,GACR,KAAK,CAAC;AAEV;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAC1B,SAAS,GACT,cAAc,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UAAU,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatPromptMessages.d.ts","sourceRoot":"","sources":["../../../src/utils/formatPromptMessages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAO3E;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,oBAAoB,EAC5B,cAAc,EAAE,iBAAiB,EAAE,EACnC,SAAS,GAAE,SAAc;;;;;;;
|
|
1
|
+
{"version":3,"file":"formatPromptMessages.d.ts","sourceRoot":"","sources":["../../../src/utils/formatPromptMessages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAO3E;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,oBAAoB,EAC5B,cAAc,EAAE,iBAAiB,EAAE,EACnC,SAAS,GAAE,SAAc;;;;;;;mBA4DsiyE,uDAAsB;;;;;;;;;IAlBtlyE"}
|
|
@@ -27,7 +27,7 @@ export declare function getPromptBySelector({ client: _client, prompt, }: GetPro
|
|
|
27
27
|
template: import("../__generated__/api/v1").components["schemas"]["PromptChatTemplate"] | import("../__generated__/api/v1").components["schemas"]["PromptStringTemplate"];
|
|
28
28
|
template_type: import("../__generated__/api/v1").components["schemas"]["PromptTemplateType"];
|
|
29
29
|
template_format: import("../__generated__/api/v1").components["schemas"]["PromptTemplateFormat"];
|
|
30
|
-
invocation_parameters: import("../__generated__/api/v1").components["schemas"]["PromptOpenAIInvocationParameters"] | import("../__generated__/api/v1").components["schemas"]["PromptAzureOpenAIInvocationParameters"] | import("../__generated__/api/v1").components["schemas"]["PromptAnthropicInvocationParameters"] | import("../__generated__/api/v1").components["schemas"]["PromptGoogleInvocationParameters"] | import("../__generated__/api/v1").components["schemas"]["PromptDeepSeekInvocationParameters"] | import("../__generated__/api/v1").components["schemas"]["PromptXAIInvocationParameters"];
|
|
30
|
+
invocation_parameters: import("../__generated__/api/v1").components["schemas"]["PromptOpenAIInvocationParameters"] | import("../__generated__/api/v1").components["schemas"]["PromptAzureOpenAIInvocationParameters"] | import("../__generated__/api/v1").components["schemas"]["PromptAnthropicInvocationParameters"] | import("../__generated__/api/v1").components["schemas"]["PromptGoogleInvocationParameters"] | import("../__generated__/api/v1").components["schemas"]["PromptDeepSeekInvocationParameters"] | import("../__generated__/api/v1").components["schemas"]["PromptXAIInvocationParameters"] | import("../__generated__/api/v1").components["schemas"]["PromptOllamaInvocationParameters"] | import("../__generated__/api/v1").components["schemas"]["PromptAwsInvocationParameters"];
|
|
31
31
|
tools?: import("../__generated__/api/v1").components["schemas"]["PromptTools"] | null;
|
|
32
32
|
response_format?: import("../__generated__/api/v1").components["schemas"]["PromptResponseFormatJSONSchema"] | null;
|
|
33
33
|
id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getPromptBySelector.d.ts","sourceRoot":"","sources":["../../../src/utils/getPromptBySelector.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAGzC;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,QAAQ,GAAG;IACjD;;OAEG;IACH,MAAM,EAAE,cAAc,CAAC;CACxB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,wBAAsB,mBAAmB,CAAC,EACxC,MAAM,EAAE,OAAO,EACf,MAAM,GACP,EAAE,yBAAyB;;
|
|
1
|
+
{"version":3,"file":"getPromptBySelector.d.ts","sourceRoot":"","sources":["../../../src/utils/getPromptBySelector.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAGzC;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,QAAQ,GAAG;IACjD;;OAEG;IACH,MAAM,EAAE,cAAc,CAAC;CACxB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,wBAAsB,mBAAmB,CAAC,EACxC,MAAM,EAAE,OAAO,EACf,MAAM,GACP,EAAE,yBAAyB;;oBAkD6/7D,uDAAsB;;cAAkI,uDAAsB,yBAAwB,uDAAsB;mBAAoD,uDAAsB;qBAAoD,uDAAsB;2BAAqG,uDAAsB,uCAAsC,uDAAsB,4CAA2C,uDAAsB,0CAAyC,uDAAsB,uCAAsC,uDAAsB,yCAAwC,uDAAsB,oCAAmC,uDAAsB,uCAAsC,uDAAsB;YAAsD,uDAAsB;sBAAwF,uDAAsB;;UADxm+D"}
|