diff --git a/api.md b/api.md index 02030dc07..7557ce133 100644 --- a/api.md +++ b/api.md @@ -20,6 +20,10 @@ Methods: # Chat +Types: + +- ChatModel + ## Completions Types: diff --git a/src/index.ts b/src/index.ts index 91267cfc0..7a776b2c1 100644 --- a/src/index.ts +++ b/src/index.ts @@ -238,6 +238,7 @@ export namespace OpenAI { export import CompletionCreateParamsStreaming = API.CompletionCreateParamsStreaming; export import Chat = API.Chat; + export import ChatModel = API.ChatModel; export import ChatCompletion = API.ChatCompletion; export import ChatCompletionAssistantMessageParam = API.ChatCompletionAssistantMessageParam; export import ChatCompletionChunk = API.ChatCompletionChunk; diff --git a/src/resources/chat/chat.ts b/src/resources/chat/chat.ts index 6c7bccb22..fa681ed64 100644 --- a/src/resources/chat/chat.ts +++ b/src/resources/chat/chat.ts @@ -1,13 +1,36 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from 'openai/resource'; +import * as ChatAPI from 'openai/resources/chat/chat'; import * as CompletionsAPI from 'openai/resources/chat/completions'; export class Chat extends APIResource { completions: CompletionsAPI.Completions = new CompletionsAPI.Completions(this._client); } +export type ChatModel = + | 'gpt-4-turbo' + | 'gpt-4-turbo-2024-04-09' + | 'gpt-4-0125-preview' + | 'gpt-4-turbo-preview' + | 'gpt-4-1106-preview' + | 'gpt-4-vision-preview' + | 'gpt-4' + | 'gpt-4-0314' + | 'gpt-4-0613' + | 'gpt-4-32k' + | 'gpt-4-32k-0314' + | 'gpt-4-32k-0613' + | 'gpt-3.5-turbo' + | 'gpt-3.5-turbo-16k' + | 'gpt-3.5-turbo-0301' + | 'gpt-3.5-turbo-0613' + | 'gpt-3.5-turbo-1106' + | 'gpt-3.5-turbo-0125' + | 'gpt-3.5-turbo-16k-0613'; + export namespace Chat { + export import ChatModel = ChatAPI.ChatModel; export import Completions = CompletionsAPI.Completions; export import ChatCompletion = CompletionsAPI.ChatCompletion; export import ChatCompletionAssistantMessageParam = CompletionsAPI.ChatCompletionAssistantMessageParam; diff --git a/src/resources/chat/completions.ts b/src/resources/chat/completions.ts index 2288265ea..b9672f52b 100644 --- a/src/resources/chat/completions.ts +++ b/src/resources/chat/completions.ts @@ -6,6 +6,7 @@ import { APIResource } from 'openai/resource'; import * as ChatCompletionsAPI from 'openai/resources/chat/completions'; import * as CompletionsAPI from 'openai/resources/completions'; import * as Shared from 'openai/resources/shared'; +import * as ChatAPI from 'openai/resources/chat/chat'; import { Stream } from 'openai/streaming'; export class Completions extends APIResource { @@ -665,27 +666,7 @@ export interface ChatCompletionCreateParamsBase { * [model endpoint compatibility](https://platform.openai.com/docs/models/model-endpoint-compatibility) * table for details on which models work with the Chat API. */ - model: - | (string & {}) - | 'gpt-4-turbo' - | 'gpt-4-turbo-2024-04-09' - | 'gpt-4-0125-preview' - | 'gpt-4-turbo-preview' - | 'gpt-4-1106-preview' - | 'gpt-4-vision-preview' - | 'gpt-4' - | 'gpt-4-0314' - | 'gpt-4-0613' - | 'gpt-4-32k' - | 'gpt-4-32k-0314' - | 'gpt-4-32k-0613' - | 'gpt-3.5-turbo' - | 'gpt-3.5-turbo-16k' - | 'gpt-3.5-turbo-0301' - | 'gpt-3.5-turbo-0613' - | 'gpt-3.5-turbo-1106' - | 'gpt-3.5-turbo-0125' - | 'gpt-3.5-turbo-16k-0613'; + model: (string & {}) | ChatAPI.ChatModel; /** * Number between -2.0 and 2.0. Positive values penalize new tokens based on their diff --git a/src/resources/chat/index.ts b/src/resources/chat/index.ts index 78a7516ed..ef72bbbc9 100644 --- a/src/resources/chat/index.ts +++ b/src/resources/chat/index.ts @@ -1,6 +1,5 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { Chat } from './chat'; export { ChatCompletion, ChatCompletionAssistantMessageParam, @@ -30,3 +29,4 @@ export { CompletionCreateParamsStreaming, Completions, } from './completions'; +export { ChatModel, Chat } from './chat';