diff --git a/.gitignore b/.gitignore
index 9a5858a7..3eed6ddf 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
+.prism.log
node_modules
yarn-error.log
codegen.log
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index af55ef03..949ce4c1 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.2.1"
+ ".": "0.2.2"
}
diff --git a/.stats.yml b/.stats.yml
index 2b7dbf39..699660ea 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1 +1 @@
-configured_endpoints: 6
+configured_endpoints: 8
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 91c321e0..935e1c09 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,19 @@
# Changelog
+## 0.2.2 (2024-07-05)
+
+Full Changelog: [v0.2.1...v0.2.2](https://github.com/openlayer-ai/openlayer-ts/compare/v0.2.1...v0.2.2)
+
+### Features
+
+* **api:** update via SDK Studio ([#16](https://github.com/openlayer-ai/openlayer-ts/issues/16)) ([699ba47](https://github.com/openlayer-ai/openlayer-ts/commit/699ba477252cac4546237afd55f5375171fff381))
+
+
+### Chores
+
+* go live ([#18](https://github.com/openlayer-ai/openlayer-ts/issues/18)) ([fadc413](https://github.com/openlayer-ai/openlayer-ts/commit/fadc41325e5427f4b0d43281407b5f57f72f7854))
+* update SDK settings ([#19](https://github.com/openlayer-ai/openlayer-ts/issues/19)) ([862666d](https://github.com/openlayer-ai/openlayer-ts/commit/862666da0c19f2cdb373be7aa89660c1fab9df8f))
+
## 0.2.1 (2024-06-10)
Full Changelog: [v0.2.0...v0.2.1](https://github.com/openlayer-ai/openlayer-ts/compare/v0.2.0...v0.2.1)
diff --git a/README.md b/README.md
index 8323b054..f54782b1 100644
--- a/README.md
+++ b/README.md
@@ -11,12 +11,9 @@ It is generated with [Stainless](https://www.stainlessapi.com/).
## Installation
```sh
-npm install git+ssh://git@github.com:openlayer-ai/openlayer-ts.git
+npm install openlayer
```
-> [!NOTE]
-> Once this package is [published to npm](https://app.stainlessapi.com/docs/guides/publish), this will become: `npm install openlayer`
-
## Usage
The full API of this library can be found in [api.md](api.md).
diff --git a/api.md b/api.md
index a5dc9707..8e1c3f52 100644
--- a/api.md
+++ b/api.md
@@ -2,10 +2,12 @@
Types:
+- ProjectCreateResponse
- ProjectListResponse
Methods:
+- client.projects.create({ ...params }) -> ProjectCreateResponse
- client.projects.list({ ...params }) -> ProjectListResponse
## Commits
@@ -22,10 +24,12 @@ Methods:
Types:
+- InferencePipelineCreateResponse
- InferencePipelineListResponse
Methods:
+- client.projects.inferencePipelines.create(id, { ...params }) -> InferencePipelineCreateResponse
- client.projects.inferencePipelines.list(id, { ...params }) -> InferencePipelineListResponse
# Commits
diff --git a/package-lock.json b/package-lock.json
index 374e1a18..0490e212 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "openlayer",
- "version": "0.2.1",
+ "version": "0.2.2",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "openlayer",
- "version": "0.2.1",
+ "version": "0.2.2",
"license": "ISC",
"dependencies": {
"@typescript-eslint/eslint-plugin": "^6.11.0",
diff --git a/package.json b/package.json
index a8ac1d49..ef0b7271 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "openlayer",
- "version": "0.2.1",
+ "version": "0.2.2",
"description": "The official TypeScript library for the Openlayer API",
"author": "Openlayer ",
"types": "dist/index.d.ts",
diff --git a/src/index.ts b/src/index.ts
index 251c9dca..ca4d7420 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -1,9 +1,9 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-import * as Core from './core';
import * as Errors from './error';
-import { type Agent } from './_shims/index';
import * as Uploads from './uploads';
+import { type Agent } from './_shims/index';
+import * as Core from './core';
import * as API from './resources/index';
export interface ClientOptions {
@@ -69,7 +69,9 @@ export interface ClientOptions {
defaultQuery?: Core.DefaultQuery;
}
-/** API Client for interfacing with the Openlayer API. */
+/**
+ * API Client for interfacing with the Openlayer API.
+ */
export class Openlayer extends Core.APIClient {
apiKey: string | null;
@@ -105,6 +107,7 @@ export class Openlayer extends Core.APIClient {
maxRetries: options.maxRetries,
fetch: options.fetch,
});
+
this._options = options;
this.apiKey = apiKey;
@@ -188,7 +191,9 @@ export namespace Openlayer {
export import RequestOptions = Core.RequestOptions;
export import Projects = API.Projects;
+ export import ProjectCreateResponse = API.ProjectCreateResponse;
export import ProjectListResponse = API.ProjectListResponse;
+ export import ProjectCreateParams = API.ProjectCreateParams;
export import ProjectListParams = API.ProjectListParams;
export import Commits = API.Commits;
diff --git a/src/resources/commits/test-results.ts b/src/resources/commits/test-results.ts
index 3916a459..d2b57740 100644
--- a/src/resources/commits/test-results.ts
+++ b/src/resources/commits/test-results.ts
@@ -1,8 +1,8 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-import * as Core from '../../core';
import { APIResource } from '../../resource';
import { isRequestOptions } from '../../core';
+import * as Core from '../../core';
import * as TestResultsAPI from './test-results';
export class TestResults extends APIResource {
diff --git a/src/resources/index.ts b/src/resources/index.ts
index d68108a0..e22e510a 100644
--- a/src/resources/index.ts
+++ b/src/resources/index.ts
@@ -2,4 +2,10 @@
export { Commits } from './commits/commits';
export { InferencePipelines } from './inference-pipelines/inference-pipelines';
-export { ProjectListResponse, ProjectListParams, Projects } from './projects/projects';
+export {
+ ProjectCreateResponse,
+ ProjectListResponse,
+ ProjectCreateParams,
+ ProjectListParams,
+ Projects,
+} from './projects/projects';
diff --git a/src/resources/inference-pipelines/data.ts b/src/resources/inference-pipelines/data.ts
index 841215cf..ffcb6e7d 100644
--- a/src/resources/inference-pipelines/data.ts
+++ b/src/resources/inference-pipelines/data.ts
@@ -1,7 +1,7 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-import * as Core from '../../core';
import { APIResource } from '../../resource';
+import * as Core from '../../core';
import * as DataAPI from './data';
export class Data extends APIResource {
diff --git a/src/resources/inference-pipelines/test-results.ts b/src/resources/inference-pipelines/test-results.ts
index 0a612bf9..a8dd505a 100644
--- a/src/resources/inference-pipelines/test-results.ts
+++ b/src/resources/inference-pipelines/test-results.ts
@@ -1,8 +1,8 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-import * as Core from '../../core';
import { APIResource } from '../../resource';
import { isRequestOptions } from '../../core';
+import * as Core from '../../core';
import * as TestResultsAPI from './test-results';
export class TestResults extends APIResource {
diff --git a/src/resources/projects/commits.ts b/src/resources/projects/commits.ts
index 3761b1af..fa18df33 100644
--- a/src/resources/projects/commits.ts
+++ b/src/resources/projects/commits.ts
@@ -1,8 +1,8 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-import * as Core from '../../core';
import { APIResource } from '../../resource';
import { isRequestOptions } from '../../core';
+import * as Core from '../../core';
import * as CommitsAPI from './commits';
export class Commits extends APIResource {
diff --git a/src/resources/projects/index.ts b/src/resources/projects/index.ts
index b51837cd..62a84c5a 100644
--- a/src/resources/projects/index.ts
+++ b/src/resources/projects/index.ts
@@ -2,8 +2,16 @@
export { CommitListResponse, CommitListParams, Commits } from './commits';
export {
+ InferencePipelineCreateResponse,
InferencePipelineListResponse,
+ InferencePipelineCreateParams,
InferencePipelineListParams,
InferencePipelines,
} from './inference-pipelines';
-export { ProjectListResponse, ProjectListParams, Projects } from './projects';
+export {
+ ProjectCreateResponse,
+ ProjectListResponse,
+ ProjectCreateParams,
+ ProjectListParams,
+ Projects,
+} from './projects';
diff --git a/src/resources/projects/inference-pipelines.ts b/src/resources/projects/inference-pipelines.ts
index 88c73173..28c51863 100644
--- a/src/resources/projects/inference-pipelines.ts
+++ b/src/resources/projects/inference-pipelines.ts
@@ -1,11 +1,22 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-import * as Core from '../../core';
import { APIResource } from '../../resource';
import { isRequestOptions } from '../../core';
+import * as Core from '../../core';
import * as InferencePipelinesAPI from './inference-pipelines';
export class InferencePipelines extends APIResource {
+ /**
+ * Create an inference pipeline under a project.
+ */
+ create(
+ id: string,
+ body: InferencePipelineCreateParams,
+ options?: Core.RequestOptions,
+ ): Core.APIPromise {
+ return this._client.post(`/projects/${id}/inference-pipelines`, { body, ...options });
+ }
+
/**
* List the inference pipelines in a project.
*/
@@ -27,6 +38,91 @@ export class InferencePipelines extends APIResource {
}
}
+export interface InferencePipelineCreateResponse {
+ /**
+ * 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: InferencePipelineCreateResponse.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;
+
+ /**
+ * The storage type.
+ */
+ storageType?: 'local' | 's3' | 'gcs' | 'azure';
+}
+
+export namespace InferencePipelineCreateResponse {
+ export interface Links {
+ app: string;
+ }
+}
+
export interface InferencePipelineListResponse {
_meta: InferencePipelineListResponse._Meta;
@@ -142,6 +238,28 @@ export namespace InferencePipelineListResponse {
}
}
+export interface InferencePipelineCreateParams {
+ /**
+ * The inference pipeline description.
+ */
+ description: string | null;
+
+ /**
+ * The inference pipeline name.
+ */
+ name: string;
+
+ /**
+ * The reference dataset URI.
+ */
+ referenceDatasetUri?: string | null;
+
+ /**
+ * The storage type.
+ */
+ storageType?: 'local' | 's3' | 'gcs' | 'azure';
+}
+
export interface InferencePipelineListParams {
/**
* Filter list of items by name.
@@ -160,6 +278,8 @@ export interface InferencePipelineListParams {
}
export namespace InferencePipelines {
+ export import InferencePipelineCreateResponse = InferencePipelinesAPI.InferencePipelineCreateResponse;
export import InferencePipelineListResponse = InferencePipelinesAPI.InferencePipelineListResponse;
+ export import InferencePipelineCreateParams = InferencePipelinesAPI.InferencePipelineCreateParams;
export import InferencePipelineListParams = InferencePipelinesAPI.InferencePipelineListParams;
}
diff --git a/src/resources/projects/projects.ts b/src/resources/projects/projects.ts
index bca37062..3a6ad577 100644
--- a/src/resources/projects/projects.ts
+++ b/src/resources/projects/projects.ts
@@ -1,8 +1,8 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-import * as Core from '../../core';
import { APIResource } from '../../resource';
import { isRequestOptions } from '../../core';
+import * as Core from '../../core';
import * as ProjectsAPI from './projects';
import * as CommitsAPI from './commits';
import * as InferencePipelinesAPI from './inference-pipelines';
@@ -13,6 +13,13 @@ export class Projects extends APIResource {
this._client,
);
+ /**
+ * Create a project under the current workspace.
+ */
+ create(body: ProjectCreateParams, options?: Core.RequestOptions): Core.APIPromise {
+ return this._client.post('/projects', { body, ...options });
+ }
+
/**
* List the projects in a user's workspace.
*/
@@ -29,6 +36,145 @@ export class Projects extends APIResource {
}
}
+export interface ProjectCreateResponse {
+ /**
+ * The project id.
+ */
+ id: string;
+
+ /**
+ * The project creator id.
+ */
+ creatorId: string | null;
+
+ /**
+ * The project creation date.
+ */
+ dateCreated: string;
+
+ /**
+ * The project last updated date.
+ */
+ dateUpdated: string;
+
+ /**
+ * The number of tests in the development mode of the project.
+ */
+ developmentGoalCount: number;
+
+ /**
+ * The total number of tests in the project.
+ */
+ goalCount: number;
+
+ /**
+ * The number of inference pipelines in the project.
+ */
+ inferencePipelineCount: number;
+
+ /**
+ * Links to the project.
+ */
+ links: ProjectCreateResponse.Links;
+
+ /**
+ * The number of tests in the monitoring mode of the project.
+ */
+ monitoringGoalCount: number;
+
+ /**
+ * The project name.
+ */
+ name: string;
+
+ /**
+ * Whether the project is a sample project or a user-created project.
+ */
+ sample: boolean;
+
+ /**
+ * The source of the project.
+ */
+ source: 'web' | 'api' | 'null' | null;
+
+ /**
+ * The task type of the project.
+ */
+ taskType: 'llm-base' | 'tabular-classification' | 'tabular-regression' | 'text-classification';
+
+ /**
+ * The number of versions (commits) in the project.
+ */
+ versionCount: number;
+
+ /**
+ * The workspace id.
+ */
+ workspaceId: string | null;
+
+ /**
+ * The project description.
+ */
+ description?: string | null;
+
+ gitRepo?: ProjectCreateResponse.GitRepo | null;
+
+ /**
+ * The slack channel id connected to the project.
+ */
+ slackChannelId?: string | null;
+
+ /**
+ * The slack channel connected to the project.
+ */
+ slackChannelName?: string | null;
+
+ /**
+ * Whether slack channel notifications are enabled for the project.
+ */
+ slackChannelNotificationsEnabled?: boolean;
+
+ /**
+ * The number of unread notifications in the project.
+ */
+ unreadNotificationCount?: number;
+}
+
+export namespace ProjectCreateResponse {
+ /**
+ * Links to the project.
+ */
+ export interface Links {
+ app: string;
+ }
+
+ export interface GitRepo {
+ id: string;
+
+ dateConnected: string;
+
+ dateUpdated: string;
+
+ gitAccountId: string;
+
+ gitId: number;
+
+ name: string;
+
+ private: boolean;
+
+ projectId: string;
+
+ slug: string;
+
+ url: string;
+
+ branch?: string;
+
+ rootDir?: string;
+ }
+}
+
export interface ProjectListResponse {
_meta: ProjectListResponse._Meta;
@@ -198,6 +344,52 @@ export namespace ProjectListResponse {
}
}
+export interface ProjectCreateParams {
+ /**
+ * The project name.
+ */
+ name: string;
+
+ /**
+ * The task type of the project.
+ */
+ taskType: 'llm-base' | 'tabular-classification' | 'tabular-regression' | 'text-classification';
+
+ /**
+ * The project description.
+ */
+ description?: string | null;
+
+ gitRepo?: ProjectCreateParams.GitRepo | null;
+
+ /**
+ * The slack channel id connected to the project.
+ */
+ slackChannelId?: string | null;
+
+ /**
+ * The slack channel connected to the project.
+ */
+ slackChannelName?: string | null;
+
+ /**
+ * Whether slack channel notifications are enabled for the project.
+ */
+ slackChannelNotificationsEnabled?: boolean;
+}
+
+export namespace ProjectCreateParams {
+ export interface GitRepo {
+ gitAccountId: string;
+
+ gitId: number;
+
+ branch?: string;
+
+ rootDir?: string;
+ }
+}
+
export interface ProjectListParams {
/**
* Filter list of items by project name.
@@ -221,12 +413,16 @@ export interface ProjectListParams {
}
export namespace Projects {
+ export import ProjectCreateResponse = ProjectsAPI.ProjectCreateResponse;
export import ProjectListResponse = ProjectsAPI.ProjectListResponse;
+ export import ProjectCreateParams = ProjectsAPI.ProjectCreateParams;
export import ProjectListParams = ProjectsAPI.ProjectListParams;
export import Commits = CommitsAPI.Commits;
export import CommitListResponse = CommitsAPI.CommitListResponse;
export import CommitListParams = CommitsAPI.CommitListParams;
export import InferencePipelines = InferencePipelinesAPI.InferencePipelines;
+ export import InferencePipelineCreateResponse = InferencePipelinesAPI.InferencePipelineCreateResponse;
export import InferencePipelineListResponse = InferencePipelinesAPI.InferencePipelineListResponse;
+ export import InferencePipelineCreateParams = InferencePipelinesAPI.InferencePipelineCreateParams;
export import InferencePipelineListParams = InferencePipelinesAPI.InferencePipelineListParams;
}
diff --git a/src/version.ts b/src/version.ts
index 256fecd6..bf2543cc 100644
--- a/src/version.ts
+++ b/src/version.ts
@@ -1 +1 @@
-export const VERSION = '0.2.1'; // x-release-please-version
+export const VERSION = '0.2.2'; // x-release-please-version
diff --git a/tests/api-resources/projects/inference-pipelines.test.ts b/tests/api-resources/projects/inference-pipelines.test.ts
index 0529a243..2b030a28 100644
--- a/tests/api-resources/projects/inference-pipelines.test.ts
+++ b/tests/api-resources/projects/inference-pipelines.test.ts
@@ -9,6 +9,32 @@ const openlayer = new Openlayer({
});
describe('resource inferencePipelines', () => {
+ test('create: only required params', async () => {
+ const responsePromise = openlayer.projects.inferencePipelines.create(
+ '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
+ { description: 'This pipeline is used for production.', name: 'production' },
+ );
+ 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('create: required and optional params', async () => {
+ const response = await openlayer.projects.inferencePipelines.create(
+ '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
+ {
+ description: 'This pipeline is used for production.',
+ name: 'production',
+ referenceDatasetUri: 's3://...',
+ storageType: 's3',
+ },
+ );
+ });
+
test('list', async () => {
const responsePromise = openlayer.projects.inferencePipelines.list(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
diff --git a/tests/api-resources/projects/projects.test.ts b/tests/api-resources/projects/projects.test.ts
index b007bb43..87e2c7b5 100644
--- a/tests/api-resources/projects/projects.test.ts
+++ b/tests/api-resources/projects/projects.test.ts
@@ -9,6 +9,34 @@ const openlayer = new Openlayer({
});
describe('resource projects', () => {
+ test('create: only required params', async () => {
+ const responsePromise = openlayer.projects.create({ name: 'My Project', taskType: 'llm-base' });
+ 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('create: required and optional params', async () => {
+ const response = await openlayer.projects.create({
+ name: 'My Project',
+ taskType: 'llm-base',
+ description: 'My project description.',
+ gitRepo: {
+ gitId: 0,
+ branch: 'string',
+ rootDir: 'string',
+ gitAccountId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
+ },
+ slackChannelId: 'C01B2PZQX1Z',
+ slackChannelName: '#my-project',
+ slackChannelNotificationsEnabled: true,
+ });
+ });
+
test('list', async () => {
const responsePromise = openlayer.projects.list();
const rawResponse = await responsePromise.asResponse();
diff --git a/tests/stringifyQuery.test.ts b/tests/stringifyQuery.test.ts
index df367be6..ad216be2 100644
--- a/tests/stringifyQuery.test.ts
+++ b/tests/stringifyQuery.test.ts
@@ -1,8 +1,10 @@
-import { APIClient } from 'openlayer/core';
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-const { stringifyQuery } = APIClient.prototype as any;
+import { Openlayer } from 'openlayer';
-describe('APIClient.stringifyQuery', () => {
+const { stringifyQuery } = Openlayer.prototype as any;
+
+describe(stringifyQuery, () => {
for (const [input, expected] of [
[{ a: '1', b: 2, c: true }, 'a=1&b=2&c=true'],
[{ a: null, b: false, c: undefined }, 'a=&b=false'],
@@ -18,6 +20,7 @@ describe('APIClient.stringifyQuery', () => {
expect(stringifyQuery(input)).toEqual(expected);
});
}
+
for (const value of [[], {}, new Date()]) {
it(`${JSON.stringify(value)} -> `, () => {
expect(() => stringifyQuery({ value })).toThrow(`Cannot stringify type ${typeof value}`);