File tree Expand file tree Collapse file tree 8 files changed +144
-0
lines changed Expand file tree Collapse file tree 8 files changed +144
-0
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,26 @@ import * as Core from '../../core';
6
6
export class Data extends APIResource {
7
7
/**
8
8
* Publish an inference data point to an inference pipeline.
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * const response =
13
+ * await client.inferencePipelines.data.stream(
14
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
15
+ * {
16
+ * config: { outputColumnName: 'output' },
17
+ * rows: [
18
+ * {
19
+ * user_query: 'bar',
20
+ * output: 'bar',
21
+ * tokens: 'bar',
22
+ * cost: 'bar',
23
+ * timestamp: 'bar',
24
+ * },
25
+ * ],
26
+ * },
27
+ * );
28
+ * ```
9
29
*/
10
30
stream (
11
31
inferencePipelineId : string ,
Original file line number Diff line number Diff line change @@ -17,6 +17,14 @@ export class InferencePipelines extends APIResource {
17
17
18
18
/**
19
19
* Retrieve inference pipeline.
20
+ *
21
+ * @example
22
+ * ```ts
23
+ * const inferencePipeline =
24
+ * await client.inferencePipelines.retrieve(
25
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
26
+ * );
27
+ * ```
20
28
*/
21
29
retrieve (
22
30
inferencePipelineId : string ,
@@ -40,6 +48,14 @@ export class InferencePipelines extends APIResource {
40
48
41
49
/**
42
50
* Update inference pipeline.
51
+ *
52
+ * @example
53
+ * ```ts
54
+ * const inferencePipeline =
55
+ * await client.inferencePipelines.update(
56
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
57
+ * );
58
+ * ```
43
59
*/
44
60
update (
45
61
inferencePipelineId : string ,
@@ -63,6 +79,13 @@ export class InferencePipelines extends APIResource {
63
79
64
80
/**
65
81
* Delete inference pipeline.
82
+ *
83
+ * @example
84
+ * ```ts
85
+ * await client.inferencePipelines.delete(
86
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
87
+ * );
88
+ * ```
66
89
*/
67
90
delete ( inferencePipelineId : string , options ?: Core . RequestOptions ) : Core . APIPromise < void > {
68
91
return this . _client . delete ( `/inference-pipelines/${ inferencePipelineId } ` , {
Original file line number Diff line number Diff line change @@ -6,6 +6,14 @@ import * as Core from '../../core';
6
6
export class Rows extends APIResource {
7
7
/**
8
8
* Update an inference data point in an inference pipeline.
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * const row = await client.inferencePipelines.rows.update(
13
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
14
+ * { inferenceId: 'inferenceId', row: {} },
15
+ * );
16
+ * ```
9
17
*/
10
18
update (
11
19
inferencePipelineId : string ,
Original file line number Diff line number Diff line change @@ -7,6 +7,14 @@ import * as Core from '../../core';
7
7
export class TestResults extends APIResource {
8
8
/**
9
9
* List the latest test results for an inference pipeline.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const testResults =
14
+ * await client.inferencePipelines.testResults.list(
15
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
16
+ * );
17
+ * ```
10
18
*/
11
19
list (
12
20
inferencePipelineId : string ,
Original file line number Diff line number Diff line change @@ -7,6 +7,17 @@ import * as Core from '../../core';
7
7
export class Commits extends APIResource {
8
8
/**
9
9
* Create a new commit (project version) in a project.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const commit = await client.projects.commits.create(
14
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
15
+ * {
16
+ * commit: { message: 'Updated the prompt.' },
17
+ * storageUri: 's3://...',
18
+ * },
19
+ * );
20
+ * ```
10
21
*/
11
22
create (
12
23
projectId : string ,
@@ -18,6 +29,13 @@ export class Commits extends APIResource {
18
29
19
30
/**
20
31
* List the commits (project versions) in a project.
32
+ *
33
+ * @example
34
+ * ```ts
35
+ * const commits = await client.projects.commits.list(
36
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
37
+ * );
38
+ * ```
21
39
*/
22
40
list (
23
41
projectId : string ,
Original file line number Diff line number Diff line change @@ -7,6 +7,18 @@ import * as Core from '../../core';
7
7
export class InferencePipelines extends APIResource {
8
8
/**
9
9
* Create an inference pipeline in a project.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const inferencePipeline =
14
+ * await client.projects.inferencePipelines.create(
15
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
16
+ * {
17
+ * description: 'This pipeline is used for production.',
18
+ * name: 'production',
19
+ * },
20
+ * );
21
+ * ```
10
22
*/
11
23
create (
12
24
projectId : string ,
@@ -18,6 +30,14 @@ export class InferencePipelines extends APIResource {
18
30
19
31
/**
20
32
* List the inference pipelines in a project.
33
+ *
34
+ * @example
35
+ * ```ts
36
+ * const inferencePipelines =
37
+ * await client.projects.inferencePipelines.list(
38
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
39
+ * );
40
+ * ```
21
41
*/
22
42
list (
23
43
projectId : string ,
Original file line number Diff line number Diff line change @@ -39,13 +39,26 @@ export class Projects extends APIResource {
39
39
40
40
/**
41
41
* Create a project in your workspace.
42
+ *
43
+ * @example
44
+ * ```ts
45
+ * const project = await client.projects.create({
46
+ * name: 'My Project',
47
+ * taskType: 'llm-base',
48
+ * });
49
+ * ```
42
50
*/
43
51
create ( body : ProjectCreateParams , options ?: Core . RequestOptions ) : Core . APIPromise < ProjectCreateResponse > {
44
52
return this . _client . post ( '/projects' , { body, ...options } ) ;
45
53
}
46
54
47
55
/**
48
56
* List your workspace's projects.
57
+ *
58
+ * @example
59
+ * ```ts
60
+ * const projects = await client.projects.list();
61
+ * ```
49
62
*/
50
63
list ( query ?: ProjectListParams , options ?: Core . RequestOptions ) : Core . APIPromise < ProjectListResponse > ;
51
64
list ( options ?: Core . RequestOptions ) : Core . APIPromise < ProjectListResponse > ;
Original file line number Diff line number Diff line change @@ -7,6 +7,21 @@ import * as Core from '../../core';
7
7
export class Tests extends APIResource {
8
8
/**
9
9
* Create a test.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const test = await client.projects.tests.create(
14
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
15
+ * {
16
+ * description:
17
+ * 'This test checks for duplicate rows in the dataset.',
18
+ * name: 'No duplicate rows',
19
+ * subtype: 'duplicateRowCount',
20
+ * thresholds: [{}],
21
+ * type: 'integrity',
22
+ * },
23
+ * );
24
+ * ```
10
25
*/
11
26
create (
12
27
projectId : string ,
@@ -18,6 +33,18 @@ export class Tests extends APIResource {
18
33
19
34
/**
20
35
* Update tests.
36
+ *
37
+ * @example
38
+ * ```ts
39
+ * const test = await client.projects.tests.update(
40
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
41
+ * {
42
+ * payloads: [
43
+ * { id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' },
44
+ * ],
45
+ * },
46
+ * );
47
+ * ```
21
48
*/
22
49
update (
23
50
projectId : string ,
@@ -29,6 +56,13 @@ export class Tests extends APIResource {
29
56
30
57
/**
31
58
* List tests under a project.
59
+ *
60
+ * @example
61
+ * ```ts
62
+ * const tests = await client.projects.tests.list(
63
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
64
+ * );
65
+ * ```
32
66
*/
33
67
list (
34
68
projectId : string ,
You can’t perform that action at this time.
0 commit comments