28 lines
1.1 KiB
JavaScript
28 lines
1.1 KiB
JavaScript
|
|
"use strict";
|
||
|
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||
|
|
exports.Messages = void 0;
|
||
|
|
const resource_1 = require("../../../core/resource.js");
|
||
|
|
const pagination_1 = require("../../../core/pagination.js");
|
||
|
|
const path_1 = require("../../../internal/utils/path.js");
|
||
|
|
class Messages extends resource_1.APIResource {
|
||
|
|
/**
|
||
|
|
* Get the messages in a stored chat completion. Only Chat Completions that have
|
||
|
|
* been created with the `store` parameter set to `true` will be returned.
|
||
|
|
*
|
||
|
|
* @example
|
||
|
|
* ```ts
|
||
|
|
* // Automatically fetches more pages as needed.
|
||
|
|
* for await (const chatCompletionStoreMessage of client.chat.completions.messages.list(
|
||
|
|
* 'completion_id',
|
||
|
|
* )) {
|
||
|
|
* // ...
|
||
|
|
* }
|
||
|
|
* ```
|
||
|
|
*/
|
||
|
|
list(completionID, query = {}, options) {
|
||
|
|
return this._client.getAPIList((0, path_1.path) `/chat/completions/${completionID}/messages`, (pagination_1.CursorPage), { query, ...options });
|
||
|
|
}
|
||
|
|
}
|
||
|
|
exports.Messages = Messages;
|
||
|
|
//# sourceMappingURL=messages.js.map
|