Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
configured_endpoints: 12
configured_endpoints: 13
2 changes: 2 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@ Methods:
Types:

- <code><a href="./src/resources/inference-pipelines/inference-pipelines.ts">InferencePipelineRetrieveResponse</a></code>
- <code><a href="./src/resources/inference-pipelines/inference-pipelines.ts">InferencePipelineUpdateResponse</a></code>

Methods:

- <code title="get /inference-pipelines/{inferencePipelineId}">client.inferencePipelines.<a href="./src/resources/inference-pipelines/inference-pipelines.ts">retrieve</a>(inferencePipelineId) -> InferencePipelineRetrieveResponse</code>
- <code title="put /inference-pipelines/{inferencePipelineId}">client.inferencePipelines.<a href="./src/resources/inference-pipelines/inference-pipelines.ts">update</a>(inferencePipelineId, { ...params }) -> InferencePipelineUpdateResponse</code>
- <code title="delete /inference-pipelines/{inferencePipelineId}">client.inferencePipelines.<a href="./src/resources/inference-pipelines/inference-pipelines.ts">delete</a>(inferencePipelineId) -> void</code>

## Data
Expand Down
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ export namespace Openlayer {

export import InferencePipelines = API.InferencePipelines;
export import InferencePipelineRetrieveResponse = API.InferencePipelineRetrieveResponse;
export import InferencePipelineUpdateResponse = API.InferencePipelineUpdateResponse;
export import InferencePipelineUpdateParams = API.InferencePipelineUpdateParams;

export import Storage = API.Storage;
}
Expand Down
2 changes: 2 additions & 0 deletions src/resources/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
export { Commits } from './commits/commits';
export {
InferencePipelineRetrieveResponse,
InferencePipelineUpdateResponse,
InferencePipelineUpdateParams,
InferencePipelines,
} from './inference-pipelines/inference-pipelines';
export {
Expand Down
7 changes: 6 additions & 1 deletion src/resources/inference-pipelines/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

export { DataStreamResponse, DataStreamParams, Data } from './data';
export { InferencePipelineRetrieveResponse, InferencePipelines } from './inference-pipelines';
export {
InferencePipelineRetrieveResponse,
InferencePipelineUpdateResponse,
InferencePipelineUpdateParams,
InferencePipelines,
} from './inference-pipelines';
export { RowUpdateResponse, RowUpdateParams, Rows } from './rows';
export { TestResultListResponse, TestResultListParams, TestResults } from './test-results';
124 changes: 124 additions & 0 deletions src/resources/inference-pipelines/inference-pipelines.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

import { APIResource } from '../../resource';
import { isRequestOptions } from '../../core';
import * as Core from '../../core';
import * as InferencePipelinesAPI from './inference-pipelines';
import * as DataAPI from './data';
Expand All @@ -22,6 +23,29 @@ export class InferencePipelines extends APIResource {
return this._client.get(`/inference-pipelines/${inferencePipelineId}`, options);
}

/**
* Update inference pipeline.
*/
update(
inferencePipelineId: string,
body?: InferencePipelineUpdateParams,
options?: Core.RequestOptions,
): Core.APIPromise<InferencePipelineUpdateResponse>;
update(
inferencePipelineId: string,
options?: Core.RequestOptions,
): Core.APIPromise<InferencePipelineUpdateResponse>;
update(
inferencePipelineId: string,
body: InferencePipelineUpdateParams | Core.RequestOptions = {},
options?: Core.RequestOptions,
): Core.APIPromise<InferencePipelineUpdateResponse> {
if (isRequestOptions(body)) {
return this.update(inferencePipelineId, {}, body);
}
return this._client.put(`/inference-pipelines/${inferencePipelineId}`, { body, ...options });
}

/**
* Delete inference pipeline.
*/
Expand Down Expand Up @@ -113,8 +137,108 @@ export namespace InferencePipelineRetrieveResponse {
}
}

export interface InferencePipelineUpdateResponse {
/**
* The inference pipeline id.
*/
id: string;

/**
* The creation date.
*/
dateCreated: string;

/**
* The last test evaluation date.
*/
dateLastEvaluated: string | null;

/**
* The last data sample received date.
*/
dateLastSampleReceived: string | null;

/**
* The next test evaluation date.
*/
dateOfNextEvaluation: string | null;

/**
* The last updated date.
*/
dateUpdated: string;

/**
* The inference pipeline description.
*/
description: string | null;

/**
* The number of tests failing.
*/
failingGoalCount: number;

links: InferencePipelineUpdateResponse.Links;

/**
* The inference pipeline name.
*/
name: string;

/**
* The number of tests passing.
*/
passingGoalCount: number;

/**
* The project id.
*/
projectId: string;

/**
* The status of test evaluation for the inference pipeline.
*/
status: 'queued' | 'running' | 'paused' | 'failed' | 'completed' | 'unknown';

/**
* The status message of test evaluation for the inference pipeline.
*/
statusMessage: string | null;

/**
* The total number of tests.
*/
totalGoalCount: number;
}

export namespace InferencePipelineUpdateResponse {
export interface Links {
app: string;
}
}

export interface InferencePipelineUpdateParams {
/**
* The inference pipeline description.
*/
description?: string | null;

/**
* The inference pipeline name.
*/
name?: string;

/**
* The storage uri of your reference dataset. We recommend using the Python SDK or
* the UI to handle your reference dataset updates.
*/
referenceDatasetUri?: string | null;
}

export namespace InferencePipelines {
export import InferencePipelineRetrieveResponse = InferencePipelinesAPI.InferencePipelineRetrieveResponse;
export import InferencePipelineUpdateResponse = InferencePipelinesAPI.InferencePipelineUpdateResponse;
export import InferencePipelineUpdateParams = InferencePipelinesAPI.InferencePipelineUpdateParams;
export import Data = DataAPI.Data;
export import DataStreamResponse = DataAPI.DataStreamResponse;
export import DataStreamParams = DataAPI.DataStreamParams;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,41 @@ describe('resource inferencePipelines', () => {
).rejects.toThrow(Openlayer.NotFoundError);
});

test('update', async () => {
const responsePromise = openlayer.inferencePipelines.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
expect(response).not.toBeInstanceOf(Response);
const dataAndResponse = await responsePromise.withResponse();
expect(dataAndResponse.data).toBe(response);
expect(dataAndResponse.response).toBe(rawResponse);
});

test('update: request options instead of params are passed correctly', async () => {
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
await expect(
openlayer.inferencePipelines.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
path: '/_stainless_unknown_path',
}),
).rejects.toThrow(Openlayer.NotFoundError);
});

test('update: request options and params are passed correctly', async () => {
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
await expect(
openlayer.inferencePipelines.update(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
{
description: 'This pipeline is used for production.',
name: 'production',
referenceDatasetUri: 'referenceDatasetUri',
},
{ path: '/_stainless_unknown_path' },
),
).rejects.toThrow(Openlayer.NotFoundError);
});

test('delete', async () => {
const responsePromise = openlayer.inferencePipelines.delete('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');
const rawResponse = await responsePromise.asResponse();
Expand Down