@agent-os-sdk/client 0.9.5 → 0.9.7
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.
|
@@ -13,7 +13,7 @@ export class EvaluationModule {
|
|
|
13
13
|
* List all evaluation datasets.
|
|
14
14
|
*/
|
|
15
15
|
async listDatasets(params) {
|
|
16
|
-
return this.client.GET("/v1/api/
|
|
16
|
+
return this.client.GET("/v1/api/evaluations/datasets", {
|
|
17
17
|
params: { query: params },
|
|
18
18
|
headers: this.headers(),
|
|
19
19
|
});
|
|
@@ -22,7 +22,7 @@ export class EvaluationModule {
|
|
|
22
22
|
* Get a dataset by ID.
|
|
23
23
|
*/
|
|
24
24
|
async getDataset(datasetId) {
|
|
25
|
-
return this.client.GET("/v1/api/
|
|
25
|
+
return this.client.GET("/v1/api/evaluations/datasets/{id}", {
|
|
26
26
|
params: { path: { id: datasetId } },
|
|
27
27
|
headers: this.headers(),
|
|
28
28
|
});
|
|
@@ -31,7 +31,7 @@ export class EvaluationModule {
|
|
|
31
31
|
* Create a new dataset.
|
|
32
32
|
*/
|
|
33
33
|
async createDataset(body) {
|
|
34
|
-
return this.client.POST("/v1/api/
|
|
34
|
+
return this.client.POST("/v1/api/evaluations/datasets", {
|
|
35
35
|
body,
|
|
36
36
|
headers: this.headers(),
|
|
37
37
|
});
|
|
@@ -40,7 +40,7 @@ export class EvaluationModule {
|
|
|
40
40
|
* Delete a dataset.
|
|
41
41
|
*/
|
|
42
42
|
async deleteDataset(datasetId) {
|
|
43
|
-
return this.client.DELETE("/v1/api/
|
|
43
|
+
return this.client.DELETE("/v1/api/evaluations/datasets/{id}", {
|
|
44
44
|
params: { path: { id: datasetId } },
|
|
45
45
|
headers: this.headers(),
|
|
46
46
|
});
|
|
@@ -50,7 +50,7 @@ export class EvaluationModule {
|
|
|
50
50
|
* List examples in a dataset.
|
|
51
51
|
*/
|
|
52
52
|
async listExamples(datasetId, params) {
|
|
53
|
-
return this.client.GET("/v1/api/
|
|
53
|
+
return this.client.GET("/v1/api/evaluations/datasets/{id}/examples", {
|
|
54
54
|
params: { path: { id: datasetId }, query: params },
|
|
55
55
|
headers: this.headers(),
|
|
56
56
|
});
|
|
@@ -59,7 +59,7 @@ export class EvaluationModule {
|
|
|
59
59
|
* Add examples to a dataset.
|
|
60
60
|
*/
|
|
61
61
|
async addExamples(datasetId, examples) {
|
|
62
|
-
return this.client.POST("/v1/api/
|
|
62
|
+
return this.client.POST("/v1/api/evaluations/datasets/{id}/examples", {
|
|
63
63
|
params: { path: { id: datasetId } },
|
|
64
64
|
body: { examples },
|
|
65
65
|
headers: this.headers(),
|
|
@@ -70,7 +70,7 @@ export class EvaluationModule {
|
|
|
70
70
|
* List all experiments.
|
|
71
71
|
*/
|
|
72
72
|
async listExperiments(params) {
|
|
73
|
-
return this.client.GET("/v1/api/
|
|
73
|
+
return this.client.GET("/v1/api/evaluations/experiments", {
|
|
74
74
|
params: { query: params },
|
|
75
75
|
headers: this.headers(),
|
|
76
76
|
});
|
|
@@ -79,7 +79,7 @@ export class EvaluationModule {
|
|
|
79
79
|
* Get an experiment by ID.
|
|
80
80
|
*/
|
|
81
81
|
async getExperiment(experimentId) {
|
|
82
|
-
return this.client.GET("/v1/api/
|
|
82
|
+
return this.client.GET("/v1/api/evaluations/experiments/{id}", {
|
|
83
83
|
params: { path: { id: experimentId } },
|
|
84
84
|
headers: this.headers(),
|
|
85
85
|
});
|
|
@@ -88,7 +88,7 @@ export class EvaluationModule {
|
|
|
88
88
|
* Create a new experiment.
|
|
89
89
|
*/
|
|
90
90
|
async createExperiment(body) {
|
|
91
|
-
return this.client.POST("/v1/api/
|
|
91
|
+
return this.client.POST("/v1/api/evaluations/experiments", {
|
|
92
92
|
body,
|
|
93
93
|
headers: this.headers(),
|
|
94
94
|
});
|
package/dist/modules/traces.d.ts
CHANGED
|
@@ -45,6 +45,11 @@ export interface SpanListResponse {
|
|
|
45
45
|
export interface TraceDetail extends Trace {
|
|
46
46
|
spans: Span[];
|
|
47
47
|
}
|
|
48
|
+
export interface SpansByRunResponse {
|
|
49
|
+
run_id: string;
|
|
50
|
+
spans: Span[];
|
|
51
|
+
count: number;
|
|
52
|
+
}
|
|
48
53
|
export declare class TracesModule {
|
|
49
54
|
private client;
|
|
50
55
|
private headers;
|
|
@@ -67,6 +72,11 @@ export declare class TracesModule {
|
|
|
67
72
|
* Get spans for a trace.
|
|
68
73
|
*/
|
|
69
74
|
getSpans(traceId: string): Promise<APIResponse<SpanListResponse>>;
|
|
75
|
+
/**
|
|
76
|
+
* Get all spans associated with a run.
|
|
77
|
+
* Maps to: GET /v1/api/traces/by-run/{runId}
|
|
78
|
+
*/
|
|
79
|
+
getByRun(runId: string): Promise<APIResponse<SpansByRunResponse>>;
|
|
70
80
|
/**
|
|
71
81
|
* Ingest spans (batch).
|
|
72
82
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"traces.d.ts","sourceRoot":"","sources":["../../src/modules/traces.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE3E,MAAM,MAAM,QAAQ,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,UAAU,CAAC,CAAC;AAIzD,MAAM,WAAW,eAAe;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACzC;AAED,MAAM,WAAW,KAAK;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,IAAI,GAAG,OAAO,GAAG,SAAS,CAAC;IACnC,UAAU,EAAE,MAAM,C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MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;KACnB,GAAG,OAAO,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC;IAO3C;;OAEG;IACG,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;IAO7D;;OAEG;IACG,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;IAOvE;;;OAGG;IACG,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC;IAMvE;;OAEG;IACG,MAAM,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAO3D;;OAEG;IACG,WAAW,CAAC,QAAQ,EAAE,eAAe,GAAG,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;CAM3E"}
|
package/dist/modules/traces.js
CHANGED
|
@@ -35,6 +35,15 @@ export class TracesModule {
|
|
|
35
35
|
headers: this.headers(),
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* Get all spans associated with a run.
|
|
40
|
+
* Maps to: GET /v1/api/traces/by-run/{runId}
|
|
41
|
+
*/
|
|
42
|
+
async getByRun(runId) {
|
|
43
|
+
return this.client.GET(`/v1/api/traces/by-run/${runId}`, {
|
|
44
|
+
headers: this.headers(),
|
|
45
|
+
});
|
|
46
|
+
}
|
|
38
47
|
/**
|
|
39
48
|
* Ingest spans (batch).
|
|
40
49
|
*/
|
package/package.json
CHANGED
|
@@ -77,7 +77,7 @@ export class EvaluationModule {
|
|
|
77
77
|
limit?: number;
|
|
78
78
|
offset?: number;
|
|
79
79
|
}): Promise<APIResponse<DatasetListResponse>> {
|
|
80
|
-
return this.client.GET<DatasetListResponse>("/v1/api/
|
|
80
|
+
return this.client.GET<DatasetListResponse>("/v1/api/evaluations/datasets", {
|
|
81
81
|
params: { query: params },
|
|
82
82
|
headers: this.headers(),
|
|
83
83
|
});
|
|
@@ -87,7 +87,7 @@ export class EvaluationModule {
|
|
|
87
87
|
* Get a dataset by ID.
|
|
88
88
|
*/
|
|
89
89
|
async getDataset(datasetId: string): Promise<APIResponse<EvalDataset>> {
|
|
90
|
-
return this.client.GET<EvalDataset>("/v1/api/
|
|
90
|
+
return this.client.GET<EvalDataset>("/v1/api/evaluations/datasets/{id}", {
|
|
91
91
|
params: { path: { id: datasetId } },
|
|
92
92
|
headers: this.headers(),
|
|
93
93
|
});
|
|
@@ -101,7 +101,7 @@ export class EvaluationModule {
|
|
|
101
101
|
description?: string;
|
|
102
102
|
agent_id?: string;
|
|
103
103
|
}): Promise<APIResponse<EvalDataset>> {
|
|
104
|
-
return this.client.POST<EvalDataset>("/v1/api/
|
|
104
|
+
return this.client.POST<EvalDataset>("/v1/api/evaluations/datasets", {
|
|
105
105
|
body,
|
|
106
106
|
headers: this.headers(),
|
|
107
107
|
});
|
|
@@ -111,7 +111,7 @@ export class EvaluationModule {
|
|
|
111
111
|
* Delete a dataset.
|
|
112
112
|
*/
|
|
113
113
|
async deleteDataset(datasetId: string): Promise<APIResponse<void>> {
|
|
114
|
-
return this.client.DELETE<void>("/v1/api/
|
|
114
|
+
return this.client.DELETE<void>("/v1/api/evaluations/datasets/{id}", {
|
|
115
115
|
params: { path: { id: datasetId } },
|
|
116
116
|
headers: this.headers(),
|
|
117
117
|
});
|
|
@@ -126,7 +126,7 @@ export class EvaluationModule {
|
|
|
126
126
|
limit?: number;
|
|
127
127
|
offset?: number;
|
|
128
128
|
}): Promise<APIResponse<ExamplesListResponse>> {
|
|
129
|
-
return this.client.GET<ExamplesListResponse>("/v1/api/
|
|
129
|
+
return this.client.GET<ExamplesListResponse>("/v1/api/evaluations/datasets/{id}/examples", {
|
|
130
130
|
params: { path: { id: datasetId }, query: params },
|
|
131
131
|
headers: this.headers(),
|
|
132
132
|
});
|
|
@@ -136,7 +136,7 @@ export class EvaluationModule {
|
|
|
136
136
|
* Add examples to a dataset.
|
|
137
137
|
*/
|
|
138
138
|
async addExamples(datasetId: string, examples: ExampleData[]): Promise<APIResponse<void>> {
|
|
139
|
-
return this.client.POST<void>("/v1/api/
|
|
139
|
+
return this.client.POST<void>("/v1/api/evaluations/datasets/{id}/examples", {
|
|
140
140
|
params: { path: { id: datasetId } },
|
|
141
141
|
body: { examples },
|
|
142
142
|
headers: this.headers(),
|
|
@@ -155,7 +155,7 @@ export class EvaluationModule {
|
|
|
155
155
|
limit?: number;
|
|
156
156
|
offset?: number;
|
|
157
157
|
}): Promise<APIResponse<ExperimentListResponse>> {
|
|
158
|
-
return this.client.GET<ExperimentListResponse>("/v1/api/
|
|
158
|
+
return this.client.GET<ExperimentListResponse>("/v1/api/evaluations/experiments", {
|
|
159
159
|
params: { query: params },
|
|
160
160
|
headers: this.headers(),
|
|
161
161
|
});
|
|
@@ -165,7 +165,7 @@ export class EvaluationModule {
|
|
|
165
165
|
* Get an experiment by ID.
|
|
166
166
|
*/
|
|
167
167
|
async getExperiment(experimentId: string): Promise<APIResponse<Experiment>> {
|
|
168
|
-
return this.client.GET<Experiment>("/v1/api/
|
|
168
|
+
return this.client.GET<Experiment>("/v1/api/evaluations/experiments/{id}", {
|
|
169
169
|
params: { path: { id: experimentId } },
|
|
170
170
|
headers: this.headers(),
|
|
171
171
|
});
|
|
@@ -181,7 +181,7 @@ export class EvaluationModule {
|
|
|
181
181
|
name?: string;
|
|
182
182
|
config?: Record<string, unknown>;
|
|
183
183
|
}): Promise<APIResponse<Experiment>> {
|
|
184
|
-
return this.client.POST<Experiment>("/v1/api/
|
|
184
|
+
return this.client.POST<Experiment>("/v1/api/evaluations/experiments", {
|
|
185
185
|
body,
|
|
186
186
|
headers: this.headers(),
|
|
187
187
|
});
|
package/src/modules/traces.ts
CHANGED
|
@@ -56,6 +56,12 @@ export interface TraceDetail extends Trace {
|
|
|
56
56
|
spans: Span[];
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
+
export interface SpansByRunResponse {
|
|
60
|
+
run_id: string;
|
|
61
|
+
spans: Span[];
|
|
62
|
+
count: number;
|
|
63
|
+
}
|
|
64
|
+
|
|
59
65
|
export class TracesModule {
|
|
60
66
|
constructor(private client: RawClient, private headers: () => Record<string, string>) { }
|
|
61
67
|
|
|
@@ -95,6 +101,16 @@ export class TracesModule {
|
|
|
95
101
|
});
|
|
96
102
|
}
|
|
97
103
|
|
|
104
|
+
/**
|
|
105
|
+
* Get all spans associated with a run.
|
|
106
|
+
* Maps to: GET /v1/api/traces/by-run/{runId}
|
|
107
|
+
*/
|
|
108
|
+
async getByRun(runId: string): Promise<APIResponse<SpansByRunResponse>> {
|
|
109
|
+
return this.client.GET<SpansByRunResponse>(`/v1/api/traces/by-run/${runId}`, {
|
|
110
|
+
headers: this.headers(),
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
|
|
98
114
|
/**
|
|
99
115
|
* Ingest spans (batch).
|
|
100
116
|
*/
|