From 40c7e23900db7a8af43a23a9eb24b363a076a044 Mon Sep 17 00:00:00 2001 From: Stainless Bot <107565488+stainless-bot@users.noreply.github.com> Date: Thu, 18 Apr 2024 18:32:30 -0400 Subject: [PATCH] fix(api): correct types for attachments (#783) --- src/resources/beta/threads/messages.ts | 8 ++--- src/resources/beta/threads/runs/runs.ts | 16 ++++----- src/resources/beta/threads/threads.ts | 16 ++++----- .../beta/threads/messages.test.ts | 6 ++-- .../beta/threads/runs/runs.test.ts | 18 +++++----- .../beta/threads/threads.test.ts | 36 +++++++++---------- 6 files changed, 50 insertions(+), 50 deletions(-) diff --git a/src/resources/beta/threads/messages.ts b/src/resources/beta/threads/messages.ts index f17b8508d..68fee1a94 100644 --- a/src/resources/beta/threads/messages.ts +++ b/src/resources/beta/threads/messages.ts @@ -369,12 +369,12 @@ export interface Message { export namespace Message { export interface Attachment { - add_to?: Array<'file_search' | 'code_interpreter'>; - /** * The ID of the file to attach to the message. */ file_id?: string; + + tools?: Array<'file_search' | 'code_interpreter'>; } /** @@ -523,12 +523,12 @@ export interface MessageCreateParams { export namespace MessageCreateParams { export interface Attachment { - add_to?: Array<'file_search' | 'code_interpreter'>; - /** * The ID of the file to attach to the message. */ file_id?: string; + + tools?: Array<'file_search' | 'code_interpreter'>; } } diff --git a/src/resources/beta/threads/runs/runs.ts b/src/resources/beta/threads/runs/runs.ts index 48cfac546..d48619fba 100644 --- a/src/resources/beta/threads/runs/runs.ts +++ b/src/resources/beta/threads/runs/runs.ts @@ -775,12 +775,12 @@ export namespace RunCreateParams { export namespace AdditionalMessage { export interface Attachment { - add_to?: Array<'file_search' | 'code_interpreter'>; - /** * The ID of the file to attach to the message. */ file_id?: string; + + tools?: Array<'file_search' | 'code_interpreter'>; } } @@ -1023,12 +1023,12 @@ export namespace RunCreateAndPollParams { export namespace AdditionalMessage { export interface Attachment { - add_to?: Array<'file_search' | 'code_interpreter'>; - /** * The ID of the file to attach to the message. */ file_id?: string; + + tools?: Array<'file_search' | 'code_interpreter'>; } } @@ -1224,12 +1224,12 @@ export namespace RunCreateAndStreamParams { export namespace AdditionalMessage { export interface Attachment { - add_to?: Array<'file_search' | 'code_interpreter'>; - /** * The ID of the file to attach to the message. */ file_id?: string; + + tools?: Array<'file_search' | 'code_interpreter'>; } } @@ -1425,12 +1425,12 @@ export namespace RunStreamParams { export namespace AdditionalMessage { export interface Attachment { - add_to?: Array<'file_search' | 'code_interpreter'>; - /** * The ID of the file to attach to the message. */ file_id?: string; + + tools?: Array<'file_search' | 'code_interpreter'>; } } diff --git a/src/resources/beta/threads/threads.ts b/src/resources/beta/threads/threads.ts index 6f1e761de..5f325d33a 100644 --- a/src/resources/beta/threads/threads.ts +++ b/src/resources/beta/threads/threads.ts @@ -313,12 +313,12 @@ export namespace ThreadCreateParams { export namespace Message { export interface Attachment { - add_to?: Array<'file_search' | 'code_interpreter'>; - /** * The ID of the file to attach to the message. */ file_id?: string; + + tools?: Array<'file_search' | 'code_interpreter'>; } } @@ -648,12 +648,12 @@ export namespace ThreadCreateAndRunParams { export namespace Message { export interface Attachment { - add_to?: Array<'file_search' | 'code_interpreter'>; - /** * The ID of the file to attach to the message. */ file_id?: string; + + tools?: Array<'file_search' | 'code_interpreter'>; } } @@ -994,12 +994,12 @@ export namespace ThreadCreateAndRunPollParams { export namespace Message { export interface Attachment { - add_to?: Array<'file_search' | 'code_interpreter'>; - /** * The ID of the file to attach to the message. */ file_id?: string; + + tools?: Array<'file_search' | 'code_interpreter'>; } } @@ -1319,12 +1319,12 @@ export namespace ThreadCreateAndRunStreamParams { export namespace Message { export interface Attachment { - add_to?: Array<'file_search' | 'code_interpreter'>; - /** * The ID of the file to attach to the message. */ file_id?: string; + + tools?: Array<'file_search' | 'code_interpreter'>; } } diff --git a/tests/api-resources/beta/threads/messages.test.ts b/tests/api-resources/beta/threads/messages.test.ts index a0a025869..61ccebe9f 100644 --- a/tests/api-resources/beta/threads/messages.test.ts +++ b/tests/api-resources/beta/threads/messages.test.ts @@ -25,9 +25,9 @@ describe('resource messages', () => { content: 'x', role: 'user', attachments: [ - { file_id: 'string', add_to: ['file_search', 'code_interpreter'] }, - { file_id: 'string', add_to: ['file_search', 'code_interpreter'] }, - { file_id: 'string', add_to: ['file_search', 'code_interpreter'] }, + { file_id: 'string', tools: ['file_search', 'code_interpreter'] }, + { file_id: 'string', tools: ['file_search', 'code_interpreter'] }, + { file_id: 'string', tools: ['file_search', 'code_interpreter'] }, ], metadata: {}, }); diff --git a/tests/api-resources/beta/threads/runs/runs.test.ts b/tests/api-resources/beta/threads/runs/runs.test.ts index 4a3743ca0..ea9c0761e 100644 --- a/tests/api-resources/beta/threads/runs/runs.test.ts +++ b/tests/api-resources/beta/threads/runs/runs.test.ts @@ -29,9 +29,9 @@ describe('resource runs', () => { role: 'user', content: 'x', attachments: [ - { file_id: 'string', add_to: ['file_search', 'code_interpreter'] }, - { file_id: 'string', add_to: ['file_search', 'code_interpreter'] }, - { file_id: 'string', add_to: ['file_search', 'code_interpreter'] }, + { file_id: 'string', tools: ['file_search', 'code_interpreter'] }, + { file_id: 'string', tools: ['file_search', 'code_interpreter'] }, + { file_id: 'string', tools: ['file_search', 'code_interpreter'] }, ], metadata: {}, }, @@ -39,9 +39,9 @@ describe('resource runs', () => { role: 'user', content: 'x', attachments: [ - { file_id: 'string', add_to: ['file_search', 'code_interpreter'] }, - { file_id: 'string', add_to: ['file_search', 'code_interpreter'] }, - { file_id: 'string', add_to: ['file_search', 'code_interpreter'] }, + { file_id: 'string', tools: ['file_search', 'code_interpreter'] }, + { file_id: 'string', tools: ['file_search', 'code_interpreter'] }, + { file_id: 'string', tools: ['file_search', 'code_interpreter'] }, ], metadata: {}, }, @@ -49,9 +49,9 @@ describe('resource runs', () => { role: 'user', content: 'x', attachments: [ - { file_id: 'string', add_to: ['file_search', 'code_interpreter'] }, - { file_id: 'string', add_to: ['file_search', 'code_interpreter'] }, - { file_id: 'string', add_to: ['file_search', 'code_interpreter'] }, + { file_id: 'string', tools: ['file_search', 'code_interpreter'] }, + { file_id: 'string', tools: ['file_search', 'code_interpreter'] }, + { file_id: 'string', tools: ['file_search', 'code_interpreter'] }, ], metadata: {}, }, diff --git a/tests/api-resources/beta/threads/threads.test.ts b/tests/api-resources/beta/threads/threads.test.ts index 0a5f70af4..6a697865b 100644 --- a/tests/api-resources/beta/threads/threads.test.ts +++ b/tests/api-resources/beta/threads/threads.test.ts @@ -37,9 +37,9 @@ describe('resource threads', () => { role: 'user', content: 'x', attachments: [ - { file_id: 'string', add_to: ['file_search', 'code_interpreter'] }, - { file_id: 'string', add_to: ['file_search', 'code_interpreter'] }, - { file_id: 'string', add_to: ['file_search', 'code_interpreter'] }, + { file_id: 'string', tools: ['file_search', 'code_interpreter'] }, + { file_id: 'string', tools: ['file_search', 'code_interpreter'] }, + { file_id: 'string', tools: ['file_search', 'code_interpreter'] }, ], metadata: {}, }, @@ -47,9 +47,9 @@ describe('resource threads', () => { role: 'user', content: 'x', attachments: [ - { file_id: 'string', add_to: ['file_search', 'code_interpreter'] }, - { file_id: 'string', add_to: ['file_search', 'code_interpreter'] }, - { file_id: 'string', add_to: ['file_search', 'code_interpreter'] }, + { file_id: 'string', tools: ['file_search', 'code_interpreter'] }, + { file_id: 'string', tools: ['file_search', 'code_interpreter'] }, + { file_id: 'string', tools: ['file_search', 'code_interpreter'] }, ], metadata: {}, }, @@ -57,9 +57,9 @@ describe('resource threads', () => { role: 'user', content: 'x', attachments: [ - { file_id: 'string', add_to: ['file_search', 'code_interpreter'] }, - { file_id: 'string', add_to: ['file_search', 'code_interpreter'] }, - { file_id: 'string', add_to: ['file_search', 'code_interpreter'] }, + { file_id: 'string', tools: ['file_search', 'code_interpreter'] }, + { file_id: 'string', tools: ['file_search', 'code_interpreter'] }, + { file_id: 'string', tools: ['file_search', 'code_interpreter'] }, ], metadata: {}, }, @@ -153,9 +153,9 @@ describe('resource threads', () => { role: 'user', content: 'x', attachments: [ - { file_id: 'string', add_to: ['file_search', 'code_interpreter'] }, - { file_id: 'string', add_to: ['file_search', 'code_interpreter'] }, - { file_id: 'string', add_to: ['file_search', 'code_interpreter'] }, + { file_id: 'string', tools: ['file_search', 'code_interpreter'] }, + { file_id: 'string', tools: ['file_search', 'code_interpreter'] }, + { file_id: 'string', tools: ['file_search', 'code_interpreter'] }, ], metadata: {}, }, @@ -163,9 +163,9 @@ describe('resource threads', () => { role: 'user', content: 'x', attachments: [ - { file_id: 'string', add_to: ['file_search', 'code_interpreter'] }, - { file_id: 'string', add_to: ['file_search', 'code_interpreter'] }, - { file_id: 'string', add_to: ['file_search', 'code_interpreter'] }, + { file_id: 'string', tools: ['file_search', 'code_interpreter'] }, + { file_id: 'string', tools: ['file_search', 'code_interpreter'] }, + { file_id: 'string', tools: ['file_search', 'code_interpreter'] }, ], metadata: {}, }, @@ -173,9 +173,9 @@ describe('resource threads', () => { role: 'user', content: 'x', attachments: [ - { file_id: 'string', add_to: ['file_search', 'code_interpreter'] }, - { file_id: 'string', add_to: ['file_search', 'code_interpreter'] }, - { file_id: 'string', add_to: ['file_search', 'code_interpreter'] }, + { file_id: 'string', tools: ['file_search', 'code_interpreter'] }, + { file_id: 'string', tools: ['file_search', 'code_interpreter'] }, + { file_id: 'string', tools: ['file_search', 'code_interpreter'] }, ], metadata: {}, },