Fix chat interface - restore continuous conversation flow

🎯 Major improvements to MissionControl component:
- Always keep input field visible and functional after AI responses
- Auto-clear input after submitting questions for better UX
- Add dynamic visual indicators (first question vs follow-up)
- Improve response layout with clear separation and hints
- Enable proper chat-like experience for continuous learning

🌟 Additional enhancements:
- Better language-specific messaging throughout interface
- Clearer visual hierarchy between input and response areas
- Intuitive flow that guides users to ask follow-up questions
- Maintains responsive design and accessibility

🔧 Technical changes:
- Enhanced MissionControl state management
- Improved component layout and styling
- Better TypeScript integration across components
- Updated tsconfig for stricter type checking
This commit is contained in:
rwiegand
2025-07-14 12:39:05 +02:00
parent b31492a354
commit f893530471
1798 changed files with 25329 additions and 92638 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -1,20 +1,13 @@
import { APIResource } from "../../../core/resource.js";
import { APIResource } from "../../../resource.js";
import { APIPromise } from "../../../core.js";
import * as Core from "../../../core.js";
import * as CompletionsCompletionsAPI from "./completions.js";
import * as CompletionsAPI from "../../completions.js";
import * as Shared from "../../shared.js";
import * as MessagesAPI from "./messages.js";
import { MessageListParams, Messages } from "./messages.js";
import { APIPromise } from "../../../core/api-promise.js";
import { CursorPage, type CursorPageParams, PagePromise } from "../../../core/pagination.js";
import { Stream } from "../../../core/streaming.js";
import { RequestOptions } from "../../../internal/request-options.js";
import { ChatCompletionRunner } from "../../../lib/ChatCompletionRunner.js";
import { ChatCompletionStreamingRunner } from "../../../lib/ChatCompletionStreamingRunner.js";
import { RunnerOptions } from "../../../lib/AbstractChatCompletionRunner.js";
import { ChatCompletionToolRunnerParams } from "../../../lib/ChatCompletionRunner.js";
import { ChatCompletionStreamingToolRunnerParams } from "../../../lib/ChatCompletionStreamingRunner.js";
import { ChatCompletionStream, type ChatCompletionStreamParams } from "../../../lib/ChatCompletionStream.js";
import { ExtractParsedContentFromParams } from "../../../lib/parser.js";
import { CursorPage, type CursorPageParams } from "../../../pagination.js";
import { Stream } from "../../../streaming.js";
export declare class Completions extends APIResource {
messages: MessagesAPI.Messages;
/**
@@ -46,9 +39,9 @@ export declare class Completions extends APIResource {
* );
* ```
*/
create(body: ChatCompletionCreateParamsNonStreaming, options?: RequestOptions): APIPromise<ChatCompletion>;
create(body: ChatCompletionCreateParamsStreaming, options?: RequestOptions): APIPromise<Stream<ChatCompletionChunk>>;
create(body: ChatCompletionCreateParamsBase, options?: RequestOptions): APIPromise<Stream<ChatCompletionChunk> | ChatCompletion>;
create(body: ChatCompletionCreateParamsNonStreaming, options?: Core.RequestOptions): APIPromise<ChatCompletion>;
create(body: ChatCompletionCreateParamsStreaming, options?: Core.RequestOptions): APIPromise<Stream<ChatCompletionChunk>>;
create(body: ChatCompletionCreateParamsBase, options?: Core.RequestOptions): APIPromise<Stream<ChatCompletionChunk> | ChatCompletion>;
/**
* Get a stored chat completion. Only Chat Completions that have been created with
* the `store` parameter set to `true` will be returned.
@@ -59,7 +52,7 @@ export declare class Completions extends APIResource {
* await client.chat.completions.retrieve('completion_id');
* ```
*/
retrieve(completionID: string, options?: RequestOptions): APIPromise<ChatCompletion>;
retrieve(completionId: string, options?: Core.RequestOptions): Core.APIPromise<ChatCompletion>;
/**
* 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
@@ -73,7 +66,7 @@ export declare class Completions extends APIResource {
* );
* ```
*/
update(completionID: string, body: ChatCompletionUpdateParams, options?: RequestOptions): APIPromise<ChatCompletion>;
update(completionId: string, body: ChatCompletionUpdateParams, options?: Core.RequestOptions): Core.APIPromise<ChatCompletion>;
/**
* List stored Chat Completions. Only Chat Completions that have been stored with
* the `store` parameter set to `true` will be returned.
@@ -86,7 +79,8 @@ export declare class Completions extends APIResource {
* }
* ```
*/
list(query?: ChatCompletionListParams | null | undefined, options?: RequestOptions): PagePromise<ChatCompletionsPage, ChatCompletion>;
list(query?: ChatCompletionListParams, options?: Core.RequestOptions): Core.PagePromise<ChatCompletionsPage, ChatCompletion>;
list(options?: Core.RequestOptions): Core.PagePromise<ChatCompletionsPage, ChatCompletion>;
/**
* Delete a stored chat completion. Only Chat Completions that have been created
* with the `store` parameter set to `true` can be deleted.
@@ -94,52 +88,15 @@ export declare class Completions extends APIResource {
* @example
* ```ts
* const chatCompletionDeleted =
* await client.chat.completions.delete('completion_id');
* await client.chat.completions.del('completion_id');
* ```
*/
delete(completionID: string, options?: RequestOptions): APIPromise<ChatCompletionDeleted>;
parse<Params extends ChatCompletionParseParams, ParsedT = ExtractParsedContentFromParams<Params>>(body: Params, options?: RequestOptions): APIPromise<ParsedChatCompletion<ParsedT>>;
/**
* A convenience helper for using tool calls with the /chat/completions endpoint
* which automatically calls the JavaScript functions you provide and sends their
* results back to the /chat/completions endpoint, looping as long as the model
* requests function calls.
*
* For more details and examples, see
* [the docs](https://github.com/openai/openai-node#automated-function-calls)
*/
runTools<Params extends ChatCompletionToolRunnerParams<any>, ParsedT = ExtractParsedContentFromParams<Params>>(body: Params, options?: RunnerOptions): ChatCompletionRunner<ParsedT>;
runTools<Params extends ChatCompletionStreamingToolRunnerParams<any>, ParsedT = ExtractParsedContentFromParams<Params>>(body: Params, options?: RunnerOptions): ChatCompletionStreamingRunner<ParsedT>;
/**
* Creates a chat completion stream
*/
stream<Params extends ChatCompletionStreamParams, ParsedT = ExtractParsedContentFromParams<Params>>(body: Params, options?: RequestOptions): ChatCompletionStream<ParsedT>;
del(completionId: string, options?: Core.RequestOptions): Core.APIPromise<ChatCompletionDeleted>;
}
export interface ParsedFunction extends ChatCompletionMessageToolCall.Function {
parsed_arguments?: unknown;
export declare class ChatCompletionsPage extends CursorPage<ChatCompletion> {
}
export interface ParsedFunctionToolCall extends ChatCompletionMessageToolCall {
function: ParsedFunction;
export declare class ChatCompletionStoreMessagesPage extends CursorPage<ChatCompletionStoreMessage> {
}
export interface ParsedChatCompletionMessage<ParsedT> extends ChatCompletionMessage {
parsed: ParsedT | null;
tool_calls?: Array<ParsedFunctionToolCall>;
}
export interface ParsedChoice<ParsedT> extends ChatCompletion.Choice {
message: ParsedChatCompletionMessage<ParsedT>;
}
export interface ParsedChatCompletion<ParsedT> extends ChatCompletion {
choices: Array<ParsedChoice<ParsedT>>;
}
export type ChatCompletionParseParams = ChatCompletionCreateParamsNonStreaming;
export { ChatCompletionStreamingRunner } from "../../../lib/ChatCompletionStreamingRunner.js";
export { type RunnableFunctionWithParse, type RunnableFunctionWithoutParse, ParsingToolFunction, } from "../../../lib/RunnableFunction.js";
export { type ChatCompletionToolRunnerParams } from "../../../lib/ChatCompletionRunner.js";
export { type ChatCompletionStreamingToolRunnerParams } from "../../../lib/ChatCompletionStreamingRunner.js";
export { ChatCompletionStream, type ChatCompletionStreamParams } from "../../../lib/ChatCompletionStream.js";
export { ChatCompletionRunner } from "../../../lib/ChatCompletionRunner.js";
export type ChatCompletionsPage = CursorPage<ChatCompletion>;
export type ChatCompletionStoreMessagesPage = CursorPage<ChatCompletionStoreMessage>;
/**
* Represents a chat completion response returned by model, based on the provided
* input.
@@ -167,25 +124,25 @@ export interface ChatCompletion {
*/
object: 'chat.completion';
/**
* Specifies the processing type used for serving the request.
* Specifies the latency tier to use for processing the request. This parameter is
* relevant for customers subscribed to the scale tier service:
*
* - If set to 'auto', then the request will be processed with the service tier
* configured in the Project settings. Unless otherwise configured, the Project
* will use 'default'.
* - If set to 'default', then the requset will be processed with the standard
* pricing and performance for the selected model.
* - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or
* 'priority', then the request will be processed with the corresponding service
* tier. [Contact sales](https://openai.com/contact-sales) to learn more about
* Priority processing.
* - If set to 'auto', and the Project is Scale tier enabled, the system will
* utilize scale tier credits until they are exhausted.
* - If set to 'auto', and the Project is not Scale tier enabled, the request will
* be processed using the default service tier with a lower uptime SLA and no
* latency guarentee.
* - If set to 'default', the request will be processed using the default service
* tier with a lower uptime SLA and no latency guarentee.
* - If set to 'flex', the request will be processed with the Flex Processing
* service tier.
* [Learn more](https://platform.openai.com/docs/guides/flex-processing).
* - When not set, the default behavior is 'auto'.
*
* When the `service_tier` parameter is set, the response body will include the
* `service_tier` value based on the processing mode actually used to serve the
* request. This response value may be different from the value set in the
* parameter.
* When this parameter is set, the response body will include the `service_tier`
* utilized.
*/
service_tier?: 'auto' | 'default' | 'flex' | 'scale' | 'priority' | null;
service_tier?: 'auto' | 'default' | 'flex' | null;
/**
* This fingerprint represents the backend configuration that the model runs with.
*
@@ -376,25 +333,25 @@ export interface ChatCompletionChunk {
*/
object: 'chat.completion.chunk';
/**
* Specifies the processing type used for serving the request.
* Specifies the latency tier to use for processing the request. This parameter is
* relevant for customers subscribed to the scale tier service:
*
* - If set to 'auto', then the request will be processed with the service tier
* configured in the Project settings. Unless otherwise configured, the Project
* will use 'default'.
* - If set to 'default', then the requset will be processed with the standard
* pricing and performance for the selected model.
* - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or
* 'priority', then the request will be processed with the corresponding service
* tier. [Contact sales](https://openai.com/contact-sales) to learn more about
* Priority processing.
* - If set to 'auto', and the Project is Scale tier enabled, the system will
* utilize scale tier credits until they are exhausted.
* - If set to 'auto', and the Project is not Scale tier enabled, the request will
* be processed using the default service tier with a lower uptime SLA and no
* latency guarentee.
* - If set to 'default', the request will be processed using the default service
* tier with a lower uptime SLA and no latency guarentee.
* - If set to 'flex', the request will be processed with the Flex Processing
* service tier.
* [Learn more](https://platform.openai.com/docs/guides/flex-processing).
* - When not set, the default behavior is 'auto'.
*
* When the `service_tier` parameter is set, the response body will include the
* `service_tier` value based on the processing mode actually used to serve the
* request. This response value may be different from the value set in the
* parameter.
* When this parameter is set, the response body will include the `service_tier`
* utilized.
*/
service_tier?: 'auto' | 'default' | 'flex' | 'scale' | 'priority' | null;
service_tier?: 'auto' | 'default' | 'flex' | null;
/**
* This fingerprint represents the backend configuration that the model runs with.
* Can be used in conjunction with the `seed` request parameter to understand when
@@ -999,6 +956,10 @@ export interface ChatCompletionUserMessageParam {
*/
name?: string;
}
/**
* @deprecated ChatCompletionMessageParam should be used instead
*/
export type CreateChatCompletionRequestMessage = ChatCompletionMessageParam;
export type ChatCompletionReasoningEffort = Shared.ReasoningEffort | null;
export type ChatCompletionCreateParams = ChatCompletionCreateParamsNonStreaming | ChatCompletionCreateParamsStreaming;
export interface ChatCompletionCreateParamsBase {
@@ -1064,9 +1025,7 @@ export interface ChatCompletionCreateParamsBase {
* increase likelihood of selection; values like -100 or 100 should result in a ban
* or exclusive selection of the relevant token.
*/
logit_bias?: {
[key: string]: number;
} | null;
logit_bias?: Record<string, number> | null;
/**
* Whether to return log probabilities of the output tokens or not. If true,
* returns the log probabilities of each output token returned in the `content` of
@@ -1165,25 +1124,25 @@ export interface ChatCompletionCreateParamsBase {
*/
seed?: number | null;
/**
* Specifies the processing type used for serving the request.
* Specifies the latency tier to use for processing the request. This parameter is
* relevant for customers subscribed to the scale tier service:
*
* - If set to 'auto', then the request will be processed with the service tier
* configured in the Project settings. Unless otherwise configured, the Project
* will use 'default'.
* - If set to 'default', then the requset will be processed with the standard
* pricing and performance for the selected model.
* - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or
* 'priority', then the request will be processed with the corresponding service
* tier. [Contact sales](https://openai.com/contact-sales) to learn more about
* Priority processing.
* - If set to 'auto', and the Project is Scale tier enabled, the system will
* utilize scale tier credits until they are exhausted.
* - If set to 'auto', and the Project is not Scale tier enabled, the request will
* be processed using the default service tier with a lower uptime SLA and no
* latency guarentee.
* - If set to 'default', the request will be processed using the default service
* tier with a lower uptime SLA and no latency guarentee.
* - If set to 'flex', the request will be processed with the Flex Processing
* service tier.
* [Learn more](https://platform.openai.com/docs/guides/flex-processing).
* - When not set, the default behavior is 'auto'.
*
* When the `service_tier` parameter is set, the response body will include the
* `service_tier` value based on the processing mode actually used to serve the
* request. This response value may be different from the value set in the
* parameter.
* When this parameter is set, the response body will include the `service_tier`
* utilized.
*/
service_tier?: 'auto' | 'default' | 'flex' | 'scale' | 'priority' | null;
service_tier?: 'auto' | 'default' | 'flex' | null;
/**
* Not supported with latest reasoning models `o3` and `o4-mini`.
*
@@ -1195,8 +1154,6 @@ export interface ChatCompletionCreateParamsBase {
* Whether or not to store the output of this chat completion request for use in
* our [model distillation](https://platform.openai.com/docs/guides/distillation)
* or [evals](https://platform.openai.com/docs/guides/evals) products.
*
* Supports text and image inputs. Note: image inputs over 10MB will be dropped.
*/
store?: boolean | null;
/**
@@ -1351,6 +1308,10 @@ export declare namespace ChatCompletionCreateParams {
type ChatCompletionCreateParamsNonStreaming = CompletionsCompletionsAPI.ChatCompletionCreateParamsNonStreaming;
type ChatCompletionCreateParamsStreaming = CompletionsCompletionsAPI.ChatCompletionCreateParamsStreaming;
}
/**
* @deprecated Use ChatCompletionCreateParams instead
*/
export type CompletionCreateParams = ChatCompletionCreateParams;
export interface ChatCompletionCreateParamsNonStreaming extends ChatCompletionCreateParamsBase {
/**
* If set to true, the model response data will be streamed to the client as it is
@@ -1364,6 +1325,10 @@ export interface ChatCompletionCreateParamsNonStreaming extends ChatCompletionCr
*/
stream?: false | null;
}
/**
* @deprecated Use ChatCompletionCreateParamsNonStreaming instead
*/
export type CompletionCreateParamsNonStreaming = ChatCompletionCreateParamsNonStreaming;
export interface ChatCompletionCreateParamsStreaming extends ChatCompletionCreateParamsBase {
/**
* If set to true, the model response data will be streamed to the client as it is
@@ -1377,6 +1342,10 @@ export interface ChatCompletionCreateParamsStreaming extends ChatCompletionCreat
*/
stream: true;
}
/**
* @deprecated Use ChatCompletionCreateParamsStreaming instead
*/
export type CompletionCreateParamsStreaming = ChatCompletionCreateParamsStreaming;
export interface ChatCompletionUpdateParams {
/**
* Set of 16 key-value pairs that can be attached to an object. This can be useful
@@ -1388,6 +1357,10 @@ export interface ChatCompletionUpdateParams {
*/
metadata: Shared.Metadata | null;
}
/**
* @deprecated Use ChatCompletionUpdateParams instead
*/
export type CompletionUpdateParams = ChatCompletionUpdateParams;
export interface ChatCompletionListParams extends CursorPageParams {
/**
* A list of metadata keys to filter the Chat Completions by. Example:
@@ -1405,8 +1378,12 @@ export interface ChatCompletionListParams extends CursorPageParams {
*/
order?: 'asc' | 'desc';
}
/**
* @deprecated Use ChatCompletionListParams instead
*/
export type CompletionListParams = ChatCompletionListParams;
export declare namespace Completions {
export { type ChatCompletion as ChatCompletion, type ChatCompletionAssistantMessageParam as ChatCompletionAssistantMessageParam, type ChatCompletionAudio as ChatCompletionAudio, type ChatCompletionAudioParam as ChatCompletionAudioParam, type ChatCompletionChunk as ChatCompletionChunk, type ChatCompletionContentPart as ChatCompletionContentPart, type ChatCompletionContentPartImage as ChatCompletionContentPartImage, type ChatCompletionContentPartInputAudio as ChatCompletionContentPartInputAudio, type ChatCompletionContentPartRefusal as ChatCompletionContentPartRefusal, type ChatCompletionContentPartText as ChatCompletionContentPartText, type ChatCompletionDeleted as ChatCompletionDeleted, type ChatCompletionDeveloperMessageParam as ChatCompletionDeveloperMessageParam, type ChatCompletionFunctionCallOption as ChatCompletionFunctionCallOption, type ChatCompletionFunctionMessageParam as ChatCompletionFunctionMessageParam, type ChatCompletionMessage as ChatCompletionMessage, type ChatCompletionMessageParam as ChatCompletionMessageParam, type ChatCompletionMessageToolCall as ChatCompletionMessageToolCall, type ChatCompletionModality as ChatCompletionModality, type ChatCompletionNamedToolChoice as ChatCompletionNamedToolChoice, type ChatCompletionPredictionContent as ChatCompletionPredictionContent, type ChatCompletionRole as ChatCompletionRole, type ChatCompletionStoreMessage as ChatCompletionStoreMessage, type ChatCompletionStreamOptions as ChatCompletionStreamOptions, type ChatCompletionSystemMessageParam as ChatCompletionSystemMessageParam, type ChatCompletionTokenLogprob as ChatCompletionTokenLogprob, type ChatCompletionTool as ChatCompletionTool, type ChatCompletionToolChoiceOption as ChatCompletionToolChoiceOption, type ChatCompletionToolMessageParam as ChatCompletionToolMessageParam, type ChatCompletionUserMessageParam as ChatCompletionUserMessageParam, type ChatCompletionReasoningEffort as ChatCompletionReasoningEffort, type ChatCompletionsPage as ChatCompletionsPage, type ChatCompletionCreateParams as ChatCompletionCreateParams, type ChatCompletionCreateParamsNonStreaming as ChatCompletionCreateParamsNonStreaming, type ChatCompletionCreateParamsStreaming as ChatCompletionCreateParamsStreaming, type ChatCompletionUpdateParams as ChatCompletionUpdateParams, type ChatCompletionListParams as ChatCompletionListParams, };
export { type ChatCompletion as ChatCompletion, type ChatCompletionAssistantMessageParam as ChatCompletionAssistantMessageParam, type ChatCompletionAudio as ChatCompletionAudio, type ChatCompletionAudioParam as ChatCompletionAudioParam, type ChatCompletionChunk as ChatCompletionChunk, type ChatCompletionContentPart as ChatCompletionContentPart, type ChatCompletionContentPartImage as ChatCompletionContentPartImage, type ChatCompletionContentPartInputAudio as ChatCompletionContentPartInputAudio, type ChatCompletionContentPartRefusal as ChatCompletionContentPartRefusal, type ChatCompletionContentPartText as ChatCompletionContentPartText, type ChatCompletionDeleted as ChatCompletionDeleted, type ChatCompletionDeveloperMessageParam as ChatCompletionDeveloperMessageParam, type ChatCompletionFunctionCallOption as ChatCompletionFunctionCallOption, type ChatCompletionFunctionMessageParam as ChatCompletionFunctionMessageParam, type ChatCompletionMessage as ChatCompletionMessage, type ChatCompletionMessageParam as ChatCompletionMessageParam, type ChatCompletionMessageToolCall as ChatCompletionMessageToolCall, type ChatCompletionModality as ChatCompletionModality, type ChatCompletionNamedToolChoice as ChatCompletionNamedToolChoice, type ChatCompletionPredictionContent as ChatCompletionPredictionContent, type ChatCompletionRole as ChatCompletionRole, type ChatCompletionStoreMessage as ChatCompletionStoreMessage, type ChatCompletionStreamOptions as ChatCompletionStreamOptions, type ChatCompletionSystemMessageParam as ChatCompletionSystemMessageParam, type ChatCompletionTokenLogprob as ChatCompletionTokenLogprob, type ChatCompletionTool as ChatCompletionTool, type ChatCompletionToolChoiceOption as ChatCompletionToolChoiceOption, type ChatCompletionToolMessageParam as ChatCompletionToolMessageParam, type ChatCompletionUserMessageParam as ChatCompletionUserMessageParam, type CreateChatCompletionRequestMessage as CreateChatCompletionRequestMessage, type ChatCompletionReasoningEffort as ChatCompletionReasoningEffort, ChatCompletionsPage as ChatCompletionsPage, type ChatCompletionCreateParams as ChatCompletionCreateParams, type CompletionCreateParams as CompletionCreateParams, type ChatCompletionCreateParamsNonStreaming as ChatCompletionCreateParamsNonStreaming, type CompletionCreateParamsNonStreaming as CompletionCreateParamsNonStreaming, type ChatCompletionCreateParamsStreaming as ChatCompletionCreateParamsStreaming, type CompletionCreateParamsStreaming as CompletionCreateParamsStreaming, type ChatCompletionUpdateParams as ChatCompletionUpdateParams, type CompletionUpdateParams as CompletionUpdateParams, type ChatCompletionListParams as ChatCompletionListParams, type CompletionListParams as CompletionListParams, };
export { Messages as Messages, type MessageListParams as MessageListParams };
}
//# sourceMappingURL=completions.d.ts.map

File diff suppressed because one or more lines are too long

View File

@@ -1,17 +1,35 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
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"));
exports.ChatCompletionStoreMessagesPage = exports.ChatCompletionsPage = exports.Completions = void 0;
const resource_1 = require("../../../resource.js");
const core_1 = require("../../../core.js");
const MessagesAPI = __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");
const pagination_1 = require("../../../pagination.js");
class Completions extends resource_1.APIResource {
constructor() {
super(...arguments);
@@ -30,8 +48,8 @@ class Completions extends resource_1.APIResource {
* await client.chat.completions.retrieve('completion_id');
* ```
*/
retrieve(completionID, options) {
return this._client.get((0, path_1.path) `/chat/completions/${completionID}`, options);
retrieve(completionId, options) {
return this._client.get(`/chat/completions/${completionId}`, options);
}
/**
* Modify a stored chat completion. Only Chat Completions that have been created
@@ -46,23 +64,14 @@ class Completions extends resource_1.APIResource {
* );
* ```
*/
update(completionID, body, options) {
return this._client.post((0, path_1.path) `/chat/completions/${completionID}`, { body, ...options });
update(completionId, body, options) {
return this._client.post(`/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 });
if ((0, core_1.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
@@ -71,45 +80,20 @@ class Completions extends resource_1.APIResource {
* @example
* ```ts
* const chatCompletionDeleted =
* await client.chat.completions.delete('completion_id');
* await client.chat.completions.del('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);
del(completionId, options) {
return this._client.delete(`/chat/completions/${completionId}`, 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; } });
class ChatCompletionsPage extends pagination_1.CursorPage {
}
exports.ChatCompletionsPage = ChatCompletionsPage;
class ChatCompletionStoreMessagesPage extends pagination_1.CursorPage {
}
exports.ChatCompletionStoreMessagesPage = ChatCompletionStoreMessagesPage;
Completions.ChatCompletionsPage = ChatCompletionsPage;
Completions.Messages = messages_1.Messages;
//# sourceMappingURL=completions.js.map

View File

@@ -1 +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,MAAa,WAAY,SAAQ,sBAAW;IAA5C;;QACE,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAoL1E,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,CAAA,uBAA0B,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzG,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,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IAClG,CAAC;IAED;;;;;;;;;OASG;IACH,GAAG,CAAC,YAAoB,EAAE,OAA6B;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,qBAAqB,YAAY,EAAE,EAAE,OAAO,CAAC,CAAC;IAC3E,CAAC;CACF;AAhID,kCAgIC;AAED,MAAa,mBAAoB,SAAQ,uBAA0B;CAAG;AAAtE,kDAAsE;AAEtE,MAAa,+BAAgC,SAAQ,uBAAsC;CAAG;AAA9F,0EAA8F;AAm+C9F,WAAW,CAAC,mBAAmB,GAAG,mBAAmB,CAAC;AACtD,WAAW,CAAC,QAAQ,GAAG,mBAAQ,CAAC"}

View File

@@ -1,13 +1,9 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../../core/resource.mjs";
import { APIResource } from "../../../resource.mjs";
import { isRequestOptions } from "../../../core.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";
import { CursorPage } from "../../../pagination.mjs";
export class Completions extends APIResource {
constructor() {
super(...arguments);
@@ -26,8 +22,8 @@ export class Completions extends APIResource {
* await client.chat.completions.retrieve('completion_id');
* ```
*/
retrieve(completionID, options) {
return this._client.get(path `/chat/completions/${completionID}`, options);
retrieve(completionId, options) {
return this._client.get(`/chat/completions/${completionId}`, options);
}
/**
* Modify a stored chat completion. Only Chat Completions that have been created
@@ -42,23 +38,14 @@ export class Completions extends APIResource {
* );
* ```
*/
update(completionID, body, options) {
return this._client.post(path `/chat/completions/${completionID}`, { body, ...options });
update(completionId, body, options) {
return this._client.post(`/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 });
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
@@ -67,40 +54,17 @@ export class Completions extends APIResource {
* @example
* ```ts
* const chatCompletionDeleted =
* await client.chat.completions.delete('completion_id');
* await client.chat.completions.del('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);
del(completionId, options) {
return this._client.delete(`/chat/completions/${completionId}`, 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";
export class ChatCompletionsPage extends CursorPage {
}
export class ChatCompletionStoreMessagesPage extends CursorPage {
}
Completions.ChatCompletionsPage = ChatCompletionsPage;
Completions.Messages = Messages;
//# sourceMappingURL=completions.mjs.map

View File

@@ -1 +1 @@
{"version":3,"file":"completions.mjs","sourceRoot":"","sources":["../../../src/resources/chat/completions/completions.ts"],"names":[],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EAAE,OAA6B;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,qBAAqB,YAAY,EAAE,EAAE,OAAO,CAAC,CAAC;IAC3E,CAAC;CACF;AAED,MAAM,OAAO,mBAAoB,SAAQ,UAA0B;CAAG;AAEtE,MAAM,OAAO,+BAAgC,SAAQ,UAAsC;CAAG;AAm+C9F,WAAW,CAAC,mBAAmB,GAAG,mBAAmB,CAAC;AACtD,WAAW,CAAC,QAAQ,GAAG,QAAQ,CAAC"}

View File

@@ -1,4 +0,0 @@
export { Completions, type ChatCompletion, type ChatCompletionAssistantMessageParam, type ChatCompletionAudio, type ChatCompletionAudioParam, type ChatCompletionChunk, type ChatCompletionContentPart, type ChatCompletionContentPartImage, type ChatCompletionContentPartInputAudio, type ChatCompletionContentPartRefusal, type ChatCompletionContentPartText, type ChatCompletionDeleted, type ChatCompletionDeveloperMessageParam, type ChatCompletionFunctionCallOption, type ChatCompletionFunctionMessageParam, type ChatCompletionMessage, type ChatCompletionMessageParam, type ChatCompletionMessageToolCall, type ChatCompletionModality, type ChatCompletionNamedToolChoice, type ChatCompletionPredictionContent, type ChatCompletionRole, type ChatCompletionStoreMessage, type ChatCompletionStreamOptions, type ChatCompletionSystemMessageParam, type ChatCompletionTokenLogprob, type ChatCompletionTool, type ChatCompletionToolChoiceOption, type ChatCompletionToolMessageParam, type ChatCompletionUserMessageParam, 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

View File

@@ -1 +0,0 @@
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/resources/chat/completions/index.ts"],"names":[],"mappings":"OAEO,EACL,WAAW,EACX,KAAK,cAAc,EACnB,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,qBAAqB,EAC1B,KAAK,mCAAmC,EACxC,KAAK,gCAAgC,EACrC,KAAK,kCAAkC,EACvC,KAAK,qBAAqB,EAC1B,KAAK,0BAA0B,EAC/B,KAAK,6BAA6B,EAClC,KAAK,sBAAsB,EAC3B,KAAK,6BAA6B,EAClC,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,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"}

View File

@@ -1,4 +1,3 @@
export { Completions, type ChatCompletion, type ChatCompletionAssistantMessageParam, type ChatCompletionAudio, type ChatCompletionAudioParam, type ChatCompletionChunk, type ChatCompletionContentPart, type ChatCompletionContentPartImage, type ChatCompletionContentPartInputAudio, type ChatCompletionContentPartRefusal, type ChatCompletionContentPartText, type ChatCompletionDeleted, type ChatCompletionDeveloperMessageParam, type ChatCompletionFunctionCallOption, type ChatCompletionFunctionMessageParam, type ChatCompletionMessage, type ChatCompletionMessageParam, type ChatCompletionMessageToolCall, type ChatCompletionModality, type ChatCompletionNamedToolChoice, type ChatCompletionPredictionContent, type ChatCompletionRole, type ChatCompletionStoreMessage, type ChatCompletionStreamOptions, type ChatCompletionSystemMessageParam, type ChatCompletionTokenLogprob, type ChatCompletionTool, type ChatCompletionToolChoiceOption, type ChatCompletionToolMessageParam, type ChatCompletionUserMessageParam, type ChatCompletionCreateParams, type ChatCompletionCreateParamsNonStreaming, type ChatCompletionCreateParamsStreaming, type ChatCompletionUpdateParams, type ChatCompletionListParams, type ChatCompletionStoreMessagesPage, type ChatCompletionsPage, } from "./completions.js";
export * from "./completions.js";
export { ChatCompletionStoreMessagesPage, ChatCompletionsPage, Completions, type ChatCompletion, type ChatCompletionAssistantMessageParam, type ChatCompletionAudio, type ChatCompletionAudioParam, type ChatCompletionChunk, type ChatCompletionContentPart, type ChatCompletionContentPartImage, type ChatCompletionContentPartInputAudio, type ChatCompletionContentPartRefusal, type ChatCompletionContentPartText, type ChatCompletionDeleted, type ChatCompletionDeveloperMessageParam, type ChatCompletionFunctionCallOption, type ChatCompletionFunctionMessageParam, type ChatCompletionMessage, type ChatCompletionMessageParam, type ChatCompletionMessageToolCall, type ChatCompletionModality, type ChatCompletionNamedToolChoice, type ChatCompletionPredictionContent, type ChatCompletionRole, type ChatCompletionStoreMessage, type ChatCompletionStreamOptions, type ChatCompletionSystemMessageParam, type ChatCompletionTokenLogprob, type ChatCompletionTool, type ChatCompletionToolChoiceOption, type ChatCompletionToolMessageParam, type ChatCompletionUserMessageParam, type CreateChatCompletionRequestMessage, type ChatCompletionCreateParams, type CompletionCreateParams, type ChatCompletionCreateParamsNonStreaming, type CompletionCreateParamsNonStreaming, type ChatCompletionCreateParamsStreaming, type CompletionCreateParamsStreaming, type ChatCompletionUpdateParams, type CompletionUpdateParams, type ChatCompletionListParams, type CompletionListParams, } from "./completions.js";
export { Messages, type MessageListParams } from "./messages.js";
//# sourceMappingURL=index.d.ts.map

View File

@@ -1 +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,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,qBAAqB,EAC1B,KAAK,mCAAmC,EACxC,KAAK,gCAAgC,EACrC,KAAK,kCAAkC,EACvC,KAAK,qBAAqB,EAC1B,KAAK,0BAA0B,EAC/B,KAAK,6BAA6B,EAClC,KAAK,sBAAsB,EAC3B,KAAK,6BAA6B,EAClC,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,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"}
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/resources/chat/completions/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,+BAA+B,EAC/B,mBAAmB,EACnB,WAAW,EACX,KAAK,cAAc,EACnB,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,qBAAqB,EAC1B,KAAK,mCAAmC,EACxC,KAAK,gCAAgC,EACrC,KAAK,kCAAkC,EACvC,KAAK,qBAAqB,EAC1B,KAAK,0BAA0B,EAC/B,KAAK,6BAA6B,EAClC,KAAK,sBAAsB,EAC3B,KAAK,6BAA6B,EAClC,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,kCAAkC,EACvC,KAAK,0BAA0B,EAC/B,KAAK,sBAAsB,EAC3B,KAAK,sCAAsC,EAC3C,KAAK,kCAAkC,EACvC,KAAK,mCAAmC,EACxC,KAAK,+BAA+B,EACpC,KAAK,0BAA0B,EAC/B,KAAK,sBAAsB,EAC3B,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,GAC1B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,KAAK,iBAAiB,EAAE,MAAM,YAAY,CAAC"}

View File

@@ -1,11 +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");
exports.Messages = exports.Completions = exports.ChatCompletionsPage = exports.ChatCompletionStoreMessagesPage = void 0;
var completions_1 = require("./completions.js");
Object.defineProperty(exports, "ChatCompletionStoreMessagesPage", { enumerable: true, get: function () { return completions_1.ChatCompletionStoreMessagesPage; } });
Object.defineProperty(exports, "ChatCompletionsPage", { enumerable: true, get: function () { return completions_1.ChatCompletionsPage; } });
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

View File

@@ -1 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/resources/chat/completions/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,gDAsCuB;AArCrB,0GAAA,WAAW,OAAA;AAsCb,2DAA8B;AAC9B,0CAA8D;AAArD,oGAAA,QAAQ,OAAA"}
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/resources/chat/completions/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,gDA4CuB;AA3CrB,8HAAA,+BAA+B,OAAA;AAC/B,kHAAA,mBAAmB,OAAA;AACnB,0GAAA,WAAW,OAAA;AA0Cb,0CAA8D;AAArD,oGAAA,QAAQ,OAAA"}

View File

@@ -1,5 +1,4 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
export { Completions, } from "./completions.mjs";
export * from "./completions.mjs";
export { ChatCompletionStoreMessagesPage, ChatCompletionsPage, Completions, } from "./completions.mjs";
export { Messages } from "./messages.mjs";
//# sourceMappingURL=index.mjs.map

View File

@@ -1 +1 @@
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/resources/chat/completions/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,WAAW,GAqCZ;;OAEM,EAAE,QAAQ,EAA0B"}
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/resources/chat/completions/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,+BAA+B,EAC/B,mBAAmB,EACnB,WAAW,GAyCZ;OACM,EAAE,QAAQ,EAA0B"}

View File

@@ -1,34 +0,0 @@
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";
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

View File

@@ -1 +0,0 @@
{"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,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"}

View File

@@ -1,8 +1,8 @@
import { APIResource } from "../../../core/resource.js";
import { APIResource } from "../../../resource.js";
import * as Core from "../../../core.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";
import { type CursorPageParams } from "../../../pagination.js";
export declare class Messages extends APIResource {
/**
* Get the messages in a stored chat completion. Only Chat Completions that have
@@ -18,7 +18,8 @@ export declare class Messages extends APIResource {
* }
* ```
*/
list(completionID: string, query?: MessageListParams | null | undefined, options?: RequestOptions): PagePromise<ChatCompletionStoreMessagesPage, CompletionsAPI.ChatCompletionStoreMessage>;
list(completionId: string, query?: MessageListParams, options?: Core.RequestOptions): Core.PagePromise<ChatCompletionStoreMessagesPage, CompletionsAPI.ChatCompletionStoreMessage>;
list(completionId: string, options?: Core.RequestOptions): Core.PagePromise<ChatCompletionStoreMessagesPage, CompletionsAPI.ChatCompletionStoreMessage>;
}
export interface MessageListParams extends CursorPageParams {
/**
@@ -30,5 +31,5 @@ export interface MessageListParams extends CursorPageParams {
export declare namespace Messages {
export { type MessageListParams as MessageListParams };
}
export { type ChatCompletionStoreMessagesPage };
export { ChatCompletionStoreMessagesPage };
//# sourceMappingURL=messages.d.ts.map

View File

@@ -1 +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,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"}
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../src/resources/chat/completions/messages.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AACtC,OAAO,KAAK,cAAc,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;;OAaG;IACH,IAAI,CACF,YAAY,EAAE,MAAM,EACpB,KAAK,CAAC,EAAE,iBAAiB,EACzB,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAC5B,IAAI,CAAC,WAAW,CAAC,+BAA+B,EAAE,cAAc,CAAC,0BAA0B,CAAC;IAC/F,IAAI,CACF,YAAY,EAAE,MAAM,EACpB,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAC5B,IAAI,CAAC,WAAW,CAAC,+BAA+B,EAAE,cAAc,CAAC,0BAA0B,CAAC;CAehG;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,+BAA+B,EAAE,CAAC"}

View File

@@ -1,27 +1,17 @@
"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");
exports.ChatCompletionStoreMessagesPage = exports.Messages = void 0;
const resource_1 = require("../../../resource.js");
const core_1 = require("../../../core.js");
const completions_1 = require("./completions.js");
Object.defineProperty(exports, "ChatCompletionStoreMessagesPage", { enumerable: true, get: function () { return completions_1.ChatCompletionStoreMessagesPage; } });
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 });
list(completionId, query = {}, options) {
if ((0, core_1.isRequestOptions)(query)) {
return this.list(completionId, {}, query);
}
return this._client.getAPIList(`/chat/completions/${completionId}/messages`, completions_1.ChatCompletionStoreMessagesPage, { query, ...options });
}
}
exports.Messages = Messages;

View File

@@ -1 +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,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"}
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/resources/chat/completions/messages.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,mDAAgD;AAChD,2CAAiD;AAGjD,kDAAgE;AAuDvD,gHAvDA,6CAA+B,OAuDA;AApDxC,MAAa,QAAS,SAAQ,sBAAW;IAwBvC,IAAI,CACF,YAAoB,EACpB,QAAiD,EAAE,EACnD,OAA6B;QAE7B,IAAI,IAAA,uBAAgB,EAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;SAC3C;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,qBAAqB,YAAY,WAAW,EAC5C,6CAA+B,EAC/B,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CACtB,CAAC;IACJ,CAAC;CACF;AAtCD,4BAsCC"}

View File

@@ -1,24 +1,14 @@
// 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";
import { APIResource } from "../../../resource.mjs";
import { isRequestOptions } from "../../../core.mjs";
import { ChatCompletionStoreMessagesPage } from "./completions.mjs";
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 });
list(completionId, query = {}, options) {
if (isRequestOptions(query)) {
return this.list(completionId, {}, query);
}
return this._client.getAPIList(`/chat/completions/${completionId}/messages`, ChatCompletionStoreMessagesPage, { query, ...options });
}
}
export { ChatCompletionStoreMessagesPage };
//# sourceMappingURL=messages.mjs.map

View File

@@ -1 +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,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"}
{"version":3,"file":"messages.mjs","sourceRoot":"","sources":["../../../src/resources/chat/completions/messages.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,EAAE,gBAAgB,EAAE;OAGpB,EAAE,+BAA+B,EAAE;AAG1C,MAAM,OAAO,QAAS,SAAQ,WAAW;IAwBvC,IAAI,CACF,YAAoB,EACpB,QAAiD,EAAE,EACnD,OAA6B;QAE7B,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;SAC3C;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,qBAAqB,YAAY,WAAW,EAC5C,+BAA+B,EAC/B,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CACtB,CAAC;IACJ,CAAC;CACF;AAcD,OAAO,EAAE,+BAA+B,EAAE,CAAC"}