Comparing version 4.76.3 to 4.77.0
@@ -76,3 +76,3 @@ | ||
constructor({ baseURL, maxRetries, timeout, // 10 minutes | ||
httpAgent, fetch: overridenFetch, }: { | ||
httpAgent, fetch: overriddenFetch, }: { | ||
baseURL: string; | ||
@@ -79,0 +79,0 @@ maxRetries?: number | undefined; |
@@ -136,3 +136,3 @@ "use strict"; | ||
constructor({ baseURL, maxRetries = 2, timeout = 600000, // 10 minutes | ||
httpAgent, fetch: overridenFetch, }) { | ||
httpAgent, fetch: overriddenFetch, }) { | ||
this.baseURL = baseURL; | ||
@@ -142,3 +142,3 @@ this.maxRetries = validatePositiveInteger('maxRetries', maxRetries); | ||
this.httpAgent = httpAgent; | ||
this.fetch = overridenFetch ?? index_1.fetch; | ||
this.fetch = overriddenFetch ?? index_1.fetch; | ||
} | ||
@@ -145,0 +145,0 @@ authHeaders(opts) { |
@@ -18,3 +18,3 @@ import { type Agent, type RequestInit } from "./_shims/index.js"; | ||
import { Chat, ChatModel } from "./resources/chat/chat.js"; | ||
import { ChatCompletion, ChatCompletionAssistantMessageParam, ChatCompletionAudio, ChatCompletionAudioParam, ChatCompletionChunk, ChatCompletionContentPart, ChatCompletionContentPartImage, ChatCompletionContentPartInputAudio, ChatCompletionContentPartRefusal, ChatCompletionContentPartText, ChatCompletionCreateParams, ChatCompletionCreateParamsNonStreaming, ChatCompletionCreateParamsStreaming, ChatCompletionFunctionCallOption, ChatCompletionFunctionMessageParam, ChatCompletionMessage, ChatCompletionMessageParam, ChatCompletionMessageToolCall, ChatCompletionModality, ChatCompletionNamedToolChoice, ChatCompletionPredictionContent, ChatCompletionRole, ChatCompletionStreamOptions, ChatCompletionSystemMessageParam, ChatCompletionTokenLogprob, ChatCompletionTool, ChatCompletionToolChoiceOption, ChatCompletionToolMessageParam, ChatCompletionUserMessageParam } from "./resources/chat/completions.js"; | ||
import { ChatCompletion, ChatCompletionAssistantMessageParam, ChatCompletionAudio, ChatCompletionAudioParam, ChatCompletionChunk, ChatCompletionContentPart, ChatCompletionContentPartImage, ChatCompletionContentPartInputAudio, ChatCompletionContentPartRefusal, ChatCompletionContentPartText, ChatCompletionCreateParams, ChatCompletionCreateParamsNonStreaming, ChatCompletionCreateParamsStreaming, ChatCompletionDeveloperMessageParam, ChatCompletionFunctionCallOption, ChatCompletionFunctionMessageParam, ChatCompletionMessage, ChatCompletionMessageParam, ChatCompletionMessageToolCall, ChatCompletionModality, ChatCompletionNamedToolChoice, ChatCompletionPredictionContent, ChatCompletionReasoningEffort, ChatCompletionRole, ChatCompletionStreamOptions, ChatCompletionSystemMessageParam, ChatCompletionTokenLogprob, ChatCompletionTool, ChatCompletionToolChoiceOption, ChatCompletionToolMessageParam, ChatCompletionUserMessageParam } from "./resources/chat/completions.js"; | ||
import { FineTuning } from "./resources/fine-tuning/fine-tuning.js"; | ||
@@ -155,3 +155,3 @@ import { Upload, UploadCompleteParams, UploadCreateParams, Uploads as UploadsAPIUploads } from "./resources/uploads/uploads.js"; | ||
export { Completions as Completions, type Completion as Completion, type CompletionChoice as CompletionChoice, type CompletionUsage as CompletionUsage, type CompletionCreateParams as CompletionCreateParams, type CompletionCreateParamsNonStreaming as CompletionCreateParamsNonStreaming, type CompletionCreateParamsStreaming as CompletionCreateParamsStreaming, }; | ||
export { Chat as Chat, type ChatModel as ChatModel, type ChatCompletion as ChatCompletion, type ChatCompletionAssistantMessageParam as ChatCompletionAssistantMessageParam, type ChatCompletionAudio as ChatCompletionAudio, type ChatCompletionAudioParam as ChatCompletionAudioParam, type ChatCompletionChunk as ChatCompletionChunk, type ChatCompletionContentPart as ChatCompletionContentPart, type ChatCompletionContentPartImage as ChatCompletionContentPartImage, type ChatCompletionContentPartInputAudio as ChatCompletionContentPartInputAudio, type ChatCompletionContentPartRefusal as ChatCompletionContentPartRefusal, type ChatCompletionContentPartText as ChatCompletionContentPartText, type ChatCompletionFunctionCallOption as ChatCompletionFunctionCallOption, type ChatCompletionFunctionMessageParam as ChatCompletionFunctionMessageParam, type ChatCompletionMessage as ChatCompletionMessage, type ChatCompletionMessageParam as ChatCompletionMessageParam, type ChatCompletionMessageToolCall as ChatCompletionMessageToolCall, type ChatCompletionModality as ChatCompletionModality, type ChatCompletionNamedToolChoice as ChatCompletionNamedToolChoice, type ChatCompletionPredictionContent as ChatCompletionPredictionContent, type ChatCompletionRole as ChatCompletionRole, type ChatCompletionStreamOptions as ChatCompletionStreamOptions, type ChatCompletionSystemMessageParam as ChatCompletionSystemMessageParam, type ChatCompletionTokenLogprob as ChatCompletionTokenLogprob, type ChatCompletionTool as ChatCompletionTool, type ChatCompletionToolChoiceOption as ChatCompletionToolChoiceOption, type ChatCompletionToolMessageParam as ChatCompletionToolMessageParam, type ChatCompletionUserMessageParam as ChatCompletionUserMessageParam, type ChatCompletionCreateParams as ChatCompletionCreateParams, type ChatCompletionCreateParamsNonStreaming as ChatCompletionCreateParamsNonStreaming, type ChatCompletionCreateParamsStreaming as ChatCompletionCreateParamsStreaming, }; | ||
export { Chat as Chat, type ChatModel as ChatModel, type ChatCompletion as ChatCompletion, type ChatCompletionAssistantMessageParam as ChatCompletionAssistantMessageParam, type ChatCompletionAudio as ChatCompletionAudio, type ChatCompletionAudioParam as ChatCompletionAudioParam, type ChatCompletionChunk as ChatCompletionChunk, type ChatCompletionContentPart as ChatCompletionContentPart, type ChatCompletionContentPartImage as ChatCompletionContentPartImage, type ChatCompletionContentPartInputAudio as ChatCompletionContentPartInputAudio, type ChatCompletionContentPartRefusal as ChatCompletionContentPartRefusal, type ChatCompletionContentPartText as ChatCompletionContentPartText, type ChatCompletionDeveloperMessageParam as ChatCompletionDeveloperMessageParam, type ChatCompletionFunctionCallOption as ChatCompletionFunctionCallOption, type ChatCompletionFunctionMessageParam as ChatCompletionFunctionMessageParam, type ChatCompletionMessage as ChatCompletionMessage, type ChatCompletionMessageParam as ChatCompletionMessageParam, type ChatCompletionMessageToolCall as ChatCompletionMessageToolCall, type ChatCompletionModality as ChatCompletionModality, type ChatCompletionNamedToolChoice as ChatCompletionNamedToolChoice, type ChatCompletionPredictionContent as ChatCompletionPredictionContent, type ChatCompletionReasoningEffort as ChatCompletionReasoningEffort, type ChatCompletionRole as ChatCompletionRole, type ChatCompletionStreamOptions as ChatCompletionStreamOptions, type ChatCompletionSystemMessageParam as ChatCompletionSystemMessageParam, type ChatCompletionTokenLogprob as ChatCompletionTokenLogprob, type ChatCompletionTool as ChatCompletionTool, type ChatCompletionToolChoiceOption as ChatCompletionToolChoiceOption, type ChatCompletionToolMessageParam as ChatCompletionToolMessageParam, type ChatCompletionUserMessageParam as ChatCompletionUserMessageParam, type ChatCompletionCreateParams as ChatCompletionCreateParams, type ChatCompletionCreateParamsNonStreaming as ChatCompletionCreateParamsNonStreaming, type ChatCompletionCreateParamsStreaming as ChatCompletionCreateParamsStreaming, }; | ||
export { Embeddings as Embeddings, type CreateEmbeddingResponse as CreateEmbeddingResponse, type Embedding as Embedding, type EmbeddingModel as EmbeddingModel, type EmbeddingCreateParams as EmbeddingCreateParams, }; | ||
@@ -158,0 +158,0 @@ export { Files as Files, type FileContent as FileContent, type FileDeleted as FileDeleted, type FileObject as FileObject, type FilePurpose as FilePurpose, FileObjectsPage as FileObjectsPage, type FileCreateParams as FileCreateParams, type FileListParams as FileListParams, }; |
{ | ||
"name": "openai", | ||
"version": "4.76.3", | ||
"version": "4.77.0", | ||
"description": "The official TypeScript library for the OpenAI API", | ||
@@ -5,0 +5,0 @@ "author": "OpenAI <support@openai.com>", |
import { APIResource } from "../../resource.js"; | ||
import * as CompletionsAPI from "./completions.js"; | ||
import { ChatCompletion, ChatCompletionAssistantMessageParam, ChatCompletionAudio, ChatCompletionAudioParam, ChatCompletionChunk, ChatCompletionContentPart, ChatCompletionContentPartImage, ChatCompletionContentPartInputAudio, ChatCompletionContentPartRefusal, ChatCompletionContentPartText, ChatCompletionCreateParams, ChatCompletionCreateParamsNonStreaming, ChatCompletionCreateParamsStreaming, ChatCompletionFunctionCallOption, ChatCompletionFunctionMessageParam, ChatCompletionMessage, ChatCompletionMessageParam, ChatCompletionMessageToolCall, ChatCompletionModality, ChatCompletionNamedToolChoice, ChatCompletionPredictionContent, ChatCompletionRole, ChatCompletionStreamOptions, ChatCompletionSystemMessageParam, ChatCompletionTokenLogprob, ChatCompletionTool, ChatCompletionToolChoiceOption, ChatCompletionToolMessageParam, ChatCompletionUserMessageParam, CompletionCreateParams, CompletionCreateParamsNonStreaming, CompletionCreateParamsStreaming, Completions, CreateChatCompletionRequestMessage } from "./completions.js"; | ||
import { ChatCompletion, ChatCompletionAssistantMessageParam, ChatCompletionAudio, ChatCompletionAudioParam, ChatCompletionChunk, ChatCompletionContentPart, ChatCompletionContentPartImage, ChatCompletionContentPartInputAudio, ChatCompletionContentPartRefusal, ChatCompletionContentPartText, ChatCompletionCreateParams, ChatCompletionCreateParamsNonStreaming, ChatCompletionCreateParamsStreaming, ChatCompletionDeveloperMessageParam, ChatCompletionFunctionCallOption, ChatCompletionFunctionMessageParam, ChatCompletionMessage, ChatCompletionMessageParam, ChatCompletionMessageToolCall, ChatCompletionModality, ChatCompletionNamedToolChoice, ChatCompletionPredictionContent, ChatCompletionReasoningEffort, ChatCompletionRole, ChatCompletionStreamOptions, ChatCompletionSystemMessageParam, ChatCompletionTokenLogprob, ChatCompletionTool, ChatCompletionToolChoiceOption, ChatCompletionToolMessageParam, ChatCompletionUserMessageParam, CompletionCreateParams, CompletionCreateParamsNonStreaming, CompletionCreateParamsStreaming, Completions, CreateChatCompletionRequestMessage } from "./completions.js"; | ||
export declare class Chat extends APIResource { | ||
completions: CompletionsAPI.Completions; | ||
} | ||
export type ChatModel = 'o1-preview' | 'o1-preview-2024-09-12' | 'o1-mini' | 'o1-mini-2024-09-12' | 'gpt-4o' | 'gpt-4o-2024-11-20' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-05-13' | 'gpt-4o-realtime-preview' | 'gpt-4o-realtime-preview-2024-10-01' | 'gpt-4o-audio-preview' | 'gpt-4o-audio-preview-2024-10-01' | 'chatgpt-4o-latest' | 'gpt-4o-mini' | 'gpt-4o-mini-2024-07-18' | '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 type ChatModel = 'o1' | 'o1-2024-12-17' | 'o1-preview' | 'o1-preview-2024-09-12' | 'o1-mini' | 'o1-mini-2024-09-12' | 'gpt-4o' | 'gpt-4o-2024-11-20' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-05-13' | 'gpt-4o-audio-preview' | 'gpt-4o-audio-preview-2024-10-01' | 'gpt-4o-audio-preview-2024-12-17' | 'gpt-4o-mini-audio-preview' | 'gpt-4o-mini-audio-preview-2024-12-17' | 'chatgpt-4o-latest' | 'gpt-4o-mini' | 'gpt-4o-mini-2024-07-18' | '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 declare namespace Chat { | ||
export { type ChatModel as ChatModel }; | ||
export { Completions as Completions, type ChatCompletion as ChatCompletion, type ChatCompletionAssistantMessageParam as ChatCompletionAssistantMessageParam, type ChatCompletionAudio as ChatCompletionAudio, type ChatCompletionAudioParam as ChatCompletionAudioParam, type ChatCompletionChunk as ChatCompletionChunk, type ChatCompletionContentPart as ChatCompletionContentPart, type ChatCompletionContentPartImage as ChatCompletionContentPartImage, type ChatCompletionContentPartInputAudio as ChatCompletionContentPartInputAudio, type ChatCompletionContentPartRefusal as ChatCompletionContentPartRefusal, type ChatCompletionContentPartText as ChatCompletionContentPartText, type ChatCompletionFunctionCallOption as ChatCompletionFunctionCallOption, type ChatCompletionFunctionMessageParam as ChatCompletionFunctionMessageParam, type ChatCompletionMessage as ChatCompletionMessage, type ChatCompletionMessageParam as ChatCompletionMessageParam, type ChatCompletionMessageToolCall as ChatCompletionMessageToolCall, type ChatCompletionModality as ChatCompletionModality, type ChatCompletionNamedToolChoice as ChatCompletionNamedToolChoice, type ChatCompletionPredictionContent as ChatCompletionPredictionContent, type ChatCompletionRole as ChatCompletionRole, type ChatCompletionStreamOptions as ChatCompletionStreamOptions, type ChatCompletionSystemMessageParam as ChatCompletionSystemMessageParam, type ChatCompletionTokenLogprob as ChatCompletionTokenLogprob, type ChatCompletionTool as ChatCompletionTool, type ChatCompletionToolChoiceOption as ChatCompletionToolChoiceOption, type ChatCompletionToolMessageParam as ChatCompletionToolMessageParam, type ChatCompletionUserMessageParam as ChatCompletionUserMessageParam, type CreateChatCompletionRequestMessage as CreateChatCompletionRequestMessage, type ChatCompletionCreateParams as ChatCompletionCreateParams, type CompletionCreateParams as CompletionCreateParams, type ChatCompletionCreateParamsNonStreaming as ChatCompletionCreateParamsNonStreaming, type CompletionCreateParamsNonStreaming as CompletionCreateParamsNonStreaming, type ChatCompletionCreateParamsStreaming as ChatCompletionCreateParamsStreaming, type CompletionCreateParamsStreaming as CompletionCreateParamsStreaming, }; | ||
export { Completions as Completions, type ChatCompletion as ChatCompletion, type ChatCompletionAssistantMessageParam as ChatCompletionAssistantMessageParam, type ChatCompletionAudio as ChatCompletionAudio, type ChatCompletionAudioParam as ChatCompletionAudioParam, type ChatCompletionChunk as ChatCompletionChunk, type ChatCompletionContentPart as ChatCompletionContentPart, type ChatCompletionContentPartImage as ChatCompletionContentPartImage, type ChatCompletionContentPartInputAudio as ChatCompletionContentPartInputAudio, type ChatCompletionContentPartRefusal as ChatCompletionContentPartRefusal, type ChatCompletionContentPartText as ChatCompletionContentPartText, type ChatCompletionDeveloperMessageParam as ChatCompletionDeveloperMessageParam, type ChatCompletionFunctionCallOption as ChatCompletionFunctionCallOption, type ChatCompletionFunctionMessageParam as ChatCompletionFunctionMessageParam, type ChatCompletionMessage as ChatCompletionMessage, type ChatCompletionMessageParam as ChatCompletionMessageParam, type ChatCompletionMessageToolCall as ChatCompletionMessageToolCall, type ChatCompletionModality as ChatCompletionModality, type ChatCompletionNamedToolChoice as ChatCompletionNamedToolChoice, type ChatCompletionPredictionContent as ChatCompletionPredictionContent, type ChatCompletionReasoningEffort as ChatCompletionReasoningEffort, type ChatCompletionRole as ChatCompletionRole, type ChatCompletionStreamOptions as ChatCompletionStreamOptions, type ChatCompletionSystemMessageParam as ChatCompletionSystemMessageParam, type ChatCompletionTokenLogprob as ChatCompletionTokenLogprob, type ChatCompletionTool as ChatCompletionTool, type ChatCompletionToolChoiceOption as ChatCompletionToolChoiceOption, type ChatCompletionToolMessageParam as ChatCompletionToolMessageParam, type ChatCompletionUserMessageParam as ChatCompletionUserMessageParam, type CreateChatCompletionRequestMessage as CreateChatCompletionRequestMessage, type ChatCompletionCreateParams as ChatCompletionCreateParams, type CompletionCreateParams as CompletionCreateParams, type ChatCompletionCreateParamsNonStreaming as ChatCompletionCreateParamsNonStreaming, type CompletionCreateParamsNonStreaming as CompletionCreateParamsNonStreaming, type ChatCompletionCreateParamsStreaming as ChatCompletionCreateParamsStreaming, type CompletionCreateParamsStreaming as CompletionCreateParamsStreaming, }; | ||
} | ||
//# sourceMappingURL=chat.d.ts.map |
@@ -15,2 +15,8 @@ import { APIResource } from "../../resource.js"; | ||
* [audio](https://platform.openai.com/docs/guides/audio) guides. | ||
* | ||
* Parameter support can differ depending on the model used to generate the | ||
* response, particularly for newer reasoning models. Parameters that are only | ||
* supported for reasoning models are noted below. For the current state of | ||
* unsupported parameters in reasoning models, | ||
* [refer to the reasoning guide](https://platform.openai.com/docs/guides/reasoning). | ||
*/ | ||
@@ -104,2 +110,5 @@ create(body: ChatCompletionCreateParamsNonStreaming, options?: Core.RequestOptions): APIPromise<ChatCompletion>; | ||
} | ||
/** | ||
* Messages sent by the model in response to user messages. | ||
*/ | ||
export interface ChatCompletionAssistantMessageParam { | ||
@@ -442,2 +451,22 @@ /** | ||
/** | ||
* Developer-provided instructions that the model should follow, regardless of | ||
* messages sent by the user. With o1 models and newer, `developer` messages | ||
* replace the previous `system` messages. | ||
*/ | ||
export interface ChatCompletionDeveloperMessageParam { | ||
/** | ||
* The contents of the developer message. | ||
*/ | ||
content: string | Array<ChatCompletionContentPartText>; | ||
/** | ||
* The role of the messages author, in this case `developer`. | ||
*/ | ||
role: 'developer'; | ||
/** | ||
* An optional name for the participant. Provides the model information to | ||
* differentiate between participants of the same role. | ||
*/ | ||
name?: string; | ||
} | ||
/** | ||
* Specifying a particular function via `{"name": "my_function"}` forces the model | ||
@@ -520,3 +549,8 @@ * to call that function. | ||
} | ||
export type ChatCompletionMessageParam = ChatCompletionSystemMessageParam | ChatCompletionUserMessageParam | ChatCompletionAssistantMessageParam | ChatCompletionToolMessageParam | ChatCompletionFunctionMessageParam; | ||
/** | ||
* Developer-provided instructions that the model should follow, regardless of | ||
* messages sent by the user. With o1 models and newer, `developer` messages | ||
* replace the previous `system` messages. | ||
*/ | ||
export type ChatCompletionMessageParam = ChatCompletionDeveloperMessageParam | ChatCompletionSystemMessageParam | ChatCompletionUserMessageParam | ChatCompletionAssistantMessageParam | ChatCompletionToolMessageParam | ChatCompletionFunctionMessageParam; | ||
export interface ChatCompletionMessageToolCall { | ||
@@ -592,2 +626,11 @@ /** | ||
/** | ||
* **o1 models only** | ||
* | ||
* Constrains effort on reasoning for | ||
* [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently | ||
* supported values are `low`, `medium`, and `high`. Reducing reasoning effort can | ||
* result in faster responses and fewer tokens used on reasoning in a response. | ||
*/ | ||
export type ChatCompletionReasoningEffort = 'low' | 'medium' | 'high'; | ||
/** | ||
* The role of the author of a message | ||
@@ -608,2 +651,7 @@ */ | ||
} | ||
/** | ||
* Developer-provided instructions that the model should follow, regardless of | ||
* messages sent by the user. With o1 models and newer, use `developer` messages | ||
* for this purpose instead. | ||
*/ | ||
export interface ChatCompletionSystemMessageParam { | ||
@@ -703,2 +751,6 @@ /** | ||
} | ||
/** | ||
* Messages sent by an end user, containing prompts or additional context | ||
* information. | ||
*/ | ||
export interface ChatCompletionUserMessageParam { | ||
@@ -750,4 +802,2 @@ /** | ||
* repeat the same line verbatim. | ||
* | ||
* [See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation) | ||
*/ | ||
@@ -758,8 +808,12 @@ frequency_penalty?: number | null; | ||
* | ||
* Controls which (if any) function is called by the model. `none` means the model | ||
* will not call a function and instead generates a message. `auto` means the model | ||
* can pick between generating a message or calling a function. Specifying a | ||
* particular function via `{"name": "my_function"}` forces the model to call that | ||
* Controls which (if any) function is called by the model. | ||
* | ||
* `none` means the model will not call a function and instead generates a message. | ||
* | ||
* `auto` means the model can pick between generating a message or calling a | ||
* function. | ||
* | ||
* Specifying a particular function via `{"name": "my_function"}` forces the model | ||
* to call that function. | ||
* | ||
* `none` is the default when no functions are present. `auto` is the default if | ||
@@ -847,13 +901,16 @@ * functions are present. | ||
* talk about new topics. | ||
* | ||
* [See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation) | ||
*/ | ||
presence_penalty?: number | null; | ||
/** | ||
* An object specifying the format that the model must output. Compatible with | ||
* [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), | ||
* [GPT-4o mini](https://platform.openai.com/docs/models#gpt-4o-mini), | ||
* [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4) and | ||
* all GPT-3.5 Turbo models newer than `gpt-3.5-turbo-1106`. | ||
* **o1 models only** | ||
* | ||
* Constrains effort on reasoning for | ||
* [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently | ||
* supported values are `low`, `medium`, and `high`. Reducing reasoning effort can | ||
* result in faster responses and fewer tokens used on reasoning in a response. | ||
*/ | ||
reasoning_effort?: ChatCompletionReasoningEffort; | ||
/** | ||
* An object specifying the format that the model must output. | ||
* | ||
* Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured | ||
@@ -927,5 +984,4 @@ * Outputs which ensures the model will match your supplied JSON schema. Learn more | ||
* make the output more random, while lower values like 0.2 will make it more | ||
* focused and deterministic. | ||
* | ||
* We generally recommend altering this or `top_p` but not both. | ||
* focused and deterministic. We generally recommend altering this or `top_p` but | ||
* not both. | ||
*/ | ||
@@ -1036,4 +1092,4 @@ temperature?: number | null; | ||
export declare namespace Completions { | ||
export { type ChatCompletion as ChatCompletion, type ChatCompletionAssistantMessageParam as ChatCompletionAssistantMessageParam, type ChatCompletionAudio as ChatCompletionAudio, type ChatCompletionAudioParam as ChatCompletionAudioParam, type ChatCompletionChunk as ChatCompletionChunk, type ChatCompletionContentPart as ChatCompletionContentPart, type ChatCompletionContentPartImage as ChatCompletionContentPartImage, type ChatCompletionContentPartInputAudio as ChatCompletionContentPartInputAudio, type ChatCompletionContentPartRefusal as ChatCompletionContentPartRefusal, type ChatCompletionContentPartText as ChatCompletionContentPartText, type ChatCompletionFunctionCallOption as ChatCompletionFunctionCallOption, type ChatCompletionFunctionMessageParam as ChatCompletionFunctionMessageParam, type ChatCompletionMessage as ChatCompletionMessage, type ChatCompletionMessageParam as ChatCompletionMessageParam, type ChatCompletionMessageToolCall as ChatCompletionMessageToolCall, type ChatCompletionModality as ChatCompletionModality, type ChatCompletionNamedToolChoice as ChatCompletionNamedToolChoice, type ChatCompletionPredictionContent as ChatCompletionPredictionContent, type ChatCompletionRole as ChatCompletionRole, type ChatCompletionStreamOptions as ChatCompletionStreamOptions, type ChatCompletionSystemMessageParam as ChatCompletionSystemMessageParam, type ChatCompletionTokenLogprob as ChatCompletionTokenLogprob, type ChatCompletionTool as ChatCompletionTool, type ChatCompletionToolChoiceOption as ChatCompletionToolChoiceOption, type ChatCompletionToolMessageParam as ChatCompletionToolMessageParam, type ChatCompletionUserMessageParam as ChatCompletionUserMessageParam, type CreateChatCompletionRequestMessage as CreateChatCompletionRequestMessage, type ChatCompletionCreateParams as ChatCompletionCreateParams, type CompletionCreateParams as CompletionCreateParams, type ChatCompletionCreateParamsNonStreaming as ChatCompletionCreateParamsNonStreaming, type CompletionCreateParamsNonStreaming as CompletionCreateParamsNonStreaming, type ChatCompletionCreateParamsStreaming as ChatCompletionCreateParamsStreaming, type CompletionCreateParamsStreaming as CompletionCreateParamsStreaming, }; | ||
export { type ChatCompletion as ChatCompletion, type ChatCompletionAssistantMessageParam as ChatCompletionAssistantMessageParam, type ChatCompletionAudio as ChatCompletionAudio, type ChatCompletionAudioParam as ChatCompletionAudioParam, type ChatCompletionChunk as ChatCompletionChunk, type ChatCompletionContentPart as ChatCompletionContentPart, type ChatCompletionContentPartImage as ChatCompletionContentPartImage, type ChatCompletionContentPartInputAudio as ChatCompletionContentPartInputAudio, type ChatCompletionContentPartRefusal as ChatCompletionContentPartRefusal, type ChatCompletionContentPartText as ChatCompletionContentPartText, type ChatCompletionDeveloperMessageParam as ChatCompletionDeveloperMessageParam, type ChatCompletionFunctionCallOption as ChatCompletionFunctionCallOption, type ChatCompletionFunctionMessageParam as ChatCompletionFunctionMessageParam, type ChatCompletionMessage as ChatCompletionMessage, type ChatCompletionMessageParam as ChatCompletionMessageParam, type ChatCompletionMessageToolCall as ChatCompletionMessageToolCall, type ChatCompletionModality as ChatCompletionModality, type ChatCompletionNamedToolChoice as ChatCompletionNamedToolChoice, type ChatCompletionPredictionContent as ChatCompletionPredictionContent, type ChatCompletionReasoningEffort as ChatCompletionReasoningEffort, type ChatCompletionRole as ChatCompletionRole, type ChatCompletionStreamOptions as ChatCompletionStreamOptions, type ChatCompletionSystemMessageParam as ChatCompletionSystemMessageParam, type ChatCompletionTokenLogprob as ChatCompletionTokenLogprob, type ChatCompletionTool as ChatCompletionTool, type ChatCompletionToolChoiceOption as ChatCompletionToolChoiceOption, type ChatCompletionToolMessageParam as ChatCompletionToolMessageParam, type ChatCompletionUserMessageParam as ChatCompletionUserMessageParam, type CreateChatCompletionRequestMessage as CreateChatCompletionRequestMessage, type ChatCompletionCreateParams as ChatCompletionCreateParams, type CompletionCreateParams as CompletionCreateParams, type ChatCompletionCreateParamsNonStreaming as ChatCompletionCreateParamsNonStreaming, type CompletionCreateParamsNonStreaming as CompletionCreateParamsNonStreaming, type ChatCompletionCreateParamsStreaming as ChatCompletionCreateParamsStreaming, type CompletionCreateParamsStreaming as CompletionCreateParamsStreaming, }; | ||
} | ||
//# sourceMappingURL=completions.d.ts.map |
export { Chat, type ChatModel } from "./chat.js"; | ||
export { Completions, type ChatCompletion, type ChatCompletionAssistantMessageParam, type ChatCompletionAudio, type ChatCompletionAudioParam, type ChatCompletionChunk, type ChatCompletionContentPart, type ChatCompletionContentPartImage, type ChatCompletionContentPartInputAudio, type ChatCompletionContentPartRefusal, type ChatCompletionContentPartText, type ChatCompletionFunctionCallOption, type ChatCompletionFunctionMessageParam, type ChatCompletionMessage, type ChatCompletionMessageParam, type ChatCompletionMessageToolCall, type ChatCompletionModality, type ChatCompletionNamedToolChoice, type ChatCompletionPredictionContent, type ChatCompletionRole, type ChatCompletionStreamOptions, type ChatCompletionSystemMessageParam, type ChatCompletionTokenLogprob, type ChatCompletionTool, type ChatCompletionToolChoiceOption, type ChatCompletionToolMessageParam, type ChatCompletionUserMessageParam, type CreateChatCompletionRequestMessage, type ChatCompletionCreateParams, type CompletionCreateParams, type ChatCompletionCreateParamsNonStreaming, type CompletionCreateParamsNonStreaming, type ChatCompletionCreateParamsStreaming, type CompletionCreateParamsStreaming, } from "./completions.js"; | ||
export { Completions, type ChatCompletion, type ChatCompletionAssistantMessageParam, type ChatCompletionAudio, type ChatCompletionAudioParam, type ChatCompletionChunk, type ChatCompletionContentPart, type ChatCompletionContentPartImage, type ChatCompletionContentPartInputAudio, type ChatCompletionContentPartRefusal, type ChatCompletionContentPartText, type ChatCompletionDeveloperMessageParam, type ChatCompletionFunctionCallOption, type ChatCompletionFunctionMessageParam, type ChatCompletionMessage, type ChatCompletionMessageParam, type ChatCompletionMessageToolCall, type ChatCompletionModality, type ChatCompletionNamedToolChoice, type ChatCompletionPredictionContent, type ChatCompletionReasoningEffort, type ChatCompletionRole, type ChatCompletionStreamOptions, type ChatCompletionSystemMessageParam, type ChatCompletionTokenLogprob, type ChatCompletionTool, type ChatCompletionToolChoiceOption, type ChatCompletionToolMessageParam, type ChatCompletionUserMessageParam, type CreateChatCompletionRequestMessage, type ChatCompletionCreateParams, type CompletionCreateParams, type ChatCompletionCreateParamsNonStreaming, type CompletionCreateParamsNonStreaming, type ChatCompletionCreateParamsStreaming, type CompletionCreateParamsStreaming, } from "./completions.js"; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -72,5 +72,4 @@ import { APIResource } from "../../../resource.js"; | ||
/** | ||
* The hyperparameters used for the fine-tuning job. See the | ||
* [fine-tuning guide](https://platform.openai.com/docs/guides/fine-tuning) for | ||
* more details. | ||
* The hyperparameters used for the fine-tuning job. This value will only be | ||
* returned when running `supervised` jobs. | ||
*/ | ||
@@ -130,2 +129,6 @@ hyperparameters: FineTuningJob.Hyperparameters; | ||
integrations?: Array<FineTuningJobWandbIntegrationObject> | null; | ||
/** | ||
* The method used for fine-tuning. | ||
*/ | ||
method?: FineTuningJob.Method; | ||
} | ||
@@ -153,15 +156,108 @@ export declare namespace FineTuningJob { | ||
/** | ||
* The hyperparameters used for the fine-tuning job. See the | ||
* [fine-tuning guide](https://platform.openai.com/docs/guides/fine-tuning) for | ||
* more details. | ||
* The hyperparameters used for the fine-tuning job. This value will only be | ||
* returned when running `supervised` jobs. | ||
*/ | ||
interface Hyperparameters { | ||
/** | ||
* Number of examples in each batch. A larger batch size means that model | ||
* parameters are updated less frequently, but with lower variance. | ||
*/ | ||
batch_size?: 'auto' | number; | ||
/** | ||
* Scaling factor for the learning rate. A smaller learning rate may be useful to | ||
* avoid overfitting. | ||
*/ | ||
learning_rate_multiplier?: 'auto' | number; | ||
/** | ||
* The number of epochs to train the model for. An epoch refers to one full cycle | ||
* through the training dataset. "auto" decides the optimal number of epochs based | ||
* on the size of the dataset. If setting the number manually, we support any | ||
* number between 1 and 50 epochs. | ||
* through the training dataset. | ||
*/ | ||
n_epochs: 'auto' | number; | ||
n_epochs?: 'auto' | number; | ||
} | ||
/** | ||
* The method used for fine-tuning. | ||
*/ | ||
interface Method { | ||
/** | ||
* Configuration for the DPO fine-tuning method. | ||
*/ | ||
dpo?: Method.Dpo; | ||
/** | ||
* Configuration for the supervised fine-tuning method. | ||
*/ | ||
supervised?: Method.Supervised; | ||
/** | ||
* The type of method. Is either `supervised` or `dpo`. | ||
*/ | ||
type?: 'supervised' | 'dpo'; | ||
} | ||
namespace Method { | ||
/** | ||
* Configuration for the DPO fine-tuning method. | ||
*/ | ||
interface Dpo { | ||
/** | ||
* The hyperparameters used for the fine-tuning job. | ||
*/ | ||
hyperparameters?: Dpo.Hyperparameters; | ||
} | ||
namespace Dpo { | ||
/** | ||
* The hyperparameters used for the fine-tuning job. | ||
*/ | ||
interface Hyperparameters { | ||
/** | ||
* Number of examples in each batch. A larger batch size means that model | ||
* parameters are updated less frequently, but with lower variance. | ||
*/ | ||
batch_size?: 'auto' | number; | ||
/** | ||
* The beta value for the DPO method. A higher beta value will increase the weight | ||
* of the penalty between the policy and reference model. | ||
*/ | ||
beta?: 'auto' | number; | ||
/** | ||
* Scaling factor for the learning rate. A smaller learning rate may be useful to | ||
* avoid overfitting. | ||
*/ | ||
learning_rate_multiplier?: 'auto' | number; | ||
/** | ||
* The number of epochs to train the model for. An epoch refers to one full cycle | ||
* through the training dataset. | ||
*/ | ||
n_epochs?: 'auto' | number; | ||
} | ||
} | ||
/** | ||
* Configuration for the supervised fine-tuning method. | ||
*/ | ||
interface Supervised { | ||
/** | ||
* The hyperparameters used for the fine-tuning job. | ||
*/ | ||
hyperparameters?: Supervised.Hyperparameters; | ||
} | ||
namespace Supervised { | ||
/** | ||
* The hyperparameters used for the fine-tuning job. | ||
*/ | ||
interface Hyperparameters { | ||
/** | ||
* Number of examples in each batch. A larger batch size means that model | ||
* parameters are updated less frequently, but with lower variance. | ||
*/ | ||
batch_size?: 'auto' | number; | ||
/** | ||
* Scaling factor for the learning rate. A smaller learning rate may be useful to | ||
* avoid overfitting. | ||
*/ | ||
learning_rate_multiplier?: 'auto' | number; | ||
/** | ||
* The number of epochs to train the model for. An epoch refers to one full cycle | ||
* through the training dataset. | ||
*/ | ||
n_epochs?: 'auto' | number; | ||
} | ||
} | ||
} | ||
} | ||
@@ -172,7 +268,30 @@ /** | ||
export interface FineTuningJobEvent { | ||
/** | ||
* The object identifier. | ||
*/ | ||
id: string; | ||
/** | ||
* The Unix timestamp (in seconds) for when the fine-tuning job was created. | ||
*/ | ||
created_at: number; | ||
/** | ||
* The log level of the event. | ||
*/ | ||
level: 'info' | 'warn' | 'error'; | ||
/** | ||
* The message of the event. | ||
*/ | ||
message: string; | ||
/** | ||
* The object type, which is always "fine_tuning.job.event". | ||
*/ | ||
object: 'fine_tuning.job.event'; | ||
/** | ||
* The data associated with the event. | ||
*/ | ||
data?: unknown; | ||
/** | ||
* The type of event. | ||
*/ | ||
type?: 'message' | 'metrics'; | ||
} | ||
@@ -238,4 +357,6 @@ export type FineTuningJobIntegration = FineTuningJobWandbIntegrationObject; | ||
* The contents of the file should differ depending on if the model uses the | ||
* [chat](https://platform.openai.com/docs/api-reference/fine-tuning/chat-input) or | ||
* [chat](https://platform.openai.com/docs/api-reference/fine-tuning/chat-input), | ||
* [completions](https://platform.openai.com/docs/api-reference/fine-tuning/completions-input) | ||
* format, or if the fine-tuning method uses the | ||
* [preference](https://platform.openai.com/docs/api-reference/fine-tuning/preference-input) | ||
* format. | ||
@@ -248,3 +369,4 @@ * | ||
/** | ||
* The hyperparameters used for the fine-tuning job. | ||
* The hyperparameters used for the fine-tuning job. This value is now deprecated | ||
* in favor of `method`, and should be passed in under the `method` parameter. | ||
*/ | ||
@@ -257,2 +379,6 @@ hyperparameters?: JobCreateParams.Hyperparameters; | ||
/** | ||
* The method used for fine-tuning. | ||
*/ | ||
method?: JobCreateParams.Method; | ||
/** | ||
* The seed controls the reproducibility of the job. Passing in the same seed and | ||
@@ -289,3 +415,5 @@ * job parameters should produce the same results, but may differ in rare cases. If | ||
/** | ||
* The hyperparameters used for the fine-tuning job. | ||
* @deprecated: The hyperparameters used for the fine-tuning job. This value is now | ||
* deprecated in favor of `method`, and should be passed in under the `method` | ||
* parameter. | ||
*/ | ||
@@ -354,2 +482,88 @@ interface Hyperparameters { | ||
} | ||
/** | ||
* The method used for fine-tuning. | ||
*/ | ||
interface Method { | ||
/** | ||
* Configuration for the DPO fine-tuning method. | ||
*/ | ||
dpo?: Method.Dpo; | ||
/** | ||
* Configuration for the supervised fine-tuning method. | ||
*/ | ||
supervised?: Method.Supervised; | ||
/** | ||
* The type of method. Is either `supervised` or `dpo`. | ||
*/ | ||
type?: 'supervised' | 'dpo'; | ||
} | ||
namespace Method { | ||
/** | ||
* Configuration for the DPO fine-tuning method. | ||
*/ | ||
interface Dpo { | ||
/** | ||
* The hyperparameters used for the fine-tuning job. | ||
*/ | ||
hyperparameters?: Dpo.Hyperparameters; | ||
} | ||
namespace Dpo { | ||
/** | ||
* The hyperparameters used for the fine-tuning job. | ||
*/ | ||
interface Hyperparameters { | ||
/** | ||
* Number of examples in each batch. A larger batch size means that model | ||
* parameters are updated less frequently, but with lower variance. | ||
*/ | ||
batch_size?: 'auto' | number; | ||
/** | ||
* The beta value for the DPO method. A higher beta value will increase the weight | ||
* of the penalty between the policy and reference model. | ||
*/ | ||
beta?: 'auto' | number; | ||
/** | ||
* Scaling factor for the learning rate. A smaller learning rate may be useful to | ||
* avoid overfitting. | ||
*/ | ||
learning_rate_multiplier?: 'auto' | number; | ||
/** | ||
* The number of epochs to train the model for. An epoch refers to one full cycle | ||
* through the training dataset. | ||
*/ | ||
n_epochs?: 'auto' | number; | ||
} | ||
} | ||
/** | ||
* Configuration for the supervised fine-tuning method. | ||
*/ | ||
interface Supervised { | ||
/** | ||
* The hyperparameters used for the fine-tuning job. | ||
*/ | ||
hyperparameters?: Supervised.Hyperparameters; | ||
} | ||
namespace Supervised { | ||
/** | ||
* The hyperparameters used for the fine-tuning job. | ||
*/ | ||
interface Hyperparameters { | ||
/** | ||
* Number of examples in each batch. A larger batch size means that model | ||
* parameters are updated less frequently, but with lower variance. | ||
*/ | ||
batch_size?: 'auto' | number; | ||
/** | ||
* Scaling factor for the learning rate. A smaller learning rate may be useful to | ||
* avoid overfitting. | ||
*/ | ||
learning_rate_multiplier?: 'auto' | number; | ||
/** | ||
* The number of epochs to train the model for. An epoch refers to one full cycle | ||
* through the training dataset. | ||
*/ | ||
n_epochs?: 'auto' | number; | ||
} | ||
} | ||
} | ||
} | ||
@@ -356,0 +570,0 @@ export interface JobListParams extends CursorPageParams { |
@@ -201,3 +201,3 @@ import { VERSION } from './version'; | ||
httpAgent, | ||
fetch: overridenFetch, | ||
fetch: overriddenFetch, | ||
}: { | ||
@@ -215,3 +215,3 @@ baseURL: string; | ||
this.fetch = overridenFetch ?? fetch; | ||
this.fetch = overriddenFetch ?? fetch; | ||
} | ||
@@ -218,0 +218,0 @@ |
@@ -83,2 +83,3 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. | ||
ChatCompletionCreateParamsStreaming, | ||
ChatCompletionDeveloperMessageParam, | ||
ChatCompletionFunctionCallOption, | ||
@@ -92,2 +93,3 @@ ChatCompletionFunctionMessageParam, | ||
ChatCompletionPredictionContent, | ||
ChatCompletionReasoningEffort, | ||
ChatCompletionRole, | ||
@@ -358,2 +360,3 @@ ChatCompletionStreamOptions, | ||
type ChatCompletionContentPartText as ChatCompletionContentPartText, | ||
type ChatCompletionDeveloperMessageParam as ChatCompletionDeveloperMessageParam, | ||
type ChatCompletionFunctionCallOption as ChatCompletionFunctionCallOption, | ||
@@ -367,2 +370,3 @@ type ChatCompletionFunctionMessageParam as ChatCompletionFunctionMessageParam, | ||
type ChatCompletionPredictionContent as ChatCompletionPredictionContent, | ||
type ChatCompletionReasoningEffort as ChatCompletionReasoningEffort, | ||
type ChatCompletionRole as ChatCompletionRole, | ||
@@ -369,0 +373,0 @@ type ChatCompletionStreamOptions as ChatCompletionStreamOptions, |
@@ -19,2 +19,3 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. | ||
ChatCompletionCreateParamsStreaming, | ||
ChatCompletionDeveloperMessageParam, | ||
ChatCompletionFunctionCallOption, | ||
@@ -28,2 +29,3 @@ ChatCompletionFunctionMessageParam, | ||
ChatCompletionPredictionContent, | ||
ChatCompletionReasoningEffort, | ||
ChatCompletionRole, | ||
@@ -49,2 +51,4 @@ ChatCompletionStreamOptions, | ||
export type ChatModel = | ||
| 'o1' | ||
| 'o1-2024-12-17' | ||
| 'o1-preview' | ||
@@ -58,6 +62,7 @@ | 'o1-preview-2024-09-12' | ||
| 'gpt-4o-2024-05-13' | ||
| 'gpt-4o-realtime-preview' | ||
| 'gpt-4o-realtime-preview-2024-10-01' | ||
| 'gpt-4o-audio-preview' | ||
| 'gpt-4o-audio-preview-2024-10-01' | ||
| 'gpt-4o-audio-preview-2024-12-17' | ||
| 'gpt-4o-mini-audio-preview' | ||
| 'gpt-4o-mini-audio-preview-2024-12-17' | ||
| 'chatgpt-4o-latest' | ||
@@ -103,2 +108,3 @@ | 'gpt-4o-mini' | ||
type ChatCompletionContentPartText as ChatCompletionContentPartText, | ||
type ChatCompletionDeveloperMessageParam as ChatCompletionDeveloperMessageParam, | ||
type ChatCompletionFunctionCallOption as ChatCompletionFunctionCallOption, | ||
@@ -112,2 +118,3 @@ type ChatCompletionFunctionMessageParam as ChatCompletionFunctionMessageParam, | ||
type ChatCompletionPredictionContent as ChatCompletionPredictionContent, | ||
type ChatCompletionReasoningEffort as ChatCompletionReasoningEffort, | ||
type ChatCompletionRole as ChatCompletionRole, | ||
@@ -114,0 +121,0 @@ type ChatCompletionStreamOptions as ChatCompletionStreamOptions, |
@@ -18,2 +18,8 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. | ||
* [audio](https://platform.openai.com/docs/guides/audio) guides. | ||
* | ||
* Parameter support can differ depending on the model used to generate the | ||
* response, particularly for newer reasoning models. Parameters that are only | ||
* supported for reasoning models are noted below. For the current state of | ||
* unsupported parameters in reasoning models, | ||
* [refer to the reasoning guide](https://platform.openai.com/docs/guides/reasoning). | ||
*/ | ||
@@ -139,2 +145,5 @@ create( | ||
/** | ||
* Messages sent by the model in response to user messages. | ||
*/ | ||
export interface ChatCompletionAssistantMessageParam { | ||
@@ -536,2 +545,25 @@ /** | ||
/** | ||
* Developer-provided instructions that the model should follow, regardless of | ||
* messages sent by the user. With o1 models and newer, `developer` messages | ||
* replace the previous `system` messages. | ||
*/ | ||
export interface ChatCompletionDeveloperMessageParam { | ||
/** | ||
* The contents of the developer message. | ||
*/ | ||
content: string | Array<ChatCompletionContentPartText>; | ||
/** | ||
* The role of the messages author, in this case `developer`. | ||
*/ | ||
role: 'developer'; | ||
/** | ||
* An optional name for the participant. Provides the model information to | ||
* differentiate between participants of the same role. | ||
*/ | ||
name?: string; | ||
} | ||
/** | ||
* Specifying a particular function via `{"name": "my_function"}` forces the model | ||
@@ -626,3 +658,9 @@ * to call that function. | ||
/** | ||
* Developer-provided instructions that the model should follow, regardless of | ||
* messages sent by the user. With o1 models and newer, `developer` messages | ||
* replace the previous `system` messages. | ||
*/ | ||
export type ChatCompletionMessageParam = | ||
| ChatCompletionDeveloperMessageParam | ||
| ChatCompletionSystemMessageParam | ||
@@ -715,2 +753,12 @@ | ChatCompletionUserMessageParam | ||
/** | ||
* **o1 models only** | ||
* | ||
* Constrains effort on reasoning for | ||
* [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently | ||
* supported values are `low`, `medium`, and `high`. Reducing reasoning effort can | ||
* result in faster responses and fewer tokens used on reasoning in a response. | ||
*/ | ||
export type ChatCompletionReasoningEffort = 'low' | 'medium' | 'high'; | ||
/** | ||
* The role of the author of a message | ||
@@ -733,2 +781,7 @@ */ | ||
/** | ||
* Developer-provided instructions that the model should follow, regardless of | ||
* messages sent by the user. With o1 models and newer, use `developer` messages | ||
* for this purpose instead. | ||
*/ | ||
export interface ChatCompletionSystemMessageParam { | ||
@@ -844,2 +897,6 @@ /** | ||
/** | ||
* Messages sent by an end user, containing prompts or additional context | ||
* information. | ||
*/ | ||
export interface ChatCompletionUserMessageParam { | ||
@@ -901,4 +958,2 @@ /** | ||
* repeat the same line verbatim. | ||
* | ||
* [See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation) | ||
*/ | ||
@@ -910,8 +965,12 @@ frequency_penalty?: number | null; | ||
* | ||
* Controls which (if any) function is called by the model. `none` means the model | ||
* will not call a function and instead generates a message. `auto` means the model | ||
* can pick between generating a message or calling a function. Specifying a | ||
* particular function via `{"name": "my_function"}` forces the model to call that | ||
* Controls which (if any) function is called by the model. | ||
* | ||
* `none` means the model will not call a function and instead generates a message. | ||
* | ||
* `auto` means the model can pick between generating a message or calling a | ||
* function. | ||
* | ||
* Specifying a particular function via `{"name": "my_function"}` forces the model | ||
* to call that function. | ||
* | ||
* `none` is the default when no functions are present. `auto` is the default if | ||
@@ -1010,4 +1069,2 @@ * functions are present. | ||
* talk about new topics. | ||
* | ||
* [See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation) | ||
*/ | ||
@@ -1017,8 +1074,14 @@ presence_penalty?: number | null; | ||
/** | ||
* An object specifying the format that the model must output. Compatible with | ||
* [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), | ||
* [GPT-4o mini](https://platform.openai.com/docs/models#gpt-4o-mini), | ||
* [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4) and | ||
* all GPT-3.5 Turbo models newer than `gpt-3.5-turbo-1106`. | ||
* **o1 models only** | ||
* | ||
* Constrains effort on reasoning for | ||
* [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently | ||
* supported values are `low`, `medium`, and `high`. Reducing reasoning effort can | ||
* result in faster responses and fewer tokens used on reasoning in a response. | ||
*/ | ||
reasoning_effort?: ChatCompletionReasoningEffort; | ||
/** | ||
* An object specifying the format that the model must output. | ||
* | ||
* Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured | ||
@@ -1102,5 +1165,4 @@ * Outputs which ensures the model will match your supplied JSON schema. Learn more | ||
* make the output more random, while lower values like 0.2 will make it more | ||
* focused and deterministic. | ||
* | ||
* We generally recommend altering this or `top_p` but not both. | ||
* focused and deterministic. We generally recommend altering this or `top_p` but | ||
* not both. | ||
*/ | ||
@@ -1238,2 +1300,3 @@ temperature?: number | null; | ||
type ChatCompletionContentPartText as ChatCompletionContentPartText, | ||
type ChatCompletionDeveloperMessageParam as ChatCompletionDeveloperMessageParam, | ||
type ChatCompletionFunctionCallOption as ChatCompletionFunctionCallOption, | ||
@@ -1247,2 +1310,3 @@ type ChatCompletionFunctionMessageParam as ChatCompletionFunctionMessageParam, | ||
type ChatCompletionPredictionContent as ChatCompletionPredictionContent, | ||
type ChatCompletionReasoningEffort as ChatCompletionReasoningEffort, | ||
type ChatCompletionRole as ChatCompletionRole, | ||
@@ -1249,0 +1313,0 @@ type ChatCompletionStreamOptions as ChatCompletionStreamOptions, |
@@ -16,2 +16,3 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. | ||
type ChatCompletionContentPartText, | ||
type ChatCompletionDeveloperMessageParam, | ||
type ChatCompletionFunctionCallOption, | ||
@@ -25,2 +26,3 @@ type ChatCompletionFunctionMessageParam, | ||
type ChatCompletionPredictionContent, | ||
type ChatCompletionReasoningEffort, | ||
type ChatCompletionRole, | ||
@@ -27,0 +29,0 @@ type ChatCompletionStreamOptions, |
@@ -130,5 +130,4 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. | ||
/** | ||
* The hyperparameters used for the fine-tuning job. See the | ||
* [fine-tuning guide](https://platform.openai.com/docs/guides/fine-tuning) for | ||
* more details. | ||
* The hyperparameters used for the fine-tuning job. This value will only be | ||
* returned when running `supervised` jobs. | ||
*/ | ||
@@ -199,2 +198,7 @@ hyperparameters: FineTuningJob.Hyperparameters; | ||
integrations?: Array<FineTuningJobWandbIntegrationObject> | null; | ||
/** | ||
* The method used for fine-tuning. | ||
*/ | ||
method?: FineTuningJob.Method; | ||
} | ||
@@ -226,15 +230,122 @@ | ||
/** | ||
* The hyperparameters used for the fine-tuning job. See the | ||
* [fine-tuning guide](https://platform.openai.com/docs/guides/fine-tuning) for | ||
* more details. | ||
* The hyperparameters used for the fine-tuning job. This value will only be | ||
* returned when running `supervised` jobs. | ||
*/ | ||
export interface Hyperparameters { | ||
/** | ||
* Number of examples in each batch. A larger batch size means that model | ||
* parameters are updated less frequently, but with lower variance. | ||
*/ | ||
batch_size?: 'auto' | number; | ||
/** | ||
* Scaling factor for the learning rate. A smaller learning rate may be useful to | ||
* avoid overfitting. | ||
*/ | ||
learning_rate_multiplier?: 'auto' | number; | ||
/** | ||
* The number of epochs to train the model for. An epoch refers to one full cycle | ||
* through the training dataset. "auto" decides the optimal number of epochs based | ||
* on the size of the dataset. If setting the number manually, we support any | ||
* number between 1 and 50 epochs. | ||
* through the training dataset. | ||
*/ | ||
n_epochs: 'auto' | number; | ||
n_epochs?: 'auto' | number; | ||
} | ||
/** | ||
* The method used for fine-tuning. | ||
*/ | ||
export interface Method { | ||
/** | ||
* Configuration for the DPO fine-tuning method. | ||
*/ | ||
dpo?: Method.Dpo; | ||
/** | ||
* Configuration for the supervised fine-tuning method. | ||
*/ | ||
supervised?: Method.Supervised; | ||
/** | ||
* The type of method. Is either `supervised` or `dpo`. | ||
*/ | ||
type?: 'supervised' | 'dpo'; | ||
} | ||
export namespace Method { | ||
/** | ||
* Configuration for the DPO fine-tuning method. | ||
*/ | ||
export interface Dpo { | ||
/** | ||
* The hyperparameters used for the fine-tuning job. | ||
*/ | ||
hyperparameters?: Dpo.Hyperparameters; | ||
} | ||
export namespace Dpo { | ||
/** | ||
* The hyperparameters used for the fine-tuning job. | ||
*/ | ||
export interface Hyperparameters { | ||
/** | ||
* Number of examples in each batch. A larger batch size means that model | ||
* parameters are updated less frequently, but with lower variance. | ||
*/ | ||
batch_size?: 'auto' | number; | ||
/** | ||
* The beta value for the DPO method. A higher beta value will increase the weight | ||
* of the penalty between the policy and reference model. | ||
*/ | ||
beta?: 'auto' | number; | ||
/** | ||
* Scaling factor for the learning rate. A smaller learning rate may be useful to | ||
* avoid overfitting. | ||
*/ | ||
learning_rate_multiplier?: 'auto' | number; | ||
/** | ||
* The number of epochs to train the model for. An epoch refers to one full cycle | ||
* through the training dataset. | ||
*/ | ||
n_epochs?: 'auto' | number; | ||
} | ||
} | ||
/** | ||
* Configuration for the supervised fine-tuning method. | ||
*/ | ||
export interface Supervised { | ||
/** | ||
* The hyperparameters used for the fine-tuning job. | ||
*/ | ||
hyperparameters?: Supervised.Hyperparameters; | ||
} | ||
export namespace Supervised { | ||
/** | ||
* The hyperparameters used for the fine-tuning job. | ||
*/ | ||
export interface Hyperparameters { | ||
/** | ||
* Number of examples in each batch. A larger batch size means that model | ||
* parameters are updated less frequently, but with lower variance. | ||
*/ | ||
batch_size?: 'auto' | number; | ||
/** | ||
* Scaling factor for the learning rate. A smaller learning rate may be useful to | ||
* avoid overfitting. | ||
*/ | ||
learning_rate_multiplier?: 'auto' | number; | ||
/** | ||
* The number of epochs to train the model for. An epoch refers to one full cycle | ||
* through the training dataset. | ||
*/ | ||
n_epochs?: 'auto' | number; | ||
} | ||
} | ||
} | ||
} | ||
@@ -246,11 +357,36 @@ | ||
export interface FineTuningJobEvent { | ||
/** | ||
* The object identifier. | ||
*/ | ||
id: string; | ||
/** | ||
* The Unix timestamp (in seconds) for when the fine-tuning job was created. | ||
*/ | ||
created_at: number; | ||
/** | ||
* The log level of the event. | ||
*/ | ||
level: 'info' | 'warn' | 'error'; | ||
/** | ||
* The message of the event. | ||
*/ | ||
message: string; | ||
/** | ||
* The object type, which is always "fine_tuning.job.event". | ||
*/ | ||
object: 'fine_tuning.job.event'; | ||
/** | ||
* The data associated with the event. | ||
*/ | ||
data?: unknown; | ||
/** | ||
* The type of event. | ||
*/ | ||
type?: 'message' | 'metrics'; | ||
} | ||
@@ -325,4 +461,6 @@ | ||
* The contents of the file should differ depending on if the model uses the | ||
* [chat](https://platform.openai.com/docs/api-reference/fine-tuning/chat-input) or | ||
* [chat](https://platform.openai.com/docs/api-reference/fine-tuning/chat-input), | ||
* [completions](https://platform.openai.com/docs/api-reference/fine-tuning/completions-input) | ||
* format, or if the fine-tuning method uses the | ||
* [preference](https://platform.openai.com/docs/api-reference/fine-tuning/preference-input) | ||
* format. | ||
@@ -336,3 +474,4 @@ * | ||
/** | ||
* The hyperparameters used for the fine-tuning job. | ||
* The hyperparameters used for the fine-tuning job. This value is now deprecated | ||
* in favor of `method`, and should be passed in under the `method` parameter. | ||
*/ | ||
@@ -347,2 +486,7 @@ hyperparameters?: JobCreateParams.Hyperparameters; | ||
/** | ||
* The method used for fine-tuning. | ||
*/ | ||
method?: JobCreateParams.Method; | ||
/** | ||
* The seed controls the reproducibility of the job. Passing in the same seed and | ||
@@ -382,3 +526,5 @@ * job parameters should produce the same results, but may differ in rare cases. If | ||
/** | ||
* The hyperparameters used for the fine-tuning job. | ||
* @deprecated: The hyperparameters used for the fine-tuning job. This value is now | ||
* deprecated in favor of `method`, and should be passed in under the `method` | ||
* parameter. | ||
*/ | ||
@@ -455,2 +601,100 @@ export interface Hyperparameters { | ||
} | ||
/** | ||
* The method used for fine-tuning. | ||
*/ | ||
export interface Method { | ||
/** | ||
* Configuration for the DPO fine-tuning method. | ||
*/ | ||
dpo?: Method.Dpo; | ||
/** | ||
* Configuration for the supervised fine-tuning method. | ||
*/ | ||
supervised?: Method.Supervised; | ||
/** | ||
* The type of method. Is either `supervised` or `dpo`. | ||
*/ | ||
type?: 'supervised' | 'dpo'; | ||
} | ||
export namespace Method { | ||
/** | ||
* Configuration for the DPO fine-tuning method. | ||
*/ | ||
export interface Dpo { | ||
/** | ||
* The hyperparameters used for the fine-tuning job. | ||
*/ | ||
hyperparameters?: Dpo.Hyperparameters; | ||
} | ||
export namespace Dpo { | ||
/** | ||
* The hyperparameters used for the fine-tuning job. | ||
*/ | ||
export interface Hyperparameters { | ||
/** | ||
* Number of examples in each batch. A larger batch size means that model | ||
* parameters are updated less frequently, but with lower variance. | ||
*/ | ||
batch_size?: 'auto' | number; | ||
/** | ||
* The beta value for the DPO method. A higher beta value will increase the weight | ||
* of the penalty between the policy and reference model. | ||
*/ | ||
beta?: 'auto' | number; | ||
/** | ||
* Scaling factor for the learning rate. A smaller learning rate may be useful to | ||
* avoid overfitting. | ||
*/ | ||
learning_rate_multiplier?: 'auto' | number; | ||
/** | ||
* The number of epochs to train the model for. An epoch refers to one full cycle | ||
* through the training dataset. | ||
*/ | ||
n_epochs?: 'auto' | number; | ||
} | ||
} | ||
/** | ||
* Configuration for the supervised fine-tuning method. | ||
*/ | ||
export interface Supervised { | ||
/** | ||
* The hyperparameters used for the fine-tuning job. | ||
*/ | ||
hyperparameters?: Supervised.Hyperparameters; | ||
} | ||
export namespace Supervised { | ||
/** | ||
* The hyperparameters used for the fine-tuning job. | ||
*/ | ||
export interface Hyperparameters { | ||
/** | ||
* Number of examples in each batch. A larger batch size means that model | ||
* parameters are updated less frequently, but with lower variance. | ||
*/ | ||
batch_size?: 'auto' | number; | ||
/** | ||
* Scaling factor for the learning rate. A smaller learning rate may be useful to | ||
* avoid overfitting. | ||
*/ | ||
learning_rate_multiplier?: 'auto' | number; | ||
/** | ||
* The number of epochs to train the model for. An epoch refers to one full cycle | ||
* through the training dataset. | ||
*/ | ||
n_epochs?: 'auto' | number; | ||
} | ||
} | ||
} | ||
} | ||
@@ -457,0 +701,0 @@ |
@@ -1,1 +0,1 @@ | ||
export const VERSION = '4.76.3'; // x-release-please-version | ||
export const VERSION = '4.77.0'; // x-release-please-version |
@@ -1,2 +0,2 @@ | ||
export declare const VERSION = "4.76.3"; | ||
export declare const VERSION = "4.77.0"; | ||
//# sourceMappingURL=version.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.VERSION = void 0; | ||
exports.VERSION = '4.76.3'; // x-release-please-version | ||
exports.VERSION = '4.77.0'; // x-release-please-version | ||
//# sourceMappingURL=version.js.map |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2760441
47286
21