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
+73
View File
@@ -0,0 +1,73 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.Assistants = void 0;
const resource_1 = require("../../core/resource.js");
const pagination_1 = require("../../core/pagination.js");
const headers_1 = require("../../internal/headers.js");
const path_1 = require("../../internal/utils/path.js");
/**
* Build Assistants that can call models and use tools.
*/
class Assistants extends resource_1.APIResource {
/**
* Create an assistant with a model and instructions.
*
* @deprecated
*/
create(body, options) {
return this._client.post('/assistants', {
body,
...options,
headers: (0, headers_1.buildHeaders)([{ 'OpenAI-Beta': 'assistants=v2' }, options?.headers]),
});
}
/**
* Retrieves an assistant.
*
* @deprecated
*/
retrieve(assistantID, options) {
return this._client.get((0, path_1.path) `/assistants/${assistantID}`, {
...options,
headers: (0, headers_1.buildHeaders)([{ 'OpenAI-Beta': 'assistants=v2' }, options?.headers]),
});
}
/**
* Modifies an assistant.
*
* @deprecated
*/
update(assistantID, body, options) {
return this._client.post((0, path_1.path) `/assistants/${assistantID}`, {
body,
...options,
headers: (0, headers_1.buildHeaders)([{ 'OpenAI-Beta': 'assistants=v2' }, options?.headers]),
});
}
/**
* Returns a list of assistants.
*
* @deprecated
*/
list(query = {}, options) {
return this._client.getAPIList('/assistants', (pagination_1.CursorPage), {
query,
...options,
headers: (0, headers_1.buildHeaders)([{ 'OpenAI-Beta': 'assistants=v2' }, options?.headers]),
});
}
/**
* Delete an assistant.
*
* @deprecated
*/
delete(assistantID, options) {
return this._client.delete((0, path_1.path) `/assistants/${assistantID}`, {
...options,
headers: (0, headers_1.buildHeaders)([{ 'OpenAI-Beta': 'assistants=v2' }, options?.headers]),
});
}
}
exports.Assistants = Assistants;
//# sourceMappingURL=assistants.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"assistants.js","sourceRoot":"","sources":["../../src/resources/beta/assistants.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAOlD,yDAAuF;AACvF,uDAAsD;AAEtD,uDAAiD;AAGjD;;GAEG;AACH,MAAa,UAAW,SAAQ,sBAAW;IACzC;;;;OAIG;IACH,MAAM,CAAC,IAA2B,EAAE,OAAwB;QAC1D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE;YACtC,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,aAAa,EAAE,eAAe,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC9E,CAAC,CAAC;IACL,CAAC;IAED;;;;OAIG;IACH,QAAQ,CAAC,WAAmB,EAAE,OAAwB;QACpD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,eAAe,WAAW,EAAE,EAAE;YACxD,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,aAAa,EAAE,eAAe,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC9E,CAAC,CAAC;IACL,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,WAAmB,EAAE,IAA2B,EAAE,OAAwB;QAC/E,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,eAAe,WAAW,EAAE,EAAE;YACzD,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,aAAa,EAAE,eAAe,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC9E,CAAC,CAAC;IACL,CAAC;IAED;;;;OAIG;IACH,IAAI,CACF,QAAgD,EAAE,EAClD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,aAAa,EAAE,CAAA,uBAAqB,CAAA,EAAE;YACnE,KAAK;YACL,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,aAAa,EAAE,eAAe,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC9E,CAAC,CAAC;IACL,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,WAAmB,EAAE,OAAwB;QAClD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,eAAe,WAAW,EAAE,EAAE;YAC3D,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,aAAa,EAAE,eAAe,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC9E,CAAC,CAAC;IACL,CAAC;CACF;AAlED,gCAkEC"}
+69
View File
@@ -0,0 +1,69 @@
// 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 { buildHeaders } from "../../internal/headers.mjs";
import { path } from "../../internal/utils/path.mjs";
/**
* Build Assistants that can call models and use tools.
*/
export class Assistants extends APIResource {
/**
* Create an assistant with a model and instructions.
*
* @deprecated
*/
create(body, options) {
return this._client.post('/assistants', {
body,
...options,
headers: buildHeaders([{ 'OpenAI-Beta': 'assistants=v2' }, options?.headers]),
});
}
/**
* Retrieves an assistant.
*
* @deprecated
*/
retrieve(assistantID, options) {
return this._client.get(path `/assistants/${assistantID}`, {
...options,
headers: buildHeaders([{ 'OpenAI-Beta': 'assistants=v2' }, options?.headers]),
});
}
/**
* Modifies an assistant.
*
* @deprecated
*/
update(assistantID, body, options) {
return this._client.post(path `/assistants/${assistantID}`, {
body,
...options,
headers: buildHeaders([{ 'OpenAI-Beta': 'assistants=v2' }, options?.headers]),
});
}
/**
* Returns a list of assistants.
*
* @deprecated
*/
list(query = {}, options) {
return this._client.getAPIList('/assistants', (CursorPage), {
query,
...options,
headers: buildHeaders([{ 'OpenAI-Beta': 'assistants=v2' }, options?.headers]),
});
}
/**
* Delete an assistant.
*
* @deprecated
*/
delete(assistantID, options) {
return this._client.delete(path `/assistants/${assistantID}`, {
...options,
headers: buildHeaders([{ 'OpenAI-Beta': 'assistants=v2' }, options?.headers]),
});
}
}
//# sourceMappingURL=assistants.mjs.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"assistants.mjs","sourceRoot":"","sources":["../../src/resources/beta/assistants.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAOf,EAAE,UAAU,EAAsC;OAClD,EAAE,YAAY,EAAE;OAEhB,EAAE,IAAI,EAAE;AAGf;;GAEG;AACH,MAAM,OAAO,UAAW,SAAQ,WAAW;IACzC;;;;OAIG;IACH,MAAM,CAAC,IAA2B,EAAE,OAAwB;QAC1D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE;YACtC,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,aAAa,EAAE,eAAe,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC9E,CAAC,CAAC;IACL,CAAC;IAED;;;;OAIG;IACH,QAAQ,CAAC,WAAmB,EAAE,OAAwB;QACpD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,eAAe,WAAW,EAAE,EAAE;YACxD,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,aAAa,EAAE,eAAe,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC9E,CAAC,CAAC;IACL,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,WAAmB,EAAE,IAA2B,EAAE,OAAwB;QAC/E,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,eAAe,WAAW,EAAE,EAAE;YACzD,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,aAAa,EAAE,eAAe,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC9E,CAAC,CAAC;IACL,CAAC;IAED;;;;OAIG;IACH,IAAI,CACF,QAAgD,EAAE,EAClD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,aAAa,EAAE,CAAA,UAAqB,CAAA,EAAE;YACnE,KAAK;YACL,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,aAAa,EAAE,eAAe,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC9E,CAAC,CAAC;IACL,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,WAAmB,EAAE,OAAwB;QAClD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,eAAe,WAAW,EAAE,EAAE;YAC3D,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,aAAa,EAAE,eAAe,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC9E,CAAC,CAAC;IACL,CAAC;CACF"}
+21
View File
@@ -0,0 +1,21 @@
import { APIResource } from "../../core/resource.mjs";
import * as AssistantsAPI from "./assistants.mjs";
import { Assistant, AssistantCreateParams, AssistantDeleted, AssistantListParams, AssistantStreamEvent, AssistantTool, AssistantUpdateParams, Assistants, AssistantsPage, CodeInterpreterTool, FileSearchTool, FunctionTool, MessageStreamEvent, RunStepStreamEvent, RunStreamEvent, ThreadStreamEvent } from "./assistants.mjs";
import * as RealtimeAPI from "./realtime/realtime.mjs";
import { ConversationCreatedEvent, ConversationItem, ConversationItemContent, ConversationItemCreateEvent, ConversationItemCreatedEvent, ConversationItemDeleteEvent, ConversationItemDeletedEvent, ConversationItemInputAudioTranscriptionCompletedEvent, ConversationItemInputAudioTranscriptionDeltaEvent, ConversationItemInputAudioTranscriptionFailedEvent, ConversationItemRetrieveEvent, ConversationItemTruncateEvent, ConversationItemTruncatedEvent, ConversationItemWithReference, ErrorEvent, InputAudioBufferAppendEvent, InputAudioBufferClearEvent, InputAudioBufferClearedEvent, InputAudioBufferCommitEvent, InputAudioBufferCommittedEvent, InputAudioBufferSpeechStartedEvent, InputAudioBufferSpeechStoppedEvent, RateLimitsUpdatedEvent, Realtime, RealtimeClientEvent, RealtimeResponse, RealtimeResponseStatus, RealtimeResponseUsage, RealtimeServerEvent, ResponseAudioDeltaEvent, ResponseAudioDoneEvent, ResponseAudioTranscriptDeltaEvent, ResponseAudioTranscriptDoneEvent, ResponseCancelEvent, ResponseContentPartAddedEvent, ResponseContentPartDoneEvent, ResponseCreateEvent, ResponseCreatedEvent, ResponseDoneEvent, ResponseFunctionCallArgumentsDeltaEvent, ResponseFunctionCallArgumentsDoneEvent, ResponseOutputItemAddedEvent, ResponseOutputItemDoneEvent, ResponseTextDeltaEvent, ResponseTextDoneEvent, SessionCreatedEvent, SessionUpdateEvent, SessionUpdatedEvent, TranscriptionSessionUpdate, TranscriptionSessionUpdatedEvent } from "./realtime/realtime.mjs";
import * as ChatKitAPI from "./chatkit/chatkit.mjs";
import { ChatKit, ChatKitWorkflow } from "./chatkit/chatkit.mjs";
import * as ThreadsAPI from "./threads/threads.mjs";
import { AssistantResponseFormatOption, AssistantToolChoice, AssistantToolChoiceFunction, AssistantToolChoiceOption, Thread, ThreadCreateAndRunParams, ThreadCreateAndRunParamsNonStreaming, ThreadCreateAndRunParamsStreaming, ThreadCreateAndRunPollParams, ThreadCreateAndRunStreamParams, ThreadCreateParams, ThreadDeleted, ThreadUpdateParams, Threads } from "./threads/threads.mjs";
export declare class Beta extends APIResource {
realtime: RealtimeAPI.Realtime;
chatkit: ChatKitAPI.ChatKit;
assistants: AssistantsAPI.Assistants;
threads: ThreadsAPI.Threads;
}
export declare namespace Beta {
export { Realtime as Realtime, type ConversationCreatedEvent as ConversationCreatedEvent, type ConversationItem as ConversationItem, type ConversationItemContent as ConversationItemContent, type ConversationItemCreateEvent as ConversationItemCreateEvent, type ConversationItemCreatedEvent as ConversationItemCreatedEvent, type ConversationItemDeleteEvent as ConversationItemDeleteEvent, type ConversationItemDeletedEvent as ConversationItemDeletedEvent, type ConversationItemInputAudioTranscriptionCompletedEvent as ConversationItemInputAudioTranscriptionCompletedEvent, type ConversationItemInputAudioTranscriptionDeltaEvent as ConversationItemInputAudioTranscriptionDeltaEvent, type ConversationItemInputAudioTranscriptionFailedEvent as ConversationItemInputAudioTranscriptionFailedEvent, type ConversationItemRetrieveEvent as ConversationItemRetrieveEvent, type ConversationItemTruncateEvent as ConversationItemTruncateEvent, type ConversationItemTruncatedEvent as ConversationItemTruncatedEvent, type ConversationItemWithReference as ConversationItemWithReference, type ErrorEvent as ErrorEvent, type InputAudioBufferAppendEvent as InputAudioBufferAppendEvent, type InputAudioBufferClearEvent as InputAudioBufferClearEvent, type InputAudioBufferClearedEvent as InputAudioBufferClearedEvent, type InputAudioBufferCommitEvent as InputAudioBufferCommitEvent, type InputAudioBufferCommittedEvent as InputAudioBufferCommittedEvent, type InputAudioBufferSpeechStartedEvent as InputAudioBufferSpeechStartedEvent, type InputAudioBufferSpeechStoppedEvent as InputAudioBufferSpeechStoppedEvent, type RateLimitsUpdatedEvent as RateLimitsUpdatedEvent, type RealtimeClientEvent as RealtimeClientEvent, type RealtimeResponse as RealtimeResponse, type RealtimeResponseStatus as RealtimeResponseStatus, type RealtimeResponseUsage as RealtimeResponseUsage, type RealtimeServerEvent as RealtimeServerEvent, type ResponseAudioDeltaEvent as ResponseAudioDeltaEvent, type ResponseAudioDoneEvent as ResponseAudioDoneEvent, type ResponseAudioTranscriptDeltaEvent as ResponseAudioTranscriptDeltaEvent, type ResponseAudioTranscriptDoneEvent as ResponseAudioTranscriptDoneEvent, type ResponseCancelEvent as ResponseCancelEvent, type ResponseContentPartAddedEvent as ResponseContentPartAddedEvent, type ResponseContentPartDoneEvent as ResponseContentPartDoneEvent, type ResponseCreateEvent as ResponseCreateEvent, type ResponseCreatedEvent as ResponseCreatedEvent, type ResponseDoneEvent as ResponseDoneEvent, type ResponseFunctionCallArgumentsDeltaEvent as ResponseFunctionCallArgumentsDeltaEvent, type ResponseFunctionCallArgumentsDoneEvent as ResponseFunctionCallArgumentsDoneEvent, type ResponseOutputItemAddedEvent as ResponseOutputItemAddedEvent, type ResponseOutputItemDoneEvent as ResponseOutputItemDoneEvent, type ResponseTextDeltaEvent as ResponseTextDeltaEvent, type ResponseTextDoneEvent as ResponseTextDoneEvent, type SessionCreatedEvent as SessionCreatedEvent, type SessionUpdateEvent as SessionUpdateEvent, type SessionUpdatedEvent as SessionUpdatedEvent, type TranscriptionSessionUpdate as TranscriptionSessionUpdate, type TranscriptionSessionUpdatedEvent as TranscriptionSessionUpdatedEvent, ChatKit as ChatKit, type ChatKitWorkflow as ChatKitWorkflow, };
export { Assistants as Assistants, type Assistant as Assistant, type AssistantDeleted as AssistantDeleted, type AssistantStreamEvent as AssistantStreamEvent, type AssistantTool as AssistantTool, type CodeInterpreterTool as CodeInterpreterTool, type FileSearchTool as FileSearchTool, type FunctionTool as FunctionTool, type MessageStreamEvent as MessageStreamEvent, type RunStepStreamEvent as RunStepStreamEvent, type RunStreamEvent as RunStreamEvent, type ThreadStreamEvent as ThreadStreamEvent, type AssistantsPage as AssistantsPage, type AssistantCreateParams as AssistantCreateParams, type AssistantUpdateParams as AssistantUpdateParams, type AssistantListParams as AssistantListParams, };
export { Threads as Threads, type AssistantResponseFormatOption as AssistantResponseFormatOption, type AssistantToolChoice as AssistantToolChoice, type AssistantToolChoiceFunction as AssistantToolChoiceFunction, type AssistantToolChoiceOption as AssistantToolChoiceOption, type Thread as Thread, type ThreadDeleted as ThreadDeleted, type ThreadCreateParams as ThreadCreateParams, type ThreadUpdateParams as ThreadUpdateParams, type ThreadCreateAndRunParams as ThreadCreateAndRunParams, type ThreadCreateAndRunParamsNonStreaming as ThreadCreateAndRunParamsNonStreaming, type ThreadCreateAndRunParamsStreaming as ThreadCreateAndRunParamsStreaming, type ThreadCreateAndRunPollParams, type ThreadCreateAndRunStreamParams, };
}
//# sourceMappingURL=beta.d.mts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"beta.d.mts","sourceRoot":"","sources":["../../src/resources/beta/beta.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,aAAa;OAClB,EACL,SAAS,EACT,qBAAqB,EACrB,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,aAAa,EACb,qBAAqB,EACrB,UAAU,EACV,cAAc,EACd,mBAAmB,EACnB,cAAc,EACd,YAAY,EACZ,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EAClB;OACM,KAAK,WAAW;OAChB,EACL,wBAAwB,EACxB,gBAAgB,EAChB,uBAAuB,EACvB,2BAA2B,EAC3B,4BAA4B,EAC5B,2BAA2B,EAC3B,4BAA4B,EAC5B,qDAAqD,EACrD,iDAAiD,EACjD,kDAAkD,EAClD,6BAA6B,EAC7B,6BAA6B,EAC7B,8BAA8B,EAC9B,6BAA6B,EAC7B,UAAU,EACV,2BAA2B,EAC3B,0BAA0B,EAC1B,4BAA4B,EAC5B,2BAA2B,EAC3B,8BAA8B,EAC9B,kCAAkC,EAClC,kCAAkC,EAClC,sBAAsB,EACtB,QAAQ,EACR,mBAAmB,EACnB,gBAAgB,EAChB,sBAAsB,EACtB,qBAAqB,EACrB,mBAAmB,EACnB,uBAAuB,EACvB,sBAAsB,EACtB,iCAAiC,EACjC,gCAAgC,EAChC,mBAAmB,EACnB,6BAA6B,EAC7B,4BAA4B,EAC5B,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,uCAAuC,EACvC,sCAAsC,EACtC,4BAA4B,EAC5B,2BAA2B,EAC3B,sBAAsB,EACtB,qBAAqB,EACrB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,0BAA0B,EAC1B,gCAAgC,EACjC;OACM,KAAK,UAAU;O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AAoB,IAAI,oBAAoB,EACjD,KAAK,aAAa,IAAI,aAAa,EACnC,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,YAAY,IAAI,YAAY,EACjC,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;IAEF,OAAO,EACL,OAAO,IAAI,OAAO,EAClB,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,MAAM,IAAI,MAAM,EACrB,KAAK,aAAa,IAAI,aAAa,EACnC,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,oCAAoC,IAAI,oCAAoC,EACjF,KAAK,iCAAiC,IAAI,iCAAiC,EAC3E,KAAK,4BAA4B,EACjC,KAAK,8BAA8B,GACpC,CAAC;CACH"}
+21
View File
@@ -0,0 +1,21 @@
import { APIResource } from "../../core/resource.js";
import * as AssistantsAPI from "./assistants.js";
import { Assistant, AssistantCreateParams, AssistantDeleted, AssistantListParams, AssistantStreamEvent, AssistantTool, AssistantUpdateParams, Assistants, AssistantsPage, CodeInterpreterTool, FileSearchTool, FunctionTool, MessageStreamEvent, RunStepStreamEvent, RunStreamEvent, ThreadStreamEvent } from "./assistants.js";
import * as RealtimeAPI from "./realtime/realtime.js";
import { ConversationCreatedEvent, ConversationItem, ConversationItemContent, ConversationItemCreateEvent, ConversationItemCreatedEvent, ConversationItemDeleteEvent, ConversationItemDeletedEvent, ConversationItemInputAudioTranscriptionCompletedEvent, ConversationItemInputAudioTranscriptionDeltaEvent, ConversationItemInputAudioTranscriptionFailedEvent, ConversationItemRetrieveEvent, ConversationItemTruncateEvent, ConversationItemTruncatedEvent, ConversationItemWithReference, ErrorEvent, InputAudioBufferAppendEvent, InputAudioBufferClearEvent, InputAudioBufferClearedEvent, InputAudioBufferCommitEvent, InputAudioBufferCommittedEvent, InputAudioBufferSpeechStartedEvent, InputAudioBufferSpeechStoppedEvent, RateLimitsUpdatedEvent, Realtime, RealtimeClientEvent, RealtimeResponse, RealtimeResponseStatus, RealtimeResponseUsage, RealtimeServerEvent, ResponseAudioDeltaEvent, ResponseAudioDoneEvent, ResponseAudioTranscriptDeltaEvent, ResponseAudioTranscriptDoneEvent, ResponseCancelEvent, ResponseContentPartAddedEvent, ResponseContentPartDoneEvent, ResponseCreateEvent, ResponseCreatedEvent, ResponseDoneEvent, ResponseFunctionCallArgumentsDeltaEvent, ResponseFunctionCallArgumentsDoneEvent, ResponseOutputItemAddedEvent, ResponseOutputItemDoneEvent, ResponseTextDeltaEvent, ResponseTextDoneEvent, SessionCreatedEvent, SessionUpdateEvent, SessionUpdatedEvent, TranscriptionSessionUpdate, TranscriptionSessionUpdatedEvent } from "./realtime/realtime.js";
import * as ChatKitAPI from "./chatkit/chatkit.js";
import { ChatKit, ChatKitWorkflow } from "./chatkit/chatkit.js";
import * as ThreadsAPI from "./threads/threads.js";
import { AssistantResponseFormatOption, AssistantToolChoice, AssistantToolChoiceFunction, AssistantToolChoiceOption, Thread, ThreadCreateAndRunParams, ThreadCreateAndRunParamsNonStreaming, ThreadCreateAndRunParamsStreaming, ThreadCreateAndRunPollParams, ThreadCreateAndRunStreamParams, ThreadCreateParams, ThreadDeleted, ThreadUpdateParams, Threads } from "./threads/threads.js";
export declare class Beta extends APIResource {
realtime: RealtimeAPI.Realtime;
chatkit: ChatKitAPI.ChatKit;
assistants: AssistantsAPI.Assistants;
threads: ThreadsAPI.Threads;
}
export declare namespace Beta {
export { Realtime as Realtime, type ConversationCreatedEvent as ConversationCreatedEvent, type ConversationItem as ConversationItem, type ConversationItemContent as ConversationItemContent, type ConversationItemCreateEvent as ConversationItemCreateEvent, type ConversationItemCreatedEvent as ConversationItemCreatedEvent, type ConversationItemDeleteEvent as ConversationItemDeleteEvent, type ConversationItemDeletedEvent as ConversationItemDeletedEvent, type ConversationItemInputAudioTranscriptionCompletedEvent as ConversationItemInputAudioTranscriptionCompletedEvent, type ConversationItemInputAudioTranscriptionDeltaEvent as ConversationItemInputAudioTranscriptionDeltaEvent, type ConversationItemInputAudioTranscriptionFailedEvent as ConversationItemInputAudioTranscriptionFailedEvent, type ConversationItemRetrieveEvent as ConversationItemRetrieveEvent, type ConversationItemTruncateEvent as ConversationItemTruncateEvent, type ConversationItemTruncatedEvent as ConversationItemTruncatedEvent, type ConversationItemWithReference as ConversationItemWithReference, type ErrorEvent as ErrorEvent, type InputAudioBufferAppendEvent as InputAudioBufferAppendEvent, type InputAudioBufferClearEvent as InputAudioBufferClearEvent, type InputAudioBufferClearedEvent as InputAudioBufferClearedEvent, type InputAudioBufferCommitEvent as InputAudioBufferCommitEvent, type InputAudioBufferCommittedEvent as InputAudioBufferCommittedEvent, type InputAudioBufferSpeechStartedEvent as InputAudioBufferSpeechStartedEvent, type InputAudioBufferSpeechStoppedEvent as InputAudioBufferSpeechStoppedEvent, type RateLimitsUpdatedEvent as RateLimitsUpdatedEvent, type RealtimeClientEvent as RealtimeClientEvent, type RealtimeResponse as RealtimeResponse, type RealtimeResponseStatus as RealtimeResponseStatus, type RealtimeResponseUsage as RealtimeResponseUsage, type RealtimeServerEvent as RealtimeServerEvent, type ResponseAudioDeltaEvent as ResponseAudioDeltaEvent, type ResponseAudioDoneEvent as ResponseAudioDoneEvent, type ResponseAudioTranscriptDeltaEvent as ResponseAudioTranscriptDeltaEvent, type ResponseAudioTranscriptDoneEvent as ResponseAudioTranscriptDoneEvent, type ResponseCancelEvent as ResponseCancelEvent, type ResponseContentPartAddedEvent as ResponseContentPartAddedEvent, type ResponseContentPartDoneEvent as ResponseContentPartDoneEvent, type ResponseCreateEvent as ResponseCreateEvent, type ResponseCreatedEvent as ResponseCreatedEvent, type ResponseDoneEvent as ResponseDoneEvent, type ResponseFunctionCallArgumentsDeltaEvent as ResponseFunctionCallArgumentsDeltaEvent, type ResponseFunctionCallArgumentsDoneEvent as ResponseFunctionCallArgumentsDoneEvent, type ResponseOutputItemAddedEvent as ResponseOutputItemAddedEvent, type ResponseOutputItemDoneEvent as ResponseOutputItemDoneEvent, type ResponseTextDeltaEvent as ResponseTextDeltaEvent, type ResponseTextDoneEvent as ResponseTextDoneEvent, type SessionCreatedEvent as SessionCreatedEvent, type SessionUpdateEvent as SessionUpdateEvent, type SessionUpdatedEvent as SessionUpdatedEvent, type TranscriptionSessionUpdate as TranscriptionSessionUpdate, type TranscriptionSessionUpdatedEvent as TranscriptionSessionUpdatedEvent, ChatKit as ChatKit, type ChatKitWorkflow as ChatKitWorkflow, };
export { Assistants as Assistants, type Assistant as Assistant, type AssistantDeleted as AssistantDeleted, type AssistantStreamEvent as AssistantStreamEvent, type AssistantTool as AssistantTool, type CodeInterpreterTool as CodeInterpreterTool, type FileSearchTool as FileSearchTool, type FunctionTool as FunctionTool, type MessageStreamEvent as MessageStreamEvent, type RunStepStreamEvent as RunStepStreamEvent, type RunStreamEvent as RunStreamEvent, type ThreadStreamEvent as ThreadStreamEvent, type AssistantsPage as AssistantsPage, type AssistantCreateParams as AssistantCreateParams, type AssistantUpdateParams as AssistantUpdateParams, type AssistantListParams as AssistantListParams, };
export { Threads as Threads, type AssistantResponseFormatOption as AssistantResponseFormatOption, type AssistantToolChoice as AssistantToolChoice, type AssistantToolChoiceFunction as AssistantToolChoiceFunction, type AssistantToolChoiceOption as AssistantToolChoiceOption, type Thread as Thread, type ThreadDeleted as ThreadDeleted, type ThreadCreateParams as ThreadCreateParams, type ThreadUpdateParams as ThreadUpdateParams, type ThreadCreateAndRunParams as ThreadCreateAndRunParams, type ThreadCreateAndRunParamsNonStreaming as ThreadCreateAndRunParamsNonStreaming, type ThreadCreateAndRunParamsStreaming as ThreadCreateAndRunParamsStreaming, type ThreadCreateAndRunPollParams, type ThreadCreateAndRunStreamParams, };
}
//# sourceMappingURL=beta.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"beta.d.ts","sourceRoot":"","sources":["../../src/resources/beta/beta.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,aAAa;OAClB,EACL,SAAS,EACT,qBAAqB,EACrB,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,aAAa,EACb,qBAAqB,EACrB,UAAU,EACV,cAAc,EACd,mBAAmB,EACnB,cAAc,EACd,YAAY,EACZ,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EAClB;OACM,KAAK,WAAW;OAChB,EACL,wBAAwB,EACxB,gBAAgB,EAChB,uBAAuB,EACvB,2BAA2B,EAC3B,4BAA4B,EAC5B,2BAA2B,EAC3B,4BAA4B,EAC5B,qDAAqD,EACrD,iDAAiD,EACjD,kDAAkD,EAClD,6BAA6B,EAC7B,6BAA6B,EAC7B,8BAA8B,EAC9B,6BAA6B,EAC7B,UAAU,EACV,2BAA2B,EAC3B,0BAA0B,EAC1B,4BAA4B,EAC5B,2BAA2B,EAC3B,8BAA8B,EAC9B,kCAAkC,EAClC,kCAAkC,EAClC,sBAAsB,EACtB,QAAQ,EACR,mBAAmB,EACnB,gBAAgB,EAChB,sBAAsB,EACtB,qBAAqB,EACrB,mBAAmB,EACnB,uBAAuB,EACvB,sBAAsB,EACtB,iCAAiC,EACjC,gCAAgC,EAChC,mBAAmB,EACnB,6BAA6B,EAC7B,4BAA4B,EAC5B,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,uCAAuC,EACvC,sCAAsC,EACtC,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KAAK,eAAe,IAAI,eAAe,GACxC,CAAC;IAEF,OAAO,EACL,UAAU,IAAI,UAAU,EACxB,KAAK,SAAS,IAAI,SAAS,EAC3B,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,aAAa,IAAI,aAAa,EACnC,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,YAAY,IAAI,YAAY,EACjC,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;IAEF,OAAO,EACL,OAAO,IAAI,OAAO,EAClB,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,MAAM,IAAI,MAAM,EACrB,KAAK,aAAa,IAAI,aAAa,EACnC,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,oCAAoC,IAAI,oCAAoC,EACjF,KAAK,iCAAiC,IAAI,iCAAiC,EAC3E,KAAK,4BAA4B,EACjC,KAAK,8BAA8B,GACpC,CAAC;CACH"}
+29
View File
@@ -0,0 +1,29 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.Beta = void 0;
const tslib_1 = require("../../internal/tslib.js");
const resource_1 = require("../../core/resource.js");
const AssistantsAPI = tslib_1.__importStar(require("./assistants.js"));
const assistants_1 = require("./assistants.js");
const RealtimeAPI = tslib_1.__importStar(require("./realtime/realtime.js"));
const realtime_1 = require("./realtime/realtime.js");
const ChatKitAPI = tslib_1.__importStar(require("./chatkit/chatkit.js"));
const chatkit_1 = require("./chatkit/chatkit.js");
const ThreadsAPI = tslib_1.__importStar(require("./threads/threads.js"));
const threads_1 = require("./threads/threads.js");
class Beta extends resource_1.APIResource {
constructor() {
super(...arguments);
this.realtime = new RealtimeAPI.Realtime(this._client);
this.chatkit = new ChatKitAPI.ChatKit(this._client);
this.assistants = new AssistantsAPI.Assistants(this._client);
this.threads = new ThreadsAPI.Threads(this._client);
}
}
exports.Beta = Beta;
Beta.Realtime = realtime_1.Realtime;
Beta.ChatKit = chatkit_1.ChatKit;
Beta.Assistants = assistants_1.Assistants;
Beta.Threads = threads_1.Threads;
//# sourceMappingURL=beta.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"beta.js","sourceRoot":"","sources":["../../src/resources/beta/beta.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAClD,uEAA8C;AAC9C,gDAiBsB;AACtB,4EAAmD;AACnD,qDAmD6B;AAC7B,yEAAgD;AAChD,kDAA6D;AAC7D,yEAAgD;AAChD,kDAe2B;AAE3B,MAAa,IAAK,SAAQ,sBAAW;IAArC;;QACE,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACxE,YAAO,GAAuB,IAAI,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACnE,eAAU,GAA6B,IAAI,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAClF,YAAO,GAAuB,IAAI,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACrE,CAAC;CAAA;AALD,oBAKC;AAED,IAAI,CAAC,QAAQ,GAAG,mBAAQ,CAAC;AACzB,IAAI,CAAC,OAAO,GAAG,iBAAO,CAAC;AACvB,IAAI,CAAC,UAAU,GAAG,uBAAU,CAAC;AAC7B,IAAI,CAAC,OAAO,GAAG,iBAAO,CAAC"}
+24
View File
@@ -0,0 +1,24 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../core/resource.mjs";
import * as AssistantsAPI from "./assistants.mjs";
import { Assistants, } from "./assistants.mjs";
import * as RealtimeAPI from "./realtime/realtime.mjs";
import { Realtime, } from "./realtime/realtime.mjs";
import * as ChatKitAPI from "./chatkit/chatkit.mjs";
import { ChatKit } from "./chatkit/chatkit.mjs";
import * as ThreadsAPI from "./threads/threads.mjs";
import { Threads, } from "./threads/threads.mjs";
export class Beta extends APIResource {
constructor() {
super(...arguments);
this.realtime = new RealtimeAPI.Realtime(this._client);
this.chatkit = new ChatKitAPI.ChatKit(this._client);
this.assistants = new AssistantsAPI.Assistants(this._client);
this.threads = new ThreadsAPI.Threads(this._client);
}
}
Beta.Realtime = Realtime;
Beta.ChatKit = ChatKit;
Beta.Assistants = Assistants;
Beta.Threads = Threads;
//# sourceMappingURL=beta.mjs.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"beta.mjs","sourceRoot":"","sources":["../../src/resources/beta/beta.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,aAAa;OAClB,EAQL,UAAU,GASX;OACM,KAAK,WAAW;OAChB,EAwBL,QAAQ,GA2BT;OACM,KAAK,UAAU;OACf,EAAE,OAAO,EAAmB;OAC5B,KAAK,UAAU;OACf,EAcL,OAAO,GACR;AAED,MAAM,OAAO,IAAK,SAAQ,WAAW;IAArC;;QACE,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACxE,YAAO,GAAuB,IAAI,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACnE,eAAU,GAA6B,IAAI,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAClF,YAAO,GAAuB,IAAI,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACrE,CAAC;CAAA;AAED,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;AACzB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;AACvB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;AAC7B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC"}
+2
View File
@@ -0,0 +1,2 @@
export * from "./chatkit/index.mjs";
//# sourceMappingURL=chatkit.d.mts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"chatkit.d.mts","sourceRoot":"","sources":["../../src/resources/beta/chatkit.ts"],"names":[],"mappings":""}
+2
View File
@@ -0,0 +1,2 @@
export * from "./chatkit/index.js";
//# sourceMappingURL=chatkit.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"chatkit.d.ts","sourceRoot":"","sources":["../../src/resources/beta/chatkit.ts"],"names":[],"mappings":""}
+6
View File
@@ -0,0 +1,6 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("../../internal/tslib.js");
tslib_1.__exportStar(require("./chatkit/index.js"), exports);
//# sourceMappingURL=chatkit.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"chatkit.js","sourceRoot":"","sources":["../../src/resources/beta/chatkit.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,6DAAgC"}
+3
View File
@@ -0,0 +1,3 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
export * from "./chatkit/index.mjs";
//# sourceMappingURL=chatkit.mjs.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"chatkit.mjs","sourceRoot":"","sources":["../../src/resources/beta/chatkit.ts"],"names":[],"mappings":"AAAA,sFAAsF"}
+51
View File
@@ -0,0 +1,51 @@
import { APIResource } from "../../../core/resource.mjs";
import * as SessionsAPI from "./sessions.mjs";
import { SessionCreateParams, Sessions } from "./sessions.mjs";
import * as ThreadsAPI from "./threads.mjs";
import { ChatKitAttachment, ChatKitResponseOutputText, ChatKitThread, ChatKitThreadAssistantMessageItem, ChatKitThreadItemList, ChatKitThreadItemListDataPage, ChatKitThreadUserMessageItem, ChatKitThreadsPage, ChatKitWidgetItem, ChatSession, ChatSessionAutomaticThreadTitling, ChatSessionChatKitConfiguration, ChatSessionChatKitConfigurationParam, ChatSessionExpiresAfterParam, ChatSessionFileUpload, ChatSessionHistory, ChatSessionRateLimits, ChatSessionRateLimitsParam, ChatSessionStatus, ChatSessionWorkflowParam, ThreadDeleteResponse, ThreadListItemsParams, ThreadListParams, Threads } from "./threads.mjs";
export declare class ChatKit extends APIResource {
sessions: SessionsAPI.Sessions;
threads: ThreadsAPI.Threads;
}
/**
* Workflow metadata and state returned for the session.
*/
export interface ChatKitWorkflow {
/**
* Identifier of the workflow backing the session.
*/
id: string;
/**
* State variable key-value pairs applied when invoking the workflow. Defaults to
* null when no overrides were provided.
*/
state_variables: {
[key: string]: string | boolean | number;
} | null;
/**
* Tracing settings applied to the workflow.
*/
tracing: ChatKitWorkflow.Tracing;
/**
* Specific workflow version used for the session. Defaults to null when using the
* latest deployment.
*/
version: string | null;
}
export declare namespace ChatKitWorkflow {
/**
* Tracing settings applied to the workflow.
*/
interface Tracing {
/**
* Indicates whether tracing is enabled.
*/
enabled: boolean;
}
}
export declare namespace ChatKit {
export { type ChatKitWorkflow as ChatKitWorkflow };
export { Sessions as Sessions, type SessionCreateParams as SessionCreateParams };
export { Threads as Threads, type ChatSession as ChatSession, type ChatSessionAutomaticThreadTitling as ChatSessionAutomaticThreadTitling, type ChatSessionChatKitConfiguration as ChatSessionChatKitConfiguration, type ChatSessionChatKitConfigurationParam as ChatSessionChatKitConfigurationParam, type ChatSessionExpiresAfterParam as ChatSessionExpiresAfterParam, type ChatSessionFileUpload as ChatSessionFileUpload, type ChatSessionHistory as ChatSessionHistory, type ChatSessionRateLimits as ChatSessionRateLimits, type ChatSessionRateLimitsParam as ChatSessionRateLimitsParam, type ChatSessionStatus as ChatSessionStatus, type ChatSessionWorkflowParam as ChatSessionWorkflowParam, type ChatKitAttachment as ChatKitAttachment, type ChatKitResponseOutputText as ChatKitResponseOutputText, type ChatKitThread as ChatKitThread, type ChatKitThreadAssistantMessageItem as ChatKitThreadAssistantMessageItem, type ChatKitThreadItemList as ChatKitThreadItemList, type ChatKitThreadUserMessageItem as ChatKitThreadUserMessageItem, type ChatKitWidgetItem as ChatKitWidgetItem, type ThreadDeleteResponse as ThreadDeleteResponse, type ChatKitThreadsPage as ChatKitThreadsPage, type ChatKitThreadItemListDataPage as ChatKitThreadItemListDataPage, type ThreadListParams as ThreadListParams, type ThreadListItemsParams as ThreadListItemsParams, };
}
//# sourceMappingURL=chatkit.d.mts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"chatkit.d.mts","sourceRoot":"","sources":["../../../src/resources/beta/chatkit/chatkit.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,WAAW;OAChB,EAAE,mBAAmB,EAAE,QAAQ,EAAE;OACjC,KAAK,UAAU;OACf,EACL,iBAAiB,EACjB,yBAAyB,EACzB,aAAa,EACb,iCAAiC,EACjC,qBAAqB,EACrB,6BAA6B,EAC7B,4BAA4B,EAC5B,kBAAkB,EAClB,iBAAiB,EACjB,WAAW,EACX,iCAAiC,EACjC,+BAA+B,EAC/B,oCAAoC,EACpC,4BAA4B,EAC5B,qBAAqB,EACrB,kBAAkB,EAClB,qBAAqB,EACrB,0BAA0B,EAC1B,iBAAiB,EACjB,wBAAwB,EACxB,oBAAoB,EACpB,qBAAqB,EACrB,gBAAgB,EAChB,OAAO,EACR;AAED,qBAAa,OAAQ,SAAQ,WAAW;IACtC,QAAQ,EAAE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AAiC,IAAI,iCAAiC,EAC3E,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,qBAAqB,IAAI,qBAAqB,GACpD,CAAC;CACH"}
+51
View File
@@ -0,0 +1,51 @@
import { APIResource } from "../../../core/resource.js";
import * as SessionsAPI from "./sessions.js";
import { SessionCreateParams, Sessions } from "./sessions.js";
import * as ThreadsAPI from "./threads.js";
import { ChatKitAttachment, ChatKitResponseOutputText, ChatKitThread, ChatKitThreadAssistantMessageItem, ChatKitThreadItemList, ChatKitThreadItemListDataPage, ChatKitThreadUserMessageItem, ChatKitThreadsPage, ChatKitWidgetItem, ChatSession, ChatSessionAutomaticThreadTitling, ChatSessionChatKitConfiguration, ChatSessionChatKitConfigurationParam, ChatSessionExpiresAfterParam, ChatSessionFileUpload, ChatSessionHistory, ChatSessionRateLimits, ChatSessionRateLimitsParam, ChatSessionStatus, ChatSessionWorkflowParam, ThreadDeleteResponse, ThreadListItemsParams, ThreadListParams, Threads } from "./threads.js";
export declare class ChatKit extends APIResource {
sessions: SessionsAPI.Sessions;
threads: ThreadsAPI.Threads;
}
/**
* Workflow metadata and state returned for the session.
*/
export interface ChatKitWorkflow {
/**
* Identifier of the workflow backing the session.
*/
id: string;
/**
* State variable key-value pairs applied when invoking the workflow. Defaults to
* null when no overrides were provided.
*/
state_variables: {
[key: string]: string | boolean | number;
} | null;
/**
* Tracing settings applied to the workflow.
*/
tracing: ChatKitWorkflow.Tracing;
/**
* Specific workflow version used for the session. Defaults to null when using the
* latest deployment.
*/
version: string | null;
}
export declare namespace ChatKitWorkflow {
/**
* Tracing settings applied to the workflow.
*/
interface Tracing {
/**
* Indicates whether tracing is enabled.
*/
enabled: boolean;
}
}
export declare namespace ChatKit {
export { type ChatKitWorkflow as ChatKitWorkflow };
export { Sessions as Sessions, type SessionCreateParams as SessionCreateParams };
export { Threads as Threads, type ChatSession as ChatSession, type ChatSessionAutomaticThreadTitling as ChatSessionAutomaticThreadTitling, type ChatSessionChatKitConfiguration as ChatSessionChatKitConfiguration, type ChatSessionChatKitConfigurationParam as ChatSessionChatKitConfigurationParam, type ChatSessionExpiresAfterParam as ChatSessionExpiresAfterParam, type ChatSessionFileUpload as ChatSessionFileUpload, type ChatSessionHistory as ChatSessionHistory, type ChatSessionRateLimits as ChatSessionRateLimits, type ChatSessionRateLimitsParam as ChatSessionRateLimitsParam, type ChatSessionStatus as ChatSessionStatus, type ChatSessionWorkflowParam as ChatSessionWorkflowParam, type ChatKitAttachment as ChatKitAttachment, type ChatKitResponseOutputText as ChatKitResponseOutputText, type ChatKitThread as ChatKitThread, type ChatKitThreadAssistantMessageItem as ChatKitThreadAssistantMessageItem, type ChatKitThreadItemList as ChatKitThreadItemList, type ChatKitThreadUserMessageItem as ChatKitThreadUserMessageItem, type ChatKitWidgetItem as ChatKitWidgetItem, type ThreadDeleteResponse as ThreadDeleteResponse, type ChatKitThreadsPage as ChatKitThreadsPage, type ChatKitThreadItemListDataPage as ChatKitThreadItemListDataPage, type ThreadListParams as ThreadListParams, type ThreadListItemsParams as ThreadListItemsParams, };
}
//# sourceMappingURL=chatkit.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"chatkit.d.ts","sourceRoot":"","sources":["../../../src/resources/beta/chatkit/chatkit.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,WAAW;OAChB,EAAE,mBAAmB,EAAE,QAAQ,EAAE;OACjC,KAAK,UAAU;OACf,EACL,iBAAiB,EACjB,yBAAyB,EACzB,aAAa,EACb,iCAAiC,EACjC,qBAAqB,EACrB,6BAA6B,EAC7B,4BAA4B,EAC5B,kBAAkB,EAClB,iBAA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AAI,kBAAkB,EAC7C,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,aAAa,IAAI,aAAa,EACnC,KAAK,iCAAiC,IAAI,iCAAiC,EAC3E,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,qBAAqB,IAAI,qBAAqB,GACpD,CAAC;CACH"}
+21
View File
@@ -0,0 +1,21 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.ChatKit = void 0;
const tslib_1 = require("../../../internal/tslib.js");
const resource_1 = require("../../../core/resource.js");
const SessionsAPI = tslib_1.__importStar(require("./sessions.js"));
const sessions_1 = require("./sessions.js");
const ThreadsAPI = tslib_1.__importStar(require("./threads.js"));
const threads_1 = require("./threads.js");
class ChatKit extends resource_1.APIResource {
constructor() {
super(...arguments);
this.sessions = new SessionsAPI.Sessions(this._client);
this.threads = new ThreadsAPI.Threads(this._client);
}
}
exports.ChatKit = ChatKit;
ChatKit.Sessions = sessions_1.Sessions;
ChatKit.Threads = threads_1.Threads;
//# sourceMappingURL=chatkit.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"chatkit.js","sourceRoot":"","sources":["../../../src/resources/beta/chatkit/chatkit.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,wDAAqD;AACrD,mEAA0C;AAC1C,4CAA2D;AAC3D,iEAAwC;AACxC,0CAyBmB;AAEnB,MAAa,OAAQ,SAAQ,sBAAW;IAAxC;;QACE,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACxE,YAAO,GAAuB,IAAI,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACrE,CAAC;CAAA;AAHD,0BAGC;AAyCD,OAAO,CAAC,QAAQ,GAAG,mBAAQ,CAAC;AAC5B,OAAO,CAAC,OAAO,GAAG,iBAAO,CAAC"}
+16
View File
@@ -0,0 +1,16 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../../core/resource.mjs";
import * as SessionsAPI from "./sessions.mjs";
import { Sessions } from "./sessions.mjs";
import * as ThreadsAPI from "./threads.mjs";
import { Threads, } from "./threads.mjs";
export class ChatKit extends APIResource {
constructor() {
super(...arguments);
this.sessions = new SessionsAPI.Sessions(this._client);
this.threads = new ThreadsAPI.Threads(this._client);
}
}
ChatKit.Sessions = Sessions;
ChatKit.Threads = Threads;
//# sourceMappingURL=chatkit.mjs.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"chatkit.mjs","sourceRoot":"","sources":["../../../src/resources/beta/chatkit/chatkit.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,WAAW;OAChB,EAAuB,QAAQ,EAAE;OACjC,KAAK,UAAU;OACf,EAwBL,OAAO,GACR;AAED,MAAM,OAAO,OAAQ,SAAQ,WAAW;IAAxC;;QACE,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACxE,YAAO,GAAuB,IAAI,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACrE,CAAC;CAAA;AAyCD,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC5B,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC"}
+4
View File
@@ -0,0 +1,4 @@
export { ChatKit, type ChatKitWorkflow } from "./chatkit.mjs";
export { Sessions, type SessionCreateParams } from "./sessions.mjs";
export { Threads, type ChatSession, type ChatSessionAutomaticThreadTitling, type ChatSessionChatKitConfiguration, type ChatSessionChatKitConfigurationParam, type ChatSessionExpiresAfterParam, type ChatSessionFileUpload, type ChatSessionHistory, type ChatSessionRateLimits, type ChatSessionRateLimitsParam, type ChatSessionStatus, type ChatSessionWorkflowParam, type ChatKitAttachment, type ChatKitResponseOutputText, type ChatKitThread, type ChatKitThreadAssistantMessageItem, type ChatKitThreadItemList, type ChatKitThreadUserMessageItem, type ChatKitWidgetItem, type ThreadDeleteResponse, type ThreadListParams, type ThreadListItemsParams, type ChatKitThreadsPage, type ChatKitThreadItemListDataPage, } from "./threads.mjs";
//# sourceMappingURL=index.d.mts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/resources/beta/chatkit/index.ts"],"names":[],"mappings":"OAEO,EAAE,OAAO,EAAE,KAAK,eAAe,EAAE;OACjC,EAAE,QAAQ,EAAE,KAAK,mBAAmB,EAAE;OACtC,EACL,OAAO,EACP,KAAK,WAAW,EAChB,KAAK,iCAAiC,EACtC,KAAK,+BAA+B,EACpC,KAAK,oCAAoC,EACzC,KAAK,4BAA4B,EACjC,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,0BAA0B,EAC/B,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC9B,KAAK,aAAa,EAClB,KAAK,iCAAiC,EACtC,KAAK,qBAAqB,EAC1B,KAAK,4BAA4B,EACjC,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,6BAA6B,GACnC"}
+4
View File
@@ -0,0 +1,4 @@
export { ChatKit, type ChatKitWorkflow } from "./chatkit.js";
export { Sessions, type SessionCreateParams } from "./sessions.js";
export { Threads, type ChatSession, type ChatSessionAutomaticThreadTitling, type ChatSessionChatKitConfiguration, type ChatSessionChatKitConfigurationParam, type ChatSessionExpiresAfterParam, type ChatSessionFileUpload, type ChatSessionHistory, type ChatSessionRateLimits, type ChatSessionRateLimitsParam, type ChatSessionStatus, type ChatSessionWorkflowParam, type ChatKitAttachment, type ChatKitResponseOutputText, type ChatKitThread, type ChatKitThreadAssistantMessageItem, type ChatKitThreadItemList, type ChatKitThreadUserMessageItem, type ChatKitWidgetItem, type ThreadDeleteResponse, type ThreadListParams, type ThreadListItemsParams, type ChatKitThreadsPage, type ChatKitThreadItemListDataPage, } from "./threads.js";
//# sourceMappingURL=index.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/resources/beta/chatkit/index.ts"],"names":[],"mappings":"OAEO,EAAE,OAAO,EAAE,KAAK,eAAe,EAAE;OACjC,EAAE,QAAQ,EAAE,KAAK,mBAAmB,EAAE;OACtC,EACL,OAAO,EACP,KAAK,WAAW,EAChB,KAAK,iCAAiC,EACtC,KAAK,+BAA+B,EACpC,KAAK,oCAAoC,EACzC,KAAK,4BAA4B,EACjC,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,0BAA0B,EAC/B,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC9B,KAAK,aAAa,EAClB,KAAK,iCAAiC,EACtC,KAAK,qBAAqB,EAC1B,KAAK,4BAA4B,EACjC,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,6BAA6B,GACnC"}
+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.Threads = exports.Sessions = exports.ChatKit = void 0;
var chatkit_1 = require("./chatkit.js");
Object.defineProperty(exports, "ChatKit", { enumerable: true, get: function () { return chatkit_1.ChatKit; } });
var sessions_1 = require("./sessions.js");
Object.defineProperty(exports, "Sessions", { enumerable: true, get: function () { return sessions_1.Sessions; } });
var threads_1 = require("./threads.js");
Object.defineProperty(exports, "Threads", { enumerable: true, get: function () { return threads_1.Threads; } });
//# sourceMappingURL=index.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/resources/beta/chatkit/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wCAA0D;AAAjD,kGAAA,OAAO,OAAA;AAChB,0CAAgE;AAAvD,oGAAA,QAAQ,OAAA;AACjB,wCAyBmB;AAxBjB,kGAAA,OAAO,OAAA"}
+5
View File
@@ -0,0 +1,5 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
export { ChatKit } from "./chatkit.mjs";
export { Sessions } from "./sessions.mjs";
export { Threads, } from "./threads.mjs";
//# sourceMappingURL=index.mjs.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/resources/beta/chatkit/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,OAAO,EAAwB;OACjC,EAAE,QAAQ,EAA4B;OACtC,EACL,OAAO,GAwBR"}
+59
View File
@@ -0,0 +1,59 @@
import { APIResource } from "../../../core/resource.mjs";
import * as ThreadsAPI from "./threads.mjs";
import { APIPromise } from "../../../core/api-promise.mjs";
import { RequestOptions } from "../../../internal/request-options.mjs";
export declare class Sessions extends APIResource {
/**
* Create a ChatKit session.
*
* @example
* ```ts
* const chatSession =
* await client.beta.chatkit.sessions.create({
* user: 'x',
* workflow: { id: 'id' },
* });
* ```
*/
create(body: SessionCreateParams, options?: RequestOptions): APIPromise<ThreadsAPI.ChatSession>;
/**
* Cancel an active ChatKit session and return its most recent metadata.
*
* Cancelling prevents new requests from using the issued client secret.
*
* @example
* ```ts
* const chatSession =
* await client.beta.chatkit.sessions.cancel('cksess_123');
* ```
*/
cancel(sessionID: string, options?: RequestOptions): APIPromise<ThreadsAPI.ChatSession>;
}
export interface SessionCreateParams {
/**
* A free-form string that identifies your end user; ensures this Session can
* access other objects that have the same `user` scope.
*/
user: string;
/**
* Workflow that powers the session.
*/
workflow: ThreadsAPI.ChatSessionWorkflowParam;
/**
* Optional overrides for ChatKit runtime configuration features
*/
chatkit_configuration?: ThreadsAPI.ChatSessionChatKitConfigurationParam;
/**
* Optional override for session expiration timing in seconds from creation.
* Defaults to 10 minutes.
*/
expires_after?: ThreadsAPI.ChatSessionExpiresAfterParam;
/**
* Optional override for per-minute request limits. When omitted, defaults to 10.
*/
rate_limits?: ThreadsAPI.ChatSessionRateLimitsParam;
}
export declare namespace Sessions {
export { type SessionCreateParams as SessionCreateParams };
}
//# sourceMappingURL=sessions.d.mts.map
@@ -0,0 +1 @@
{"version":3,"file":"sessions.d.mts","sourceRoot":"","sources":["../../../src/resources/beta/chatkit/sessions.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,UAAU;OACf,EAAE,UAAU,EAAE;OAEd,EAAE,cAAc,EAAE;AAGzB,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,UAAU,CAAC,WAAW,CAAC;IAQ/F;;;;;;;;;;OAUG;IACH,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,UAAU,CAAC,WAAW,CAAC;CAMxF;AAED,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,QAAQ,EAAE,UAAU,CAAC,wBAAwB,CAAC;IAE9C;;OAEG;IACH,qBAAqB,CAAC,EAAE,UAAU,CAAC,oCAAoC,CAAC;IAExE;;;OAGG;IACH,aAAa,CAAC,EAAE,UAAU,CAAC,4BAA4B,CAAC;IAExD;;OAEG;IACH,WAAW,CAAC,EAAE,UAAU,CAAC,0BAA0B,CAAC;CACrD;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EAAE,KAAK,mBAAmB,IAAI,mBAAmB,EAAE,CAAC;CAC5D"}
+59
View File
@@ -0,0 +1,59 @@
import { APIResource } from "../../../core/resource.js";
import * as ThreadsAPI from "./threads.js";
import { APIPromise } from "../../../core/api-promise.js";
import { RequestOptions } from "../../../internal/request-options.js";
export declare class Sessions extends APIResource {
/**
* Create a ChatKit session.
*
* @example
* ```ts
* const chatSession =
* await client.beta.chatkit.sessions.create({
* user: 'x',
* workflow: { id: 'id' },
* });
* ```
*/
create(body: SessionCreateParams, options?: RequestOptions): APIPromise<ThreadsAPI.ChatSession>;
/**
* Cancel an active ChatKit session and return its most recent metadata.
*
* Cancelling prevents new requests from using the issued client secret.
*
* @example
* ```ts
* const chatSession =
* await client.beta.chatkit.sessions.cancel('cksess_123');
* ```
*/
cancel(sessionID: string, options?: RequestOptions): APIPromise<ThreadsAPI.ChatSession>;
}
export interface SessionCreateParams {
/**
* A free-form string that identifies your end user; ensures this Session can
* access other objects that have the same `user` scope.
*/
user: string;
/**
* Workflow that powers the session.
*/
workflow: ThreadsAPI.ChatSessionWorkflowParam;
/**
* Optional overrides for ChatKit runtime configuration features
*/
chatkit_configuration?: ThreadsAPI.ChatSessionChatKitConfigurationParam;
/**
* Optional override for session expiration timing in seconds from creation.
* Defaults to 10 minutes.
*/
expires_after?: ThreadsAPI.ChatSessionExpiresAfterParam;
/**
* Optional override for per-minute request limits. When omitted, defaults to 10.
*/
rate_limits?: ThreadsAPI.ChatSessionRateLimitsParam;
}
export declare namespace Sessions {
export { type SessionCreateParams as SessionCreateParams };
}
//# sourceMappingURL=sessions.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"sessions.d.ts","sourceRoot":"","sources":["../../../src/resources/beta/chatkit/sessions.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,UAAU;OACf,EAAE,UAAU,EAAE;OAEd,EAAE,cAAc,EAAE;AAGzB,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,UAAU,CAAC,WAAW,CAAC;IAQ/F;;;;;;;;;;OAUG;IACH,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,UAAU,CAAC,WAAW,CAAC;CAMxF;AAED,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,QAAQ,EAAE,UAAU,CAAC,wBAAwB,CAAC;IAE9C;;OAEG;IACH,qBAAqB,CAAC,EAAE,UAAU,CAAC,oCAAoC,CAAC;IAExE;;;OAGG;IACH,aAAa,CAAC,EAAE,UAAU,CAAC,4BAA4B,CAAC;IAExD;;OAEG;IACH,WAAW,CAAC,EAAE,UAAU,CAAC,0BAA0B,CAAC;CACrD;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EAAE,KAAK,mBAAmB,IAAI,mBAAmB,EAAE,CAAC;CAC5D"}
+47
View File
@@ -0,0 +1,47 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.Sessions = void 0;
const resource_1 = require("../../../core/resource.js");
const headers_1 = require("../../../internal/headers.js");
const path_1 = require("../../../internal/utils/path.js");
class Sessions extends resource_1.APIResource {
/**
* Create a ChatKit session.
*
* @example
* ```ts
* const chatSession =
* await client.beta.chatkit.sessions.create({
* user: 'x',
* workflow: { id: 'id' },
* });
* ```
*/
create(body, options) {
return this._client.post('/chatkit/sessions', {
body,
...options,
headers: (0, headers_1.buildHeaders)([{ 'OpenAI-Beta': 'chatkit_beta=v1' }, options?.headers]),
});
}
/**
* Cancel an active ChatKit session and return its most recent metadata.
*
* Cancelling prevents new requests from using the issued client secret.
*
* @example
* ```ts
* const chatSession =
* await client.beta.chatkit.sessions.cancel('cksess_123');
* ```
*/
cancel(sessionID, options) {
return this._client.post((0, path_1.path) `/chatkit/sessions/${sessionID}/cancel`, {
...options,
headers: (0, headers_1.buildHeaders)([{ 'OpenAI-Beta': 'chatkit_beta=v1' }, options?.headers]),
});
}
}
exports.Sessions = Sessions;
//# sourceMappingURL=sessions.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"sessions.js","sourceRoot":"","sources":["../../../src/resources/beta/chatkit/sessions.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAqD;AAGrD,0DAAyD;AAEzD,0DAAoD;AAEpD,MAAa,QAAS,SAAQ,sBAAW;IACvC;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,IAAyB,EAAE,OAAwB;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,mBAAmB,EAAE;YAC5C,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,aAAa,EAAE,iBAAiB,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAChF,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACH,MAAM,CAAC,SAAiB,EAAE,OAAwB;QAChD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,qBAAqB,SAAS,SAAS,EAAE;YACpE,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,aAAa,EAAE,iBAAiB,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAChF,CAAC,CAAC;IACL,CAAC;CACF;AAtCD,4BAsCC"}
+43
View File
@@ -0,0 +1,43 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../../core/resource.mjs";
import { buildHeaders } from "../../../internal/headers.mjs";
import { path } from "../../../internal/utils/path.mjs";
export class Sessions extends APIResource {
/**
* Create a ChatKit session.
*
* @example
* ```ts
* const chatSession =
* await client.beta.chatkit.sessions.create({
* user: 'x',
* workflow: { id: 'id' },
* });
* ```
*/
create(body, options) {
return this._client.post('/chatkit/sessions', {
body,
...options,
headers: buildHeaders([{ 'OpenAI-Beta': 'chatkit_beta=v1' }, options?.headers]),
});
}
/**
* Cancel an active ChatKit session and return its most recent metadata.
*
* Cancelling prevents new requests from using the issued client secret.
*
* @example
* ```ts
* const chatSession =
* await client.beta.chatkit.sessions.cancel('cksess_123');
* ```
*/
cancel(sessionID, options) {
return this._client.post(path `/chatkit/sessions/${sessionID}/cancel`, {
...options,
headers: buildHeaders([{ 'OpenAI-Beta': 'chatkit_beta=v1' }, options?.headers]),
});
}
}
//# sourceMappingURL=sessions.mjs.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"sessions.mjs","sourceRoot":"","sources":["../../../src/resources/beta/chatkit/sessions.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,YAAY,EAAE;OAEhB,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,IAAyB,EAAE,OAAwB;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,mBAAmB,EAAE;YAC5C,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,aAAa,EAAE,iBAAiB,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAChF,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACH,MAAM,CAAC,SAAiB,EAAE,OAAwB;QAChD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,qBAAqB,SAAS,SAAS,EAAE;YACpE,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,aAAa,EAAE,iBAAiB,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAChF,CAAC,CAAC;IACL,CAAC;CACF"}
+811
View File
@@ -0,0 +1,811 @@
import { APIResource } from "../../../core/resource.mjs";
import * as ChatKitAPI from "./chatkit.mjs";
import { APIPromise } from "../../../core/api-promise.mjs";
import { ConversationCursorPage, type ConversationCursorPageParams, PagePromise } from "../../../core/pagination.mjs";
import { RequestOptions } from "../../../internal/request-options.mjs";
export declare class Threads extends APIResource {
/**
* Retrieve a ChatKit thread by its identifier.
*
* @example
* ```ts
* const chatkitThread =
* await client.beta.chatkit.threads.retrieve('cthr_123');
* ```
*/
retrieve(threadID: string, options?: RequestOptions): APIPromise<ChatKitThread>;
/**
* List ChatKit threads with optional pagination and user filters.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const chatkitThread of client.beta.chatkit.threads.list()) {
* // ...
* }
* ```
*/
list(query?: ThreadListParams | null | undefined, options?: RequestOptions): PagePromise<ChatKitThreadsPage, ChatKitThread>;
/**
* Delete a ChatKit thread along with its items and stored attachments.
*
* @example
* ```ts
* const thread = await client.beta.chatkit.threads.delete(
* 'cthr_123',
* );
* ```
*/
delete(threadID: string, options?: RequestOptions): APIPromise<ThreadDeleteResponse>;
/**
* List items that belong to a ChatKit thread.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const thread of client.beta.chatkit.threads.listItems(
* 'cthr_123',
* )) {
* // ...
* }
* ```
*/
listItems(threadID: string, query?: ThreadListItemsParams | null | undefined, options?: RequestOptions): PagePromise<ChatKitThreadItemListDataPage, ChatKitThreadUserMessageItem | ChatKitThreadAssistantMessageItem | ChatKitWidgetItem | ChatKitThreadItemList.ChatKitClientToolCall | ChatKitThreadItemList.ChatKitTask | ChatKitThreadItemList.ChatKitTaskGroup>;
}
export type ChatKitThreadsPage = ConversationCursorPage<ChatKitThread>;
export type ChatKitThreadItemListDataPage = ConversationCursorPage<ChatKitThreadUserMessageItem | ChatKitThreadAssistantMessageItem | ChatKitWidgetItem | ChatKitThreadItemList.ChatKitClientToolCall | ChatKitThreadItemList.ChatKitTask | ChatKitThreadItemList.ChatKitTaskGroup>;
/**
* Represents a ChatKit session and its resolved configuration.
*/
export interface ChatSession {
/**
* Identifier for the ChatKit session.
*/
id: string;
/**
* Resolved ChatKit feature configuration for the session.
*/
chatkit_configuration: ChatSessionChatKitConfiguration;
/**
* Ephemeral client secret that authenticates session requests.
*/
client_secret: string;
/**
* Unix timestamp (in seconds) for when the session expires.
*/
expires_at: number;
/**
* Convenience copy of the per-minute request limit.
*/
max_requests_per_1_minute: number;
/**
* Type discriminator that is always `chatkit.session`.
*/
object: 'chatkit.session';
/**
* Resolved rate limit values.
*/
rate_limits: ChatSessionRateLimits;
/**
* Current lifecycle state of the session.
*/
status: ChatSessionStatus;
/**
* User identifier associated with the session.
*/
user: string;
/**
* Workflow metadata for the session.
*/
workflow: ChatKitAPI.ChatKitWorkflow;
}
/**
* Automatic thread title preferences for the session.
*/
export interface ChatSessionAutomaticThreadTitling {
/**
* Whether automatic thread titling is enabled.
*/
enabled: boolean;
}
/**
* ChatKit configuration for the session.
*/
export interface ChatSessionChatKitConfiguration {
/**
* Automatic thread titling preferences.
*/
automatic_thread_titling: ChatSessionAutomaticThreadTitling;
/**
* Upload settings for the session.
*/
file_upload: ChatSessionFileUpload;
/**
* History retention configuration.
*/
history: ChatSessionHistory;
}
/**
* Optional per-session configuration settings for ChatKit behavior.
*/
export interface ChatSessionChatKitConfigurationParam {
/**
* Configuration for automatic thread titling. When omitted, automatic thread
* titling is enabled by default.
*/
automatic_thread_titling?: ChatSessionChatKitConfigurationParam.AutomaticThreadTitling;
/**
* Configuration for upload enablement and limits. When omitted, uploads are
* disabled by default (max_files 10, max_file_size 512 MB).
*/
file_upload?: ChatSessionChatKitConfigurationParam.FileUpload;
/**
* Configuration for chat history retention. When omitted, history is enabled by
* default with no limit on recent_threads (null).
*/
history?: ChatSessionChatKitConfigurationParam.History;
}
export declare namespace ChatSessionChatKitConfigurationParam {
/**
* Configuration for automatic thread titling. When omitted, automatic thread
* titling is enabled by default.
*/
interface AutomaticThreadTitling {
/**
* Enable automatic thread title generation. Defaults to true.
*/
enabled?: boolean;
}
/**
* Configuration for upload enablement and limits. When omitted, uploads are
* disabled by default (max_files 10, max_file_size 512 MB).
*/
interface FileUpload {
/**
* Enable uploads for this session. Defaults to false.
*/
enabled?: boolean;
/**
* Maximum size in megabytes for each uploaded file. Defaults to 512 MB, which is
* the maximum allowable size.
*/
max_file_size?: number;
/**
* Maximum number of files that can be uploaded to the session. Defaults to 10.
*/
max_files?: number;
}
/**
* Configuration for chat history retention. When omitted, history is enabled by
* default with no limit on recent_threads (null).
*/
interface History {
/**
* Enables chat users to access previous ChatKit threads. Defaults to true.
*/
enabled?: boolean;
/**
* Number of recent ChatKit threads users have access to. Defaults to unlimited
* when unset.
*/
recent_threads?: number;
}
}
/**
* Controls when the session expires relative to an anchor timestamp.
*/
export interface ChatSessionExpiresAfterParam {
/**
* Base timestamp used to calculate expiration. Currently fixed to `created_at`.
*/
anchor: 'created_at';
/**
* Number of seconds after the anchor when the session expires.
*/
seconds: number;
}
/**
* Upload permissions and limits applied to the session.
*/
export interface ChatSessionFileUpload {
/**
* Indicates if uploads are enabled for the session.
*/
enabled: boolean;
/**
* Maximum upload size in megabytes.
*/
max_file_size: number | null;
/**
* Maximum number of uploads allowed during the session.
*/
max_files: number | null;
}
/**
* History retention preferences returned for the session.
*/
export interface ChatSessionHistory {
/**
* Indicates if chat history is persisted for the session.
*/
enabled: boolean;
/**
* Number of prior threads surfaced in history views. Defaults to null when all
* history is retained.
*/
recent_threads: number | null;
}
/**
* Active per-minute request limit for the session.
*/
export interface ChatSessionRateLimits {
/**
* Maximum allowed requests per one-minute window.
*/
max_requests_per_1_minute: number;
}
/**
* Controls request rate limits for the session.
*/
export interface ChatSessionRateLimitsParam {
/**
* Maximum number of requests allowed per minute for the session. Defaults to 10.
*/
max_requests_per_1_minute?: number;
}
export type ChatSessionStatus = 'active' | 'expired' | 'cancelled';
/**
* Workflow reference and overrides applied to the chat session.
*/
export interface ChatSessionWorkflowParam {
/**
* Identifier for the workflow invoked by the session.
*/
id: string;
/**
* State variables forwarded to the workflow. Keys may be up to 64 characters,
* values must be primitive types, and the map defaults to an empty object.
*/
state_variables?: {
[key: string]: string | boolean | number;
};
/**
* Optional tracing overrides for the workflow invocation. When omitted, tracing is
* enabled by default.
*/
tracing?: ChatSessionWorkflowParam.Tracing;
/**
* Specific workflow version to run. Defaults to the latest deployed version.
*/
version?: string;
}
export declare namespace ChatSessionWorkflowParam {
/**
* Optional tracing overrides for the workflow invocation. When omitted, tracing is
* enabled by default.
*/
interface Tracing {
/**
* Whether tracing is enabled during the session. Defaults to true.
*/
enabled?: boolean;
}
}
/**
* Attachment metadata included on thread items.
*/
export interface ChatKitAttachment {
/**
* Identifier for the attachment.
*/
id: string;
/**
* MIME type of the attachment.
*/
mime_type: string;
/**
* Original display name for the attachment.
*/
name: string;
/**
* Preview URL for rendering the attachment inline.
*/
preview_url: string | null;
/**
* Attachment discriminator.
*/
type: 'image' | 'file';
}
/**
* Assistant response text accompanied by optional annotations.
*/
export interface ChatKitResponseOutputText {
/**
* Ordered list of annotations attached to the response text.
*/
annotations: Array<ChatKitResponseOutputText.File | ChatKitResponseOutputText.URL>;
/**
* Assistant generated text.
*/
text: string;
/**
* Type discriminator that is always `output_text`.
*/
type: 'output_text';
}
export declare namespace ChatKitResponseOutputText {
/**
* Annotation that references an uploaded file.
*/
interface File {
/**
* File attachment referenced by the annotation.
*/
source: File.Source;
/**
* Type discriminator that is always `file` for this annotation.
*/
type: 'file';
}
namespace File {
/**
* File attachment referenced by the annotation.
*/
interface Source {
/**
* Filename referenced by the annotation.
*/
filename: string;
/**
* Type discriminator that is always `file`.
*/
type: 'file';
}
}
/**
* Annotation that references a URL.
*/
interface URL {
/**
* URL referenced by the annotation.
*/
source: URL.Source;
/**
* Type discriminator that is always `url` for this annotation.
*/
type: 'url';
}
namespace URL {
/**
* URL referenced by the annotation.
*/
interface Source {
/**
* Type discriminator that is always `url`.
*/
type: 'url';
/**
* URL referenced by the annotation.
*/
url: string;
}
}
}
/**
* Represents a ChatKit thread and its current status.
*/
export interface ChatKitThread {
/**
* Identifier of the thread.
*/
id: string;
/**
* Unix timestamp (in seconds) for when the thread was created.
*/
created_at: number;
/**
* Type discriminator that is always `chatkit.thread`.
*/
object: 'chatkit.thread';
/**
* Current status for the thread. Defaults to `active` for newly created threads.
*/
status: ChatKitThread.Active | ChatKitThread.Locked | ChatKitThread.Closed;
/**
* Optional human-readable title for the thread. Defaults to null when no title has
* been generated.
*/
title: string | null;
/**
* Free-form string that identifies your end user who owns the thread.
*/
user: string;
}
export declare namespace ChatKitThread {
/**
* Indicates that a thread is active.
*/
interface Active {
/**
* Status discriminator that is always `active`.
*/
type: 'active';
}
/**
* Indicates that a thread is locked and cannot accept new input.
*/
interface Locked {
/**
* Reason that the thread was locked. Defaults to null when no reason is recorded.
*/
reason: string | null;
/**
* Status discriminator that is always `locked`.
*/
type: 'locked';
}
/**
* Indicates that a thread has been closed.
*/
interface Closed {
/**
* Reason that the thread was closed. Defaults to null when no reason is recorded.
*/
reason: string | null;
/**
* Status discriminator that is always `closed`.
*/
type: 'closed';
}
}
/**
* Assistant-authored message within a thread.
*/
export interface ChatKitThreadAssistantMessageItem {
/**
* Identifier of the thread item.
*/
id: string;
/**
* Ordered assistant response segments.
*/
content: Array<ChatKitResponseOutputText>;
/**
* Unix timestamp (in seconds) for when the item was created.
*/
created_at: number;
/**
* Type discriminator that is always `chatkit.thread_item`.
*/
object: 'chatkit.thread_item';
/**
* Identifier of the parent thread.
*/
thread_id: string;
/**
* Type discriminator that is always `chatkit.assistant_message`.
*/
type: 'chatkit.assistant_message';
}
/**
* A paginated list of thread items rendered for the ChatKit API.
*/
export interface ChatKitThreadItemList {
/**
* A list of items
*/
data: Array<ChatKitThreadUserMessageItem | ChatKitThreadAssistantMessageItem | ChatKitWidgetItem | ChatKitThreadItemList.ChatKitClientToolCall | ChatKitThreadItemList.ChatKitTask | ChatKitThreadItemList.ChatKitTaskGroup>;
/**
* The ID of the first item in the list.
*/
first_id: string | null;
/**
* Whether there are more items available.
*/
has_more: boolean;
/**
* The ID of the last item in the list.
*/
last_id: string | null;
/**
* The type of object returned, must be `list`.
*/
object: 'list';
}
export declare namespace ChatKitThreadItemList {
/**
* Record of a client side tool invocation initiated by the assistant.
*/
interface ChatKitClientToolCall {
/**
* Identifier of the thread item.
*/
id: string;
/**
* JSON-encoded arguments that were sent to the tool.
*/
arguments: string;
/**
* Identifier for the client tool call.
*/
call_id: string;
/**
* Unix timestamp (in seconds) for when the item was created.
*/
created_at: number;
/**
* Tool name that was invoked.
*/
name: string;
/**
* Type discriminator that is always `chatkit.thread_item`.
*/
object: 'chatkit.thread_item';
/**
* JSON-encoded output captured from the tool. Defaults to null while execution is
* in progress.
*/
output: string | null;
/**
* Execution status for the tool call.
*/
status: 'in_progress' | 'completed';
/**
* Identifier of the parent thread.
*/
thread_id: string;
/**
* Type discriminator that is always `chatkit.client_tool_call`.
*/
type: 'chatkit.client_tool_call';
}
/**
* Task emitted by the workflow to show progress and status updates.
*/
interface ChatKitTask {
/**
* Identifier of the thread item.
*/
id: string;
/**
* Unix timestamp (in seconds) for when the item was created.
*/
created_at: number;
/**
* Optional heading for the task. Defaults to null when not provided.
*/
heading: string | null;
/**
* Type discriminator that is always `chatkit.thread_item`.
*/
object: 'chatkit.thread_item';
/**
* Optional summary that describes the task. Defaults to null when omitted.
*/
summary: string | null;
/**
* Subtype for the task.
*/
task_type: 'custom' | 'thought';
/**
* Identifier of the parent thread.
*/
thread_id: string;
/**
* Type discriminator that is always `chatkit.task`.
*/
type: 'chatkit.task';
}
/**
* Collection of workflow tasks grouped together in the thread.
*/
interface ChatKitTaskGroup {
/**
* Identifier of the thread item.
*/
id: string;
/**
* Unix timestamp (in seconds) for when the item was created.
*/
created_at: number;
/**
* Type discriminator that is always `chatkit.thread_item`.
*/
object: 'chatkit.thread_item';
/**
* Tasks included in the group.
*/
tasks: Array<ChatKitTaskGroup.Task>;
/**
* Identifier of the parent thread.
*/
thread_id: string;
/**
* Type discriminator that is always `chatkit.task_group`.
*/
type: 'chatkit.task_group';
}
namespace ChatKitTaskGroup {
/**
* Task entry that appears within a TaskGroup.
*/
interface Task {
/**
* Optional heading for the grouped task. Defaults to null when not provided.
*/
heading: string | null;
/**
* Optional summary that describes the grouped task. Defaults to null when omitted.
*/
summary: string | null;
/**
* Subtype for the grouped task.
*/
type: 'custom' | 'thought';
}
}
}
/**
* User-authored messages within a thread.
*/
export interface ChatKitThreadUserMessageItem {
/**
* Identifier of the thread item.
*/
id: string;
/**
* Attachments associated with the user message. Defaults to an empty list.
*/
attachments: Array<ChatKitAttachment>;
/**
* Ordered content elements supplied by the user.
*/
content: Array<ChatKitThreadUserMessageItem.InputText | ChatKitThreadUserMessageItem.QuotedText>;
/**
* Unix timestamp (in seconds) for when the item was created.
*/
created_at: number;
/**
* Inference overrides applied to the message. Defaults to null when unset.
*/
inference_options: ChatKitThreadUserMessageItem.InferenceOptions | null;
/**
* Type discriminator that is always `chatkit.thread_item`.
*/
object: 'chatkit.thread_item';
/**
* Identifier of the parent thread.
*/
thread_id: string;
type: 'chatkit.user_message';
}
export declare namespace ChatKitThreadUserMessageItem {
/**
* Text block that a user contributed to the thread.
*/
interface InputText {
/**
* Plain-text content supplied by the user.
*/
text: string;
/**
* Type discriminator that is always `input_text`.
*/
type: 'input_text';
}
/**
* Quoted snippet that the user referenced in their message.
*/
interface QuotedText {
/**
* Quoted text content.
*/
text: string;
/**
* Type discriminator that is always `quoted_text`.
*/
type: 'quoted_text';
}
/**
* Inference overrides applied to the message. Defaults to null when unset.
*/
interface InferenceOptions {
/**
* Model name that generated the response. Defaults to null when using the session
* default.
*/
model: string | null;
/**
* Preferred tool to invoke. Defaults to null when ChatKit should auto-select.
*/
tool_choice: InferenceOptions.ToolChoice | null;
}
namespace InferenceOptions {
/**
* Preferred tool to invoke. Defaults to null when ChatKit should auto-select.
*/
interface ToolChoice {
/**
* Identifier of the requested tool.
*/
id: string;
}
}
}
/**
* Thread item that renders a widget payload.
*/
export interface ChatKitWidgetItem {
/**
* Identifier of the thread item.
*/
id: string;
/**
* Unix timestamp (in seconds) for when the item was created.
*/
created_at: number;
/**
* Type discriminator that is always `chatkit.thread_item`.
*/
object: 'chatkit.thread_item';
/**
* Identifier of the parent thread.
*/
thread_id: string;
/**
* Type discriminator that is always `chatkit.widget`.
*/
type: 'chatkit.widget';
/**
* Serialized widget payload rendered in the UI.
*/
widget: string;
}
/**
* Confirmation payload returned after deleting a thread.
*/
export interface ThreadDeleteResponse {
/**
* Identifier of the deleted thread.
*/
id: string;
/**
* Indicates that the thread has been deleted.
*/
deleted: boolean;
/**
* Type discriminator that is always `chatkit.thread.deleted`.
*/
object: 'chatkit.thread.deleted';
}
export interface ThreadListParams extends ConversationCursorPageParams {
/**
* List items created before this thread item ID. Defaults to null for the newest
* results.
*/
before?: string;
/**
* Sort order for results by creation time. Defaults to `desc`.
*/
order?: 'asc' | 'desc';
/**
* Filter threads that belong to this user identifier. Defaults to null to return
* all users.
*/
user?: string;
}
export interface ThreadListItemsParams extends ConversationCursorPageParams {
/**
* List items created before this thread item ID. Defaults to null for the newest
* results.
*/
before?: string;
/**
* Sort order for results by creation time. Defaults to `desc`.
*/
order?: 'asc' | 'desc';
}
export declare namespace Threads {
export { type ChatSession as ChatSession, type ChatSessionAutomaticThreadTitling as ChatSessionAutomaticThreadTitling, type ChatSessionChatKitConfiguration as ChatSessionChatKitConfiguration, type ChatSessionChatKitConfigurationParam as ChatSessionChatKitConfigurationParam, type ChatSessionExpiresAfterParam as ChatSessionExpiresAfterParam, type ChatSessionFileUpload as ChatSessionFileUpload, type ChatSessionHistory as ChatSessionHistory, type ChatSessionRateLimits as ChatSessionRateLimits, type ChatSessionRateLimitsParam as ChatSessionRateLimitsParam, type ChatSessionStatus as ChatSessionStatus, type ChatSessionWorkflowParam as ChatSessionWorkflowParam, type ChatKitAttachment as ChatKitAttachment, type ChatKitResponseOutputText as ChatKitResponseOutputText, type ChatKitThread as ChatKitThread, type ChatKitThreadAssistantMessageItem as ChatKitThreadAssistantMessageItem, type ChatKitThreadItemList as ChatKitThreadItemList, type ChatKitThreadUserMessageItem as ChatKitThreadUserMessageItem, type ChatKitWidgetItem as ChatKitWidgetItem, type ThreadDeleteResponse as ThreadDeleteResponse, type ChatKitThreadsPage as ChatKitThreadsPage, type ChatKitThreadItemListDataPage as ChatKitThreadItemListDataPage, type ThreadListParams as ThreadListParams, type ThreadListItemsParams as ThreadListItemsParams, };
}
//# sourceMappingURL=threads.d.mts.map
File diff suppressed because one or more lines are too long
+811
View File
@@ -0,0 +1,811 @@
import { APIResource } from "../../../core/resource.js";
import * as ChatKitAPI from "./chatkit.js";
import { APIPromise } from "../../../core/api-promise.js";
import { ConversationCursorPage, type ConversationCursorPageParams, PagePromise } from "../../../core/pagination.js";
import { RequestOptions } from "../../../internal/request-options.js";
export declare class Threads extends APIResource {
/**
* Retrieve a ChatKit thread by its identifier.
*
* @example
* ```ts
* const chatkitThread =
* await client.beta.chatkit.threads.retrieve('cthr_123');
* ```
*/
retrieve(threadID: string, options?: RequestOptions): APIPromise<ChatKitThread>;
/**
* List ChatKit threads with optional pagination and user filters.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const chatkitThread of client.beta.chatkit.threads.list()) {
* // ...
* }
* ```
*/
list(query?: ThreadListParams | null | undefined, options?: RequestOptions): PagePromise<ChatKitThreadsPage, ChatKitThread>;
/**
* Delete a ChatKit thread along with its items and stored attachments.
*
* @example
* ```ts
* const thread = await client.beta.chatkit.threads.delete(
* 'cthr_123',
* );
* ```
*/
delete(threadID: string, options?: RequestOptions): APIPromise<ThreadDeleteResponse>;
/**
* List items that belong to a ChatKit thread.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const thread of client.beta.chatkit.threads.listItems(
* 'cthr_123',
* )) {
* // ...
* }
* ```
*/
listItems(threadID: string, query?: ThreadListItemsParams | null | undefined, options?: RequestOptions): PagePromise<ChatKitThreadItemListDataPage, ChatKitThreadUserMessageItem | ChatKitThreadAssistantMessageItem | ChatKitWidgetItem | ChatKitThreadItemList.ChatKitClientToolCall | ChatKitThreadItemList.ChatKitTask | ChatKitThreadItemList.ChatKitTaskGroup>;
}
export type ChatKitThreadsPage = ConversationCursorPage<ChatKitThread>;
export type ChatKitThreadItemListDataPage = ConversationCursorPage<ChatKitThreadUserMessageItem | ChatKitThreadAssistantMessageItem | ChatKitWidgetItem | ChatKitThreadItemList.ChatKitClientToolCall | ChatKitThreadItemList.ChatKitTask | ChatKitThreadItemList.ChatKitTaskGroup>;
/**
* Represents a ChatKit session and its resolved configuration.
*/
export interface ChatSession {
/**
* Identifier for the ChatKit session.
*/
id: string;
/**
* Resolved ChatKit feature configuration for the session.
*/
chatkit_configuration: ChatSessionChatKitConfiguration;
/**
* Ephemeral client secret that authenticates session requests.
*/
client_secret: string;
/**
* Unix timestamp (in seconds) for when the session expires.
*/
expires_at: number;
/**
* Convenience copy of the per-minute request limit.
*/
max_requests_per_1_minute: number;
/**
* Type discriminator that is always `chatkit.session`.
*/
object: 'chatkit.session';
/**
* Resolved rate limit values.
*/
rate_limits: ChatSessionRateLimits;
/**
* Current lifecycle state of the session.
*/
status: ChatSessionStatus;
/**
* User identifier associated with the session.
*/
user: string;
/**
* Workflow metadata for the session.
*/
workflow: ChatKitAPI.ChatKitWorkflow;
}
/**
* Automatic thread title preferences for the session.
*/
export interface ChatSessionAutomaticThreadTitling {
/**
* Whether automatic thread titling is enabled.
*/
enabled: boolean;
}
/**
* ChatKit configuration for the session.
*/
export interface ChatSessionChatKitConfiguration {
/**
* Automatic thread titling preferences.
*/
automatic_thread_titling: ChatSessionAutomaticThreadTitling;
/**
* Upload settings for the session.
*/
file_upload: ChatSessionFileUpload;
/**
* History retention configuration.
*/
history: ChatSessionHistory;
}
/**
* Optional per-session configuration settings for ChatKit behavior.
*/
export interface ChatSessionChatKitConfigurationParam {
/**
* Configuration for automatic thread titling. When omitted, automatic thread
* titling is enabled by default.
*/
automatic_thread_titling?: ChatSessionChatKitConfigurationParam.AutomaticThreadTitling;
/**
* Configuration for upload enablement and limits. When omitted, uploads are
* disabled by default (max_files 10, max_file_size 512 MB).
*/
file_upload?: ChatSessionChatKitConfigurationParam.FileUpload;
/**
* Configuration for chat history retention. When omitted, history is enabled by
* default with no limit on recent_threads (null).
*/
history?: ChatSessionChatKitConfigurationParam.History;
}
export declare namespace ChatSessionChatKitConfigurationParam {
/**
* Configuration for automatic thread titling. When omitted, automatic thread
* titling is enabled by default.
*/
interface AutomaticThreadTitling {
/**
* Enable automatic thread title generation. Defaults to true.
*/
enabled?: boolean;
}
/**
* Configuration for upload enablement and limits. When omitted, uploads are
* disabled by default (max_files 10, max_file_size 512 MB).
*/
interface FileUpload {
/**
* Enable uploads for this session. Defaults to false.
*/
enabled?: boolean;
/**
* Maximum size in megabytes for each uploaded file. Defaults to 512 MB, which is
* the maximum allowable size.
*/
max_file_size?: number;
/**
* Maximum number of files that can be uploaded to the session. Defaults to 10.
*/
max_files?: number;
}
/**
* Configuration for chat history retention. When omitted, history is enabled by
* default with no limit on recent_threads (null).
*/
interface History {
/**
* Enables chat users to access previous ChatKit threads. Defaults to true.
*/
enabled?: boolean;
/**
* Number of recent ChatKit threads users have access to. Defaults to unlimited
* when unset.
*/
recent_threads?: number;
}
}
/**
* Controls when the session expires relative to an anchor timestamp.
*/
export interface ChatSessionExpiresAfterParam {
/**
* Base timestamp used to calculate expiration. Currently fixed to `created_at`.
*/
anchor: 'created_at';
/**
* Number of seconds after the anchor when the session expires.
*/
seconds: number;
}
/**
* Upload permissions and limits applied to the session.
*/
export interface ChatSessionFileUpload {
/**
* Indicates if uploads are enabled for the session.
*/
enabled: boolean;
/**
* Maximum upload size in megabytes.
*/
max_file_size: number | null;
/**
* Maximum number of uploads allowed during the session.
*/
max_files: number | null;
}
/**
* History retention preferences returned for the session.
*/
export interface ChatSessionHistory {
/**
* Indicates if chat history is persisted for the session.
*/
enabled: boolean;
/**
* Number of prior threads surfaced in history views. Defaults to null when all
* history is retained.
*/
recent_threads: number | null;
}
/**
* Active per-minute request limit for the session.
*/
export interface ChatSessionRateLimits {
/**
* Maximum allowed requests per one-minute window.
*/
max_requests_per_1_minute: number;
}
/**
* Controls request rate limits for the session.
*/
export interface ChatSessionRateLimitsParam {
/**
* Maximum number of requests allowed per minute for the session. Defaults to 10.
*/
max_requests_per_1_minute?: number;
}
export type ChatSessionStatus = 'active' | 'expired' | 'cancelled';
/**
* Workflow reference and overrides applied to the chat session.
*/
export interface ChatSessionWorkflowParam {
/**
* Identifier for the workflow invoked by the session.
*/
id: string;
/**
* State variables forwarded to the workflow. Keys may be up to 64 characters,
* values must be primitive types, and the map defaults to an empty object.
*/
state_variables?: {
[key: string]: string | boolean | number;
};
/**
* Optional tracing overrides for the workflow invocation. When omitted, tracing is
* enabled by default.
*/
tracing?: ChatSessionWorkflowParam.Tracing;
/**
* Specific workflow version to run. Defaults to the latest deployed version.
*/
version?: string;
}
export declare namespace ChatSessionWorkflowParam {
/**
* Optional tracing overrides for the workflow invocation. When omitted, tracing is
* enabled by default.
*/
interface Tracing {
/**
* Whether tracing is enabled during the session. Defaults to true.
*/
enabled?: boolean;
}
}
/**
* Attachment metadata included on thread items.
*/
export interface ChatKitAttachment {
/**
* Identifier for the attachment.
*/
id: string;
/**
* MIME type of the attachment.
*/
mime_type: string;
/**
* Original display name for the attachment.
*/
name: string;
/**
* Preview URL for rendering the attachment inline.
*/
preview_url: string | null;
/**
* Attachment discriminator.
*/
type: 'image' | 'file';
}
/**
* Assistant response text accompanied by optional annotations.
*/
export interface ChatKitResponseOutputText {
/**
* Ordered list of annotations attached to the response text.
*/
annotations: Array<ChatKitResponseOutputText.File | ChatKitResponseOutputText.URL>;
/**
* Assistant generated text.
*/
text: string;
/**
* Type discriminator that is always `output_text`.
*/
type: 'output_text';
}
export declare namespace ChatKitResponseOutputText {
/**
* Annotation that references an uploaded file.
*/
interface File {
/**
* File attachment referenced by the annotation.
*/
source: File.Source;
/**
* Type discriminator that is always `file` for this annotation.
*/
type: 'file';
}
namespace File {
/**
* File attachment referenced by the annotation.
*/
interface Source {
/**
* Filename referenced by the annotation.
*/
filename: string;
/**
* Type discriminator that is always `file`.
*/
type: 'file';
}
}
/**
* Annotation that references a URL.
*/
interface URL {
/**
* URL referenced by the annotation.
*/
source: URL.Source;
/**
* Type discriminator that is always `url` for this annotation.
*/
type: 'url';
}
namespace URL {
/**
* URL referenced by the annotation.
*/
interface Source {
/**
* Type discriminator that is always `url`.
*/
type: 'url';
/**
* URL referenced by the annotation.
*/
url: string;
}
}
}
/**
* Represents a ChatKit thread and its current status.
*/
export interface ChatKitThread {
/**
* Identifier of the thread.
*/
id: string;
/**
* Unix timestamp (in seconds) for when the thread was created.
*/
created_at: number;
/**
* Type discriminator that is always `chatkit.thread`.
*/
object: 'chatkit.thread';
/**
* Current status for the thread. Defaults to `active` for newly created threads.
*/
status: ChatKitThread.Active | ChatKitThread.Locked | ChatKitThread.Closed;
/**
* Optional human-readable title for the thread. Defaults to null when no title has
* been generated.
*/
title: string | null;
/**
* Free-form string that identifies your end user who owns the thread.
*/
user: string;
}
export declare namespace ChatKitThread {
/**
* Indicates that a thread is active.
*/
interface Active {
/**
* Status discriminator that is always `active`.
*/
type: 'active';
}
/**
* Indicates that a thread is locked and cannot accept new input.
*/
interface Locked {
/**
* Reason that the thread was locked. Defaults to null when no reason is recorded.
*/
reason: string | null;
/**
* Status discriminator that is always `locked`.
*/
type: 'locked';
}
/**
* Indicates that a thread has been closed.
*/
interface Closed {
/**
* Reason that the thread was closed. Defaults to null when no reason is recorded.
*/
reason: string | null;
/**
* Status discriminator that is always `closed`.
*/
type: 'closed';
}
}
/**
* Assistant-authored message within a thread.
*/
export interface ChatKitThreadAssistantMessageItem {
/**
* Identifier of the thread item.
*/
id: string;
/**
* Ordered assistant response segments.
*/
content: Array<ChatKitResponseOutputText>;
/**
* Unix timestamp (in seconds) for when the item was created.
*/
created_at: number;
/**
* Type discriminator that is always `chatkit.thread_item`.
*/
object: 'chatkit.thread_item';
/**
* Identifier of the parent thread.
*/
thread_id: string;
/**
* Type discriminator that is always `chatkit.assistant_message`.
*/
type: 'chatkit.assistant_message';
}
/**
* A paginated list of thread items rendered for the ChatKit API.
*/
export interface ChatKitThreadItemList {
/**
* A list of items
*/
data: Array<ChatKitThreadUserMessageItem | ChatKitThreadAssistantMessageItem | ChatKitWidgetItem | ChatKitThreadItemList.ChatKitClientToolCall | ChatKitThreadItemList.ChatKitTask | ChatKitThreadItemList.ChatKitTaskGroup>;
/**
* The ID of the first item in the list.
*/
first_id: string | null;
/**
* Whether there are more items available.
*/
has_more: boolean;
/**
* The ID of the last item in the list.
*/
last_id: string | null;
/**
* The type of object returned, must be `list`.
*/
object: 'list';
}
export declare namespace ChatKitThreadItemList {
/**
* Record of a client side tool invocation initiated by the assistant.
*/
interface ChatKitClientToolCall {
/**
* Identifier of the thread item.
*/
id: string;
/**
* JSON-encoded arguments that were sent to the tool.
*/
arguments: string;
/**
* Identifier for the client tool call.
*/
call_id: string;
/**
* Unix timestamp (in seconds) for when the item was created.
*/
created_at: number;
/**
* Tool name that was invoked.
*/
name: string;
/**
* Type discriminator that is always `chatkit.thread_item`.
*/
object: 'chatkit.thread_item';
/**
* JSON-encoded output captured from the tool. Defaults to null while execution is
* in progress.
*/
output: string | null;
/**
* Execution status for the tool call.
*/
status: 'in_progress' | 'completed';
/**
* Identifier of the parent thread.
*/
thread_id: string;
/**
* Type discriminator that is always `chatkit.client_tool_call`.
*/
type: 'chatkit.client_tool_call';
}
/**
* Task emitted by the workflow to show progress and status updates.
*/
interface ChatKitTask {
/**
* Identifier of the thread item.
*/
id: string;
/**
* Unix timestamp (in seconds) for when the item was created.
*/
created_at: number;
/**
* Optional heading for the task. Defaults to null when not provided.
*/
heading: string | null;
/**
* Type discriminator that is always `chatkit.thread_item`.
*/
object: 'chatkit.thread_item';
/**
* Optional summary that describes the task. Defaults to null when omitted.
*/
summary: string | null;
/**
* Subtype for the task.
*/
task_type: 'custom' | 'thought';
/**
* Identifier of the parent thread.
*/
thread_id: string;
/**
* Type discriminator that is always `chatkit.task`.
*/
type: 'chatkit.task';
}
/**
* Collection of workflow tasks grouped together in the thread.
*/
interface ChatKitTaskGroup {
/**
* Identifier of the thread item.
*/
id: string;
/**
* Unix timestamp (in seconds) for when the item was created.
*/
created_at: number;
/**
* Type discriminator that is always `chatkit.thread_item`.
*/
object: 'chatkit.thread_item';
/**
* Tasks included in the group.
*/
tasks: Array<ChatKitTaskGroup.Task>;
/**
* Identifier of the parent thread.
*/
thread_id: string;
/**
* Type discriminator that is always `chatkit.task_group`.
*/
type: 'chatkit.task_group';
}
namespace ChatKitTaskGroup {
/**
* Task entry that appears within a TaskGroup.
*/
interface Task {
/**
* Optional heading for the grouped task. Defaults to null when not provided.
*/
heading: string | null;
/**
* Optional summary that describes the grouped task. Defaults to null when omitted.
*/
summary: string | null;
/**
* Subtype for the grouped task.
*/
type: 'custom' | 'thought';
}
}
}
/**
* User-authored messages within a thread.
*/
export interface ChatKitThreadUserMessageItem {
/**
* Identifier of the thread item.
*/
id: string;
/**
* Attachments associated with the user message. Defaults to an empty list.
*/
attachments: Array<ChatKitAttachment>;
/**
* Ordered content elements supplied by the user.
*/
content: Array<ChatKitThreadUserMessageItem.InputText | ChatKitThreadUserMessageItem.QuotedText>;
/**
* Unix timestamp (in seconds) for when the item was created.
*/
created_at: number;
/**
* Inference overrides applied to the message. Defaults to null when unset.
*/
inference_options: ChatKitThreadUserMessageItem.InferenceOptions | null;
/**
* Type discriminator that is always `chatkit.thread_item`.
*/
object: 'chatkit.thread_item';
/**
* Identifier of the parent thread.
*/
thread_id: string;
type: 'chatkit.user_message';
}
export declare namespace ChatKitThreadUserMessageItem {
/**
* Text block that a user contributed to the thread.
*/
interface InputText {
/**
* Plain-text content supplied by the user.
*/
text: string;
/**
* Type discriminator that is always `input_text`.
*/
type: 'input_text';
}
/**
* Quoted snippet that the user referenced in their message.
*/
interface QuotedText {
/**
* Quoted text content.
*/
text: string;
/**
* Type discriminator that is always `quoted_text`.
*/
type: 'quoted_text';
}
/**
* Inference overrides applied to the message. Defaults to null when unset.
*/
interface InferenceOptions {
/**
* Model name that generated the response. Defaults to null when using the session
* default.
*/
model: string | null;
/**
* Preferred tool to invoke. Defaults to null when ChatKit should auto-select.
*/
tool_choice: InferenceOptions.ToolChoice | null;
}
namespace InferenceOptions {
/**
* Preferred tool to invoke. Defaults to null when ChatKit should auto-select.
*/
interface ToolChoice {
/**
* Identifier of the requested tool.
*/
id: string;
}
}
}
/**
* Thread item that renders a widget payload.
*/
export interface ChatKitWidgetItem {
/**
* Identifier of the thread item.
*/
id: string;
/**
* Unix timestamp (in seconds) for when the item was created.
*/
created_at: number;
/**
* Type discriminator that is always `chatkit.thread_item`.
*/
object: 'chatkit.thread_item';
/**
* Identifier of the parent thread.
*/
thread_id: string;
/**
* Type discriminator that is always `chatkit.widget`.
*/
type: 'chatkit.widget';
/**
* Serialized widget payload rendered in the UI.
*/
widget: string;
}
/**
* Confirmation payload returned after deleting a thread.
*/
export interface ThreadDeleteResponse {
/**
* Identifier of the deleted thread.
*/
id: string;
/**
* Indicates that the thread has been deleted.
*/
deleted: boolean;
/**
* Type discriminator that is always `chatkit.thread.deleted`.
*/
object: 'chatkit.thread.deleted';
}
export interface ThreadListParams extends ConversationCursorPageParams {
/**
* List items created before this thread item ID. Defaults to null for the newest
* results.
*/
before?: string;
/**
* Sort order for results by creation time. Defaults to `desc`.
*/
order?: 'asc' | 'desc';
/**
* Filter threads that belong to this user identifier. Defaults to null to return
* all users.
*/
user?: string;
}
export interface ThreadListItemsParams extends ConversationCursorPageParams {
/**
* List items created before this thread item ID. Defaults to null for the newest
* results.
*/
before?: string;
/**
* Sort order for results by creation time. Defaults to `desc`.
*/
order?: 'asc' | 'desc';
}
export declare namespace Threads {
export { type ChatSession as ChatSession, type ChatSessionAutomaticThreadTitling as ChatSessionAutomaticThreadTitling, type ChatSessionChatKitConfiguration as ChatSessionChatKitConfiguration, type ChatSessionChatKitConfigurationParam as ChatSessionChatKitConfigurationParam, type ChatSessionExpiresAfterParam as ChatSessionExpiresAfterParam, type ChatSessionFileUpload as ChatSessionFileUpload, type ChatSessionHistory as ChatSessionHistory, type ChatSessionRateLimits as ChatSessionRateLimits, type ChatSessionRateLimitsParam as ChatSessionRateLimitsParam, type ChatSessionStatus as ChatSessionStatus, type ChatSessionWorkflowParam as ChatSessionWorkflowParam, type ChatKitAttachment as ChatKitAttachment, type ChatKitResponseOutputText as ChatKitResponseOutputText, type ChatKitThread as ChatKitThread, type ChatKitThreadAssistantMessageItem as ChatKitThreadAssistantMessageItem, type ChatKitThreadItemList as ChatKitThreadItemList, type ChatKitThreadUserMessageItem as ChatKitThreadUserMessageItem, type ChatKitWidgetItem as ChatKitWidgetItem, type ThreadDeleteResponse as ThreadDeleteResponse, type ChatKitThreadsPage as ChatKitThreadsPage, type ChatKitThreadItemListDataPage as ChatKitThreadItemListDataPage, type ThreadListParams as ThreadListParams, type ThreadListItemsParams as ThreadListItemsParams, };
}
//# sourceMappingURL=threads.d.ts.map
File diff suppressed because one or more lines are too long
+77
View File
@@ -0,0 +1,77 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.Threads = void 0;
const resource_1 = require("../../../core/resource.js");
const pagination_1 = require("../../../core/pagination.js");
const headers_1 = require("../../../internal/headers.js");
const path_1 = require("../../../internal/utils/path.js");
class Threads extends resource_1.APIResource {
/**
* Retrieve a ChatKit thread by its identifier.
*
* @example
* ```ts
* const chatkitThread =
* await client.beta.chatkit.threads.retrieve('cthr_123');
* ```
*/
retrieve(threadID, options) {
return this._client.get((0, path_1.path) `/chatkit/threads/${threadID}`, {
...options,
headers: (0, headers_1.buildHeaders)([{ 'OpenAI-Beta': 'chatkit_beta=v1' }, options?.headers]),
});
}
/**
* List ChatKit threads with optional pagination and user filters.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const chatkitThread of client.beta.chatkit.threads.list()) {
* // ...
* }
* ```
*/
list(query = {}, options) {
return this._client.getAPIList('/chatkit/threads', (pagination_1.ConversationCursorPage), {
query,
...options,
headers: (0, headers_1.buildHeaders)([{ 'OpenAI-Beta': 'chatkit_beta=v1' }, options?.headers]),
});
}
/**
* Delete a ChatKit thread along with its items and stored attachments.
*
* @example
* ```ts
* const thread = await client.beta.chatkit.threads.delete(
* 'cthr_123',
* );
* ```
*/
delete(threadID, options) {
return this._client.delete((0, path_1.path) `/chatkit/threads/${threadID}`, {
...options,
headers: (0, headers_1.buildHeaders)([{ 'OpenAI-Beta': 'chatkit_beta=v1' }, options?.headers]),
});
}
/**
* List items that belong to a ChatKit thread.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const thread of client.beta.chatkit.threads.listItems(
* 'cthr_123',
* )) {
* // ...
* }
* ```
*/
listItems(threadID, query = {}, options) {
return this._client.getAPIList((0, path_1.path) `/chatkit/threads/${threadID}/items`, (pagination_1.ConversationCursorPage), { query, ...options, headers: (0, headers_1.buildHeaders)([{ 'OpenAI-Beta': 'chatkit_beta=v1' }, options?.headers]) });
}
}
exports.Threads = Threads;
//# sourceMappingURL=threads.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"threads.js","sourceRoot":"","sources":["../../../src/resources/beta/chatkit/threads.ts"],"names":[],"mappings":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xC,CAAA,mCAOC,CAAA,EACD,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,aAAa,EAAE,iBAAiB,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,EAAE,CACvG,CAAC;IACJ,CAAC;CACF;AA/FD,0BA+FC"}
+73
View File
@@ -0,0 +1,73 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../../core/resource.mjs";
import { ConversationCursorPage, } from "../../../core/pagination.mjs";
import { buildHeaders } from "../../../internal/headers.mjs";
import { path } from "../../../internal/utils/path.mjs";
export class Threads extends APIResource {
/**
* Retrieve a ChatKit thread by its identifier.
*
* @example
* ```ts
* const chatkitThread =
* await client.beta.chatkit.threads.retrieve('cthr_123');
* ```
*/
retrieve(threadID, options) {
return this._client.get(path `/chatkit/threads/${threadID}`, {
...options,
headers: buildHeaders([{ 'OpenAI-Beta': 'chatkit_beta=v1' }, options?.headers]),
});
}
/**
* List ChatKit threads with optional pagination and user filters.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const chatkitThread of client.beta.chatkit.threads.list()) {
* // ...
* }
* ```
*/
list(query = {}, options) {
return this._client.getAPIList('/chatkit/threads', (ConversationCursorPage), {
query,
...options,
headers: buildHeaders([{ 'OpenAI-Beta': 'chatkit_beta=v1' }, options?.headers]),
});
}
/**
* Delete a ChatKit thread along with its items and stored attachments.
*
* @example
* ```ts
* const thread = await client.beta.chatkit.threads.delete(
* 'cthr_123',
* );
* ```
*/
delete(threadID, options) {
return this._client.delete(path `/chatkit/threads/${threadID}`, {
...options,
headers: buildHeaders([{ 'OpenAI-Beta': 'chatkit_beta=v1' }, options?.headers]),
});
}
/**
* List items that belong to a ChatKit thread.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const thread of client.beta.chatkit.threads.listItems(
* 'cthr_123',
* )) {
* // ...
* }
* ```
*/
listItems(threadID, query = {}, options) {
return this._client.getAPIList(path `/chatkit/threads/${threadID}/items`, (ConversationCursorPage), { query, ...options, headers: buildHeaders([{ 'OpenAI-Beta': 'chatkit_beta=v1' }, options?.headers]) });
}
}
//# sourceMappingURL=threads.mjs.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"threads.mjs","sourceRoot":"","sources":["../../../src/resources/beta/chatkit/threads.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EACL,sBAAsB,GAGvB;OACM,EAAE,YAAY,EAAE;OAEhB,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;OAQG;IACH,QAAQ,CAAC,QAAgB,EAAE,OAAwB;QACjD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,oBAAoB,QAAQ,EAAE,EAAE;YAC1D,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,aAAa,EAAE,iBAAiB,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAChF,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACH,IAAI,CACF,QAA6C,EAAE,EAC/C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,kBAAkB,EAAE,CAAA,sBAAqC,CAAA,EAAE;YACxF,KAAK;YACL,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,aAAa,EAAE,iBAAiB,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAChF,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,QAAgB,EAAE,OAAwB;QAC/C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,oBAAoB,QAAQ,EAAE,EAAE;YAC7D,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,aAAa,EAAE,iBAAiB,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAChF,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,SAAS,CACP,QAAgB,EAChB,QAAkD,EAAE,EACpD,OAAwB;QAUxB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,IAAI,CAAA,oBAAoB,QAAQ,QAAQ,EACxC,CAAA,sBAOC,CAAA,EACD,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,aAAa,EAAE,iBAAiB,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,EAAE,CACvG,CAAC;IACJ,CAAC;CACF"}
+6
View File
@@ -0,0 +1,6 @@
export { Assistants, type Assistant, type AssistantDeleted, type AssistantStreamEvent, type AssistantTool, type CodeInterpreterTool, type FileSearchTool, type FunctionTool, type MessageStreamEvent, type RunStepStreamEvent, type RunStreamEvent, type ThreadStreamEvent, type AssistantCreateParams, type AssistantUpdateParams, type AssistantListParams, type AssistantsPage, } from "./assistants.mjs";
export { Beta } from "./beta.mjs";
export { Realtime } from "./realtime/index.mjs";
export { ChatKit, type ChatKitWorkflow } from "./chatkit/index.mjs";
export { Threads, type AssistantResponseFormatOption, type AssistantToolChoice, type AssistantToolChoiceFunction, type AssistantToolChoiceOption, type Thread, type ThreadDeleted, type ThreadCreateParams, type ThreadUpdateParams, type ThreadCreateAndRunParams, type ThreadCreateAndRunParamsNonStreaming, type ThreadCreateAndRunParamsStreaming, type ThreadCreateAndRunPollParams, type ThreadCreateAndRunStreamParams, } from "./threads/index.mjs";
//# sourceMappingURL=index.d.mts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/resources/beta/index.ts"],"names":[],"mappings":"OAEO,EACL,UAAU,EACV,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,cAAc,GACpB;OACM,EAAE,IAAI,EAAE;OACR,EAAE,QAAQ,EAAE;OACZ,EAAE,OAAO,EAAE,KAAK,eAAe,EAAE;OACjC,EACL,OAAO,EACP,KAAK,6BAA6B,EAClC,KAAK,mBAAmB,EACxB,KAAK,2BAA2B,EAChC,KAAK,yBAAyB,EAC9B,KAAK,MAAM,EACX,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,wBAAwB,EAC7B,KAAK,oCAAoC,EACzC,KAAK,iCAAiC,EACtC,KAAK,4BAA4B,EACjC,KAAK,8BAA8B,GACpC"}
+6
View File
@@ -0,0 +1,6 @@
export { Assistants, type Assistant, type AssistantDeleted, type AssistantStreamEvent, type AssistantTool, type CodeInterpreterTool, type FileSearchTool, type FunctionTool, type MessageStreamEvent, type RunStepStreamEvent, type RunStreamEvent, type ThreadStreamEvent, type AssistantCreateParams, type AssistantUpdateParams, type AssistantListParams, type AssistantsPage, } from "./assistants.js";
export { Beta } from "./beta.js";
export { Realtime } from "./realtime/index.js";
export { ChatKit, type ChatKitWorkflow } from "./chatkit/index.js";
export { Threads, type AssistantResponseFormatOption, type AssistantToolChoice, type AssistantToolChoiceFunction, type AssistantToolChoiceOption, type Thread, type ThreadDeleted, type ThreadCreateParams, type ThreadUpdateParams, type ThreadCreateAndRunParams, type ThreadCreateAndRunParamsNonStreaming, type ThreadCreateAndRunParamsStreaming, type ThreadCreateAndRunPollParams, type ThreadCreateAndRunStreamParams, } from "./threads/index.js";
//# sourceMappingURL=index.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/beta/index.ts"],"names":[],"mappings":"OAEO,EACL,UAAU,EACV,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,cAAc,GACpB;OACM,EAAE,IAAI,EAAE;OACR,EAAE,QAAQ,EAAE;OACZ,EAAE,OAAO,EAAE,KAAK,eAAe,EAAE;OACjC,EACL,OAAO,EACP,KAAK,6BAA6B,EAClC,KAAK,mBAAmB,EACxB,KAAK,2BAA2B,EAChC,KAAK,yBAAyB,EAC9B,KAAK,MAAM,EACX,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,wBAAwB,EAC7B,KAAK,oCAAoC,EACzC,KAAK,iCAAiC,EACtC,KAAK,4BAA4B,EACjC,KAAK,8BAA8B,GACpC"}
+15
View File
@@ -0,0 +1,15 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.Threads = exports.ChatKit = exports.Realtime = exports.Beta = exports.Assistants = void 0;
var assistants_1 = require("./assistants.js");
Object.defineProperty(exports, "Assistants", { enumerable: true, get: function () { return assistants_1.Assistants; } });
var beta_1 = require("./beta.js");
Object.defineProperty(exports, "Beta", { enumerable: true, get: function () { return beta_1.Beta; } });
var index_1 = require("./realtime/index.js");
Object.defineProperty(exports, "Realtime", { enumerable: true, get: function () { return index_1.Realtime; } });
var index_2 = require("./chatkit/index.js");
Object.defineProperty(exports, "ChatKit", { enumerable: true, get: function () { return index_2.ChatKit; } });
var index_3 = require("./threads/index.js");
Object.defineProperty(exports, "Threads", { enumerable: true, get: function () { return index_3.Threads; } });
//# sourceMappingURL=index.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/beta/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,8CAiBsB;AAhBpB,wGAAA,UAAU,OAAA;AAiBZ,kCAA8B;AAArB,4FAAA,IAAI,OAAA;AACb,6CAA4C;AAAnC,iGAAA,QAAQ,OAAA;AACjB,4CAAgE;AAAvD,gGAAA,OAAO,OAAA;AAChB,4CAeyB;AAdvB,gGAAA,OAAO,OAAA"}
+7
View File
@@ -0,0 +1,7 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
export { Assistants, } from "./assistants.mjs";
export { Beta } from "./beta.mjs";
export { Realtime } from "./realtime/index.mjs";
export { ChatKit } from "./chatkit/index.mjs";
export { Threads, } from "./threads/index.mjs";
//# sourceMappingURL=index.mjs.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/beta/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,UAAU,GAgBX;OACM,EAAE,IAAI,EAAE;OACR,EAAE,QAAQ,EAAE;OACZ,EAAE,OAAO,EAAwB;OACjC,EACL,OAAO,GAcR"}
+2
View File
@@ -0,0 +1,2 @@
export * from "./realtime/index.mjs";
//# sourceMappingURL=realtime.d.mts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"realtime.d.mts","sourceRoot":"","sources":["../../src/resources/beta/realtime.ts"],"names":[],"mappings":""}
+2
View File
@@ -0,0 +1,2 @@
export * from "./realtime/index.js";
//# sourceMappingURL=realtime.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"realtime.d.ts","sourceRoot":"","sources":["../../src/resources/beta/realtime.ts"],"names":[],"mappings":""}
+6
View File
@@ -0,0 +1,6 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("../../internal/tslib.js");
tslib_1.__exportStar(require("./realtime/index.js"), exports);
//# sourceMappingURL=realtime.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"realtime.js","sourceRoot":"","sources":["../../src/resources/beta/realtime.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,8DAAiC"}
+3
View File
@@ -0,0 +1,3 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
export * from "./realtime/index.mjs";
//# sourceMappingURL=realtime.mjs.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"realtime.mjs","sourceRoot":"","sources":["../../src/resources/beta/realtime.ts"],"names":[],"mappings":"AAAA,sFAAsF"}
+4
View File
@@ -0,0 +1,4 @@
export { Realtime } from "./realtime.mjs";
export { Sessions, type Session, type SessionCreateResponse, type SessionCreateParams } from "./sessions.mjs";
export { TranscriptionSessions, type TranscriptionSession, type TranscriptionSessionCreateParams, } from "./transcription-sessions.mjs";
//# sourceMappingURL=index.d.mts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/resources/beta/realtime/index.ts"],"names":[],"mappings":"OAEO,EAAE,QAAQ,EAAE;OACZ,EAAE,QAAQ,EAAE,KAAK,OAAO,EAAE,KAAK,qBAAqB,EAAE,KAAK,mBAAmB,EAAE;OAChF,EACL,qBAAqB,EACrB,KAAK,oBAAoB,EACzB,KAAK,gCAAgC,GACtC"}
+4
View File
@@ -0,0 +1,4 @@
export { Realtime } from "./realtime.js";
export { Sessions, type Session, type SessionCreateResponse, type SessionCreateParams } from "./sessions.js";
export { TranscriptionSessions, type TranscriptionSession, type TranscriptionSessionCreateParams, } from "./transcription-sessions.js";
//# sourceMappingURL=index.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/resources/beta/realtime/index.ts"],"names":[],"mappings":"OAEO,EAAE,QAAQ,EAAE;OACZ,EAAE,QAAQ,EAAE,KAAK,OAAO,EAAE,KAAK,qBAAqB,EAAE,KAAK,mBAAmB,EAAE;OAChF,EACL,qBAAqB,EACrB,KAAK,oBAAoB,EACzB,KAAK,gCAAgC,GACtC"}
+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.TranscriptionSessions = exports.Sessions = exports.Realtime = void 0;
var realtime_1 = require("./realtime.js");
Object.defineProperty(exports, "Realtime", { enumerable: true, get: function () { return realtime_1.Realtime; } });
var sessions_1 = require("./sessions.js");
Object.defineProperty(exports, "Sessions", { enumerable: true, get: function () { return sessions_1.Sessions; } });
var transcription_sessions_1 = require("./transcription-sessions.js");
Object.defineProperty(exports, "TranscriptionSessions", { enumerable: true, get: function () { return transcription_sessions_1.TranscriptionSessions; } });
//# sourceMappingURL=index.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/resources/beta/realtime/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,0CAAsC;AAA7B,oGAAA,QAAQ,OAAA;AACjB,0CAA0G;AAAjG,oGAAA,QAAQ,OAAA;AACjB,sEAIkC;AAHhC,+HAAA,qBAAqB,OAAA"}
+5
View File
@@ -0,0 +1,5 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
export { Realtime } from "./realtime.mjs";
export { Sessions } from "./sessions.mjs";
export { TranscriptionSessions, } from "./transcription-sessions.mjs";
//# sourceMappingURL=index.mjs.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/resources/beta/realtime/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,QAAQ,EAAE;OACZ,EAAE,QAAQ,EAAsE;OAChF,EACL,qBAAqB,GAGtB"}
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
+24
View File
@@ -0,0 +1,24 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.Realtime = void 0;
const tslib_1 = require("../../../internal/tslib.js");
const resource_1 = require("../../../core/resource.js");
const SessionsAPI = tslib_1.__importStar(require("./sessions.js"));
const sessions_1 = require("./sessions.js");
const TranscriptionSessionsAPI = tslib_1.__importStar(require("./transcription-sessions.js"));
const transcription_sessions_1 = require("./transcription-sessions.js");
/**
* @deprecated Realtime has now launched and is generally available. The old beta API is now deprecated.
*/
class Realtime extends resource_1.APIResource {
constructor() {
super(...arguments);
this.sessions = new SessionsAPI.Sessions(this._client);
this.transcriptionSessions = new TranscriptionSessionsAPI.TranscriptionSessions(this._client);
}
}
exports.Realtime = Realtime;
Realtime.Sessions = sessions_1.Sessions;
Realtime.TranscriptionSessions = transcription_sessions_1.TranscriptionSessions;
//# sourceMappingURL=realtime.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"realtime.js","sourceRoot":"","sources":["../../../src/resources/beta/realtime/realtime.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,wDAAqD;AAGrD,mEAA0C;AAC1C,4CAKoB;AACpB,8FAAqE;AACrE,wEAIkC;AAElC;;GAEG;AACH,MAAa,QAAS,SAAQ,sBAAW;IAAzC;;QACE,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACxE,0BAAqB,GACnB,IAAI,wBAAwB,CAAC,qBAAqB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACrE,CAAC;CAAA;AAJD,4BAIC;AA8qFD,QAAQ,CAAC,QAAQ,GAAG,mBAAQ,CAAC;AAC7B,QAAQ,CAAC,qBAAqB,GAAG,8CAAqB,CAAC"}
+19
View File
@@ -0,0 +1,19 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../../core/resource.mjs";
import * as SessionsAPI from "./sessions.mjs";
import { Sessions, } from "./sessions.mjs";
import * as TranscriptionSessionsAPI from "./transcription-sessions.mjs";
import { TranscriptionSessions, } from "./transcription-sessions.mjs";
/**
* @deprecated Realtime has now launched and is generally available. The old beta API is now deprecated.
*/
export class Realtime extends APIResource {
constructor() {
super(...arguments);
this.sessions = new SessionsAPI.Sessions(this._client);
this.transcriptionSessions = new TranscriptionSessionsAPI.TranscriptionSessions(this._client);
}
}
Realtime.Sessions = Sessions;
Realtime.TranscriptionSessions = TranscriptionSessions;
//# sourceMappingURL=realtime.mjs.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"realtime.mjs","sourceRoot":"","sources":["../../../src/resources/beta/realtime/realtime.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,KAAK,WAAW;OAChB,EAIL,QAAQ,GACT;OACM,KAAK,wBAAwB;OAC7B,EAGL,qBAAqB,GACtB;AAED;;GAEG;AACH,MAAM,OAAO,QAAS,SAAQ,WAAW;IAAzC;;QACE,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACxE,0BAAqB,GACnB,IAAI,wBAAwB,CAAC,qBAAqB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACrE,CAAC;CAAA;AA8qFD,QAAQ,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC7B,QAAQ,CAAC,qBAAqB,GAAG,qBAAqB,CAAC"}
+744
View File
@@ -0,0 +1,744 @@
import { APIResource } from "../../../core/resource.mjs";
import { APIPromise } from "../../../core/api-promise.mjs";
import { RequestOptions } from "../../../internal/request-options.mjs";
export declare class Sessions extends APIResource {
/**
* Create an ephemeral API token for use in client-side applications with the
* Realtime API. Can be configured with the same session parameters as the
* `session.update` client event.
*
* It responds with a session object, plus a `client_secret` key which contains a
* usable ephemeral API token that can be used to authenticate browser clients for
* the Realtime API.
*
* @example
* ```ts
* const session =
* await client.beta.realtime.sessions.create();
* ```
*/
create(body: SessionCreateParams, options?: RequestOptions): APIPromise<SessionCreateResponse>;
}
/**
* Realtime session object configuration.
*/
export interface Session {
/**
* Unique identifier for the session that looks like `sess_1234567890abcdef`.
*/
id?: string;
/**
* The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. For
* `pcm16`, input audio must be 16-bit PCM at a 24kHz sample rate, single channel
* (mono), and little-endian byte order.
*/
input_audio_format?: 'pcm16' | 'g711_ulaw' | 'g711_alaw';
/**
* Configuration for input audio noise reduction. This can be set to `null` to turn
* off. Noise reduction filters audio added to the input audio buffer before it is
* sent to VAD and the model. Filtering the audio can improve VAD and turn
* detection accuracy (reducing false positives) and model performance by improving
* perception of the input audio.
*/
input_audio_noise_reduction?: Session.InputAudioNoiseReduction;
/**
* Configuration for input audio transcription, defaults to off and can be set to
* `null` to turn off once on. Input audio transcription is not native to the
* model, since the model consumes audio directly. Transcription runs
* asynchronously through
* [the /audio/transcriptions endpoint](https://platform.openai.com/docs/api-reference/audio/createTranscription)
* and should be treated as guidance of input audio content rather than precisely
* what the model heard. The client can optionally set the language and prompt for
* transcription, these offer additional guidance to the transcription service.
*/
input_audio_transcription?: Session.InputAudioTranscription;
/**
* The default system instructions (i.e. system message) prepended to model calls.
* This field allows the client to guide the model on desired responses. The model
* can be instructed on response content and format, (e.g. "be extremely succinct",
* "act friendly", "here are examples of good responses") and on audio behavior
* (e.g. "talk quickly", "inject emotion into your voice", "laugh frequently"). The
* instructions are not guaranteed to be followed by the model, but they provide
* guidance to the model on the desired behavior.
*
* Note that the server sets default instructions which will be used if this field
* is not set and are visible in the `session.created` event at the start of the
* session.
*/
instructions?: string;
/**
* Maximum number of output tokens for a single assistant response, inclusive of
* tool calls. Provide an integer between 1 and 4096 to limit output tokens, or
* `inf` for the maximum available tokens for a given model. Defaults to `inf`.
*/
max_response_output_tokens?: number | 'inf';
/**
* The set of modalities the model can respond with. To disable audio, set this to
* ["text"].
*/
modalities?: Array<'text' | 'audio'>;
/**
* The Realtime model used for this session.
*/
model?: 'gpt-4o-realtime-preview' | 'gpt-4o-realtime-preview-2024-10-01' | 'gpt-4o-realtime-preview-2024-12-17' | 'gpt-4o-realtime-preview-2025-06-03' | 'gpt-4o-mini-realtime-preview' | 'gpt-4o-mini-realtime-preview-2024-12-17';
/**
* The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
* For `pcm16`, output audio is sampled at a rate of 24kHz.
*/
output_audio_format?: 'pcm16' | 'g711_ulaw' | 'g711_alaw';
/**
* The speed of the model's spoken response. 1.0 is the default speed. 0.25 is the
* minimum speed. 1.5 is the maximum speed. This value can only be changed in
* between model turns, not while a response is in progress.
*/
speed?: number;
/**
* Sampling temperature for the model, limited to [0.6, 1.2]. For audio models a
* temperature of 0.8 is highly recommended for best performance.
*/
temperature?: number;
/**
* How the model chooses tools. Options are `auto`, `none`, `required`, or specify
* a function.
*/
tool_choice?: string;
/**
* Tools (functions) available to the model.
*/
tools?: Array<Session.Tool>;
/**
* Configuration options for tracing. Set to null to disable tracing. Once tracing
* is enabled for a session, the configuration cannot be modified.
*
* `auto` will create a trace for the session with default values for the workflow
* name, group id, and metadata.
*/
tracing?: 'auto' | Session.TracingConfiguration;
/**
* Configuration for turn detection, ether Server VAD or Semantic VAD. This can be
* set to `null` to turn off, in which case the client must manually trigger model
* response. Server VAD means that the model will detect the start and end of
* speech based on audio volume and respond at the end of user speech. Semantic VAD
* is more advanced and uses a turn detection model (in conjunction with VAD) to
* semantically estimate whether the user has finished speaking, then dynamically
* sets a timeout based on this probability. For example, if user audio trails off
* with "uhhm", the model will score a low probability of turn end and wait longer
* for the user to continue speaking. This can be useful for more natural
* conversations, but may have a higher latency.
*/
turn_detection?: Session.TurnDetection;
/**
* The voice the model uses to respond. Voice cannot be changed during the session
* once the model has responded with audio at least once. Current voice options are
* `alloy`, `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, and `verse`.
*/
voice?: (string & {}) | 'alloy' | 'ash' | 'ballad' | 'coral' | 'echo' | 'sage' | 'shimmer' | 'verse';
}
export declare namespace Session {
/**
* Configuration for input audio noise reduction. This can be set to `null` to turn
* off. Noise reduction filters audio added to the input audio buffer before it is
* sent to VAD and the model. Filtering the audio can improve VAD and turn
* detection accuracy (reducing false positives) and model performance by improving
* perception of the input audio.
*/
interface InputAudioNoiseReduction {
/**
* Type of noise reduction. `near_field` is for close-talking microphones such as
* headphones, `far_field` is for far-field microphones such as laptop or
* conference room microphones.
*/
type?: 'near_field' | 'far_field';
}
/**
* Configuration for input audio transcription, defaults to off and can be set to
* `null` to turn off once on. Input audio transcription is not native to the
* model, since the model consumes audio directly. Transcription runs
* asynchronously through
* [the /audio/transcriptions endpoint](https://platform.openai.com/docs/api-reference/audio/createTranscription)
* and should be treated as guidance of input audio content rather than precisely
* what the model heard. The client can optionally set the language and prompt for
* transcription, these offer additional guidance to the transcription service.
*/
interface InputAudioTranscription {
/**
* The language of the input audio. Supplying the input language in
* [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`)
* format will improve accuracy and latency.
*/
language?: string;
/**
* The model to use for transcription, current options are `gpt-4o-transcribe`,
* `gpt-4o-mini-transcribe`, and `whisper-1`.
*/
model?: string;
/**
* An optional text to guide the model's style or continue a previous audio
* segment. For `whisper-1`, the
* [prompt is a list of keywords](https://platform.openai.com/docs/guides/speech-to-text#prompting).
* For `gpt-4o-transcribe` models, the prompt is a free text string, for example
* "expect words related to technology".
*/
prompt?: string;
}
interface Tool {
/**
* The description of the function, including guidance on when and how to call it,
* and guidance about what to tell the user when calling (if anything).
*/
description?: string;
/**
* The name of the function.
*/
name?: string;
/**
* Parameters of the function in JSON Schema.
*/
parameters?: unknown;
/**
* The type of the tool, i.e. `function`.
*/
type?: 'function';
}
/**
* Granular configuration for tracing.
*/
interface TracingConfiguration {
/**
* The group id to attach to this trace to enable filtering and grouping in the
* traces dashboard.
*/
group_id?: string;
/**
* The arbitrary metadata to attach to this trace to enable filtering in the traces
* dashboard.
*/
metadata?: unknown;
/**
* The name of the workflow to attach to this trace. This is used to name the trace
* in the traces dashboard.
*/
workflow_name?: string;
}
/**
* Configuration for turn detection, ether Server VAD or Semantic VAD. This can be
* set to `null` to turn off, in which case the client must manually trigger model
* response. Server VAD means that the model will detect the start and end of
* speech based on audio volume and respond at the end of user speech. Semantic VAD
* is more advanced and uses a turn detection model (in conjunction with VAD) to
* semantically estimate whether the user has finished speaking, then dynamically
* sets a timeout based on this probability. For example, if user audio trails off
* with "uhhm", the model will score a low probability of turn end and wait longer
* for the user to continue speaking. This can be useful for more natural
* conversations, but may have a higher latency.
*/
interface TurnDetection {
/**
* Whether or not to automatically generate a response when a VAD stop event
* occurs.
*/
create_response?: boolean;
/**
* Used only for `semantic_vad` mode. The eagerness of the model to respond. `low`
* will wait longer for the user to continue speaking, `high` will respond more
* quickly. `auto` is the default and is equivalent to `medium`.
*/
eagerness?: 'low' | 'medium' | 'high' | 'auto';
/**
* Whether or not to automatically interrupt any ongoing response with output to
* the default conversation (i.e. `conversation` of `auto`) when a VAD start event
* occurs.
*/
interrupt_response?: boolean;
/**
* Used only for `server_vad` mode. Amount of audio to include before the VAD
* detected speech (in milliseconds). Defaults to 300ms.
*/
prefix_padding_ms?: number;
/**
* Used only for `server_vad` mode. Duration of silence to detect speech stop (in
* milliseconds). Defaults to 500ms. With shorter values the model will respond
* more quickly, but may jump in on short pauses from the user.
*/
silence_duration_ms?: number;
/**
* Used only for `server_vad` mode. Activation threshold for VAD (0.0 to 1.0), this
* defaults to 0.5. A higher threshold will require louder audio to activate the
* model, and thus might perform better in noisy environments.
*/
threshold?: number;
/**
* Type of turn detection.
*/
type?: 'server_vad' | 'semantic_vad';
}
}
/**
* A new Realtime session configuration, with an ephemeral key. Default TTL for
* keys is one minute.
*/
export interface SessionCreateResponse {
/**
* Ephemeral key returned by the API.
*/
client_secret: SessionCreateResponse.ClientSecret;
/**
* The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
*/
input_audio_format?: string;
/**
* Configuration for input audio transcription, defaults to off and can be set to
* `null` to turn off once on. Input audio transcription is not native to the
* model, since the model consumes audio directly. Transcription runs
* asynchronously and should be treated as rough guidance rather than the
* representation understood by the model.
*/
input_audio_transcription?: SessionCreateResponse.InputAudioTranscription;
/**
* The default system instructions (i.e. system message) prepended to model calls.
* This field allows the client to guide the model on desired responses. The model
* can be instructed on response content and format, (e.g. "be extremely succinct",
* "act friendly", "here are examples of good responses") and on audio behavior
* (e.g. "talk quickly", "inject emotion into your voice", "laugh frequently"). The
* instructions are not guaranteed to be followed by the model, but they provide
* guidance to the model on the desired behavior.
*
* Note that the server sets default instructions which will be used if this field
* is not set and are visible in the `session.created` event at the start of the
* session.
*/
instructions?: string;
/**
* Maximum number of output tokens for a single assistant response, inclusive of
* tool calls. Provide an integer between 1 and 4096 to limit output tokens, or
* `inf` for the maximum available tokens for a given model. Defaults to `inf`.
*/
max_response_output_tokens?: number | 'inf';
/**
* The set of modalities the model can respond with. To disable audio, set this to
* ["text"].
*/
modalities?: Array<'text' | 'audio'>;
/**
* The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
*/
output_audio_format?: string;
/**
* The speed of the model's spoken response. 1.0 is the default speed. 0.25 is the
* minimum speed. 1.5 is the maximum speed. This value can only be changed in
* between model turns, not while a response is in progress.
*/
speed?: number;
/**
* Sampling temperature for the model, limited to [0.6, 1.2]. Defaults to 0.8.
*/
temperature?: number;
/**
* How the model chooses tools. Options are `auto`, `none`, `required`, or specify
* a function.
*/
tool_choice?: string;
/**
* Tools (functions) available to the model.
*/
tools?: Array<SessionCreateResponse.Tool>;
/**
* Configuration options for tracing. Set to null to disable tracing. Once tracing
* is enabled for a session, the configuration cannot be modified.
*
* `auto` will create a trace for the session with default values for the workflow
* name, group id, and metadata.
*/
tracing?: 'auto' | SessionCreateResponse.TracingConfiguration;
/**
* Configuration for turn detection. Can be set to `null` to turn off. Server VAD
* means that the model will detect the start and end of speech based on audio
* volume and respond at the end of user speech.
*/
turn_detection?: SessionCreateResponse.TurnDetection;
/**
* The voice the model uses to respond. Voice cannot be changed during the session
* once the model has responded with audio at least once. Current voice options are
* `alloy`, `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, and `verse`.
*/
voice?: (string & {}) | 'alloy' | 'ash' | 'ballad' | 'coral' | 'echo' | 'sage' | 'shimmer' | 'verse';
}
export declare namespace SessionCreateResponse {
/**
* Ephemeral key returned by the API.
*/
interface ClientSecret {
/**
* Timestamp for when the token expires. Currently, all tokens expire after one
* minute.
*/
expires_at: number;
/**
* Ephemeral key usable in client environments to authenticate connections to the
* Realtime API. Use this in client-side environments rather than a standard API
* token, which should only be used server-side.
*/
value: string;
}
/**
* Configuration for input audio transcription, defaults to off and can be set to
* `null` to turn off once on. Input audio transcription is not native to the
* model, since the model consumes audio directly. Transcription runs
* asynchronously and should be treated as rough guidance rather than the
* representation understood by the model.
*/
interface InputAudioTranscription {
/**
* The model to use for transcription.
*/
model?: string;
}
interface Tool {
/**
* The description of the function, including guidance on when and how to call it,
* and guidance about what to tell the user when calling (if anything).
*/
description?: string;
/**
* The name of the function.
*/
name?: string;
/**
* Parameters of the function in JSON Schema.
*/
parameters?: unknown;
/**
* The type of the tool, i.e. `function`.
*/
type?: 'function';
}
/**
* Granular configuration for tracing.
*/
interface TracingConfiguration {
/**
* The group id to attach to this trace to enable filtering and grouping in the
* traces dashboard.
*/
group_id?: string;
/**
* The arbitrary metadata to attach to this trace to enable filtering in the traces
* dashboard.
*/
metadata?: unknown;
/**
* The name of the workflow to attach to this trace. This is used to name the trace
* in the traces dashboard.
*/
workflow_name?: string;
}
/**
* Configuration for turn detection. Can be set to `null` to turn off. Server VAD
* means that the model will detect the start and end of speech based on audio
* volume and respond at the end of user speech.
*/
interface TurnDetection {
/**
* Amount of audio to include before the VAD detected speech (in milliseconds).
* Defaults to 300ms.
*/
prefix_padding_ms?: number;
/**
* Duration of silence to detect speech stop (in milliseconds). Defaults to 500ms.
* With shorter values the model will respond more quickly, but may jump in on
* short pauses from the user.
*/
silence_duration_ms?: number;
/**
* Activation threshold for VAD (0.0 to 1.0), this defaults to 0.5. A higher
* threshold will require louder audio to activate the model, and thus might
* perform better in noisy environments.
*/
threshold?: number;
/**
* Type of turn detection, only `server_vad` is currently supported.
*/
type?: string;
}
}
export interface SessionCreateParams {
/**
* Configuration options for the generated client secret.
*/
client_secret?: SessionCreateParams.ClientSecret;
/**
* The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. For
* `pcm16`, input audio must be 16-bit PCM at a 24kHz sample rate, single channel
* (mono), and little-endian byte order.
*/
input_audio_format?: 'pcm16' | 'g711_ulaw' | 'g711_alaw';
/**
* Configuration for input audio noise reduction. This can be set to `null` to turn
* off. Noise reduction filters audio added to the input audio buffer before it is
* sent to VAD and the model. Filtering the audio can improve VAD and turn
* detection accuracy (reducing false positives) and model performance by improving
* perception of the input audio.
*/
input_audio_noise_reduction?: SessionCreateParams.InputAudioNoiseReduction;
/**
* Configuration for input audio transcription, defaults to off and can be set to
* `null` to turn off once on. Input audio transcription is not native to the
* model, since the model consumes audio directly. Transcription runs
* asynchronously through
* [the /audio/transcriptions endpoint](https://platform.openai.com/docs/api-reference/audio/createTranscription)
* and should be treated as guidance of input audio content rather than precisely
* what the model heard. The client can optionally set the language and prompt for
* transcription, these offer additional guidance to the transcription service.
*/
input_audio_transcription?: SessionCreateParams.InputAudioTranscription;
/**
* The default system instructions (i.e. system message) prepended to model calls.
* This field allows the client to guide the model on desired responses. The model
* can be instructed on response content and format, (e.g. "be extremely succinct",
* "act friendly", "here are examples of good responses") and on audio behavior
* (e.g. "talk quickly", "inject emotion into your voice", "laugh frequently"). The
* instructions are not guaranteed to be followed by the model, but they provide
* guidance to the model on the desired behavior.
*
* Note that the server sets default instructions which will be used if this field
* is not set and are visible in the `session.created` event at the start of the
* session.
*/
instructions?: string;
/**
* Maximum number of output tokens for a single assistant response, inclusive of
* tool calls. Provide an integer between 1 and 4096 to limit output tokens, or
* `inf` for the maximum available tokens for a given model. Defaults to `inf`.
*/
max_response_output_tokens?: number | 'inf';
/**
* The set of modalities the model can respond with. To disable audio, set this to
* ["text"].
*/
modalities?: Array<'text' | 'audio'>;
/**
* The Realtime model used for this session.
*/
model?: 'gpt-4o-realtime-preview' | 'gpt-4o-realtime-preview-2024-10-01' | 'gpt-4o-realtime-preview-2024-12-17' | 'gpt-4o-realtime-preview-2025-06-03' | 'gpt-4o-mini-realtime-preview' | 'gpt-4o-mini-realtime-preview-2024-12-17';
/**
* The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
* For `pcm16`, output audio is sampled at a rate of 24kHz.
*/
output_audio_format?: 'pcm16' | 'g711_ulaw' | 'g711_alaw';
/**
* The speed of the model's spoken response. 1.0 is the default speed. 0.25 is the
* minimum speed. 1.5 is the maximum speed. This value can only be changed in
* between model turns, not while a response is in progress.
*/
speed?: number;
/**
* Sampling temperature for the model, limited to [0.6, 1.2]. For audio models a
* temperature of 0.8 is highly recommended for best performance.
*/
temperature?: number;
/**
* How the model chooses tools. Options are `auto`, `none`, `required`, or specify
* a function.
*/
tool_choice?: string;
/**
* Tools (functions) available to the model.
*/
tools?: Array<SessionCreateParams.Tool>;
/**
* Configuration options for tracing. Set to null to disable tracing. Once tracing
* is enabled for a session, the configuration cannot be modified.
*
* `auto` will create a trace for the session with default values for the workflow
* name, group id, and metadata.
*/
tracing?: 'auto' | SessionCreateParams.TracingConfiguration;
/**
* Configuration for turn detection, ether Server VAD or Semantic VAD. This can be
* set to `null` to turn off, in which case the client must manually trigger model
* response. Server VAD means that the model will detect the start and end of
* speech based on audio volume and respond at the end of user speech. Semantic VAD
* is more advanced and uses a turn detection model (in conjunction with VAD) to
* semantically estimate whether the user has finished speaking, then dynamically
* sets a timeout based on this probability. For example, if user audio trails off
* with "uhhm", the model will score a low probability of turn end and wait longer
* for the user to continue speaking. This can be useful for more natural
* conversations, but may have a higher latency.
*/
turn_detection?: SessionCreateParams.TurnDetection;
/**
* The voice the model uses to respond. Voice cannot be changed during the session
* once the model has responded with audio at least once. Current voice options are
* `alloy`, `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, and `verse`.
*/
voice?: (string & {}) | 'alloy' | 'ash' | 'ballad' | 'coral' | 'echo' | 'sage' | 'shimmer' | 'verse';
}
export declare namespace SessionCreateParams {
/**
* Configuration options for the generated client secret.
*/
interface ClientSecret {
/**
* Configuration for the ephemeral token expiration.
*/
expires_after?: ClientSecret.ExpiresAfter;
}
namespace ClientSecret {
/**
* Configuration for the ephemeral token expiration.
*/
interface ExpiresAfter {
/**
* The anchor point for the ephemeral token expiration. Only `created_at` is
* currently supported.
*/
anchor: 'created_at';
/**
* The number of seconds from the anchor point to the expiration. Select a value
* between `10` and `7200`.
*/
seconds?: number;
}
}
/**
* Configuration for input audio noise reduction. This can be set to `null` to turn
* off. Noise reduction filters audio added to the input audio buffer before it is
* sent to VAD and the model. Filtering the audio can improve VAD and turn
* detection accuracy (reducing false positives) and model performance by improving
* perception of the input audio.
*/
interface InputAudioNoiseReduction {
/**
* Type of noise reduction. `near_field` is for close-talking microphones such as
* headphones, `far_field` is for far-field microphones such as laptop or
* conference room microphones.
*/
type?: 'near_field' | 'far_field';
}
/**
* Configuration for input audio transcription, defaults to off and can be set to
* `null` to turn off once on. Input audio transcription is not native to the
* model, since the model consumes audio directly. Transcription runs
* asynchronously through
* [the /audio/transcriptions endpoint](https://platform.openai.com/docs/api-reference/audio/createTranscription)
* and should be treated as guidance of input audio content rather than precisely
* what the model heard. The client can optionally set the language and prompt for
* transcription, these offer additional guidance to the transcription service.
*/
interface InputAudioTranscription {
/**
* The language of the input audio. Supplying the input language in
* [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`)
* format will improve accuracy and latency.
*/
language?: string;
/**
* The model to use for transcription, current options are `gpt-4o-transcribe`,
* `gpt-4o-mini-transcribe`, and `whisper-1`.
*/
model?: string;
/**
* An optional text to guide the model's style or continue a previous audio
* segment. For `whisper-1`, the
* [prompt is a list of keywords](https://platform.openai.com/docs/guides/speech-to-text#prompting).
* For `gpt-4o-transcribe` models, the prompt is a free text string, for example
* "expect words related to technology".
*/
prompt?: string;
}
interface Tool {
/**
* The description of the function, including guidance on when and how to call it,
* and guidance about what to tell the user when calling (if anything).
*/
description?: string;
/**
* The name of the function.
*/
name?: string;
/**
* Parameters of the function in JSON Schema.
*/
parameters?: unknown;
/**
* The type of the tool, i.e. `function`.
*/
type?: 'function';
}
/**
* Granular configuration for tracing.
*/
interface TracingConfiguration {
/**
* The group id to attach to this trace to enable filtering and grouping in the
* traces dashboard.
*/
group_id?: string;
/**
* The arbitrary metadata to attach to this trace to enable filtering in the traces
* dashboard.
*/
metadata?: unknown;
/**
* The name of the workflow to attach to this trace. This is used to name the trace
* in the traces dashboard.
*/
workflow_name?: string;
}
/**
* Configuration for turn detection, ether Server VAD or Semantic VAD. This can be
* set to `null` to turn off, in which case the client must manually trigger model
* response. Server VAD means that the model will detect the start and end of
* speech based on audio volume and respond at the end of user speech. Semantic VAD
* is more advanced and uses a turn detection model (in conjunction with VAD) to
* semantically estimate whether the user has finished speaking, then dynamically
* sets a timeout based on this probability. For example, if user audio trails off
* with "uhhm", the model will score a low probability of turn end and wait longer
* for the user to continue speaking. This can be useful for more natural
* conversations, but may have a higher latency.
*/
interface TurnDetection {
/**
* Whether or not to automatically generate a response when a VAD stop event
* occurs.
*/
create_response?: boolean;
/**
* Used only for `semantic_vad` mode. The eagerness of the model to respond. `low`
* will wait longer for the user to continue speaking, `high` will respond more
* quickly. `auto` is the default and is equivalent to `medium`.
*/
eagerness?: 'low' | 'medium' | 'high' | 'auto';
/**
* Whether or not to automatically interrupt any ongoing response with output to
* the default conversation (i.e. `conversation` of `auto`) when a VAD start event
* occurs.
*/
interrupt_response?: boolean;
/**
* Used only for `server_vad` mode. Amount of audio to include before the VAD
* detected speech (in milliseconds). Defaults to 300ms.
*/
prefix_padding_ms?: number;
/**
* Used only for `server_vad` mode. Duration of silence to detect speech stop (in
* milliseconds). Defaults to 500ms. With shorter values the model will respond
* more quickly, but may jump in on short pauses from the user.
*/
silence_duration_ms?: number;
/**
* Used only for `server_vad` mode. Activation threshold for VAD (0.0 to 1.0), this
* defaults to 0.5. A higher threshold will require louder audio to activate the
* model, and thus might perform better in noisy environments.
*/
threshold?: number;
/**
* Type of turn detection.
*/
type?: 'server_vad' | 'semantic_vad';
}
}
export declare namespace Sessions {
export { type Session as Session, type SessionCreateResponse as SessionCreateResponse, type SessionCreateParams as SessionCreateParams, };
}
//# sourceMappingURL=sessions.d.mts.map
File diff suppressed because one or more lines are too long
+744
View File
@@ -0,0 +1,744 @@
import { APIResource } from "../../../core/resource.js";
import { APIPromise } from "../../../core/api-promise.js";
import { RequestOptions } from "../../../internal/request-options.js";
export declare class Sessions extends APIResource {
/**
* Create an ephemeral API token for use in client-side applications with the
* Realtime API. Can be configured with the same session parameters as the
* `session.update` client event.
*
* It responds with a session object, plus a `client_secret` key which contains a
* usable ephemeral API token that can be used to authenticate browser clients for
* the Realtime API.
*
* @example
* ```ts
* const session =
* await client.beta.realtime.sessions.create();
* ```
*/
create(body: SessionCreateParams, options?: RequestOptions): APIPromise<SessionCreateResponse>;
}
/**
* Realtime session object configuration.
*/
export interface Session {
/**
* Unique identifier for the session that looks like `sess_1234567890abcdef`.
*/
id?: string;
/**
* The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. For
* `pcm16`, input audio must be 16-bit PCM at a 24kHz sample rate, single channel
* (mono), and little-endian byte order.
*/
input_audio_format?: 'pcm16' | 'g711_ulaw' | 'g711_alaw';
/**
* Configuration for input audio noise reduction. This can be set to `null` to turn
* off. Noise reduction filters audio added to the input audio buffer before it is
* sent to VAD and the model. Filtering the audio can improve VAD and turn
* detection accuracy (reducing false positives) and model performance by improving
* perception of the input audio.
*/
input_audio_noise_reduction?: Session.InputAudioNoiseReduction;
/**
* Configuration for input audio transcription, defaults to off and can be set to
* `null` to turn off once on. Input audio transcription is not native to the
* model, since the model consumes audio directly. Transcription runs
* asynchronously through
* [the /audio/transcriptions endpoint](https://platform.openai.com/docs/api-reference/audio/createTranscription)
* and should be treated as guidance of input audio content rather than precisely
* what the model heard. The client can optionally set the language and prompt for
* transcription, these offer additional guidance to the transcription service.
*/
input_audio_transcription?: Session.InputAudioTranscription;
/**
* The default system instructions (i.e. system message) prepended to model calls.
* This field allows the client to guide the model on desired responses. The model
* can be instructed on response content and format, (e.g. "be extremely succinct",
* "act friendly", "here are examples of good responses") and on audio behavior
* (e.g. "talk quickly", "inject emotion into your voice", "laugh frequently"). The
* instructions are not guaranteed to be followed by the model, but they provide
* guidance to the model on the desired behavior.
*
* Note that the server sets default instructions which will be used if this field
* is not set and are visible in the `session.created` event at the start of the
* session.
*/
instructions?: string;
/**
* Maximum number of output tokens for a single assistant response, inclusive of
* tool calls. Provide an integer between 1 and 4096 to limit output tokens, or
* `inf` for the maximum available tokens for a given model. Defaults to `inf`.
*/
max_response_output_tokens?: number | 'inf';
/**
* The set of modalities the model can respond with. To disable audio, set this to
* ["text"].
*/
modalities?: Array<'text' | 'audio'>;
/**
* The Realtime model used for this session.
*/
model?: 'gpt-4o-realtime-preview' | 'gpt-4o-realtime-preview-2024-10-01' | 'gpt-4o-realtime-preview-2024-12-17' | 'gpt-4o-realtime-preview-2025-06-03' | 'gpt-4o-mini-realtime-preview' | 'gpt-4o-mini-realtime-preview-2024-12-17';
/**
* The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
* For `pcm16`, output audio is sampled at a rate of 24kHz.
*/
output_audio_format?: 'pcm16' | 'g711_ulaw' | 'g711_alaw';
/**
* The speed of the model's spoken response. 1.0 is the default speed. 0.25 is the
* minimum speed. 1.5 is the maximum speed. This value can only be changed in
* between model turns, not while a response is in progress.
*/
speed?: number;
/**
* Sampling temperature for the model, limited to [0.6, 1.2]. For audio models a
* temperature of 0.8 is highly recommended for best performance.
*/
temperature?: number;
/**
* How the model chooses tools. Options are `auto`, `none`, `required`, or specify
* a function.
*/
tool_choice?: string;
/**
* Tools (functions) available to the model.
*/
tools?: Array<Session.Tool>;
/**
* Configuration options for tracing. Set to null to disable tracing. Once tracing
* is enabled for a session, the configuration cannot be modified.
*
* `auto` will create a trace for the session with default values for the workflow
* name, group id, and metadata.
*/
tracing?: 'auto' | Session.TracingConfiguration;
/**
* Configuration for turn detection, ether Server VAD or Semantic VAD. This can be
* set to `null` to turn off, in which case the client must manually trigger model
* response. Server VAD means that the model will detect the start and end of
* speech based on audio volume and respond at the end of user speech. Semantic VAD
* is more advanced and uses a turn detection model (in conjunction with VAD) to
* semantically estimate whether the user has finished speaking, then dynamically
* sets a timeout based on this probability. For example, if user audio trails off
* with "uhhm", the model will score a low probability of turn end and wait longer
* for the user to continue speaking. This can be useful for more natural
* conversations, but may have a higher latency.
*/
turn_detection?: Session.TurnDetection;
/**
* The voice the model uses to respond. Voice cannot be changed during the session
* once the model has responded with audio at least once. Current voice options are
* `alloy`, `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, and `verse`.
*/
voice?: (string & {}) | 'alloy' | 'ash' | 'ballad' | 'coral' | 'echo' | 'sage' | 'shimmer' | 'verse';
}
export declare namespace Session {
/**
* Configuration for input audio noise reduction. This can be set to `null` to turn
* off. Noise reduction filters audio added to the input audio buffer before it is
* sent to VAD and the model. Filtering the audio can improve VAD and turn
* detection accuracy (reducing false positives) and model performance by improving
* perception of the input audio.
*/
interface InputAudioNoiseReduction {
/**
* Type of noise reduction. `near_field` is for close-talking microphones such as
* headphones, `far_field` is for far-field microphones such as laptop or
* conference room microphones.
*/
type?: 'near_field' | 'far_field';
}
/**
* Configuration for input audio transcription, defaults to off and can be set to
* `null` to turn off once on. Input audio transcription is not native to the
* model, since the model consumes audio directly. Transcription runs
* asynchronously through
* [the /audio/transcriptions endpoint](https://platform.openai.com/docs/api-reference/audio/createTranscription)
* and should be treated as guidance of input audio content rather than precisely
* what the model heard. The client can optionally set the language and prompt for
* transcription, these offer additional guidance to the transcription service.
*/
interface InputAudioTranscription {
/**
* The language of the input audio. Supplying the input language in
* [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`)
* format will improve accuracy and latency.
*/
language?: string;
/**
* The model to use for transcription, current options are `gpt-4o-transcribe`,
* `gpt-4o-mini-transcribe`, and `whisper-1`.
*/
model?: string;
/**
* An optional text to guide the model's style or continue a previous audio
* segment. For `whisper-1`, the
* [prompt is a list of keywords](https://platform.openai.com/docs/guides/speech-to-text#prompting).
* For `gpt-4o-transcribe` models, the prompt is a free text string, for example
* "expect words related to technology".
*/
prompt?: string;
}
interface Tool {
/**
* The description of the function, including guidance on when and how to call it,
* and guidance about what to tell the user when calling (if anything).
*/
description?: string;
/**
* The name of the function.
*/
name?: string;
/**
* Parameters of the function in JSON Schema.
*/
parameters?: unknown;
/**
* The type of the tool, i.e. `function`.
*/
type?: 'function';
}
/**
* Granular configuration for tracing.
*/
interface TracingConfiguration {
/**
* The group id to attach to this trace to enable filtering and grouping in the
* traces dashboard.
*/
group_id?: string;
/**
* The arbitrary metadata to attach to this trace to enable filtering in the traces
* dashboard.
*/
metadata?: unknown;
/**
* The name of the workflow to attach to this trace. This is used to name the trace
* in the traces dashboard.
*/
workflow_name?: string;
}
/**
* Configuration for turn detection, ether Server VAD or Semantic VAD. This can be
* set to `null` to turn off, in which case the client must manually trigger model
* response. Server VAD means that the model will detect the start and end of
* speech based on audio volume and respond at the end of user speech. Semantic VAD
* is more advanced and uses a turn detection model (in conjunction with VAD) to
* semantically estimate whether the user has finished speaking, then dynamically
* sets a timeout based on this probability. For example, if user audio trails off
* with "uhhm", the model will score a low probability of turn end and wait longer
* for the user to continue speaking. This can be useful for more natural
* conversations, but may have a higher latency.
*/
interface TurnDetection {
/**
* Whether or not to automatically generate a response when a VAD stop event
* occurs.
*/
create_response?: boolean;
/**
* Used only for `semantic_vad` mode. The eagerness of the model to respond. `low`
* will wait longer for the user to continue speaking, `high` will respond more
* quickly. `auto` is the default and is equivalent to `medium`.
*/
eagerness?: 'low' | 'medium' | 'high' | 'auto';
/**
* Whether or not to automatically interrupt any ongoing response with output to
* the default conversation (i.e. `conversation` of `auto`) when a VAD start event
* occurs.
*/
interrupt_response?: boolean;
/**
* Used only for `server_vad` mode. Amount of audio to include before the VAD
* detected speech (in milliseconds). Defaults to 300ms.
*/
prefix_padding_ms?: number;
/**
* Used only for `server_vad` mode. Duration of silence to detect speech stop (in
* milliseconds). Defaults to 500ms. With shorter values the model will respond
* more quickly, but may jump in on short pauses from the user.
*/
silence_duration_ms?: number;
/**
* Used only for `server_vad` mode. Activation threshold for VAD (0.0 to 1.0), this
* defaults to 0.5. A higher threshold will require louder audio to activate the
* model, and thus might perform better in noisy environments.
*/
threshold?: number;
/**
* Type of turn detection.
*/
type?: 'server_vad' | 'semantic_vad';
}
}
/**
* A new Realtime session configuration, with an ephemeral key. Default TTL for
* keys is one minute.
*/
export interface SessionCreateResponse {
/**
* Ephemeral key returned by the API.
*/
client_secret: SessionCreateResponse.ClientSecret;
/**
* The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
*/
input_audio_format?: string;
/**
* Configuration for input audio transcription, defaults to off and can be set to
* `null` to turn off once on. Input audio transcription is not native to the
* model, since the model consumes audio directly. Transcription runs
* asynchronously and should be treated as rough guidance rather than the
* representation understood by the model.
*/
input_audio_transcription?: SessionCreateResponse.InputAudioTranscription;
/**
* The default system instructions (i.e. system message) prepended to model calls.
* This field allows the client to guide the model on desired responses. The model
* can be instructed on response content and format, (e.g. "be extremely succinct",
* "act friendly", "here are examples of good responses") and on audio behavior
* (e.g. "talk quickly", "inject emotion into your voice", "laugh frequently"). The
* instructions are not guaranteed to be followed by the model, but they provide
* guidance to the model on the desired behavior.
*
* Note that the server sets default instructions which will be used if this field
* is not set and are visible in the `session.created` event at the start of the
* session.
*/
instructions?: string;
/**
* Maximum number of output tokens for a single assistant response, inclusive of
* tool calls. Provide an integer between 1 and 4096 to limit output tokens, or
* `inf` for the maximum available tokens for a given model. Defaults to `inf`.
*/
max_response_output_tokens?: number | 'inf';
/**
* The set of modalities the model can respond with. To disable audio, set this to
* ["text"].
*/
modalities?: Array<'text' | 'audio'>;
/**
* The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
*/
output_audio_format?: string;
/**
* The speed of the model's spoken response. 1.0 is the default speed. 0.25 is the
* minimum speed. 1.5 is the maximum speed. This value can only be changed in
* between model turns, not while a response is in progress.
*/
speed?: number;
/**
* Sampling temperature for the model, limited to [0.6, 1.2]. Defaults to 0.8.
*/
temperature?: number;
/**
* How the model chooses tools. Options are `auto`, `none`, `required`, or specify
* a function.
*/
tool_choice?: string;
/**
* Tools (functions) available to the model.
*/
tools?: Array<SessionCreateResponse.Tool>;
/**
* Configuration options for tracing. Set to null to disable tracing. Once tracing
* is enabled for a session, the configuration cannot be modified.
*
* `auto` will create a trace for the session with default values for the workflow
* name, group id, and metadata.
*/
tracing?: 'auto' | SessionCreateResponse.TracingConfiguration;
/**
* Configuration for turn detection. Can be set to `null` to turn off. Server VAD
* means that the model will detect the start and end of speech based on audio
* volume and respond at the end of user speech.
*/
turn_detection?: SessionCreateResponse.TurnDetection;
/**
* The voice the model uses to respond. Voice cannot be changed during the session
* once the model has responded with audio at least once. Current voice options are
* `alloy`, `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, and `verse`.
*/
voice?: (string & {}) | 'alloy' | 'ash' | 'ballad' | 'coral' | 'echo' | 'sage' | 'shimmer' | 'verse';
}
export declare namespace SessionCreateResponse {
/**
* Ephemeral key returned by the API.
*/
interface ClientSecret {
/**
* Timestamp for when the token expires. Currently, all tokens expire after one
* minute.
*/
expires_at: number;
/**
* Ephemeral key usable in client environments to authenticate connections to the
* Realtime API. Use this in client-side environments rather than a standard API
* token, which should only be used server-side.
*/
value: string;
}
/**
* Configuration for input audio transcription, defaults to off and can be set to
* `null` to turn off once on. Input audio transcription is not native to the
* model, since the model consumes audio directly. Transcription runs
* asynchronously and should be treated as rough guidance rather than the
* representation understood by the model.
*/
interface InputAudioTranscription {
/**
* The model to use for transcription.
*/
model?: string;
}
interface Tool {
/**
* The description of the function, including guidance on when and how to call it,
* and guidance about what to tell the user when calling (if anything).
*/
description?: string;
/**
* The name of the function.
*/
name?: string;
/**
* Parameters of the function in JSON Schema.
*/
parameters?: unknown;
/**
* The type of the tool, i.e. `function`.
*/
type?: 'function';
}
/**
* Granular configuration for tracing.
*/
interface TracingConfiguration {
/**
* The group id to attach to this trace to enable filtering and grouping in the
* traces dashboard.
*/
group_id?: string;
/**
* The arbitrary metadata to attach to this trace to enable filtering in the traces
* dashboard.
*/
metadata?: unknown;
/**
* The name of the workflow to attach to this trace. This is used to name the trace
* in the traces dashboard.
*/
workflow_name?: string;
}
/**
* Configuration for turn detection. Can be set to `null` to turn off. Server VAD
* means that the model will detect the start and end of speech based on audio
* volume and respond at the end of user speech.
*/
interface TurnDetection {
/**
* Amount of audio to include before the VAD detected speech (in milliseconds).
* Defaults to 300ms.
*/
prefix_padding_ms?: number;
/**
* Duration of silence to detect speech stop (in milliseconds). Defaults to 500ms.
* With shorter values the model will respond more quickly, but may jump in on
* short pauses from the user.
*/
silence_duration_ms?: number;
/**
* Activation threshold for VAD (0.0 to 1.0), this defaults to 0.5. A higher
* threshold will require louder audio to activate the model, and thus might
* perform better in noisy environments.
*/
threshold?: number;
/**
* Type of turn detection, only `server_vad` is currently supported.
*/
type?: string;
}
}
export interface SessionCreateParams {
/**
* Configuration options for the generated client secret.
*/
client_secret?: SessionCreateParams.ClientSecret;
/**
* The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. For
* `pcm16`, input audio must be 16-bit PCM at a 24kHz sample rate, single channel
* (mono), and little-endian byte order.
*/
input_audio_format?: 'pcm16' | 'g711_ulaw' | 'g711_alaw';
/**
* Configuration for input audio noise reduction. This can be set to `null` to turn
* off. Noise reduction filters audio added to the input audio buffer before it is
* sent to VAD and the model. Filtering the audio can improve VAD and turn
* detection accuracy (reducing false positives) and model performance by improving
* perception of the input audio.
*/
input_audio_noise_reduction?: SessionCreateParams.InputAudioNoiseReduction;
/**
* Configuration for input audio transcription, defaults to off and can be set to
* `null` to turn off once on. Input audio transcription is not native to the
* model, since the model consumes audio directly. Transcription runs
* asynchronously through
* [the /audio/transcriptions endpoint](https://platform.openai.com/docs/api-reference/audio/createTranscription)
* and should be treated as guidance of input audio content rather than precisely
* what the model heard. The client can optionally set the language and prompt for
* transcription, these offer additional guidance to the transcription service.
*/
input_audio_transcription?: SessionCreateParams.InputAudioTranscription;
/**
* The default system instructions (i.e. system message) prepended to model calls.
* This field allows the client to guide the model on desired responses. The model
* can be instructed on response content and format, (e.g. "be extremely succinct",
* "act friendly", "here are examples of good responses") and on audio behavior
* (e.g. "talk quickly", "inject emotion into your voice", "laugh frequently"). The
* instructions are not guaranteed to be followed by the model, but they provide
* guidance to the model on the desired behavior.
*
* Note that the server sets default instructions which will be used if this field
* is not set and are visible in the `session.created` event at the start of the
* session.
*/
instructions?: string;
/**
* Maximum number of output tokens for a single assistant response, inclusive of
* tool calls. Provide an integer between 1 and 4096 to limit output tokens, or
* `inf` for the maximum available tokens for a given model. Defaults to `inf`.
*/
max_response_output_tokens?: number | 'inf';
/**
* The set of modalities the model can respond with. To disable audio, set this to
* ["text"].
*/
modalities?: Array<'text' | 'audio'>;
/**
* The Realtime model used for this session.
*/
model?: 'gpt-4o-realtime-preview' | 'gpt-4o-realtime-preview-2024-10-01' | 'gpt-4o-realtime-preview-2024-12-17' | 'gpt-4o-realtime-preview-2025-06-03' | 'gpt-4o-mini-realtime-preview' | 'gpt-4o-mini-realtime-preview-2024-12-17';
/**
* The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
* For `pcm16`, output audio is sampled at a rate of 24kHz.
*/
output_audio_format?: 'pcm16' | 'g711_ulaw' | 'g711_alaw';
/**
* The speed of the model's spoken response. 1.0 is the default speed. 0.25 is the
* minimum speed. 1.5 is the maximum speed. This value can only be changed in
* between model turns, not while a response is in progress.
*/
speed?: number;
/**
* Sampling temperature for the model, limited to [0.6, 1.2]. For audio models a
* temperature of 0.8 is highly recommended for best performance.
*/
temperature?: number;
/**
* How the model chooses tools. Options are `auto`, `none`, `required`, or specify
* a function.
*/
tool_choice?: string;
/**
* Tools (functions) available to the model.
*/
tools?: Array<SessionCreateParams.Tool>;
/**
* Configuration options for tracing. Set to null to disable tracing. Once tracing
* is enabled for a session, the configuration cannot be modified.
*
* `auto` will create a trace for the session with default values for the workflow
* name, group id, and metadata.
*/
tracing?: 'auto' | SessionCreateParams.TracingConfiguration;
/**
* Configuration for turn detection, ether Server VAD or Semantic VAD. This can be
* set to `null` to turn off, in which case the client must manually trigger model
* response. Server VAD means that the model will detect the start and end of
* speech based on audio volume and respond at the end of user speech. Semantic VAD
* is more advanced and uses a turn detection model (in conjunction with VAD) to
* semantically estimate whether the user has finished speaking, then dynamically
* sets a timeout based on this probability. For example, if user audio trails off
* with "uhhm", the model will score a low probability of turn end and wait longer
* for the user to continue speaking. This can be useful for more natural
* conversations, but may have a higher latency.
*/
turn_detection?: SessionCreateParams.TurnDetection;
/**
* The voice the model uses to respond. Voice cannot be changed during the session
* once the model has responded with audio at least once. Current voice options are
* `alloy`, `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, and `verse`.
*/
voice?: (string & {}) | 'alloy' | 'ash' | 'ballad' | 'coral' | 'echo' | 'sage' | 'shimmer' | 'verse';
}
export declare namespace SessionCreateParams {
/**
* Configuration options for the generated client secret.
*/
interface ClientSecret {
/**
* Configuration for the ephemeral token expiration.
*/
expires_after?: ClientSecret.ExpiresAfter;
}
namespace ClientSecret {
/**
* Configuration for the ephemeral token expiration.
*/
interface ExpiresAfter {
/**
* The anchor point for the ephemeral token expiration. Only `created_at` is
* currently supported.
*/
anchor: 'created_at';
/**
* The number of seconds from the anchor point to the expiration. Select a value
* between `10` and `7200`.
*/
seconds?: number;
}
}
/**
* Configuration for input audio noise reduction. This can be set to `null` to turn
* off. Noise reduction filters audio added to the input audio buffer before it is
* sent to VAD and the model. Filtering the audio can improve VAD and turn
* detection accuracy (reducing false positives) and model performance by improving
* perception of the input audio.
*/
interface InputAudioNoiseReduction {
/**
* Type of noise reduction. `near_field` is for close-talking microphones such as
* headphones, `far_field` is for far-field microphones such as laptop or
* conference room microphones.
*/
type?: 'near_field' | 'far_field';
}
/**
* Configuration for input audio transcription, defaults to off and can be set to
* `null` to turn off once on. Input audio transcription is not native to the
* model, since the model consumes audio directly. Transcription runs
* asynchronously through
* [the /audio/transcriptions endpoint](https://platform.openai.com/docs/api-reference/audio/createTranscription)
* and should be treated as guidance of input audio content rather than precisely
* what the model heard. The client can optionally set the language and prompt for
* transcription, these offer additional guidance to the transcription service.
*/
interface InputAudioTranscription {
/**
* The language of the input audio. Supplying the input language in
* [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`)
* format will improve accuracy and latency.
*/
language?: string;
/**
* The model to use for transcription, current options are `gpt-4o-transcribe`,
* `gpt-4o-mini-transcribe`, and `whisper-1`.
*/
model?: string;
/**
* An optional text to guide the model's style or continue a previous audio
* segment. For `whisper-1`, the
* [prompt is a list of keywords](https://platform.openai.com/docs/guides/speech-to-text#prompting).
* For `gpt-4o-transcribe` models, the prompt is a free text string, for example
* "expect words related to technology".
*/
prompt?: string;
}
interface Tool {
/**
* The description of the function, including guidance on when and how to call it,
* and guidance about what to tell the user when calling (if anything).
*/
description?: string;
/**
* The name of the function.
*/
name?: string;
/**
* Parameters of the function in JSON Schema.
*/
parameters?: unknown;
/**
* The type of the tool, i.e. `function`.
*/
type?: 'function';
}
/**
* Granular configuration for tracing.
*/
interface TracingConfiguration {
/**
* The group id to attach to this trace to enable filtering and grouping in the
* traces dashboard.
*/
group_id?: string;
/**
* The arbitrary metadata to attach to this trace to enable filtering in the traces
* dashboard.
*/
metadata?: unknown;
/**
* The name of the workflow to attach to this trace. This is used to name the trace
* in the traces dashboard.
*/
workflow_name?: string;
}
/**
* Configuration for turn detection, ether Server VAD or Semantic VAD. This can be
* set to `null` to turn off, in which case the client must manually trigger model
* response. Server VAD means that the model will detect the start and end of
* speech based on audio volume and respond at the end of user speech. Semantic VAD
* is more advanced and uses a turn detection model (in conjunction with VAD) to
* semantically estimate whether the user has finished speaking, then dynamically
* sets a timeout based on this probability. For example, if user audio trails off
* with "uhhm", the model will score a low probability of turn end and wait longer
* for the user to continue speaking. This can be useful for more natural
* conversations, but may have a higher latency.
*/
interface TurnDetection {
/**
* Whether or not to automatically generate a response when a VAD stop event
* occurs.
*/
create_response?: boolean;
/**
* Used only for `semantic_vad` mode. The eagerness of the model to respond. `low`
* will wait longer for the user to continue speaking, `high` will respond more
* quickly. `auto` is the default and is equivalent to `medium`.
*/
eagerness?: 'low' | 'medium' | 'high' | 'auto';
/**
* Whether or not to automatically interrupt any ongoing response with output to
* the default conversation (i.e. `conversation` of `auto`) when a VAD start event
* occurs.
*/
interrupt_response?: boolean;
/**
* Used only for `server_vad` mode. Amount of audio to include before the VAD
* detected speech (in milliseconds). Defaults to 300ms.
*/
prefix_padding_ms?: number;
/**
* Used only for `server_vad` mode. Duration of silence to detect speech stop (in
* milliseconds). Defaults to 500ms. With shorter values the model will respond
* more quickly, but may jump in on short pauses from the user.
*/
silence_duration_ms?: number;
/**
* Used only for `server_vad` mode. Activation threshold for VAD (0.0 to 1.0), this
* defaults to 0.5. A higher threshold will require louder audio to activate the
* model, and thus might perform better in noisy environments.
*/
threshold?: number;
/**
* Type of turn detection.
*/
type?: 'server_vad' | 'semantic_vad';
}
}
export declare namespace Sessions {
export { type Session as Session, type SessionCreateResponse as SessionCreateResponse, type SessionCreateParams as SessionCreateParams, };
}
//# sourceMappingURL=sessions.d.ts.map
File diff suppressed because one or more lines are too long
+32
View File
@@ -0,0 +1,32 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.Sessions = void 0;
const resource_1 = require("../../../core/resource.js");
const headers_1 = require("../../../internal/headers.js");
class Sessions extends resource_1.APIResource {
/**
* Create an ephemeral API token for use in client-side applications with the
* Realtime API. Can be configured with the same session parameters as the
* `session.update` client event.
*
* It responds with a session object, plus a `client_secret` key which contains a
* usable ephemeral API token that can be used to authenticate browser clients for
* the Realtime API.
*
* @example
* ```ts
* const session =
* await client.beta.realtime.sessions.create();
* ```
*/
create(body, options) {
return this._client.post('/realtime/sessions', {
body,
...options,
headers: (0, headers_1.buildHeaders)([{ 'OpenAI-Beta': 'assistants=v2' }, options?.headers]),
});
}
}
exports.Sessions = Sessions;
//# sourceMappingURL=sessions.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"sessions.js","sourceRoot":"","sources":["../../../src/resources/beta/realtime/sessions.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAqD;AAErD,0DAAyD;AAGzD,MAAa,QAAS,SAAQ,sBAAW;IACvC;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,IAAyB,EAAE,OAAwB;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE;YAC7C,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,aAAa,EAAE,eAAe,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC9E,CAAC,CAAC;IACL,CAAC;CACF;AAvBD,4BAuBC"}
+28
View File
@@ -0,0 +1,28 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../../core/resource.mjs";
import { buildHeaders } from "../../../internal/headers.mjs";
export class Sessions extends APIResource {
/**
* Create an ephemeral API token for use in client-side applications with the
* Realtime API. Can be configured with the same session parameters as the
* `session.update` client event.
*
* It responds with a session object, plus a `client_secret` key which contains a
* usable ephemeral API token that can be used to authenticate browser clients for
* the Realtime API.
*
* @example
* ```ts
* const session =
* await client.beta.realtime.sessions.create();
* ```
*/
create(body, options) {
return this._client.post('/realtime/sessions', {
body,
...options,
headers: buildHeaders([{ 'OpenAI-Beta': 'assistants=v2' }, options?.headers]),
});
}
}
//# sourceMappingURL=sessions.mjs.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"sessions.mjs","sourceRoot":"","sources":["../../../src/resources/beta/realtime/sessions.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,EAAE,YAAY,EAAE;AAGvB,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,IAAyB,EAAE,OAAwB;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE;YAC7C,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,aAAa,EAAE,eAAe,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC9E,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -0,0 +1,299 @@
import { APIResource } from "../../../core/resource.mjs";
import { APIPromise } from "../../../core/api-promise.mjs";
import { RequestOptions } from "../../../internal/request-options.mjs";
export declare class TranscriptionSessions extends APIResource {
/**
* Create an ephemeral API token for use in client-side applications with the
* Realtime API specifically for realtime transcriptions. Can be configured with
* the same session parameters as the `transcription_session.update` client event.
*
* It responds with a session object, plus a `client_secret` key which contains a
* usable ephemeral API token that can be used to authenticate browser clients for
* the Realtime API.
*
* @example
* ```ts
* const transcriptionSession =
* await client.beta.realtime.transcriptionSessions.create();
* ```
*/
create(body: TranscriptionSessionCreateParams, options?: RequestOptions): APIPromise<TranscriptionSession>;
}
/**
* A new Realtime transcription session configuration.
*
* When a session is created on the server via REST API, the session object also
* contains an ephemeral key. Default TTL for keys is 10 minutes. This property is
* not present when a session is updated via the WebSocket API.
*/
export interface TranscriptionSession {
/**
* Ephemeral key returned by the API. Only present when the session is created on
* the server via REST API.
*/
client_secret: TranscriptionSession.ClientSecret;
/**
* The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
*/
input_audio_format?: string;
/**
* Configuration of the transcription model.
*/
input_audio_transcription?: TranscriptionSession.InputAudioTranscription;
/**
* The set of modalities the model can respond with. To disable audio, set this to
* ["text"].
*/
modalities?: Array<'text' | 'audio'>;
/**
* Configuration for turn detection. Can be set to `null` to turn off. Server VAD
* means that the model will detect the start and end of speech based on audio
* volume and respond at the end of user speech.
*/
turn_detection?: TranscriptionSession.TurnDetection;
}
export declare namespace TranscriptionSession {
/**
* Ephemeral key returned by the API. Only present when the session is created on
* the server via REST API.
*/
interface ClientSecret {
/**
* Timestamp for when the token expires. Currently, all tokens expire after one
* minute.
*/
expires_at: number;
/**
* Ephemeral key usable in client environments to authenticate connections to the
* Realtime API. Use this in client-side environments rather than a standard API
* token, which should only be used server-side.
*/
value: string;
}
/**
* Configuration of the transcription model.
*/
interface InputAudioTranscription {
/**
* The language of the input audio. Supplying the input language in
* [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`)
* format will improve accuracy and latency.
*/
language?: string;
/**
* The model to use for transcription. Can be `gpt-4o-transcribe`,
* `gpt-4o-mini-transcribe`, or `whisper-1`.
*/
model?: 'gpt-4o-transcribe' | 'gpt-4o-mini-transcribe' | 'whisper-1';
/**
* An optional text to guide the model's style or continue a previous audio
* segment. The
* [prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting)
* should match the audio language.
*/
prompt?: string;
}
/**
* Configuration for turn detection. Can be set to `null` to turn off. Server VAD
* means that the model will detect the start and end of speech based on audio
* volume and respond at the end of user speech.
*/
interface TurnDetection {
/**
* Amount of audio to include before the VAD detected speech (in milliseconds).
* Defaults to 300ms.
*/
prefix_padding_ms?: number;
/**
* Duration of silence to detect speech stop (in milliseconds). Defaults to 500ms.
* With shorter values the model will respond more quickly, but may jump in on
* short pauses from the user.
*/
silence_duration_ms?: number;
/**
* Activation threshold for VAD (0.0 to 1.0), this defaults to 0.5. A higher
* threshold will require louder audio to activate the model, and thus might
* perform better in noisy environments.
*/
threshold?: number;
/**
* Type of turn detection, only `server_vad` is currently supported.
*/
type?: string;
}
}
export interface TranscriptionSessionCreateParams {
/**
* Configuration options for the generated client secret.
*/
client_secret?: TranscriptionSessionCreateParams.ClientSecret;
/**
* The set of items to include in the transcription. Current available items are:
*
* - `item.input_audio_transcription.logprobs`
*/
include?: Array<string>;
/**
* The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. For
* `pcm16`, input audio must be 16-bit PCM at a 24kHz sample rate, single channel
* (mono), and little-endian byte order.
*/
input_audio_format?: 'pcm16' | 'g711_ulaw' | 'g711_alaw';
/**
* Configuration for input audio noise reduction. This can be set to `null` to turn
* off. Noise reduction filters audio added to the input audio buffer before it is
* sent to VAD and the model. Filtering the audio can improve VAD and turn
* detection accuracy (reducing false positives) and model performance by improving
* perception of the input audio.
*/
input_audio_noise_reduction?: TranscriptionSessionCreateParams.InputAudioNoiseReduction;
/**
* Configuration for input audio transcription. The client can optionally set the
* language and prompt for transcription, these offer additional guidance to the
* transcription service.
*/
input_audio_transcription?: TranscriptionSessionCreateParams.InputAudioTranscription;
/**
* The set of modalities the model can respond with. To disable audio, set this to
* ["text"].
*/
modalities?: Array<'text' | 'audio'>;
/**
* Configuration for turn detection, ether Server VAD or Semantic VAD. This can be
* set to `null` to turn off, in which case the client must manually trigger model
* response. Server VAD means that the model will detect the start and end of
* speech based on audio volume and respond at the end of user speech. Semantic VAD
* is more advanced and uses a turn detection model (in conjunction with VAD) to
* semantically estimate whether the user has finished speaking, then dynamically
* sets a timeout based on this probability. For example, if user audio trails off
* with "uhhm", the model will score a low probability of turn end and wait longer
* for the user to continue speaking. This can be useful for more natural
* conversations, but may have a higher latency.
*/
turn_detection?: TranscriptionSessionCreateParams.TurnDetection;
}
export declare namespace TranscriptionSessionCreateParams {
/**
* Configuration options for the generated client secret.
*/
interface ClientSecret {
/**
* Configuration for the ephemeral token expiration.
*/
expires_at?: ClientSecret.ExpiresAt;
}
namespace ClientSecret {
/**
* Configuration for the ephemeral token expiration.
*/
interface ExpiresAt {
/**
* The anchor point for the ephemeral token expiration. Only `created_at` is
* currently supported.
*/
anchor?: 'created_at';
/**
* The number of seconds from the anchor point to the expiration. Select a value
* between `10` and `7200`.
*/
seconds?: number;
}
}
/**
* Configuration for input audio noise reduction. This can be set to `null` to turn
* off. Noise reduction filters audio added to the input audio buffer before it is
* sent to VAD and the model. Filtering the audio can improve VAD and turn
* detection accuracy (reducing false positives) and model performance by improving
* perception of the input audio.
*/
interface InputAudioNoiseReduction {
/**
* Type of noise reduction. `near_field` is for close-talking microphones such as
* headphones, `far_field` is for far-field microphones such as laptop or
* conference room microphones.
*/
type?: 'near_field' | 'far_field';
}
/**
* Configuration for input audio transcription. The client can optionally set the
* language and prompt for transcription, these offer additional guidance to the
* transcription service.
*/
interface InputAudioTranscription {
/**
* The language of the input audio. Supplying the input language in
* [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`)
* format will improve accuracy and latency.
*/
language?: string;
/**
* The model to use for transcription, current options are `gpt-4o-transcribe`,
* `gpt-4o-mini-transcribe`, and `whisper-1`.
*/
model?: 'gpt-4o-transcribe' | 'gpt-4o-mini-transcribe' | 'whisper-1';
/**
* An optional text to guide the model's style or continue a previous audio
* segment. For `whisper-1`, the
* [prompt is a list of keywords](https://platform.openai.com/docs/guides/speech-to-text#prompting).
* For `gpt-4o-transcribe` models, the prompt is a free text string, for example
* "expect words related to technology".
*/
prompt?: string;
}
/**
* Configuration for turn detection, ether Server VAD or Semantic VAD. This can be
* set to `null` to turn off, in which case the client must manually trigger model
* response. Server VAD means that the model will detect the start and end of
* speech based on audio volume and respond at the end of user speech. Semantic VAD
* is more advanced and uses a turn detection model (in conjunction with VAD) to
* semantically estimate whether the user has finished speaking, then dynamically
* sets a timeout based on this probability. For example, if user audio trails off
* with "uhhm", the model will score a low probability of turn end and wait longer
* for the user to continue speaking. This can be useful for more natural
* conversations, but may have a higher latency.
*/
interface TurnDetection {
/**
* Whether or not to automatically generate a response when a VAD stop event
* occurs. Not available for transcription sessions.
*/
create_response?: boolean;
/**
* Used only for `semantic_vad` mode. The eagerness of the model to respond. `low`
* will wait longer for the user to continue speaking, `high` will respond more
* quickly. `auto` is the default and is equivalent to `medium`.
*/
eagerness?: 'low' | 'medium' | 'high' | 'auto';
/**
* Whether or not to automatically interrupt any ongoing response with output to
* the default conversation (i.e. `conversation` of `auto`) when a VAD start event
* occurs. Not available for transcription sessions.
*/
interrupt_response?: boolean;
/**
* Used only for `server_vad` mode. Amount of audio to include before the VAD
* detected speech (in milliseconds). Defaults to 300ms.
*/
prefix_padding_ms?: number;
/**
* Used only for `server_vad` mode. Duration of silence to detect speech stop (in
* milliseconds). Defaults to 500ms. With shorter values the model will respond
* more quickly, but may jump in on short pauses from the user.
*/
silence_duration_ms?: number;
/**
* Used only for `server_vad` mode. Activation threshold for VAD (0.0 to 1.0), this
* defaults to 0.5. A higher threshold will require louder audio to activate the
* model, and thus might perform better in noisy environments.
*/
threshold?: number;
/**
* Type of turn detection.
*/
type?: 'server_vad' | 'semantic_vad';
}
}
export declare namespace TranscriptionSessions {
export { type TranscriptionSession as TranscriptionSession, type TranscriptionSessionCreateParams as TranscriptionSessionCreateParams, };
}
//# sourceMappingURL=transcription-sessions.d.mts.map
@@ -0,0 +1 @@
{"version":3,"file":"transcription-sessions.d.mts","sourceRoot":"","sources":["../../../src/resources/beta/realtime/transcription-sessions.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OAEd,EAAE,cAAc,EAAE;AAEzB,qBAAa,qBAAsB,SAAQ,WAAW;IACpD;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,IAAI,EAAE,gCAAgC,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,oBAAoB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3B;;;;WAIG;QACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;QAE7B;;;;WAIG;QACH,SAAS,CAAC,EAAE,MAAM,CAAC;QAEnB;;WAEG;QACH,IAAI,CAAC,EAAE,YAAY,GAAG,cAAc,CAAC;KACtC;CACF;AAED,MAAM,CAAC,OAAO,WAAW,qBAAqB,CAAC;IAC7C,OAAO,EACL,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,gCAAgC,IAAI,gCAAgC,GAC1E,CAAC;CACH"}
@@ -0,0 +1,299 @@
import { APIResource } from "../../../core/resource.js";
import { APIPromise } from "../../../core/api-promise.js";
import { RequestOptions } from "../../../internal/request-options.js";
export declare class TranscriptionSessions extends APIResource {
/**
* Create an ephemeral API token for use in client-side applications with the
* Realtime API specifically for realtime transcriptions. Can be configured with
* the same session parameters as the `transcription_session.update` client event.
*
* It responds with a session object, plus a `client_secret` key which contains a
* usable ephemeral API token that can be used to authenticate browser clients for
* the Realtime API.
*
* @example
* ```ts
* const transcriptionSession =
* await client.beta.realtime.transcriptionSessions.create();
* ```
*/
create(body: TranscriptionSessionCreateParams, options?: RequestOptions): APIPromise<TranscriptionSession>;
}
/**
* A new Realtime transcription session configuration.
*
* When a session is created on the server via REST API, the session object also
* contains an ephemeral key. Default TTL for keys is 10 minutes. This property is
* not present when a session is updated via the WebSocket API.
*/
export interface TranscriptionSession {
/**
* Ephemeral key returned by the API. Only present when the session is created on
* the server via REST API.
*/
client_secret: TranscriptionSession.ClientSecret;
/**
* The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
*/
input_audio_format?: string;
/**
* Configuration of the transcription model.
*/
input_audio_transcription?: TranscriptionSession.InputAudioTranscription;
/**
* The set of modalities the model can respond with. To disable audio, set this to
* ["text"].
*/
modalities?: Array<'text' | 'audio'>;
/**
* Configuration for turn detection. Can be set to `null` to turn off. Server VAD
* means that the model will detect the start and end of speech based on audio
* volume and respond at the end of user speech.
*/
turn_detection?: TranscriptionSession.TurnDetection;
}
export declare namespace TranscriptionSession {
/**
* Ephemeral key returned by the API. Only present when the session is created on
* the server via REST API.
*/
interface ClientSecret {
/**
* Timestamp for when the token expires. Currently, all tokens expire after one
* minute.
*/
expires_at: number;
/**
* Ephemeral key usable in client environments to authenticate connections to the
* Realtime API. Use this in client-side environments rather than a standard API
* token, which should only be used server-side.
*/
value: string;
}
/**
* Configuration of the transcription model.
*/
interface InputAudioTranscription {
/**
* The language of the input audio. Supplying the input language in
* [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`)
* format will improve accuracy and latency.
*/
language?: string;
/**
* The model to use for transcription. Can be `gpt-4o-transcribe`,
* `gpt-4o-mini-transcribe`, or `whisper-1`.
*/
model?: 'gpt-4o-transcribe' | 'gpt-4o-mini-transcribe' | 'whisper-1';
/**
* An optional text to guide the model's style or continue a previous audio
* segment. The
* [prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting)
* should match the audio language.
*/
prompt?: string;
}
/**
* Configuration for turn detection. Can be set to `null` to turn off. Server VAD
* means that the model will detect the start and end of speech based on audio
* volume and respond at the end of user speech.
*/
interface TurnDetection {
/**
* Amount of audio to include before the VAD detected speech (in milliseconds).
* Defaults to 300ms.
*/
prefix_padding_ms?: number;
/**
* Duration of silence to detect speech stop (in milliseconds). Defaults to 500ms.
* With shorter values the model will respond more quickly, but may jump in on
* short pauses from the user.
*/
silence_duration_ms?: number;
/**
* Activation threshold for VAD (0.0 to 1.0), this defaults to 0.5. A higher
* threshold will require louder audio to activate the model, and thus might
* perform better in noisy environments.
*/
threshold?: number;
/**
* Type of turn detection, only `server_vad` is currently supported.
*/
type?: string;
}
}
export interface TranscriptionSessionCreateParams {
/**
* Configuration options for the generated client secret.
*/
client_secret?: TranscriptionSessionCreateParams.ClientSecret;
/**
* The set of items to include in the transcription. Current available items are:
*
* - `item.input_audio_transcription.logprobs`
*/
include?: Array<string>;
/**
* The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. For
* `pcm16`, input audio must be 16-bit PCM at a 24kHz sample rate, single channel
* (mono), and little-endian byte order.
*/
input_audio_format?: 'pcm16' | 'g711_ulaw' | 'g711_alaw';
/**
* Configuration for input audio noise reduction. This can be set to `null` to turn
* off. Noise reduction filters audio added to the input audio buffer before it is
* sent to VAD and the model. Filtering the audio can improve VAD and turn
* detection accuracy (reducing false positives) and model performance by improving
* perception of the input audio.
*/
input_audio_noise_reduction?: TranscriptionSessionCreateParams.InputAudioNoiseReduction;
/**
* Configuration for input audio transcription. The client can optionally set the
* language and prompt for transcription, these offer additional guidance to the
* transcription service.
*/
input_audio_transcription?: TranscriptionSessionCreateParams.InputAudioTranscription;
/**
* The set of modalities the model can respond with. To disable audio, set this to
* ["text"].
*/
modalities?: Array<'text' | 'audio'>;
/**
* Configuration for turn detection, ether Server VAD or Semantic VAD. This can be
* set to `null` to turn off, in which case the client must manually trigger model
* response. Server VAD means that the model will detect the start and end of
* speech based on audio volume and respond at the end of user speech. Semantic VAD
* is more advanced and uses a turn detection model (in conjunction with VAD) to
* semantically estimate whether the user has finished speaking, then dynamically
* sets a timeout based on this probability. For example, if user audio trails off
* with "uhhm", the model will score a low probability of turn end and wait longer
* for the user to continue speaking. This can be useful for more natural
* conversations, but may have a higher latency.
*/
turn_detection?: TranscriptionSessionCreateParams.TurnDetection;
}
export declare namespace TranscriptionSessionCreateParams {
/**
* Configuration options for the generated client secret.
*/
interface ClientSecret {
/**
* Configuration for the ephemeral token expiration.
*/
expires_at?: ClientSecret.ExpiresAt;
}
namespace ClientSecret {
/**
* Configuration for the ephemeral token expiration.
*/
interface ExpiresAt {
/**
* The anchor point for the ephemeral token expiration. Only `created_at` is
* currently supported.
*/
anchor?: 'created_at';
/**
* The number of seconds from the anchor point to the expiration. Select a value
* between `10` and `7200`.
*/
seconds?: number;
}
}
/**
* Configuration for input audio noise reduction. This can be set to `null` to turn
* off. Noise reduction filters audio added to the input audio buffer before it is
* sent to VAD and the model. Filtering the audio can improve VAD and turn
* detection accuracy (reducing false positives) and model performance by improving
* perception of the input audio.
*/
interface InputAudioNoiseReduction {
/**
* Type of noise reduction. `near_field` is for close-talking microphones such as
* headphones, `far_field` is for far-field microphones such as laptop or
* conference room microphones.
*/
type?: 'near_field' | 'far_field';
}
/**
* Configuration for input audio transcription. The client can optionally set the
* language and prompt for transcription, these offer additional guidance to the
* transcription service.
*/
interface InputAudioTranscription {
/**
* The language of the input audio. Supplying the input language in
* [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`)
* format will improve accuracy and latency.
*/
language?: string;
/**
* The model to use for transcription, current options are `gpt-4o-transcribe`,
* `gpt-4o-mini-transcribe`, and `whisper-1`.
*/
model?: 'gpt-4o-transcribe' | 'gpt-4o-mini-transcribe' | 'whisper-1';
/**
* An optional text to guide the model's style or continue a previous audio
* segment. For `whisper-1`, the
* [prompt is a list of keywords](https://platform.openai.com/docs/guides/speech-to-text#prompting).
* For `gpt-4o-transcribe` models, the prompt is a free text string, for example
* "expect words related to technology".
*/
prompt?: string;
}
/**
* Configuration for turn detection, ether Server VAD or Semantic VAD. This can be
* set to `null` to turn off, in which case the client must manually trigger model
* response. Server VAD means that the model will detect the start and end of
* speech based on audio volume and respond at the end of user speech. Semantic VAD
* is more advanced and uses a turn detection model (in conjunction with VAD) to
* semantically estimate whether the user has finished speaking, then dynamically
* sets a timeout based on this probability. For example, if user audio trails off
* with "uhhm", the model will score a low probability of turn end and wait longer
* for the user to continue speaking. This can be useful for more natural
* conversations, but may have a higher latency.
*/
interface TurnDetection {
/**
* Whether or not to automatically generate a response when a VAD stop event
* occurs. Not available for transcription sessions.
*/
create_response?: boolean;
/**
* Used only for `semantic_vad` mode. The eagerness of the model to respond. `low`
* will wait longer for the user to continue speaking, `high` will respond more
* quickly. `auto` is the default and is equivalent to `medium`.
*/
eagerness?: 'low' | 'medium' | 'high' | 'auto';
/**
* Whether or not to automatically interrupt any ongoing response with output to
* the default conversation (i.e. `conversation` of `auto`) when a VAD start event
* occurs. Not available for transcription sessions.
*/
interrupt_response?: boolean;
/**
* Used only for `server_vad` mode. Amount of audio to include before the VAD
* detected speech (in milliseconds). Defaults to 300ms.
*/
prefix_padding_ms?: number;
/**
* Used only for `server_vad` mode. Duration of silence to detect speech stop (in
* milliseconds). Defaults to 500ms. With shorter values the model will respond
* more quickly, but may jump in on short pauses from the user.
*/
silence_duration_ms?: number;
/**
* Used only for `server_vad` mode. Activation threshold for VAD (0.0 to 1.0), this
* defaults to 0.5. A higher threshold will require louder audio to activate the
* model, and thus might perform better in noisy environments.
*/
threshold?: number;
/**
* Type of turn detection.
*/
type?: 'server_vad' | 'semantic_vad';
}
}
export declare namespace TranscriptionSessions {
export { type TranscriptionSession as TranscriptionSession, type TranscriptionSessionCreateParams as TranscriptionSessionCreateParams, };
}
//# sourceMappingURL=transcription-sessions.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"transcription-sessions.d.ts","sourceRoot":"","sources":["../../../src/resources/beta/realtime/transcription-sessions.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OAEd,EAAE,cAAc,EAAE;AAEzB,qBAAa,qBAAsB,SAAQ,WAAW;IACpD;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,IAAI,EAAE,gCAAgC,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,oBAAoB,CAAC;CAO3G;AAED;;;;;;GAMG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,aAAa,EAAE,oBAAoB,CAAC,YAAY,CAAC;IAEjD;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B;;OAEG;IACH,yBAAyB,CAAC,EAAE,oBAAoB,CAAC,uBAAuB,CAAC;IAEzE;;;OAGG;IACH,UAAU,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,OAAO,CAAC,CAAC;IAErC;;;;OAIG;IACH,cAAc,CAAC,EAAE,oBAAoB,C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