UNPKG

@restnfeel/agentc-starter-kit

Version:

한국어 기업용 CMS 모듈 - Task Master AI와 함께 빠르게 웹사이트를 구현할 수 있는 재사용 가능한 컴포넌트 시스템

73 lines (70 loc) 2.57 kB
import { APIResource } from '../../../resource.js'; import { isRequestOptions } from '../../../core.js'; import { Messages } from './messages.js'; import { CursorPage } from '../../../pagination.js'; // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. class Completions extends APIResource { constructor() { super(...arguments); this.messages = new Messages(this._client); } create(body, options) { return this._client.post('/chat/completions', { body, ...options, stream: body.stream ?? false }); } /** * Get a stored chat completion. Only Chat Completions that have been created with * the `store` parameter set to `true` will be returned. * * @example * ```ts * const chatCompletion = * await client.chat.completions.retrieve('completion_id'); * ``` */ retrieve(completionId, options) { return this._client.get(`/chat/completions/${completionId}`, options); } /** * Modify a stored chat completion. Only Chat Completions that have been created * with the `store` parameter set to `true` can be modified. Currently, the only * supported modification is to update the `metadata` field. * * @example * ```ts * const chatCompletion = await client.chat.completions.update( * 'completion_id', * { metadata: { foo: 'string' } }, * ); * ``` */ update(completionId, body, options) { return this._client.post(`/chat/completions/${completionId}`, { body, ...options }); } list(query = {}, options) { if (isRequestOptions(query)) { return this.list({}, query); } return this._client.getAPIList('/chat/completions', ChatCompletionsPage, { query, ...options }); } /** * Delete a stored chat completion. Only Chat Completions that have been created * with the `store` parameter set to `true` can be deleted. * * @example * ```ts * const chatCompletionDeleted = * await client.chat.completions.del('completion_id'); * ``` */ del(completionId, options) { return this._client.delete(`/chat/completions/${completionId}`, options); } } class ChatCompletionsPage extends CursorPage { } class ChatCompletionStoreMessagesPage extends CursorPage { } Completions.ChatCompletionsPage = ChatCompletionsPage; Completions.Messages = Messages; export { ChatCompletionStoreMessagesPage, ChatCompletionsPage, Completions }; //# sourceMappingURL=completions.js.map