From ee8b24c70a5ccb944e02ff2201668d6bc2b597b3 Mon Sep 17 00:00:00 2001 From: Stainless Bot <107565488+stainless-bot@users.noreply.github.com> Date: Mon, 6 Nov 2023 20:37:50 +0000 Subject: [PATCH] docs(api): improve docstrings (#435) --- README.md | 2 +- build-deno | 2 +- src/resources/beta/assistants/assistants.ts | 54 ++++++------ src/resources/beta/assistants/files.ts | 18 ++-- src/resources/beta/threads/messages/files.ts | 10 +-- .../beta/threads/messages/messages.ts | 72 ++++++++-------- src/resources/beta/threads/runs/runs.ts | 82 +++++++++---------- src/resources/beta/threads/runs/steps.ts | 64 +++++++-------- src/resources/beta/threads/threads.ts | 58 ++++++------- src/resources/files.ts | 10 +-- 10 files changed, 186 insertions(+), 186 deletions(-) diff --git a/README.md b/README.md index 2cbf9ce86..813036a12 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ You can import in Deno via: ```ts -import OpenAI from 'https://deno.land/x/openai@4.15.4/mod.ts'; +import OpenAI from 'https://deno.land/x/openai@4.16.0/mod.ts'; ``` diff --git a/build-deno b/build-deno index d7f6dc298..55e4d51bd 100755 --- a/build-deno +++ b/build-deno @@ -15,7 +15,7 @@ This is a build produced from https://github.com/openai/openai-node – please g Usage: \`\`\`ts -import OpenAI from "$(echo 'https://deno.land/x/openai@4.15.4/mod.ts' | sed -E s/@\.+\\//@"$PACKAGE_VERSION"\\//)"; +import OpenAI from "$(echo 'https://deno.land/x/openai@4.16.0/mod.ts' | sed -E s/@\.+\\//@"$PACKAGE_VERSION"\\//)"; const client = new OpenAI(); \`\`\` diff --git a/src/resources/beta/assistants/assistants.ts b/src/resources/beta/assistants/assistants.ts index a9cfea61a..8a3d1c8b7 100644 --- a/src/resources/beta/assistants/assistants.ts +++ b/src/resources/beta/assistants/assistants.ts @@ -11,7 +11,7 @@ export class Assistants extends APIResource { files: FilesAPI.Files = new FilesAPI.Files(this.client); /** - * Create an Assistant with a model and instructions. + * Create an assistant with a model and instructions. */ create(body: AssistantCreateParams, options?: Core.RequestOptions): Core.APIPromise { return this.post('/assistants', { @@ -22,7 +22,7 @@ export class Assistants extends APIResource { } /** - * Retrieves an Assistant. + * Retrieves an assistant. */ retrieve(assistantId: string, options?: Core.RequestOptions): Core.APIPromise { return this.get(`/assistants/${assistantId}`, { @@ -32,7 +32,7 @@ export class Assistants extends APIResource { } /** - * Modifies an Assistant. + * Modifies an assistant. */ update( assistantId: string, @@ -47,7 +47,7 @@ export class Assistants extends APIResource { } /** - * Returns a list of Assistants. + * Returns a list of assistants. */ list( query?: AssistantListParams, @@ -69,7 +69,7 @@ export class Assistants extends APIResource { } /** - * Delete an Assistant. + * Delete an assistant. */ del(assistantId: string, options?: Core.RequestOptions): Core.APIPromise { return this.delete(`/assistants/${assistantId}`, { @@ -82,7 +82,7 @@ export class Assistants extends APIResource { export class AssistantsPage extends CursorPage {} /** - * Represents an `Assistant` that can call the model and use tools. + * Represents an `assistant` that can call the model and use tools. */ export interface Assistant { /** @@ -91,24 +91,24 @@ export interface Assistant { id: string; /** - * The Unix timestamp (in seconds) for when the Assistant was created. + * The Unix timestamp (in seconds) for when the assistant was created. */ created_at: number; /** - * The description of the Assistant. The maximum length is 512 characters. + * The description of the assistant. The maximum length is 512 characters. */ description: string | null; /** - * A list of [File](https://platform.openai.com/docs/api-reference/files) IDs - * attached to this Assistant. There can be a maximum of 20 files attached to the - * Assistant. Files are ordered by their creation date in ascending order. + * A list of [file](https://platform.openai.com/docs/api-reference/files) IDs + * attached to this assistant. There can be a maximum of 20 files attached to the + * assistant. Files are ordered by their creation date in ascending order. */ file_ids: Array; /** - * The system instructions that the Assistant uses. The maximum length is 32768 + * The system instructions that the assistant uses. The maximum length is 32768 * characters. */ instructions: string | null; @@ -131,7 +131,7 @@ export interface Assistant { model: string; /** - * The name of the Assistant. The maximum length is 256 characters. + * The name of the assistant. The maximum length is 256 characters. */ name: string | null; @@ -141,7 +141,7 @@ export interface Assistant { object: 'assistant'; /** - * A list of tool enabled on the Assistant. There can be a maximum of 128 tools per + * A list of tool enabled on the assistant. There can be a maximum of 128 tools per * assistant. Tools can be of types `code_interpreter`, `retrieval`, or `function`. */ tools: Array; @@ -225,19 +225,19 @@ export interface AssistantCreateParams { model: string; /** - * The description of the Assistant. The maximum length is 512 characters. + * The description of the assistant. The maximum length is 512 characters. */ description?: string | null; /** - * A list of [File](https://platform.openai.com/docs/api-reference/files) IDs - * attached to this Assistant. There can be a maximum of 20 files attached to the - * Assistant. Files are ordered by their creation date in ascending order. + * A list of [file](https://platform.openai.com/docs/api-reference/files) IDs + * attached to this assistant. There can be a maximum of 20 files attached to the + * assistant. Files are ordered by their creation date in ascending order. */ file_ids?: Array; /** - * The system instructions that the Assistant uses. The maximum length is 32768 + * The system instructions that the assistant uses. The maximum length is 32768 * characters. */ instructions?: string | null; @@ -251,12 +251,12 @@ export interface AssistantCreateParams { metadata?: unknown | null; /** - * The name of the Assistant. The maximum length is 256 characters. + * The name of the assistant. The maximum length is 256 characters. */ name?: string | null; /** - * A list of tool enabled on the Assistant. There can be a maximum of 128 tools per + * A list of tool enabled on the assistant. There can be a maximum of 128 tools per * assistant. Tools can be of types `code_interpreter`, `retrieval`, or `function`. */ tools?: Array< @@ -327,21 +327,21 @@ export namespace AssistantCreateParams { export interface AssistantUpdateParams { /** - * The description of the Assistant. The maximum length is 512 characters. + * The description of the assistant. The maximum length is 512 characters. */ description?: string | null; /** * A list of [File](https://platform.openai.com/docs/api-reference/files) IDs - * attached to this Assistant. There can be a maximum of 20 files attached to the - * Assistant. Files are ordered by their creation date in ascending order. If a + * attached to this assistant. There can be a maximum of 20 files attached to the + * assistant. Files are ordered by their creation date in ascending order. If a * file was previosuly attached to the list but does not show up in the list, it * will be deleted from the assistant. */ file_ids?: Array; /** - * The system instructions that the Assistant uses. The maximum length is 32768 + * The system instructions that the assistant uses. The maximum length is 32768 * characters. */ instructions?: string | null; @@ -364,12 +364,12 @@ export interface AssistantUpdateParams { model?: string; /** - * The name of the Assistant. The maximum length is 256 characters. + * The name of the assistant. The maximum length is 256 characters. */ name?: string | null; /** - * A list of tool enabled on the Assistant. There can be a maximum of 128 tools per + * A list of tool enabled on the assistant. There can be a maximum of 128 tools per * assistant. Tools can be of types `code_interpreter`, `retrieval`, or `function`. */ tools?: Array< diff --git a/src/resources/beta/assistants/files.ts b/src/resources/beta/assistants/files.ts index d913146ea..7733cff9a 100644 --- a/src/resources/beta/assistants/files.ts +++ b/src/resources/beta/assistants/files.ts @@ -8,9 +8,9 @@ import { CursorPage, type CursorPageParams } from 'openai/pagination'; export class Files extends APIResource { /** - * Create an Assistant File by attaching a + * Create an assistant file by attaching a * [File](https://platform.openai.com/docs/api-reference/files) to an - * [Assistant](https://platform.openai.com/docs/api-reference/assistants). + * [assistant](https://platform.openai.com/docs/api-reference/assistants). */ create( assistantId: string, @@ -39,7 +39,7 @@ export class Files extends APIResource { } /** - * Returns a list of Assistant Files. + * Returns a list of assistant files. */ list( assistantId: string, @@ -66,7 +66,7 @@ export class Files extends APIResource { } /** - * Delete an Assistant File. + * Delete an assistant file. */ del( assistantId: string, @@ -84,7 +84,7 @@ export class AssistantFilesPage extends CursorPage {} /** * A list of [Files](https://platform.openai.com/docs/api-reference/files) attached - * to an `Assistant`. + * to an `assistant`. */ export interface AssistantFile { /** @@ -93,12 +93,12 @@ export interface AssistantFile { id: string; /** - * The Assistant ID that the File is attached to. + * The assistant ID that the file is attached to. */ assistant_id: string; /** - * The Unix timestamp (in seconds) for when the Assistant File was created. + * The Unix timestamp (in seconds) for when the assistant file was created. */ created_at: number; @@ -109,7 +109,7 @@ export interface AssistantFile { } /** - * Deletes the association between the Assistant and the File, but does not delete + * Deletes the association between the assistant and the file, but does not delete * the [File](https://platform.openai.com/docs/api-reference/files) object itself. */ export interface FileDeleteResponse { @@ -123,7 +123,7 @@ export interface FileDeleteResponse { export interface FileCreateParams { /** * A [File](https://platform.openai.com/docs/api-reference/files) ID (with - * `purpose="assistants"`) that the Assistant should use. Useful for tools like + * `purpose="assistants"`) that the assistant should use. Useful for tools like * `retrieval` and `code_interpreter` that can access files. */ file_id: string; diff --git a/src/resources/beta/threads/messages/files.ts b/src/resources/beta/threads/messages/files.ts index f55cd780c..4bbc06538 100644 --- a/src/resources/beta/threads/messages/files.ts +++ b/src/resources/beta/threads/messages/files.ts @@ -8,7 +8,7 @@ import { CursorPage, type CursorPageParams } from 'openai/pagination'; export class Files extends APIResource { /** - * Retrieves a Message File. + * Retrieves a message file. */ retrieve( threadId: string, @@ -23,7 +23,7 @@ export class Files extends APIResource { } /** - * Returns a list of Message Files. + * Returns a list of message files. */ list( threadId: string, @@ -56,7 +56,7 @@ export class Files extends APIResource { export class MessageFilesPage extends CursorPage {} /** - * A list of Files attached to a `Message`. + * A list of files attached to a `message`. */ export interface MessageFile { /** @@ -65,12 +65,12 @@ export interface MessageFile { id: string; /** - * The Unix timestamp (in seconds) for when the Message File was created. + * The Unix timestamp (in seconds) for when the message file was created. */ created_at: number; /** - * The ID of the [Message](https://platform.openai.com/docs/api-reference/messages) + * The ID of the [message](https://platform.openai.com/docs/api-reference/messages) * that the [File](https://platform.openai.com/docs/api-reference/files) is * attached to. */ diff --git a/src/resources/beta/threads/messages/messages.ts b/src/resources/beta/threads/messages/messages.ts index ec99a10f9..cf7bf35e5 100644 --- a/src/resources/beta/threads/messages/messages.ts +++ b/src/resources/beta/threads/messages/messages.ts @@ -11,7 +11,7 @@ export class Messages extends APIResource { files: FilesAPI.Files = new FilesAPI.Files(this.client); /** - * Create a Message. + * Create a message. */ create( threadId: string, @@ -26,7 +26,7 @@ export class Messages extends APIResource { } /** - * Retrieve a Message. + * Retrieve a message. */ retrieve( threadId: string, @@ -40,7 +40,7 @@ export class Messages extends APIResource { } /** - * Modifies a Message. + * Modifies a message. */ update( threadId: string, @@ -56,7 +56,7 @@ export class Messages extends APIResource { } /** - * Returns a list of Messages for a given Thread. + * Returns a list of messages for a given thread. */ list( threadId: string, @@ -84,13 +84,13 @@ export class ThreadMessagesPage extends CursorPage {} /** * References an image [File](https://platform.openai.com/docs/api-reference/files) - * in the content of a Message. + * in the content of a message. */ export interface MessageContentImageFile { image_file: MessageContentImageFile.ImageFile; /** - * Will always be `image_file`. + * Always `image_file`. */ type: 'image_file'; } @@ -99,20 +99,20 @@ export namespace MessageContentImageFile { export interface ImageFile { /** * The [File](https://platform.openai.com/docs/api-reference/files) ID of the image - * in the Message content. + * in the message content. */ file_id: string; } } /** - * The text content that is part of a Message. + * The text content that is part of a message. */ export interface MessageContentText { text: MessageContentText.Text; /** - * Will always be `text`. + * Always `text`. */ type: 'text'; } @@ -129,8 +129,8 @@ export namespace MessageContentText { export namespace Text { /** - * A citation within the Message that points to a specific quote from a specific - * File associated with the Assistant or the Message. Generated when the Assistant + * A citation within the message that points to a specific quote from a specific + * File associated with the assistant or the message. Generated when the assistant * uses the "retrieval" tool to search files. */ export interface FileCitation { @@ -141,12 +141,12 @@ export namespace MessageContentText { start_index: number; /** - * The text in the Message content that needs to be replaced. + * The text in the message content that needs to be replaced. */ text: string; /** - * Will always be `file_citation`. + * Always `file_citation`. */ type: 'file_citation'; } @@ -159,15 +159,15 @@ export namespace MessageContentText { file_id: string; /** - * The specific quote in the File. + * The specific quote in the file. */ quote: string; } } /** - * A URL for the File that's generated when the Assistant used the - * `code_interpreter` tool to generate a File. + * A URL for the file that's generated when the assistant used the + * `code_interpreter` tool to generate a file. */ export interface FilePath { end_index: number; @@ -177,12 +177,12 @@ export namespace MessageContentText { start_index: number; /** - * The text in the Message content that needs to be replaced. + * The text in the message content that needs to be replaced. */ text: string; /** - * Will always be `file_path`. + * Always `file_path`. */ type: 'file_path'; } @@ -190,7 +190,7 @@ export namespace MessageContentText { export namespace FilePath { export interface FilePath { /** - * The ID of the File that was generated. + * The ID of the file that was generated. */ file_id: string; } @@ -199,8 +199,8 @@ export namespace MessageContentText { } /** - * Represents a Message within a - * [Thread](https://platform.openai.com/docs/api-reference/threads). + * Represents a message within a + * [thread](https://platform.openai.com/docs/api-reference/threads). */ export interface ThreadMessage { /** @@ -210,25 +210,25 @@ export interface ThreadMessage { /** * If applicable, the ID of the - * [Assistant](https://platform.openai.com/docs/api-reference/assistants) that - * authored this Message. + * [assistant](https://platform.openai.com/docs/api-reference/assistants) that + * authored this message. */ assistant_id: string | null; /** - * The content of the Message in array of text and/or images. + * The content of the message in array of text and/or images. */ content: Array; /** - * The Unix timestamp (in seconds) for when the Message was created. + * The Unix timestamp (in seconds) for when the message was created. */ created_at: number; /** * A list of [file](https://platform.openai.com/docs/api-reference/files) IDs that - * the Assistant should use. Useful for tools like retrieval and code_interpreter - * that can access files. A maximum of 10 files can be attached to a Message. + * the assistant should use. Useful for tools like retrieval and code_interpreter + * that can access files. A maximum of 10 files can be attached to a message. */ file_ids: Array; @@ -246,20 +246,20 @@ export interface ThreadMessage { object: 'thread.message'; /** - * The entity that produced the Message. One of `user` or `assistant`. + * The entity that produced the message. One of `user` or `assistant`. */ role: 'user' | 'assistant'; /** * If applicable, the ID of the - * [Run](https://platform.openai.com/docs/api-reference/runs) associated with the - * authoring of this Message. + * [run](https://platform.openai.com/docs/api-reference/runs) associated with the + * authoring of this message. */ run_id: string | null; /** - * The [Thread](https://platform.openai.com/docs/api-reference/threads) ID that - * this Message belongs to. + * The [thread](https://platform.openai.com/docs/api-reference/threads) ID that + * this message belongs to. */ thread_id: string; } @@ -274,20 +274,20 @@ export interface ThreadMessageDeleted { export interface MessageCreateParams { /** - * The content of the Message. + * The content of the message. */ content: string; /** - * The role of the entity that is creating the Message. Currently only `user` is + * The role of the entity that is creating the message. Currently only `user` is * supported. */ role: 'user'; /** * A list of [File](https://platform.openai.com/docs/api-reference/files) IDs that - * the Message should use. There can be a maximum of 10 files attached to a - * Message. Useful for tools like `retrieval` and `code_interpreter` that can + * the message should use. There can be a maximum of 10 files attached to a + * message. Useful for tools like `retrieval` and `code_interpreter` that can * access and use files. */ file_ids?: Array; diff --git a/src/resources/beta/threads/runs/runs.ts b/src/resources/beta/threads/runs/runs.ts index e81b09a90..ffbd287bf 100644 --- a/src/resources/beta/threads/runs/runs.ts +++ b/src/resources/beta/threads/runs/runs.ts @@ -11,7 +11,7 @@ export class Runs extends APIResource { steps: StepsAPI.Steps = new StepsAPI.Steps(this.client); /** - * Create a Run. + * Create a run. */ create(threadId: string, body: RunCreateParams, options?: Core.RequestOptions): Core.APIPromise { return this.post(`/threads/${threadId}/runs`, { @@ -22,7 +22,7 @@ export class Runs extends APIResource { } /** - * Retrieves a Run. + * Retrieves a run. */ retrieve(threadId: string, runId: string, options?: Core.RequestOptions): Core.APIPromise { return this.get(`/threads/${threadId}/runs/${runId}`, { @@ -32,7 +32,7 @@ export class Runs extends APIResource { } /** - * Modifies a Run. + * Modifies a run. */ update( threadId: string, @@ -48,7 +48,7 @@ export class Runs extends APIResource { } /** - * Returns a list of Runs belonging to a Thread. + * Returns a list of runs belonging to a thread. */ list( threadId: string, @@ -72,7 +72,7 @@ export class Runs extends APIResource { } /** - * Cancels a Run that is `in_progress`. + * Cancels a run that is `in_progress`. */ cancel(threadId: string, runId: string, options?: Core.RequestOptions): Core.APIPromise { return this.post(`/threads/${threadId}/runs/${runId}/cancel`, { @@ -82,7 +82,7 @@ export class Runs extends APIResource { } /** - * When a Run has the `status: "requires_action"` and `required_action.type` is + * When a run has the `status: "requires_action"` and `required_action.type` is * `submit_tool_outputs`, this endpoint can be used to submit the outputs from the * tool calls once they're all completed. All outputs must be submitted in a single * request. @@ -110,7 +110,7 @@ export interface RequiredActionFunctionToolCall { /** * The ID of the tool call. This ID must be referenced when you submit the tool * outputs in using the - * [Submit tool outputs to Run](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) + * [Submit tool outputs to run](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) * endpoint. */ id: string; @@ -145,8 +145,8 @@ export namespace RequiredActionFunctionToolCall { } /** - * Represents an execution Run on a - * [Thread](https://platform.openai.com/docs/api-reference/threads). + * Represents an execution run on a + * [thread](https://platform.openai.com/docs/api-reference/threads). */ export interface Run { /** @@ -156,52 +156,52 @@ export interface Run { /** * The ID of the - * [Assistant](https://platform.openai.com/docs/api-reference/assistants) used for - * execution of this Run. + * [assistant](https://platform.openai.com/docs/api-reference/assistants) used for + * execution of this run. */ assistant_id: string; /** - * The Unix timestamp (in seconds) for when the Run was cancelled. + * The Unix timestamp (in seconds) for when the run was cancelled. */ cancelled_at: number | null; /** - * The Unix timestamp (in seconds) for when the Run was completed. + * The Unix timestamp (in seconds) for when the run was completed. */ completed_at: number | null; /** - * The Unix timestamp (in seconds) for when the Run was created. + * The Unix timestamp (in seconds) for when the run was created. */ created_at: number; /** - * The Unix timestamp (in seconds) for when the Run will expire. + * The Unix timestamp (in seconds) for when the run will expire. */ expires_at: number; /** - * The Unix timestamp (in seconds) for when the Run failed. + * The Unix timestamp (in seconds) for when the run failed. */ failed_at: number | null; /** * The list of [File](https://platform.openai.com/docs/api-reference/files) IDs the - * [Assistant](https://platform.openai.com/docs/api-reference/assistants) used for - * this Run. + * [assistant](https://platform.openai.com/docs/api-reference/assistants) used for + * this run. */ file_ids: Array; /** * The instructions that the - * [Assistant](https://platform.openai.com/docs/api-reference/assistants) used for + * [assistant](https://platform.openai.com/docs/api-reference/assistants) used for * this run. */ instructions: string; /** - * The last error associated with this Run. Will be `null` if there are no errors. + * The last error associated with this run. Will be `null` if there are no errors. */ last_error: Run.LastError | null; @@ -215,8 +215,8 @@ export interface Run { /** * The model that the - * [Assistant](https://platform.openai.com/docs/api-reference/assistants) used for - * this Run. + * [assistant](https://platform.openai.com/docs/api-reference/assistants) used for + * this run. */ model: string; @@ -226,13 +226,13 @@ export interface Run { object: 'assistant.run'; /** - * Details on the action required to continue the Run. Will be `null` if no action + * Details on the action required to continue the run. Will be `null` if no action * is required. */ required_action: Run.RequiredAction | null; /** - * The Unix timestamp (in seconds) for when the Run was started. + * The Unix timestamp (in seconds) for when the run was started. */ started_at: number | null; @@ -252,22 +252,22 @@ export interface Run { | 'expired'; /** - * The ID of the [Thread](https://platform.openai.com/docs/api-reference/threads) - * that was executed on as a part of this Run. + * The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) + * that was executed on as a part of this run. */ thread_id: string; /** * The list of tools that the - * [Assistant](https://platform.openai.com/docs/api-reference/assistants) used for - * this Run. + * [assistant](https://platform.openai.com/docs/api-reference/assistants) used for + * this run. */ tools: Array; } export namespace Run { /** - * The last error associated with this Run. Will be `null` if there are no errors. + * The last error associated with this run. Will be `null` if there are no errors. */ export interface LastError { /** @@ -282,12 +282,12 @@ export namespace Run { } /** - * Details on the action required to continue the Run. Will be `null` if no action + * Details on the action required to continue the run. Will be `null` if no action * is required. */ export interface RequiredAction { /** - * Details on the tool outputs needed for this Run to continue. + * Details on the tool outputs needed for this run to continue. */ submit_tool_outputs: RequiredAction.SubmitToolOutputs; @@ -299,7 +299,7 @@ export namespace Run { export namespace RequiredAction { /** - * Details on the tool outputs needed for this Run to continue. + * Details on the tool outputs needed for this run to continue. */ export interface SubmitToolOutputs { /** @@ -370,13 +370,13 @@ export namespace Run { export interface RunCreateParams { /** * The ID of the - * [Assistant](https://platform.openai.com/docs/api-reference/assistants) to use to - * execute this Run. + * [assistant](https://platform.openai.com/docs/api-reference/assistants) to use to + * execute this run. */ assistant_id: string; /** - * Override the default system message of the Assistant. This is useful for + * Override the default system message of the assistant. This is useful for * modifying the behavior on a per-run basis. */ instructions?: string | null; @@ -391,14 +391,14 @@ export interface RunCreateParams { /** * The ID of the [Model](https://platform.openai.com/docs/api-reference/models) to - * be used to execute this Run. If a value is provided here, it will override the - * model associated with the Assistant. If not, the model associated with the - * Assistant will be used. + * be used to execute this run. If a value is provided here, it will override the + * model associated with the assistant. If not, the model associated with the + * assistant will be used. */ model?: string | null; /** - * Override the tools the Assistant can use for this Run. This is useful for + * Override the tools the assistant can use for this run. This is useful for * modifying the behavior on a per-run basis. */ tools?: Array< @@ -503,12 +503,12 @@ export interface RunSubmitToolOutputsParams { export namespace RunSubmitToolOutputsParams { export interface ToolOutput { /** - * The output of the tool call to be submitted to continue the Run. + * The output of the tool call to be submitted to continue the run. */ output?: string; /** - * The ID of the tool call in the `required_action` object within the Run object + * The ID of the tool call in the `required_action` object within the run object * the output is being submitted for. */ tool_call_id?: string; diff --git a/src/resources/beta/threads/runs/steps.ts b/src/resources/beta/threads/runs/steps.ts index 94745f875..6819aa269 100644 --- a/src/resources/beta/threads/runs/steps.ts +++ b/src/resources/beta/threads/runs/steps.ts @@ -8,7 +8,7 @@ import { CursorPage, type CursorPageParams } from 'openai/pagination'; export class Steps extends APIResource { /** - * Retrieves a Run Step. + * Retrieves a run step. */ retrieve( threadId: string, @@ -23,7 +23,7 @@ export class Steps extends APIResource { } /** - * Returns a list of Run Steps belonging to a Run. + * Returns a list of run steps belonging to a run. */ list( threadId: string, @@ -56,7 +56,7 @@ export class Steps extends APIResource { export class RunStepsPage extends CursorPage {} /** - * Details of the Code Interpreter tool call the Run Step was involved in. + * Details of the Code Interpreter tool call the run step was involved in. */ export interface CodeToolCall { /** @@ -65,7 +65,7 @@ export interface CodeToolCall { id: string; /** - * The code interpreter tool call definition. + * The Code Interpreter tool call definition. */ code_interpreter: CodeToolCall.CodeInterpreter; @@ -78,7 +78,7 @@ export interface CodeToolCall { export namespace CodeToolCall { /** - * The code interpreter tool call definition. + * The Code Interpreter tool call definition. */ export interface CodeInterpreter { /** @@ -96,7 +96,7 @@ export namespace CodeToolCall { export namespace CodeInterpreter { /** - * Text output from the Code Interpreter tool call as part of a Run Step. + * Text output from the Code Interpreter tool call as part of a run step. */ export interface Logs { /** @@ -105,7 +105,7 @@ export namespace CodeToolCall { logs: string; /** - * Will always be `logs`. + * Always `logs`. */ type: 'logs'; } @@ -114,7 +114,7 @@ export namespace CodeToolCall { image: Image.Image; /** - * Will always be `image`. + * Always `image`. */ type: 'image'; } @@ -122,7 +122,7 @@ export namespace CodeToolCall { export namespace Image { export interface Image { /** - * The [File](https://platform.openai.com/docs/api-reference/files) ID of the + * The [file](https://platform.openai.com/docs/api-reference/files) ID of the * image. */ file_id: string; @@ -174,13 +174,13 @@ export namespace FunctionToolCall { } /** - * Details of the Message creation activity that the Run Step was involved in. + * Details of the message creation by the run step. */ export interface MessageCreationStepDetails { message_creation: MessageCreationStepDetails.MessageCreation; /** - * Will always be `message_creation``. + * Always `message_creation``. */ type: 'message_creation'; } @@ -188,7 +188,7 @@ export interface MessageCreationStepDetails { export namespace MessageCreationStepDetails { export interface MessageCreation { /** - * The ID of the Message that was created by this Run Step. + * The ID of the message that was created by this run step. */ message_id: string; } @@ -213,7 +213,7 @@ export interface RetrievalToolCall { } /** - * Represents a Step in execution of a Run. + * Represents a step in execution of a run. */ export interface RunStep { /** @@ -223,39 +223,39 @@ export interface RunStep { /** * The ID of the - * [Assistant](https://platform.openai.com/docs/api-reference/assistants) - * associated with the Run Step. + * [assistant](https://platform.openai.com/docs/api-reference/assistants) + * associated with the run step. */ assistant_id: string; /** - * The Unix timestamp (in seconds) for when the Run Step was cancelled. + * The Unix timestamp (in seconds) for when the run step was cancelled. */ cancelled_at: number | null; /** - * The Unix timestamp (in seconds) for when the Run Step was completed. + * The Unix timestamp (in seconds) for when the run step completed. */ completed_at: number | null; /** - * The Unix timestamp (in seconds) for when the Run Step was created. + * The Unix timestamp (in seconds) for when the run step was created. */ created_at: number; /** - * The Unix timestamp (in seconds) for when the Run Step expired. A step is - * considered expired if the parent Run is expired. + * The Unix timestamp (in seconds) for when the run step expired. A step is + * considered expired if the parent run is expired. */ expired_at: number | null; /** - * The Unix timestamp (in seconds) for when the Run Step failed. + * The Unix timestamp (in seconds) for when the run step failed. */ failed_at: number | null; /** - * The last error associated with this Run Step. Will be `null` if there are no + * The last error associated with this run step. Will be `null` if there are no * errors. */ last_error: RunStep.LastError | null; @@ -274,8 +274,8 @@ export interface RunStep { object: 'assistant.run.step'; /** - * The ID of the [Run](https://platform.openai.com/docs/api-reference/runs) that - * this Run Step is a part of. + * The ID of the [run](https://platform.openai.com/docs/api-reference/runs) that + * this run step is a part of. */ run_id: string; @@ -286,25 +286,25 @@ export interface RunStep { status: 'in_progress' | 'cancelled' | 'failed' | 'completed' | 'expired'; /** - * The details of the activity the Run Step was involved in. + * The details of the run step. */ step_details: MessageCreationStepDetails | ToolCallsStepDetails; /** - * The ID of the [Thread](https://platform.openai.com/docs/api-reference/threads) - * that was Run. + * The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) + * that was run. */ thread_id: string; /** - * The type of Run Step, which can be either `message_creation` or `tool_calls`. + * The type of run step, which can be either `message_creation` or `tool_calls`. */ type: 'message_creation' | 'tool_calls'; } export namespace RunStep { /** - * The last error associated with this Run Step. Will be `null` if there are no + * The last error associated with this run step. Will be `null` if there are no * errors. */ export interface LastError { @@ -321,18 +321,18 @@ export namespace RunStep { } /** - * Details of the Tool Call activity that the Run Step was involved in. + * Details of the tool call. */ export interface ToolCallsStepDetails { /** - * An array of tool calls the Run Step was involved in. These can be associated + * An array of tool calls the run step was involved in. These can be associated * with one of three types of tools: `code_interpreter`, `retrieval`, or * `function`. */ tool_calls: Array; /** - * Will always be `tool_calls`. + * Always `tool_calls`. */ type: 'tool_calls'; } diff --git a/src/resources/beta/threads/threads.ts b/src/resources/beta/threads/threads.ts index cb49cd230..5bf84ee1f 100644 --- a/src/resources/beta/threads/threads.ts +++ b/src/resources/beta/threads/threads.ts @@ -11,7 +11,7 @@ export class Threads extends APIResource { messages: MessagesAPI.Messages = new MessagesAPI.Messages(this.client); /** - * Create a Thread. + * Create a thread. */ create(body: ThreadCreateParams, options?: Core.RequestOptions): Core.APIPromise { return this.post('/threads', { @@ -22,7 +22,7 @@ export class Threads extends APIResource { } /** - * Retrieves a Thread. + * Retrieves a thread. */ retrieve(threadId: string, options?: Core.RequestOptions): Core.APIPromise { return this.get(`/threads/${threadId}`, { @@ -32,7 +32,7 @@ export class Threads extends APIResource { } /** - * Modifies a Thread. + * Modifies a thread. */ update(threadId: string, body: ThreadUpdateParams, options?: Core.RequestOptions): Core.APIPromise { return this.post(`/threads/${threadId}`, { @@ -43,7 +43,7 @@ export class Threads extends APIResource { } /** - * Delete a Thread. + * Delete a thread. */ del(threadId: string, options?: Core.RequestOptions): Core.APIPromise { return this.delete(`/threads/${threadId}`, { @@ -53,7 +53,7 @@ export class Threads extends APIResource { } /** - * Create a Thread and Run it in one request. + * Create a thread and run it in one request. */ createAndRun(body: ThreadCreateAndRunParams, options?: Core.RequestOptions): Core.APIPromise { return this.post('/threads/runs', { @@ -65,8 +65,8 @@ export class Threads extends APIResource { } /** - * Represents a Thread that contains - * [Messages](https://platform.openai.com/docs/api-reference/messages). + * Represents a thread that contains + * [messages](https://platform.openai.com/docs/api-reference/messages). */ export interface Thread { /** @@ -75,7 +75,7 @@ export interface Thread { id: string; /** - * The Unix timestamp (in seconds) for when the Thread was created. + * The Unix timestamp (in seconds) for when the thread was created. */ created_at: number; @@ -103,8 +103,8 @@ export interface ThreadDeleted { export interface ThreadCreateParams { /** - * A list of [Messages](https://platform.openai.com/docs/api-reference/messages) to - * start the Thread with. + * A list of [messages](https://platform.openai.com/docs/api-reference/messages) to + * start the thread with. */ messages?: Array; @@ -120,20 +120,20 @@ export interface ThreadCreateParams { export namespace ThreadCreateParams { export interface Message { /** - * The content of the Message. + * The content of the message. */ content: string; /** - * The role of the entity that is creating the Message. Currently only `user` is + * The role of the entity that is creating the message. Currently only `user` is * supported. */ role: 'user'; /** * A list of [File](https://platform.openai.com/docs/api-reference/files) IDs that - * the Message should use. There can be a maximum of 10 files attached to a - * Message. Useful for tools like `retrieval` and `code_interpreter` that can + * the message should use. There can be a maximum of 10 files attached to a + * message. Useful for tools like `retrieval` and `code_interpreter` that can * access and use files. */ file_ids?: Array; @@ -161,13 +161,13 @@ export interface ThreadUpdateParams { export interface ThreadCreateAndRunParams { /** * The ID of the - * [Assistant](https://platform.openai.com/docs/api-reference/assistants) to use to - * execute this Run. + * [assistant](https://platform.openai.com/docs/api-reference/assistants) to use to + * execute this run. */ assistant_id: string; /** - * Override the default system message of the Assistant. This is useful for + * Override the default system message of the assistant. This is useful for * modifying the behavior on a per-run basis. */ instructions?: string | null; @@ -182,19 +182,19 @@ export interface ThreadCreateAndRunParams { /** * The ID of the [Model](https://platform.openai.com/docs/api-reference/models) to - * be used to execute this Run. If a value is provided here, it will override the - * model associated with the Assistant. If not, the model associated with the - * Assistant will be used. + * be used to execute this run. If a value is provided here, it will override the + * model associated with the assistant. If not, the model associated with the + * assistant will be used. */ model?: string | null; /** - * If no Thread is provided, an empty Thread will be created. + * If no thread is provided, an empty thread will be created. */ thread?: ThreadCreateAndRunParams.Thread; /** - * Override the tools the Assistant can use for this Run. This is useful for + * Override the tools the assistant can use for this run. This is useful for * modifying the behavior on a per-run basis. */ tools?: Array< @@ -206,12 +206,12 @@ export interface ThreadCreateAndRunParams { export namespace ThreadCreateAndRunParams { /** - * If no Thread is provided, an empty Thread will be created. + * If no thread is provided, an empty thread will be created. */ export interface Thread { /** - * A list of [Messages](https://platform.openai.com/docs/api-reference/messages) to - * start the Thread with. + * A list of [messages](https://platform.openai.com/docs/api-reference/messages) to + * start the thread with. */ messages?: Array; @@ -227,20 +227,20 @@ export namespace ThreadCreateAndRunParams { export namespace Thread { export interface Message { /** - * The content of the Message. + * The content of the message. */ content: string; /** - * The role of the entity that is creating the Message. Currently only `user` is + * The role of the entity that is creating the message. Currently only `user` is * supported. */ role: 'user'; /** * A list of [File](https://platform.openai.com/docs/api-reference/files) IDs that - * the Message should use. There can be a maximum of 10 files attached to a - * Message. Useful for tools like `retrieval` and `code_interpreter` that can + * the message should use. There can be a maximum of 10 files attached to a + * message. Useful for tools like `retrieval` and `code_interpreter` that can * access and use files. */ file_ids?: Array; diff --git a/src/resources/files.ts b/src/resources/files.ts index 52eb39b7c..78acc40ed 100644 --- a/src/resources/files.ts +++ b/src/resources/files.ts @@ -112,7 +112,7 @@ export interface FileDeleted { */ export interface FileObject { /** - * The File identifier, which can be referenced in the API endpoints. + * The file identifier, which can be referenced in the API endpoints. */ id: string; @@ -122,12 +122,12 @@ export interface FileObject { bytes: number; /** - * The Unix timestamp (in seconds) for when the File was created. + * The Unix timestamp (in seconds) for when the file was created. */ created_at: number; /** - * The name of the File. + * The name of the file. */ filename: string; @@ -137,13 +137,13 @@ export interface FileObject { object: 'file'; /** - * The intended purpose of the File. Supported values are `fine-tune`, + * The intended purpose of the file. Supported values are `fine-tune`, * `fine-tune-results`, `assistants`, and `assistants_output`. */ purpose: 'fine-tune' | 'fine-tune-results' | 'assistants' | 'assistants_output'; /** - * Deprecated. The current status of the File, which can be either `uploaded`, + * Deprecated. The current status of the file, which can be either `uploaded`, * `processed`, or `error`. */ status: 'uploaded' | 'processed' | 'error';