Skip to content

Commit 190848f

Browse files
chore(internal): codegen related update
1 parent 8bef148 commit 190848f

3 files changed

Lines changed: 22 additions & 3 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 151
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-bbf1d88b9b565b893dcae280be68848dc1518ecb65e009d1e94c9f0e5ecaacb2.yml
3-
openapi_spec_hash: 0757a960c980e26cc813615d6823bfd5
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-9919ae12a2ab24389e4bcd032e986437cbc8a4b70057dda0f524976c9378f4c1.yml
3+
openapi_spec_hash: c670ab80573e61e664f6a16f5a96d67f
44
config_hash: 1d3eb2a6fc36f206d2d67bfcf1a7080d

src/client.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,18 @@ export class OpenAI {
448448
this.fetch = options.fetch ?? Shims.getDefaultFetch();
449449
this.#encoder = Opts.FallbackEncoder;
450450

451+
const customHeadersEnv = readEnv('OPENAI_CUSTOM_HEADERS');
452+
if (customHeadersEnv) {
453+
const parsed: Record<string, string> = {};
454+
for (const line of customHeadersEnv.split('\n')) {
455+
const colon = line.indexOf(':');
456+
if (colon >= 0) {
457+
parsed[line.substring(0, colon).trim()] = line.substring(colon + 1).trim();
458+
}
459+
}
460+
options.defaultHeaders = { ...parsed, ...options.defaultHeaders };
461+
}
462+
451463
this._options = options;
452464

453465
if (workloadIdentity) {

src/resources/files.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ export class Files extends APIResource {
1818
/**
1919
* Upload a file that can be used across various endpoints. Individual files can be
2020
* up to 512 MB, and each project can store up to 2.5 TB of files in total. There
21-
* is no organization-wide storage limit.
21+
* is no organization-wide storage limit. Uploads to this endpoint are rate-limited
22+
* to 1,000 requests per minute per authenticated user.
2223
*
2324
* - The Assistants API supports files up to 2 million tokens and of specific file
2425
* types. See the
@@ -33,6 +34,12 @@ export class Files extends APIResource {
3334
* - The Batch API only supports `.jsonl` files up to 200 MB in size. The input
3435
* also has a specific required
3536
* [format](https://platform.openai.com/docs/api-reference/batch/request-input).
37+
* - For Retrieval or `file_search` ingestion, upload files here first. If you need
38+
* to attach multiple uploaded files to the same vector store, use
39+
* [`/vector_stores/{vector_store_id}/file_batches`](https://platform.openai.com/docs/api-reference/vector-stores-file-batches/createBatch)
40+
* instead of attaching them one by one. Vector store attachment has separate
41+
* limits from file upload, including 2,000 attached files per minute per
42+
* organization.
3643
*
3744
* Please [contact us](https://help.openai.com/) if you need to increase these
3845
* storage limits.

0 commit comments

Comments
 (0)