diff --git a/src/client.ts b/src/client.ts index c7df965cd..1f1605a5b 100644 --- a/src/client.ts +++ b/src/client.ts @@ -229,6 +229,7 @@ import { ChatCompletionUpdateParams, ChatCompletionUserMessageParam, ChatCompletionsPage, + RunnerOptions, } from './resources/chat/completions/completions'; import { type Fetch } from './internal/builtin-types'; import { isRunningInBrowser } from './internal/detect-platform'; @@ -1467,6 +1468,7 @@ export declare namespace OpenAI { type ChatCompletionCreateParamsStreaming as ChatCompletionCreateParamsStreaming, type ChatCompletionUpdateParams as ChatCompletionUpdateParams, type ChatCompletionListParams as ChatCompletionListParams, + type RunnerOptions as RunnerOptions, }; export { diff --git a/src/index.ts b/src/index.ts index bd5e7743f..bc9e486a0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -5,6 +5,7 @@ export { OpenAI as default } from './client'; export { type Uploadable, toFile } from './core/uploads'; export { APIPromise } from './core/api-promise'; export { OpenAI, type ClientOptions } from './client'; +export { type RunnerOptions } from './resources/chat/completions'; export { PagePromise } from './core/pagination'; export { OpenAIError, diff --git a/src/resources/chat/completions/completions.ts b/src/resources/chat/completions/completions.ts index 05cae402e..b2916ad36 100644 --- a/src/resources/chat/completions/completions.ts +++ b/src/resources/chat/completions/completions.ts @@ -257,6 +257,7 @@ export { } from '../../../lib/RunnableFunction'; export { type ChatCompletionToolRunnerParams } from '../../../lib/ChatCompletionRunner'; export { type ChatCompletionStreamingToolRunnerParams } from '../../../lib/ChatCompletionStreamingRunner'; +export { type RunnerOptions } from '../../../lib/AbstractChatCompletionRunner'; export { ChatCompletionStream, type ChatCompletionStreamParams } from '../../../lib/ChatCompletionStream'; export { ChatCompletionRunner } from '../../../lib/ChatCompletionRunner'; diff --git a/src/resources/chat/completions/index.ts b/src/resources/chat/completions/index.ts index 6a379c1d6..80bb70a88 100644 --- a/src/resources/chat/completions/index.ts +++ b/src/resources/chat/completions/index.ts @@ -43,6 +43,7 @@ export { type ChatCompletionCreateParamsStreaming, type ChatCompletionUpdateParams, type ChatCompletionListParams, + type RunnerOptions, type ChatCompletionStoreMessagesPage, type ChatCompletionsPage, } from './completions'; diff --git a/src/resources/chat/index.ts b/src/resources/chat/index.ts index 3004ebb08..f7d742a8a 100644 --- a/src/resources/chat/index.ts +++ b/src/resources/chat/index.ts @@ -44,6 +44,7 @@ export { type ChatCompletionCreateParamsStreaming, type ChatCompletionUpdateParams, type ChatCompletionListParams, + type RunnerOptions, type ChatCompletionStoreMessagesPage, type ChatCompletionsPage, } from './completions/index'; diff --git a/tests/runner-options-exports.test.ts b/tests/runner-options-exports.test.ts new file mode 100644 index 000000000..8702a6b33 --- /dev/null +++ b/tests/runner-options-exports.test.ts @@ -0,0 +1,14 @@ +import OpenAI, { type RunnerOptions } from 'openai'; +import type { RunnerOptions as ResourceRunnerOptions } from 'openai/resources/chat/completions'; +import { compareType, expectType } from './utils/typing'; + +describe('RunnerOptions exports', () => { + test('exports runTools options from public package surfaces', () => { + const options: RunnerOptions = { maxChatCompletions: 1 }; + + expectType(options); + compareType(true); + + expect(true).toBe(true); + }); +});