Skip to content

Commit

Permalink
Showing 5 changed files with 31 additions and 22 deletions.
4 changes: 4 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
@@ -20,6 +20,10 @@ Methods:

# Chat

Types:

- <code><a href="./src/resources/chat/chat.ts">ChatModel</a></code>

## Completions

Types:
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -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;
23 changes: 23 additions & 0 deletions src/resources/chat/chat.ts
Original file line number Diff line number Diff line change
@@ -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;
23 changes: 2 additions & 21 deletions src/resources/chat/completions.ts
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion src/resources/chat/index.ts
Original file line number Diff line number Diff line change
@@ -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';

0 comments on commit 9dfc744

Please sign in to comment.