Socket
Socket
Sign inDemoInstall

openai

Package Overview
Dependencies
Maintainers
5
Versions
190
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

openai - npm Package Compare versions

Comparing version 4.47.3 to 4.48.1

7

lib/AbstractChatCompletionRunner.js

@@ -467,3 +467,8 @@ "use strict";

if ((0, chatCompletionUtils_1.isAssistantMessage)(message)) {
return { ...message, content: message.content ?? null };
const { function_call, ...rest } = message;
const ret = { ...rest, content: message.content ?? null };
if (function_call) {
ret.function_call = function_call;
}
return ret;
}

@@ -470,0 +475,0 @@ }

2

package.json
{
"name": "openai",
"version": "4.47.3",
"version": "4.48.1",
"description": "The official TypeScript library for the OpenAI API",

@@ -5,0 +5,0 @@ "author": "OpenAI <support@openai.com>",

@@ -22,3 +22,3 @@ # OpenAI Node API Library

```ts
import OpenAI from 'https://deno.land/x/openai@v4.47.3/mod.ts';
import OpenAI from 'https://deno.land/x/openai@v4.48.1/mod.ts';
```

@@ -25,0 +25,0 @@

@@ -20,3 +20,5 @@ import * as Core from "../core.js";

/**
* Cancels an in-progress batch.
* Cancels an in-progress batch. The batch will be in status `cancelling` for up to
* 10 minutes, before changing to `cancelled`, where it will have partial results
* (if any) available in the output file.
*/

@@ -170,3 +172,3 @@ cancel(batchId: string, options?: Core.RequestOptions): Core.APIPromise<Batch>;

* Your input file must be formatted as a
* [JSONL file](https://platform.openai.com/docs/api-reference/batch/requestInput),
* [JSONL file](https://platform.openai.com/docs/api-reference/batch/request-input),
* and must be uploaded with the purpose `batch`. The file can contain up to 50,000

@@ -173,0 +175,0 @@ * requests, and can be up to 100 MB in size.

@@ -52,3 +52,5 @@ "use strict";

/**
* Cancels an in-progress batch.
* Cancels an in-progress batch. The batch will be in status `cancelling` for up to
* 10 minutes, before changing to `cancelled`, where it will have partial results
* (if any) available in the output file.
*/

@@ -55,0 +57,0 @@ cancel(batchId, options) {

@@ -183,3 +183,3 @@ import * as Core from "../../core.js";

*/
export type AssistantStreamEvent = AssistantStreamEvent.ThreadCreated | AssistantStreamEvent.ThreadRunCreated | AssistantStreamEvent.ThreadRunQueued | AssistantStreamEvent.ThreadRunInProgress | AssistantStreamEvent.ThreadRunRequiresAction | AssistantStreamEvent.ThreadRunCompleted | AssistantStreamEvent.ThreadRunFailed | AssistantStreamEvent.ThreadRunCancelling | AssistantStreamEvent.ThreadRunCancelled | AssistantStreamEvent.ThreadRunExpired | AssistantStreamEvent.ThreadRunStepCreated | AssistantStreamEvent.ThreadRunStepInProgress | AssistantStreamEvent.ThreadRunStepDelta | AssistantStreamEvent.ThreadRunStepCompleted | AssistantStreamEvent.ThreadRunStepFailed | AssistantStreamEvent.ThreadRunStepCancelled | AssistantStreamEvent.ThreadRunStepExpired | AssistantStreamEvent.ThreadMessageCreated | AssistantStreamEvent.ThreadMessageInProgress | AssistantStreamEvent.ThreadMessageDelta | AssistantStreamEvent.ThreadMessageCompleted | AssistantStreamEvent.ThreadMessageIncomplete | AssistantStreamEvent.ErrorEvent;
export type AssistantStreamEvent = AssistantStreamEvent.ThreadCreated | AssistantStreamEvent.ThreadRunCreated | AssistantStreamEvent.ThreadRunQueued | AssistantStreamEvent.ThreadRunInProgress | AssistantStreamEvent.ThreadRunRequiresAction | AssistantStreamEvent.ThreadRunCompleted | AssistantStreamEvent.ThreadRunIncomplete | AssistantStreamEvent.ThreadRunFailed | AssistantStreamEvent.ThreadRunCancelling | AssistantStreamEvent.ThreadRunCancelled | AssistantStreamEvent.ThreadRunExpired | AssistantStreamEvent.ThreadRunStepCreated | AssistantStreamEvent.ThreadRunStepInProgress | AssistantStreamEvent.ThreadRunStepDelta | AssistantStreamEvent.ThreadRunStepCompleted | AssistantStreamEvent.ThreadRunStepFailed | AssistantStreamEvent.ThreadRunStepCancelled | AssistantStreamEvent.ThreadRunStepExpired | AssistantStreamEvent.ThreadMessageCreated | AssistantStreamEvent.ThreadMessageInProgress | AssistantStreamEvent.ThreadMessageDelta | AssistantStreamEvent.ThreadMessageCompleted | AssistantStreamEvent.ThreadMessageIncomplete | AssistantStreamEvent.ErrorEvent;
export declare namespace AssistantStreamEvent {

@@ -261,2 +261,14 @@ /**

* Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object)
* ends with status `incomplete`.
*/
interface ThreadRunIncomplete {
/**
* Represents an execution run on a
* [thread](https://platform.openai.com/docs/api-reference/threads).
*/
data: RunsAPI.Run;
event: 'thread.run.incomplete';
}
/**
* Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object)
* fails.

@@ -480,3 +492,25 @@ */

type: 'file_search';
/**
* Overrides for the file search tool.
*/
file_search?: FileSearchTool.FileSearch;
}
export declare namespace FileSearchTool {
/**
* Overrides for the file search tool.
*/
interface FileSearch {
/**
* The maximum number of results the file search tool should output. The default is
* 20 for gpt-4\* models and 5 for gpt-3.5-turbo. This number should be between 1
* and 50 inclusive.
*
* Note that the file search tool may output fewer than `max_num_results` results.
* See the
* [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search/number-of-chunks-returned)
* for more information.
*/
max_num_results?: number;
}
}
export interface FunctionTool {

@@ -659,3 +693,3 @@ function: Shared.FunctionDefinition;

*/
export type RunStreamEvent = RunStreamEvent.ThreadRunCreated | RunStreamEvent.ThreadRunQueued | RunStreamEvent.ThreadRunInProgress | RunStreamEvent.ThreadRunRequiresAction | RunStreamEvent.ThreadRunCompleted | RunStreamEvent.ThreadRunFailed | RunStreamEvent.ThreadRunCancelling | RunStreamEvent.ThreadRunCancelled | RunStreamEvent.ThreadRunExpired;
export type RunStreamEvent = RunStreamEvent.ThreadRunCreated | RunStreamEvent.ThreadRunQueued | RunStreamEvent.ThreadRunInProgress | RunStreamEvent.ThreadRunRequiresAction | RunStreamEvent.ThreadRunCompleted | RunStreamEvent.ThreadRunIncomplete | RunStreamEvent.ThreadRunFailed | RunStreamEvent.ThreadRunCancelling | RunStreamEvent.ThreadRunCancelled | RunStreamEvent.ThreadRunExpired;
export declare namespace RunStreamEvent {

@@ -724,2 +758,14 @@ /**

* Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object)
* ends with status `incomplete`.
*/
interface ThreadRunIncomplete {
/**
* Represents an execution run on a
* [thread](https://platform.openai.com/docs/api-reference/threads).
*/
data: RunsAPI.Run;
event: 'thread.run.incomplete';
}
/**
* Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object)
* fails.

@@ -899,2 +945,7 @@ */

/**
* The chunking strategy used to chunk the file(s). If not set, will use the `auto`
* strategy.
*/
chunking_strategy?: VectorStore.Auto | VectorStore.Static;
/**
* A list of [file](https://platform.openai.com/docs/api-reference/files) IDs to

@@ -913,2 +964,36 @@ * add to the vector store. There can be a maximum of 10000 files in a vector

}
namespace VectorStore {
/**
* The default strategy. This strategy currently uses a `max_chunk_size_tokens` of
* `800` and `chunk_overlap_tokens` of `400`.
*/
interface Auto {
/**
* Always `auto`.
*/
type: 'auto';
}
interface Static {
static: Static.Static;
/**
* Always `static`.
*/
type: 'static';
}
namespace Static {
interface Static {
/**
* The number of tokens that overlap between chunks. The default value is `400`.
*
* Note that the overlap must not exceed half of `max_chunk_size_tokens`.
*/
chunk_overlap_tokens: number;
/**
* The maximum number of tokens in each chunk. The default value is `800`. The
* minimum value is `100` and the maximum value is `4096`.
*/
max_chunk_size_tokens: number;
}
}
}
}

@@ -915,0 +1000,0 @@ }

@@ -271,2 +271,7 @@ import * as Core from "../../../core.js";

/**
* The chunking strategy used to chunk the file(s). If not set, will use the `auto`
* strategy.
*/
chunking_strategy?: VectorStore.Auto | VectorStore.Static;
/**
* A list of [file](https://platform.openai.com/docs/api-reference/files) IDs to

@@ -285,2 +290,36 @@ * add to the vector store. There can be a maximum of 10000 files in a vector

}
namespace VectorStore {
/**
* The default strategy. This strategy currently uses a `max_chunk_size_tokens` of
* `800` and `chunk_overlap_tokens` of `400`.
*/
interface Auto {
/**
* Always `auto`.
*/
type: 'auto';
}
interface Static {
static: Static.Static;
/**
* Always `static`.
*/
type: 'static';
}
namespace Static {
interface Static {
/**
* The number of tokens that overlap between chunks. The default value is `400`.
*
* Note that the overlap must not exceed half of `max_chunk_size_tokens`.
*/
chunk_overlap_tokens: number;
/**
* The maximum number of tokens in each chunk. The default value is `800`. The
* minimum value is `100` and the maximum value is `4096`.
*/
max_chunk_size_tokens: number;
}
}
}
}

@@ -551,2 +590,7 @@ }

/**
* The chunking strategy used to chunk the file(s). If not set, will use the `auto`
* strategy.
*/
chunking_strategy?: VectorStore.Auto | VectorStore.Static;
/**
* A list of [file](https://platform.openai.com/docs/api-reference/files) IDs to

@@ -565,2 +609,36 @@ * add to the vector store. There can be a maximum of 10000 files in a vector

}
namespace VectorStore {
/**
* The default strategy. This strategy currently uses a `max_chunk_size_tokens` of
* `800` and `chunk_overlap_tokens` of `400`.
*/
interface Auto {
/**
* Always `auto`.
*/
type: 'auto';
}
interface Static {
static: Static.Static;
/**
* Always `static`.
*/
type: 'static';
}
namespace Static {
interface Static {
/**
* The number of tokens that overlap between chunks. The default value is `400`.
*
* Note that the overlap must not exceed half of `max_chunk_size_tokens`.
*/
chunk_overlap_tokens: number;
/**
* The maximum number of tokens in each chunk. The default value is `800`. The
* minimum value is `100` and the maximum value is `4096`.
*/
max_chunk_size_tokens: number;
}
}
}
}

@@ -567,0 +645,0 @@ }

@@ -117,3 +117,42 @@ import * as Core from "../../../core.js";

file_ids: Array<string>;
/**
* The chunking strategy used to chunk the file(s). If not set, will use the `auto`
* strategy.
*/
chunking_strategy?: FileBatchCreateParams.AutoChunkingStrategyRequestParam | FileBatchCreateParams.StaticChunkingStrategyRequestParam;
}
export declare namespace FileBatchCreateParams {
/**
* The default strategy. This strategy currently uses a `max_chunk_size_tokens` of
* `800` and `chunk_overlap_tokens` of `400`.
*/
interface AutoChunkingStrategyRequestParam {
/**
* Always `auto`.
*/
type: 'auto';
}
interface StaticChunkingStrategyRequestParam {
static: StaticChunkingStrategyRequestParam.Static;
/**
* Always `static`.
*/
type: 'static';
}
namespace StaticChunkingStrategyRequestParam {
interface Static {
/**
* The number of tokens that overlap between chunks. The default value is `400`.
*
* Note that the overlap must not exceed half of `max_chunk_size_tokens`.
*/
chunk_overlap_tokens: number;
/**
* The maximum number of tokens in each chunk. The default value is `800`. The
* minimum value is `100` and the maximum value is `4096`.
*/
max_chunk_size_tokens: number;
}
}
}
export interface FileBatchListFilesParams extends CursorPageParams {

@@ -120,0 +159,0 @@ /**

@@ -99,2 +99,6 @@ import * as Core from "../../../core.js";

vector_store_id: string;
/**
* The strategy used to chunk the file.
*/
chunking_strategy?: VectorStoreFile.Static | VectorStoreFile.Other;
}

@@ -116,2 +120,35 @@ export declare namespace VectorStoreFile {

}
interface Static {
static: Static.Static;
/**
* Always `static`.
*/
type: 'static';
}
namespace Static {
interface Static {
/**
* The number of tokens that overlap between chunks. The default value is `400`.
*
* Note that the overlap must not exceed half of `max_chunk_size_tokens`.
*/
chunk_overlap_tokens: number;
/**
* The maximum number of tokens in each chunk. The default value is `800`. The
* minimum value is `100` and the maximum value is `4096`.
*/
max_chunk_size_tokens: number;
}
}
/**
* This is returned when the chunking strategy is unknown. Typically, this is
* because the file was indexed before the `chunking_strategy` concept was
* introduced in the API.
*/
interface Other {
/**
* Always `other`.
*/
type: 'other';
}
}

@@ -130,3 +167,42 @@ export interface VectorStoreFileDeleted {

file_id: string;
/**
* The chunking strategy used to chunk the file(s). If not set, will use the `auto`
* strategy.
*/
chunking_strategy?: FileCreateParams.AutoChunkingStrategyRequestParam | FileCreateParams.StaticChunkingStrategyRequestParam;
}
export declare namespace FileCreateParams {
/**
* The default strategy. This strategy currently uses a `max_chunk_size_tokens` of
* `800` and `chunk_overlap_tokens` of `400`.
*/
interface AutoChunkingStrategyRequestParam {
/**
* Always `auto`.
*/
type: 'auto';
}
interface StaticChunkingStrategyRequestParam {
static: StaticChunkingStrategyRequestParam.Static;
/**
* Always `static`.
*/
type: 'static';
}
namespace StaticChunkingStrategyRequestParam {
interface Static {
/**
* The number of tokens that overlap between chunks. The default value is `400`.
*
* Note that the overlap must not exceed half of `max_chunk_size_tokens`.
*/
chunk_overlap_tokens: number;
/**
* The maximum number of tokens in each chunk. The default value is `800`. The
* minimum value is `100` and the maximum value is `4096`.
*/
max_chunk_size_tokens: number;
}
}
}
export interface FileListParams extends CursorPageParams {

@@ -133,0 +209,0 @@ /**

@@ -131,2 +131,7 @@ import * as Core from "../../../core.js";

/**
* The chunking strategy used to chunk the file(s). If not set, will use the `auto`
* strategy. Only applicable if `file_ids` is non-empty.
*/
chunking_strategy?: VectorStoreCreateParams.Auto | VectorStoreCreateParams.Static;
/**
* The expiration policy for a vector store.

@@ -155,2 +160,34 @@ */

/**
* The default strategy. This strategy currently uses a `max_chunk_size_tokens` of
* `800` and `chunk_overlap_tokens` of `400`.
*/
interface Auto {
/**
* Always `auto`.
*/
type: 'auto';
}
interface Static {
static: Static.Static;
/**
* Always `static`.
*/
type: 'static';
}
namespace Static {
interface Static {
/**
* The number of tokens that overlap between chunks. The default value is `400`.
*
* Note that the overlap must not exceed half of `max_chunk_size_tokens`.
*/
chunk_overlap_tokens: number;
/**
* The maximum number of tokens in each chunk. The default value is `800`. The
* minimum value is `100` and the maximum value is `4096`.
*/
max_chunk_size_tokens: number;
}
}
/**
* The expiration policy for a vector store.

@@ -157,0 +194,0 @@ */

@@ -105,3 +105,3 @@ import * as Core from "../../core.js";

*/
function_call?: ChatCompletionAssistantMessageParam.FunctionCall;
function_call?: ChatCompletionAssistantMessageParam.FunctionCall | null;
/**

@@ -746,4 +746,4 @@ * An optional name for the participant. Provides the model information to

* The parameters the functions accepts, described as a JSON Schema object. See the
* [guide](https://platform.openai.com/docs/guides/text-generation/function-calling)
* for examples, and the
* [guide](https://platform.openai.com/docs/guides/function-calling) for examples,
* and the
* [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for

@@ -750,0 +750,0 @@ * documentation about the format.

@@ -18,5 +18,11 @@ import * as Core from "../core.js";

*
* The Fine-tuning API only supports `.jsonl` files.
* The Fine-tuning API only supports `.jsonl` files. The input also has certain
* required formats for fine-tuning
* [chat](https://platform.openai.com/docs/api-reference/fine-tuning/chat-input) or
* [completions](https://platform.openai.com/docs/api-reference/fine-tuning/completions-input)
* models.
*
* The Batch API only supports `.jsonl` files up to 100 MB in size.
* The Batch API only supports `.jsonl` files up to 100 MB in size. The input also
* has a specific required
* [format](https://platform.openai.com/docs/api-reference/batch/request-input).
*

@@ -125,3 +131,3 @@ * Please [contact us](https://help.openai.com/) if you need to increase these

*/
purpose: 'assistants' | 'batch' | 'fine-tune';
purpose: 'assistants' | 'batch' | 'fine-tune' | 'vision';
}

@@ -128,0 +134,0 @@ export interface FileListParams {

@@ -46,5 +46,11 @@ "use strict";

*
* The Fine-tuning API only supports `.jsonl` files.
* The Fine-tuning API only supports `.jsonl` files. The input also has certain
* required formats for fine-tuning
* [chat](https://platform.openai.com/docs/api-reference/fine-tuning/chat-input) or
* [completions](https://platform.openai.com/docs/api-reference/fine-tuning/completions-input)
* models.
*
* The Batch API only supports `.jsonl` files up to 100 MB in size.
* The Batch API only supports `.jsonl` files up to 100 MB in size. The input also
* has a specific required
* [format](https://platform.openai.com/docs/api-reference/batch/request-input).
*

@@ -51,0 +57,0 @@ * Please [contact us](https://help.openai.com/) if you need to increase these

@@ -233,2 +233,7 @@ import * as Core from "../../../core.js";

*
* 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
* [completions](https://platform.openai.com/docs/api-reference/fine-tuning/completions-input)
* format.
*
* See the [fine-tuning guide](https://platform.openai.com/docs/guides/fine-tuning)

@@ -235,0 +240,0 @@ * for more details.

@@ -20,4 +20,4 @@ export interface ErrorObject {

* The parameters the functions accepts, described as a JSON Schema object. See the
* [guide](https://platform.openai.com/docs/guides/text-generation/function-calling)
* for examples, and the
* [guide](https://platform.openai.com/docs/guides/function-calling) for examples,
* and the
* [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for

@@ -32,4 +32,4 @@ * documentation about the format.

* The parameters the functions accepts, described as a JSON Schema object. See the
* [guide](https://platform.openai.com/docs/guides/text-generation/function-calling)
* for examples, and the
* [guide](https://platform.openai.com/docs/guides/function-calling) for examples,
* and the
* [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for

@@ -36,0 +36,0 @@ * documentation about the format.

@@ -235,3 +235,8 @@ import * as Core from "../core";

if (isAssistantMessage(message)) {
return { ...message, content: message.content ?? null };
const { function_call, ...rest } = message;
const ret: ChatCompletionMessage = { ...rest, content: message.content ?? null };
if (function_call) {
ret.function_call = function_call;
}
return ret;
}

@@ -238,0 +243,0 @@ }

@@ -40,3 +40,5 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

/**
* Cancels an in-progress batch.
* Cancels an in-progress batch. The batch will be in status `cancelling` for up to
* 10 minutes, before changing to `cancelled`, where it will have partial results
* (if any) available in the output file.
*/

@@ -232,3 +234,3 @@ cancel(batchId: string, options?: Core.RequestOptions): Core.APIPromise<Batch> {

* Your input file must be formatted as a
* [JSONL file](https://platform.openai.com/docs/api-reference/batch/requestInput),
* [JSONL file](https://platform.openai.com/docs/api-reference/batch/request-input),
* and must be uploaded with the purpose `batch`. The file can contain up to 50,000

@@ -235,0 +237,0 @@ * requests, and can be up to 100 MB in size.

@@ -261,2 +261,3 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

| AssistantStreamEvent.ThreadRunCompleted
| AssistantStreamEvent.ThreadRunIncomplete
| AssistantStreamEvent.ThreadRunFailed

@@ -368,2 +369,16 @@ | AssistantStreamEvent.ThreadRunCancelling

* Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object)
* ends with status `incomplete`.
*/
export interface ThreadRunIncomplete {
/**
* Represents an execution run on a
* [thread](https://platform.openai.com/docs/api-reference/threads).
*/
data: RunsAPI.Run;
event: 'thread.run.incomplete';
}
/**
* Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object)
* fails.

@@ -623,4 +638,28 @@ */

type: 'file_search';
/**
* Overrides for the file search tool.
*/
file_search?: FileSearchTool.FileSearch;
}
export namespace FileSearchTool {
/**
* Overrides for the file search tool.
*/
export interface FileSearch {
/**
* The maximum number of results the file search tool should output. The default is
* 20 for gpt-4\* models and 5 for gpt-3.5-turbo. This number should be between 1
* and 50 inclusive.
*
* Note that the file search tool may output fewer than `max_num_results` results.
* See the
* [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search/number-of-chunks-returned)
* for more information.
*/
max_num_results?: number;
}
}
export interface FunctionTool {

@@ -849,2 +888,3 @@ function: Shared.FunctionDefinition;

| RunStreamEvent.ThreadRunCompleted
| RunStreamEvent.ThreadRunIncomplete
| RunStreamEvent.ThreadRunFailed

@@ -928,2 +968,16 @@ | RunStreamEvent.ThreadRunCancelling

* Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object)
* ends with status `incomplete`.
*/
export interface ThreadRunIncomplete {
/**
* Represents an execution run on a
* [thread](https://platform.openai.com/docs/api-reference/threads).
*/
data: RunsAPI.Run;
event: 'thread.run.incomplete';
}
/**
* Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object)
* fails.

@@ -1149,2 +1203,8 @@ */

/**
* The chunking strategy used to chunk the file(s). If not set, will use the `auto`
* strategy.
*/
chunking_strategy?: VectorStore.Auto | VectorStore.Static;
/**
* A list of [file](https://platform.openai.com/docs/api-reference/files) IDs to

@@ -1164,2 +1224,41 @@ * add to the vector store. There can be a maximum of 10000 files in a vector

}
export namespace VectorStore {
/**
* The default strategy. This strategy currently uses a `max_chunk_size_tokens` of
* `800` and `chunk_overlap_tokens` of `400`.
*/
export interface Auto {
/**
* Always `auto`.
*/
type: 'auto';
}
export interface Static {
static: Static.Static;
/**
* Always `static`.
*/
type: 'static';
}
export namespace Static {
export interface Static {
/**
* The number of tokens that overlap between chunks. The default value is `400`.
*
* Note that the overlap must not exceed half of `max_chunk_size_tokens`.
*/
chunk_overlap_tokens: number;
/**
* The maximum number of tokens in each chunk. The default value is `800`. The
* minimum value is `100` and the maximum value is `4096`.
*/
max_chunk_size_tokens: number;
}
}
}
}

@@ -1166,0 +1265,0 @@ }

@@ -373,2 +373,8 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

/**
* The chunking strategy used to chunk the file(s). If not set, will use the `auto`
* strategy.
*/
chunking_strategy?: VectorStore.Auto | VectorStore.Static;
/**
* A list of [file](https://platform.openai.com/docs/api-reference/files) IDs to

@@ -388,2 +394,41 @@ * add to the vector store. There can be a maximum of 10000 files in a vector

}
export namespace VectorStore {
/**
* The default strategy. This strategy currently uses a `max_chunk_size_tokens` of
* `800` and `chunk_overlap_tokens` of `400`.
*/
export interface Auto {
/**
* Always `auto`.
*/
type: 'auto';
}
export interface Static {
static: Static.Static;
/**
* Always `static`.
*/
type: 'static';
}
export namespace Static {
export interface Static {
/**
* The number of tokens that overlap between chunks. The default value is `400`.
*
* Note that the overlap must not exceed half of `max_chunk_size_tokens`.
*/
chunk_overlap_tokens: number;
/**
* The maximum number of tokens in each chunk. The default value is `800`. The
* minimum value is `100` and the maximum value is `4096`.
*/
max_chunk_size_tokens: number;
}
}
}
}

@@ -717,2 +762,8 @@ }

/**
* The chunking strategy used to chunk the file(s). If not set, will use the `auto`
* strategy.
*/
chunking_strategy?: VectorStore.Auto | VectorStore.Static;
/**
* A list of [file](https://platform.openai.com/docs/api-reference/files) IDs to

@@ -732,2 +783,41 @@ * add to the vector store. There can be a maximum of 10000 files in a vector

}
export namespace VectorStore {
/**
* The default strategy. This strategy currently uses a `max_chunk_size_tokens` of
* `800` and `chunk_overlap_tokens` of `400`.
*/
export interface Auto {
/**
* Always `auto`.
*/
type: 'auto';
}
export interface Static {
static: Static.Static;
/**
* Always `static`.
*/
type: 'static';
}
export namespace Static {
export interface Static {
/**
* The number of tokens that overlap between chunks. The default value is `400`.
*
* Note that the overlap must not exceed half of `max_chunk_size_tokens`.
*/
chunk_overlap_tokens: number;
/**
* The maximum number of tokens in each chunk. The default value is `800`. The
* minimum value is `100` and the maximum value is `4096`.
*/
max_chunk_size_tokens: number;
}
}
}
}

@@ -734,0 +824,0 @@ }

@@ -264,4 +264,51 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

file_ids: Array<string>;
/**
* The chunking strategy used to chunk the file(s). If not set, will use the `auto`
* strategy.
*/
chunking_strategy?:
| FileBatchCreateParams.AutoChunkingStrategyRequestParam
| FileBatchCreateParams.StaticChunkingStrategyRequestParam;
}
export namespace FileBatchCreateParams {
/**
* The default strategy. This strategy currently uses a `max_chunk_size_tokens` of
* `800` and `chunk_overlap_tokens` of `400`.
*/
export interface AutoChunkingStrategyRequestParam {
/**
* Always `auto`.
*/
type: 'auto';
}
export interface StaticChunkingStrategyRequestParam {
static: StaticChunkingStrategyRequestParam.Static;
/**
* Always `static`.
*/
type: 'static';
}
export namespace StaticChunkingStrategyRequestParam {
export interface Static {
/**
* The number of tokens that overlap between chunks. The default value is `400`.
*
* Note that the overlap must not exceed half of `max_chunk_size_tokens`.
*/
chunk_overlap_tokens: number;
/**
* The maximum number of tokens in each chunk. The default value is `800`. The
* minimum value is `100` and the maximum value is `4096`.
*/
max_chunk_size_tokens: number;
}
}
}
export interface FileBatchListFilesParams extends CursorPageParams {

@@ -268,0 +315,0 @@ /**

@@ -220,2 +220,7 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

vector_store_id: string;
/**
* The strategy used to chunk the file.
*/
chunking_strategy?: VectorStoreFile.Static | VectorStoreFile.Other;
}

@@ -239,2 +244,40 @@

}
export interface Static {
static: Static.Static;
/**
* Always `static`.
*/
type: 'static';
}
export namespace Static {
export interface Static {
/**
* The number of tokens that overlap between chunks. The default value is `400`.
*
* Note that the overlap must not exceed half of `max_chunk_size_tokens`.
*/
chunk_overlap_tokens: number;
/**
* The maximum number of tokens in each chunk. The default value is `800`. The
* minimum value is `100` and the maximum value is `4096`.
*/
max_chunk_size_tokens: number;
}
}
/**
* This is returned when the chunking strategy is unknown. Typically, this is
* because the file was indexed before the `chunking_strategy` concept was
* introduced in the API.
*/
export interface Other {
/**
* Always `other`.
*/
type: 'other';
}
}

@@ -257,4 +300,51 @@

file_id: string;
/**
* The chunking strategy used to chunk the file(s). If not set, will use the `auto`
* strategy.
*/
chunking_strategy?:
| FileCreateParams.AutoChunkingStrategyRequestParam
| FileCreateParams.StaticChunkingStrategyRequestParam;
}
export namespace FileCreateParams {
/**
* The default strategy. This strategy currently uses a `max_chunk_size_tokens` of
* `800` and `chunk_overlap_tokens` of `400`.
*/
export interface AutoChunkingStrategyRequestParam {
/**
* Always `auto`.
*/
type: 'auto';
}
export interface StaticChunkingStrategyRequestParam {
static: StaticChunkingStrategyRequestParam.Static;
/**
* Always `static`.
*/
type: 'static';
}
export namespace StaticChunkingStrategyRequestParam {
export interface Static {
/**
* The number of tokens that overlap between chunks. The default value is `400`.
*
* Note that the overlap must not exceed half of `max_chunk_size_tokens`.
*/
chunk_overlap_tokens: number;
/**
* The maximum number of tokens in each chunk. The default value is `800`. The
* minimum value is `100` and the maximum value is `4096`.
*/
max_chunk_size_tokens: number;
}
}
}
export interface FileListParams extends CursorPageParams {

@@ -261,0 +351,0 @@ /**

@@ -204,2 +204,8 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

/**
* The chunking strategy used to chunk the file(s). If not set, will use the `auto`
* strategy. Only applicable if `file_ids` is non-empty.
*/
chunking_strategy?: VectorStoreCreateParams.Auto | VectorStoreCreateParams.Static;
/**
* The expiration policy for a vector store.

@@ -232,2 +238,39 @@ */

/**
* The default strategy. This strategy currently uses a `max_chunk_size_tokens` of
* `800` and `chunk_overlap_tokens` of `400`.
*/
export interface Auto {
/**
* Always `auto`.
*/
type: 'auto';
}
export interface Static {
static: Static.Static;
/**
* Always `static`.
*/
type: 'static';
}
export namespace Static {
export interface Static {
/**
* The number of tokens that overlap between chunks. The default value is `400`.
*
* Note that the overlap must not exceed half of `max_chunk_size_tokens`.
*/
chunk_overlap_tokens: number;
/**
* The maximum number of tokens in each chunk. The default value is `800`. The
* minimum value is `100` and the maximum value is `4096`.
*/
max_chunk_size_tokens: number;
}
}
/**
* The expiration policy for a vector store.

@@ -234,0 +277,0 @@ */

@@ -140,3 +140,3 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

*/
function_call?: ChatCompletionAssistantMessageParam.FunctionCall;
function_call?: ChatCompletionAssistantMessageParam.FunctionCall | null;

@@ -889,4 +889,4 @@ /**

* The parameters the functions accepts, described as a JSON Schema object. See the
* [guide](https://platform.openai.com/docs/guides/text-generation/function-calling)
* for examples, and the
* [guide](https://platform.openai.com/docs/guides/function-calling) for examples,
* and the
* [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for

@@ -893,0 +893,0 @@ * documentation about the format.

@@ -24,5 +24,11 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

*
* The Fine-tuning API only supports `.jsonl` files.
* The Fine-tuning API only supports `.jsonl` files. The input also has certain
* required formats for fine-tuning
* [chat](https://platform.openai.com/docs/api-reference/fine-tuning/chat-input) or
* [completions](https://platform.openai.com/docs/api-reference/fine-tuning/completions-input)
* models.
*
* The Batch API only supports `.jsonl` files up to 100 MB in size.
* The Batch API only supports `.jsonl` files up to 100 MB in size. The input also
* has a specific required
* [format](https://platform.openai.com/docs/api-reference/batch/request-input).
*

@@ -198,3 +204,3 @@ * Please [contact us](https://help.openai.com/) if you need to increase these

*/
purpose: 'assistants' | 'batch' | 'fine-tune';
purpose: 'assistants' | 'batch' | 'fine-tune' | 'vision';
}

@@ -201,0 +207,0 @@

@@ -315,2 +315,7 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

*
* 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
* [completions](https://platform.openai.com/docs/api-reference/fine-tuning/completions-input)
* format.
*
* See the [fine-tuning guide](https://platform.openai.com/docs/guides/fine-tuning)

@@ -317,0 +322,0 @@ * for more details.

@@ -28,4 +28,4 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

* The parameters the functions accepts, described as a JSON Schema object. See the
* [guide](https://platform.openai.com/docs/guides/text-generation/function-calling)
* for examples, and the
* [guide](https://platform.openai.com/docs/guides/function-calling) for examples,
* and the
* [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for

@@ -41,4 +41,4 @@ * documentation about the format.

* The parameters the functions accepts, described as a JSON Schema object. See the
* [guide](https://platform.openai.com/docs/guides/text-generation/function-calling)
* for examples, and the
* [guide](https://platform.openai.com/docs/guides/function-calling) for examples,
* and the
* [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for

@@ -45,0 +45,0 @@ * documentation about the format.

@@ -1,1 +0,1 @@

export const VERSION = '4.47.3'; // x-release-please-version
export const VERSION = '4.48.1'; // x-release-please-version

@@ -1,2 +0,2 @@

export declare const VERSION = "4.47.3";
export declare const VERSION = "4.48.1";
//# sourceMappingURL=version.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.VERSION = void 0;
exports.VERSION = '4.47.3'; // x-release-please-version
exports.VERSION = '4.48.1'; // 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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc