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

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 .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
7 changes: 7 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,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
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 @@ -13,6 +13,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
9 changes: 8 additions & 1 deletion src/resources/beta/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,14 @@ export {
ThreadCreateAndRunParamsStreaming,
Threads,
} from './threads/index';
export { Beta } from './beta';
export {
AutoFileChunkingStrategyParam,
FileChunkingStrategy,
FileChunkingStrategyParam,
OtherFileChunkingStrategyObject,
StaticFileChunkingStrategy,
StaticFileChunkingStrategyObject,
StaticFileChunkingStrategyParam,
VectorStore,
VectorStoreDeleted,
VectorStoreCreateParams,
Expand All @@ -42,3 +48,4 @@ export {
VectorStoresPage,
VectorStores,
} from './vector-stores/index';
export { Beta } from './beta';
87 changes: 5 additions & 82 deletions src/resources/beta/threads/threads.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,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 @@ -355,9 +356,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 @@ -374,45 +375,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 @@ -741,9 +703,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 @@ -760,45 +722,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 @@ -6,6 +6,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 @@ -160,50 +161,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