UNPKG

openai

Version:

The official TypeScript library for the OpenAI API

57 lines 2.01 kB
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from "../../core/resource.mjs"; import * as ContentAPI from "./content.mjs"; import { Content } from "./content.mjs"; import * as VersionsAPI from "./versions/versions.mjs"; import { Versions, } from "./versions/versions.mjs"; import { CursorPage } from "../../core/pagination.mjs"; import { maybeMultipartFormRequestOptions } from "../../internal/uploads.mjs"; import { path } from "../../internal/utils/path.mjs"; export class Skills extends APIResource { constructor() { super(...arguments); this.content = new ContentAPI.Content(this._client); this.versions = new VersionsAPI.Versions(this._client); } /** * Create a new skill. */ create(body = {}, options) { return this._client.post('/skills', maybeMultipartFormRequestOptions({ body, ...options, __security: { bearerAuth: true } }, this._client)); } /** * Get a skill by its ID. */ retrieve(skillID, options) { return this._client.get(path `/skills/${skillID}`, { ...options, __security: { bearerAuth: true } }); } /** * Update the default version pointer for a skill. */ update(skillID, body, options) { return this._client.post(path `/skills/${skillID}`, { body, ...options, __security: { bearerAuth: true }, }); } /** * List all skills for the current project. */ list(query = {}, options) { return this._client.getAPIList('/skills', (CursorPage), { query, ...options, __security: { bearerAuth: true }, }); } /** * Delete a skill by its ID. */ delete(skillID, options) { return this._client.delete(path `/skills/${skillID}`, { ...options, __security: { bearerAuth: true } }); } } Skills.Content = Content; Skills.Versions = Versions; //# sourceMappingURL=skills.mjs.map