Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release: 4.58.0 #1044

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "4.57.3"
".": "4.58.0"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 68
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-1dbac0e95bdb5a89a0dd3d93265475a378214551b7d8c22862928e0d87ace94b.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-85a85e0c08de456441431c0ae4e9c078cc8f9748c29430b9a9058340db6389ee.yml
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 4.58.0 (2024-09-05)

Full Changelog: [v4.57.3...v4.58.0](https://github.com/openai/openai-node/compare/v4.57.3...v4.58.0)

### Features

* **vector store:** improve chunking strategy type names ([#1041](https://github.com/openai/openai-node/issues/1041)) ([471cec3](https://github.com/openai/openai-node/commit/471cec3228886253f07c13a362827a31e9ec7b63))


### Bug Fixes

* **uploads:** avoid making redundant memory copies ([#1043](https://github.com/openai/openai-node/issues/1043)) ([271297b](https://github.com/openai/openai-node/commit/271297bd32393d4c5663023adf82f8fb19dc3d25))

## 4.57.3 (2024-09-04)

Full Changelog: [v4.57.2...v4.57.3](https://github.com/openai/openai-node/compare/v4.57.2...v4.57.3)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ You can import in Deno via:
<!-- x-release-please-start-version -->

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

<!-- x-release-please-end -->
Expand Down
7 changes: 7 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,13 @@ Methods:

Types:

- <code><a href="./src/resources/beta/vector-stores/vector-stores.ts">AutoFileChunkingStrategyParam</a></code>
- <code><a href="./src/resources/beta/vector-stores/vector-stores.ts">FileChunkingStrategy</a></code>
- <code><a href="./src/resources/beta/vector-stores/vector-stores.ts">FileChunkingStrategyParam</a></code>
- <code><a href="./src/resources/beta/vector-stores/vector-stores.ts">OtherFileChunkingStrategyObject</a></code>
- <code><a href="./src/resources/beta/vector-stores/vector-stores.ts">StaticFileChunkingStrategy</a></code>
- <code><a href="./src/resources/beta/vector-stores/vector-stores.ts">StaticFileChunkingStrategyObject</a></code>
- <code><a href="./src/resources/beta/vector-stores/vector-stores.ts">StaticFileChunkingStrategyParam</a></code>
- <code><a href="./src/resources/beta/vector-stores/vector-stores.ts">VectorStore</a></code>
- <code><a href="./src/resources/beta/vector-stores/vector-stores.ts">VectorStoreDeleted</a></code>

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "openai",
"version": "4.57.3",
"version": "4.58.0",
"description": "The official TypeScript library for the OpenAI API",
"author": "OpenAI <[email protected]>",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion scripts/build-deno
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This is a build produced from https://github.com/openai/openai-node – please g
Usage:
\`\`\`ts
import OpenAI from "https://deno.land/x/openai@v4.57.3/mod.ts";
import OpenAI from "https://deno.land/x/openai@v4.58.0/mod.ts";
const client = new OpenAI();
\`\`\`
Expand Down
44 changes: 3 additions & 41 deletions src/resources/beta/assistants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import * as Shared from '../shared';
import * as ChatAPI from '../chat/chat';
import * as MessagesAPI from './threads/messages';
import * as ThreadsAPI from './threads/threads';
import * as VectorStoresAPI from './vector-stores/vector-stores';
import * as RunsAPI from './threads/runs/runs';
import * as StepsAPI from './threads/runs/steps';
import { CursorPage, type CursorPageParams } from '../../pagination';
Expand Down Expand Up @@ -1218,9 +1219,9 @@ export namespace AssistantCreateParams {
export interface VectorStore {
/**
* The chunking strategy used to chunk the file(s). If not set, will use the `auto`
* strategy.
* strategy. Only applicable if `file_ids` is non-empty.
*/
chunking_strategy?: VectorStore.Auto | VectorStore.Static;
chunking_strategy?: VectorStoresAPI.FileChunkingStrategyParam;

/**
* A list of [file](https://platform.openai.com/docs/api-reference/files) IDs to
Expand All @@ -1237,45 +1238,6 @@ export namespace AssistantCreateParams {
*/
metadata?: unknown;
}

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;
}
}
}
}
}
}
Expand Down
7 changes: 7 additions & 0 deletions src/resources/beta/beta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ export class Beta extends APIResource {

export namespace Beta {
export import VectorStores = VectorStoresAPI.VectorStores;
export import AutoFileChunkingStrategyParam = VectorStoresAPI.AutoFileChunkingStrategyParam;
export import FileChunkingStrategy = VectorStoresAPI.FileChunkingStrategy;
export import FileChunkingStrategyParam = VectorStoresAPI.FileChunkingStrategyParam;
export import OtherFileChunkingStrategyObject = VectorStoresAPI.OtherFileChunkingStrategyObject;
export import StaticFileChunkingStrategy = VectorStoresAPI.StaticFileChunkingStrategy;
export import StaticFileChunkingStrategyObject = VectorStoresAPI.StaticFileChunkingStrategyObject;
export import StaticFileChunkingStrategyParam = VectorStoresAPI.StaticFileChunkingStrategyParam;
export import VectorStore = VectorStoresAPI.VectorStore;
export import VectorStoreDeleted = VectorStoresAPI.VectorStoreDeleted;
export import VectorStoresPage = VectorStoresAPI.VectorStoresPage;
Expand Down
7 changes: 7 additions & 0 deletions src/resources/beta/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ export {
export { Beta } from './beta';
export { Chat } from './chat/index';
export {
AutoFileChunkingStrategyParam,
FileChunkingStrategy,
FileChunkingStrategyParam,
OtherFileChunkingStrategyObject,
StaticFileChunkingStrategy,
StaticFileChunkingStrategyObject,
StaticFileChunkingStrategyParam,
VectorStore,
VectorStoreDeleted,
VectorStoreCreateParams,
Expand Down
87 changes: 5 additions & 82 deletions src/resources/beta/threads/threads.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import * as Shared from '../../shared';
import * as AssistantsAPI from '../assistants';
import * as ChatAPI from '../../chat/chat';
import * as MessagesAPI from './messages';
import * as VectorStoresAPI from '../vector-stores/vector-stores';
import * as RunsAPI from './runs/runs';
import { Stream } from '../../../streaming';

Expand Down Expand Up @@ -379,9 +380,9 @@ export namespace ThreadCreateParams {
export interface VectorStore {
/**
* The chunking strategy used to chunk the file(s). If not set, will use the `auto`
* strategy.
* strategy. Only applicable if `file_ids` is non-empty.
*/
chunking_strategy?: VectorStore.Auto | VectorStore.Static;
chunking_strategy?: VectorStoresAPI.FileChunkingStrategyParam;

/**
* A list of [file](https://platform.openai.com/docs/api-reference/files) IDs to
Expand All @@ -398,45 +399,6 @@ export namespace ThreadCreateParams {
*/
metadata?: unknown;
}

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;
}
}
}
}
}
}
Expand Down Expand Up @@ -765,9 +727,9 @@ export namespace ThreadCreateAndRunParams {
export interface VectorStore {
/**
* The chunking strategy used to chunk the file(s). If not set, will use the `auto`
* strategy.
* strategy. Only applicable if `file_ids` is non-empty.
*/
chunking_strategy?: VectorStore.Auto | VectorStore.Static;
chunking_strategy?: VectorStoresAPI.FileChunkingStrategyParam;

/**
* A list of [file](https://platform.openai.com/docs/api-reference/files) IDs to
Expand All @@ -784,45 +746,6 @@ export namespace ThreadCreateAndRunParams {
*/
metadata?: unknown;
}

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;
}
}
}
}
}
}
Expand Down
46 changes: 3 additions & 43 deletions src/resources/beta/vector-stores/file-batches.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import * as Core from '../../../core';
import * as FileBatchesAPI from './file-batches';
import * as FilesAPI from './files';
import { VectorStoreFilesPage } from './files';
import * as VectorStoresAPI from './vector-stores';
import { type CursorPageParams } from '../../../pagination';

export class FileBatches extends APIResource {
Expand Down Expand Up @@ -267,50 +268,9 @@ export interface FileBatchCreateParams {

/**
* The chunking strategy used to chunk the file(s). If not set, will use the `auto`
* strategy.
* strategy. Only applicable if `file_ids` is non-empty.
*/
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;
}
}
chunking_strategy?: VectorStoresAPI.FileChunkingStrategyParam;
}

export interface FileBatchListFilesParams extends CursorPageParams {
Expand Down
Loading