Skip to content

Commit

Permalink
fix(api): correct types for attachments (#783)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-bot committed Apr 18, 2024
1 parent a28e0ba commit 40c7e23
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 50 deletions.
8 changes: 4 additions & 4 deletions src/resources/beta/threads/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'>;
}

/**
Expand Down Expand Up @@ -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'>;
}
}

Expand Down
16 changes: 8 additions & 8 deletions src/resources/beta/threads/runs/runs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'>;
}
}

Expand Down Expand Up @@ -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'>;
}
}

Expand Down Expand Up @@ -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'>;
}
}

Expand Down Expand Up @@ -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'>;
}
}

Expand Down
16 changes: 8 additions & 8 deletions src/resources/beta/threads/threads.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'>;
}
}

Expand Down Expand Up @@ -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'>;
}
}

Expand Down Expand Up @@ -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'>;
}
}

Expand Down Expand Up @@ -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'>;
}
}

Expand Down
6 changes: 3 additions & 3 deletions tests/api-resources/beta/threads/messages.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {},
});
Expand Down
18 changes: 9 additions & 9 deletions tests/api-resources/beta/threads/runs/runs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,29 +29,29 @@ 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: {},
},
{
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: {},
},
{
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: {},
},
Expand Down
36 changes: 18 additions & 18 deletions tests/api-resources/beta/threads/threads.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,29 +37,29 @@ 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: {},
},
{
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: {},
},
{
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: {},
},
Expand Down Expand Up @@ -153,29 +153,29 @@ 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: {},
},
{
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: {},
},
{
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: {},
},
Expand Down

0 comments on commit 40c7e23

Please sign in to comment.