first commit

This commit is contained in:
2026-07-19 03:44:35 +09:00
commit 7f950339ae
23281 changed files with 3217138 additions and 0 deletions
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
+118
View File
@@ -0,0 +1,118 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.ChatCompletionRunner = exports.ChatCompletionStream = exports.ParsingToolFunction = exports.ChatCompletionStreamingRunner = exports.Completions = void 0;
const tslib_1 = require("../../../internal/tslib.js");
const resource_1 = require("../../../core/resource.js");
const MessagesAPI = tslib_1.__importStar(require("./messages.js"));
const messages_1 = require("./messages.js");
const pagination_1 = require("../../../core/pagination.js");
const path_1 = require("../../../internal/utils/path.js");
const ChatCompletionRunner_1 = require("../../../lib/ChatCompletionRunner.js");
const ChatCompletionStreamingRunner_1 = require("../../../lib/ChatCompletionStreamingRunner.js");
const ChatCompletionStream_1 = require("../../../lib/ChatCompletionStream.js");
const parser_1 = require("../../../lib/parser.js");
/**
* Given a list of messages comprising a conversation, the model will return a response.
*/
class Completions extends resource_1.APIResource {
constructor() {
super(...arguments);
this.messages = new MessagesAPI.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((0, path_1.path) `/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((0, path_1.path) `/chat/completions/${completionID}`, { body, ...options });
}
/**
* List stored Chat Completions. Only Chat Completions that have been stored with
* the `store` parameter set to `true` will be returned.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const chatCompletion of client.chat.completions.list()) {
* // ...
* }
* ```
*/
list(query = {}, options) {
return this._client.getAPIList('/chat/completions', (pagination_1.CursorPage), { 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.delete('completion_id');
* ```
*/
delete(completionID, options) {
return this._client.delete((0, path_1.path) `/chat/completions/${completionID}`, options);
}
parse(body, options) {
(0, parser_1.validateInputTools)(body.tools);
return this._client.chat.completions
.create(body, {
...options,
headers: {
...options?.headers,
'X-Stainless-Helper-Method': 'chat.completions.parse',
},
})
._thenUnwrap((completion) => (0, parser_1.parseChatCompletion)(completion, body));
}
runTools(body, options) {
if (body.stream) {
return ChatCompletionStreamingRunner_1.ChatCompletionStreamingRunner.runTools(this._client, body, options);
}
return ChatCompletionRunner_1.ChatCompletionRunner.runTools(this._client, body, options);
}
/**
* Creates a chat completion stream
*/
stream(body, options) {
return ChatCompletionStream_1.ChatCompletionStream.createChatCompletion(this._client, body, options);
}
}
exports.Completions = Completions;
var ChatCompletionStreamingRunner_2 = require("../../../lib/ChatCompletionStreamingRunner.js");
Object.defineProperty(exports, "ChatCompletionStreamingRunner", { enumerable: true, get: function () { return ChatCompletionStreamingRunner_2.ChatCompletionStreamingRunner; } });
var RunnableFunction_1 = require("../../../lib/RunnableFunction.js");
Object.defineProperty(exports, "ParsingToolFunction", { enumerable: true, get: function () { return RunnableFunction_1.ParsingToolFunction; } });
var ChatCompletionStream_2 = require("../../../lib/ChatCompletionStream.js");
Object.defineProperty(exports, "ChatCompletionStream", { enumerable: true, get: function () { return ChatCompletionStream_2.ChatCompletionStream; } });
var ChatCompletionRunner_2 = require("../../../lib/ChatCompletionRunner.js");
Object.defineProperty(exports, "ChatCompletionRunner", { enumerable: true, get: function () { return ChatCompletionRunner_2.ChatCompletionRunner; } });
Completions.Messages = messages_1.Messages;
//# sourceMappingURL=completions.js.map
@@ -0,0 +1 @@
{"version":3,"file":"completions.js","sourceRoot":"","sources":["../../../src/resources/chat/completions/completions.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,wDAAqD;AAIrD,mEAA0C;AAC1C,4CAAyD;AAEzD,4DAA0F;AAG1F,0DAAoD;AAEpD,+EAAyE;AACzE,iGAA2F;AAI3F,+EAA0G;AAC1G,mDAA8G;AAE9G;;GAEG;AACH,MAAa,WAAY,SAAQ,sBAAW;IAA5C;;QACE,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAuL1E,CAAC;IA5IC,MAAM,CACJ,IAAgC,EAChC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,mBAAmB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,IAAI,KAAK,EAAE,CAErD,CAAC;IAC9C,CAAC;IAED;;;;;;;;;OASG;IACH,QAAQ,CAAC,YAAoB,EAAE,OAAwB;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,qBAAqB,YAAY,EAAE,EAAE,OAAO,CAAC,CAAC;IAC5E,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,MAAM,CACJ,YAAoB,EACpB,IAAgC,EAChC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,qBAAqB,YAAY,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC1F,CAAC;IAED;;;;;;;;;;;OAWG;IACH,IAAI,CACF,QAAqD,EAAE,EACvD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,mBAAmB,EAAE,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AIrB,6EAA0G;AAAjG,4HAAA,oBAAoB,OAAA;AAC7B,6EAAyE;AAAhE,4HAAA,oBAAoB,OAAA;AAguD7B,WAAW,CAAC,QAAQ,GAAG,mBAAQ,CAAC"}
+109
View File
@@ -0,0 +1,109 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../../core/resource.mjs";
import * as MessagesAPI from "./messages.mjs";
import { Messages } from "./messages.mjs";
import { CursorPage } from "../../../core/pagination.mjs";
import { path } from "../../../internal/utils/path.mjs";
import { ChatCompletionRunner } from "../../../lib/ChatCompletionRunner.mjs";
import { ChatCompletionStreamingRunner } from "../../../lib/ChatCompletionStreamingRunner.mjs";
import { ChatCompletionStream } from "../../../lib/ChatCompletionStream.mjs";
import { parseChatCompletion, validateInputTools } from "../../../lib/parser.mjs";
/**
* Given a list of messages comprising a conversation, the model will return a response.
*/
export class Completions extends APIResource {
constructor() {
super(...arguments);
this.messages = new MessagesAPI.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(path `/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(path `/chat/completions/${completionID}`, { body, ...options });
}
/**
* List stored Chat Completions. Only Chat Completions that have been stored with
* the `store` parameter set to `true` will be returned.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const chatCompletion of client.chat.completions.list()) {
* // ...
* }
* ```
*/
list(query = {}, options) {
return this._client.getAPIList('/chat/completions', (CursorPage), { 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.delete('completion_id');
* ```
*/
delete(completionID, options) {
return this._client.delete(path `/chat/completions/${completionID}`, options);
}
parse(body, options) {
validateInputTools(body.tools);
return this._client.chat.completions
.create(body, {
...options,
headers: {
...options?.headers,
'X-Stainless-Helper-Method': 'chat.completions.parse',
},
})
._thenUnwrap((completion) => parseChatCompletion(completion, body));
}
runTools(body, options) {
if (body.stream) {
return ChatCompletionStreamingRunner.runTools(this._client, body, options);
}
return ChatCompletionRunner.runTools(this._client, body, options);
}
/**
* Creates a chat completion stream
*/
stream(body, options) {
return ChatCompletionStream.createChatCompletion(this._client, body, options);
}
}
export { ChatCompletionStreamingRunner } from "../../../lib/ChatCompletionStreamingRunner.mjs";
export { ParsingToolFunction, } from "../../../lib/RunnableFunction.mjs";
export { ChatCompletionStream } from "../../../lib/ChatCompletionStream.mjs";
export { ChatCompletionRunner } from "../../../lib/ChatCompletionRunner.mjs";
Completions.Messages = Messages;
//# sourceMappingURL=completions.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"completions.mjs","sourceRoot":"","sources":["../../../src/resources/chat/completions/completions.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAIf,KAAK,WAAW;OAChB,EAAqB,QAAQ,EAAE;OAE/B,EAAE,UAAU,EAAsC;OAGlD,EAAE,IAAI,EAAE;OAER,EAAE,oBAAoB,EAAE;OACxB,EAAE,6BAA6B,EAAE;OAIjC,EAAE,oBAAoB,EAAmC;OACzD,EAAkC,mBAAmB,EAAE,kBAAkB,EAAE;AAElF;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,WAAW;IAA5C;;QACE,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAuL1E,CAAC;IA5IC,MAA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AA2B,EAAE,wBAAwB;aACtD;SACF,CAAC;aACD,WAAW,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,mBAAmB,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,CAAC;IACxE,CAAC;IAqBD,QAAQ,CAIN,IAAY,EACZ,OAAuB;QAEvB,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,OAAO,6BAA6B,CAAC,QAAQ,CAC3C,IAAI,CAAC,OAAO,EACZ,IAAoD,EACpD,OAAO,CACR,CAAC;QACJ,CAAC;QAED,OAAO,oBAAoB,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,IAA2C,EAAE,OAAO,CAAC,CAAC;IAC3G,CAAC;IAED;;OAEG;IACH,MAAM,CACJ,IAAY,EACZ,OAAwB;QAExB,OAAO,oBAAoB,CAAC,oBAAoB,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IAChF,CAAC;CACF;OAyBM,EAAE,6BAA6B,EAAE;OACjC,EAGL,mBAAmB,GACpB;OAGM,EAAE,oBAAoB,EAAmC;OACzD,EAAE,oBAAoB,EAAE;AAguD/B,WAAW,CAAC,QAAQ,GAAG,QAAQ,CAAC"}
+4
View File
@@ -0,0 +1,4 @@
export { Completions, type ChatCompletion, type ChatCompletionAllowedToolChoice, type ChatCompletionAssistantMessageParam, type ChatCompletionAudio, type ChatCompletionAudioParam, type ChatCompletionChunk, type ChatCompletionContentPart, type ChatCompletionContentPartImage, type ChatCompletionContentPartInputAudio, type ChatCompletionContentPartRefusal, type ChatCompletionContentPartText, type ChatCompletionCustomTool, type ChatCompletionDeleted, type ChatCompletionDeveloperMessageParam, type ChatCompletionFunctionCallOption, type ChatCompletionFunctionMessageParam, type ChatCompletionFunctionTool, type ChatCompletionMessage, type ChatCompletionMessageCustomToolCall, type ChatCompletionMessageFunctionToolCall, type ChatCompletionMessageParam, type ChatCompletionMessageToolCall, type ChatCompletionModality, type ChatCompletionNamedToolChoice, type ChatCompletionNamedToolChoiceCustom, type ChatCompletionPredictionContent, type ChatCompletionRole, type ChatCompletionStoreMessage, type ChatCompletionStreamOptions, type ChatCompletionSystemMessageParam, type ChatCompletionTokenLogprob, type ChatCompletionTool, type ChatCompletionToolChoiceOption, type ChatCompletionToolMessageParam, type ChatCompletionUserMessageParam, type ChatCompletionAllowedTools, type ChatCompletionCreateParams, type ChatCompletionCreateParamsNonStreaming, type ChatCompletionCreateParamsStreaming, type ChatCompletionUpdateParams, type ChatCompletionListParams, type ChatCompletionStoreMessagesPage, type ChatCompletionsPage, } from "./completions.mjs";
export * from "./completions.mjs";
export { Messages, type MessageListParams } from "./messages.mjs";
//# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/resources/chat/completions/index.ts"],"names":[],"mappings":"OAEO,EACL,WAAW,EACX,KAAK,cAAc,EACnB,KAAK,+BAA+B,EACpC,KAAK,mCAAmC,EACxC,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EACxB,KAAK,yBAAyB,EAC9B,KAAK,8BAA8B,EACnC,KAAK,mCAAmC,EACxC,KAAK,gCAAgC,EACrC,KAAK,6BAA6B,EAClC,KAAK,wBAAwB,EAC7B,KAAK,qBAAqB,EAC1B,KAAK,mCAAmC,EACxC,KAAK,gCAAgC,EACrC,KAAK,kCAAkC,EACvC,KAAK,0BAA0B,EAC/B,KAAK,qBAAqB,EAC1B,KAAK,mCAAmC,EACxC,KAAK,qCAAqC,EAC1C,KAAK,0BAA0B,EAC/B,KAAK,6BAA6B,EAClC,KAAK,sBAAsB,EAC3B,KAAK,6BAA6B,EAClC,KAAK,mCAAmC,EACxC,KAAK,+BAA+B,EACpC,KAAK,kBAAkB,EACvB,KAAK,0BAA0B,EAC/B,KAAK,2BAA2B,EAChC,KAAK,gCAAgC,EACrC,KAAK,0BAA0B,EAC/B,KAAK,kBAAkB,EACvB,KAAK,8BAA8B,EACnC,KAAK,8BAA8B,EACnC,KAAK,8BAA8B,EACnC,KAAK,0BAA0B,EAC/B,KAAK,0BAA0B,EAC/B,KAAK,sCAAsC,EAC3C,KAAK,mCAAmC,EACxC,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,EAC7B,KAAK,+BAA+B,EACpC,KAAK,mBAAmB,GACzB;;OAEM,EAAE,QAAQ,EAAE,KAAK,iBAAiB,EAAE"}
+4
View File
@@ -0,0 +1,4 @@
export { Completions, type ChatCompletion, type ChatCompletionAllowedToolChoice, type ChatCompletionAssistantMessageParam, type ChatCompletionAudio, type ChatCompletionAudioParam, type ChatCompletionChunk, type ChatCompletionContentPart, type ChatCompletionContentPartImage, type ChatCompletionContentPartInputAudio, type ChatCompletionContentPartRefusal, type ChatCompletionContentPartText, type ChatCompletionCustomTool, type ChatCompletionDeleted, type ChatCompletionDeveloperMessageParam, type ChatCompletionFunctionCallOption, type ChatCompletionFunctionMessageParam, type ChatCompletionFunctionTool, type ChatCompletionMessage, type ChatCompletionMessageCustomToolCall, type ChatCompletionMessageFunctionToolCall, type ChatCompletionMessageParam, type ChatCompletionMessageToolCall, type ChatCompletionModality, type ChatCompletionNamedToolChoice, type ChatCompletionNamedToolChoiceCustom, type ChatCompletionPredictionContent, type ChatCompletionRole, type ChatCompletionStoreMessage, type ChatCompletionStreamOptions, type ChatCompletionSystemMessageParam, type ChatCompletionTokenLogprob, type ChatCompletionTool, type ChatCompletionToolChoiceOption, type ChatCompletionToolMessageParam, type ChatCompletionUserMessageParam, type ChatCompletionAllowedTools, type ChatCompletionCreateParams, type ChatCompletionCreateParamsNonStreaming, type ChatCompletionCreateParamsStreaming, type ChatCompletionUpdateParams, type ChatCompletionListParams, type ChatCompletionStoreMessagesPage, type ChatCompletionsPage, } from "./completions.js";
export * from "./completions.js";
export { Messages, type MessageListParams } from "./messages.js";
//# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/resources/chat/completions/index.ts"],"names":[],"mappings":"OAEO,EACL,WAAW,EACX,KAAK,cAAc,EACnB,KAAK,+BAA+B,EACpC,KAAK,mCAAmC,EACxC,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EACxB,KAAK,yBAAyB,EAC9B,KAAK,8BAA8B,EACnC,KAAK,mCAAmC,EACxC,KAAK,gCAAgC,EACrC,KAAK,6BAA6B,EAClC,KAAK,wBAAwB,EAC7B,KAAK,qBAAqB,EAC1B,KAAK,mCAAmC,EACxC,KAAK,gCAAgC,EACrC,KAAK,kCAAkC,EACvC,KAAK,0BAA0B,EAC/B,KAAK,qBAAqB,EAC1B,KAAK,mCAAmC,EACxC,KAAK,qCAAqC,EAC1C,KAAK,0BAA0B,EAC/B,KAAK,6BAA6B,EAClC,KAAK,sBAAsB,EAC3B,KAAK,6BAA6B,EAClC,KAAK,mCAAmC,EACxC,KAAK,+BAA+B,EACpC,KAAK,kBAAkB,EACvB,KAAK,0BAA0B,EAC/B,KAAK,2BAA2B,EAChC,KAAK,gCAAgC,EACrC,KAAK,0BAA0B,EAC/B,KAAK,kBAAkB,EACvB,KAAK,8BAA8B,EACnC,KAAK,8BAA8B,EACnC,KAAK,8BAA8B,EACnC,KAAK,0BAA0B,EAC/B,KAAK,0BAA0B,EAC/B,KAAK,sCAAsC,EAC3C,KAAK,mCAAmC,EACxC,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,EAC7B,KAAK,+BAA+B,EACpC,KAAK,mBAAmB,GACzB;;OAEM,EAAE,QAAQ,EAAE,KAAK,iBAAiB,EAAE"}
+11
View File
@@ -0,0 +1,11 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.Messages = exports.Completions = void 0;
const tslib_1 = require("../../../internal/tslib.js");
var completions_1 = require("./completions.js");
Object.defineProperty(exports, "Completions", { enumerable: true, get: function () { return completions_1.Completions; } });
tslib_1.__exportStar(require("./completions.js"), exports);
var messages_1 = require("./messages.js");
Object.defineProperty(exports, "Messages", { enumerable: true, get: function () { return messages_1.Messages; } });
//# sourceMappingURL=index.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/resources/chat/completions/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,gDA6CuB;AA5CrB,0GAAA,WAAW,OAAA;AA6Cb,2DAA8B;AAC9B,0CAA8D;AAArD,oGAAA,QAAQ,OAAA"}
+5
View File
@@ -0,0 +1,5 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
export { Completions, } from "./completions.mjs";
export * from "./completions.mjs";
export { Messages } from "./messages.mjs";
//# sourceMappingURL=index.mjs.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/resources/chat/completions/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,WAAW,GA4CZ;;OAEM,EAAE,QAAQ,EAA0B"}
+37
View File
@@ -0,0 +1,37 @@
import { APIResource } from "../../../core/resource.mjs";
import * as CompletionsAPI from "./completions.mjs";
import { ChatCompletionStoreMessagesPage } from "./completions.mjs";
import { type CursorPageParams, PagePromise } from "../../../core/pagination.mjs";
import { RequestOptions } from "../../../internal/request-options.mjs";
/**
* Given a list of messages comprising a conversation, the model will return a response.
*/
export declare class Messages extends 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: string, query?: MessageListParams | null | undefined, options?: RequestOptions): PagePromise<ChatCompletionStoreMessagesPage, CompletionsAPI.ChatCompletionStoreMessage>;
}
export interface MessageListParams extends CursorPageParams {
/**
* Sort order for messages by timestamp. Use `asc` for ascending order or `desc`
* for descending order. Defaults to `asc`.
*/
order?: 'asc' | 'desc';
}
export declare namespace Messages {
export { type MessageListParams as MessageListParams };
}
export { type ChatCompletionStoreMessagesPage };
//# sourceMappingURL=messages.d.mts.map
@@ -0,0 +1 @@
{"version":3,"file":"messages.d.mts","sourceRoot":"","sources":["../../../src/resources/chat/completions/messages.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,cAAc;OACnB,EAAE,+BAA+B,EAAE;OACnC,EAAc,KAAK,gBAAgB,EAAE,WAAW,EAAE;OAClD,EAAE,cAAc,EAAE;AAGzB;;GAEG;AACH,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;;OAaG;IACH,IAAI,CACF,YAAY,EAAE,MAAM,EACpB,KAAK,GAAE,iBAAiB,GAAG,IAAI,GAAG,SAAc,EAChD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,+BAA+B,EAAE,cAAc,CAAC,0BAA0B,CAAC;CAO3F;AAED,MAAM,WAAW,iBAAkB,SAAQ,gBAAgB;IACzD;;;OAGG;IACH,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;CACxB;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EAAE,KAAK,iBAAiB,IAAI,iBAAiB,EAAE,CAAC;CACxD;AAED,OAAO,EAAE,KAAK,+BAA+B,EAAE,CAAC"}
+37
View File
@@ -0,0 +1,37 @@
import { APIResource } from "../../../core/resource.js";
import * as CompletionsAPI from "./completions.js";
import { ChatCompletionStoreMessagesPage } from "./completions.js";
import { type CursorPageParams, PagePromise } from "../../../core/pagination.js";
import { RequestOptions } from "../../../internal/request-options.js";
/**
* Given a list of messages comprising a conversation, the model will return a response.
*/
export declare class Messages extends 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: string, query?: MessageListParams | null | undefined, options?: RequestOptions): PagePromise<ChatCompletionStoreMessagesPage, CompletionsAPI.ChatCompletionStoreMessage>;
}
export interface MessageListParams extends CursorPageParams {
/**
* Sort order for messages by timestamp. Use `asc` for ascending order or `desc`
* for descending order. Defaults to `asc`.
*/
order?: 'asc' | 'desc';
}
export declare namespace Messages {
export { type MessageListParams as MessageListParams };
}
export { type ChatCompletionStoreMessagesPage };
//# sourceMappingURL=messages.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../src/resources/chat/completions/messages.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,cAAc;OACnB,EAAE,+BAA+B,EAAE;OACnC,EAAc,KAAK,gBAAgB,EAAE,WAAW,EAAE;OAClD,EAAE,cAAc,EAAE;AAGzB;;GAEG;AACH,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;;OAaG;IACH,IAAI,CACF,YAAY,EAAE,MAAM,EACpB,KAAK,GAAE,iBAAiB,GAAG,IAAI,GAAG,SAAc,EAChD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,+BAA+B,EAAE,cAAc,CAAC,0BAA0B,CAAC;CAO3F;AAED,MAAM,WAAW,iBAAkB,SAAQ,gBAAgB;IACzD;;;OAGG;IACH,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;CACxB;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EAAE,KAAK,iBAAiB,IAAI,iBAAiB,EAAE,CAAC;CACxD;AAED,OAAO,EAAE,KAAK,+BAA+B,EAAE,CAAC"}
+31
View File
@@ -0,0 +1,31 @@
"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");
/**
* Given a list of messages comprising a conversation, the model will return a response.
*/
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
@@ -0,0 +1 @@
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/resources/chat/completions/messages.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAqD;AAGrD,4DAA0F;AAE1F,0DAAoD;AAEpD;;GAEG;AACH,MAAa,QAAS,SAAQ,sBAAW;IACvC;;;;;;;;;;;;;OAaG;IACH,IAAI,CACF,YAAoB,EACpB,QAA8C,EAAE,EAChD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,IAAA,WAAI,EAAA,qBAAqB,YAAY,WAAW,EAChD,CAAA,uBAAqD,CAAA,EACrD,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CACtB,CAAC;IACJ,CAAC;CACF;AA1BD,4BA0BC"}
+27
View File
@@ -0,0 +1,27 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../../core/resource.mjs";
import { CursorPage } from "../../../core/pagination.mjs";
import { path } from "../../../internal/utils/path.mjs";
/**
* Given a list of messages comprising a conversation, the model will return a response.
*/
export class Messages extends 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(path `/chat/completions/${completionID}/messages`, (CursorPage), { query, ...options });
}
}
//# sourceMappingURL=messages.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"messages.mjs","sourceRoot":"","sources":["../../../src/resources/chat/completions/messages.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,UAAU,EAAsC;OAElD,EAAE,IAAI,EAAE;AAEf;;GAEG;AACH,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;;OAaG;IACH,IAAI,CACF,YAAoB,EACpB,QAA8C,EAAE,EAChD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,IAAI,CAAA,qBAAqB,YAAY,WAAW,EAChD,CAAA,UAAqD,CAAA,EACrD,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CACtB,CAAC;IACJ,CAAC;CACF"}