Share via


AgentsOperations interface

Agents Interface Contains operations for creating, listing, updating, and deleting agents, threads, runs, messages, and files.

Properties

cancelRun

Cancels a run of an in progress thread.

cancelVectorStoreFileBatch

Cancel a vector store file batch. This attempts to cancel the processing of files in this batch as soon as possible.

createAgent

Creates a new agent.

createMessage

Creates a new message on a specified thread.

createRun

Creates and starts a new run of the specified thread using the specified agent.

createThread

Creates a new thread. Threads contain messages and can be run by agents.

createThreadAndRun

Creates a new thread and immediately starts a run of that thread.

createVectorStore

Creates a vector store.

createVectorStoreAndPoll

Create vector store and poll.

createVectorStoreFile

Create a vector store file by attching a file to a vector store.

createVectorStoreFileAndPoll

Create a vector store file by attaching a file to a vector store and poll.

createVectorStoreFileBatch

Create a vector store file batch.

createVectorStoreFileBatchAndPoll

Create a vector store file batch and poll.

deleteAgent

Deletes an agent.

deleteFile

Delete a previously uploaded file.

deleteThread

Deletes an existing thread.

deleteVectorStore

Deletes the vector store object matching the specified ID.

deleteVectorStoreFile

Delete a vector store file. This will remove the file from the vector store but the file itself will not be deleted. To delete the file, use the delete file endpoint.

getAgent

Retrieves an existing agent.

getFile

Returns information about a specific file. Does not retrieve file content.

getFileContent

Returns the content of a specific file.

getRun

Gets an existing run from an existing thread.

getRunStep

Gets a single run step from a thread run.

getThread

Gets information about an existing thread.

getVectorStore

Returns the vector store object object matching the specific ID.

getVectorStoreFile

Retrieves a vector store file.

getVectorStoreFileBatch

Retrieve a vector store file batch.

listAgents

Gets a list of agents that were previously created.

listFiles

Gets a list of previously uploaded files.

listMessages

Gets a list of messages that exist on a thread.

listRuns

Gets a list of runs for a specified thread.

listRunSteps

Gets a list of run steps from a thread run.

listThreads

Gets a list of threads that were previously created.

listVectorStoreFileBatchFiles

Returns a list of vector store files in a batch.

listVectorStoreFiles

Returns a list of vector store files.

listVectorStores

Returns a list of vector stores.

modifyVectorStore

The ID of the vector store to modify.

submitToolOutputsToRun

Submits outputs from tools as requested by tool calls in a run. Runs that need submitted tool outputs will have a status of 'requires_action' with a required_action.type of 'submit_tool_outputs'.

updateAgent

Modifies an existing agent.

updateMessage

Modifies an existing message on an existing thread.

updateRun

Modifies an existing thread run.

updateThread

Modifies an existing thread.

uploadFile

Uploads a file for use by other operations.

uploadFileAndPoll

Uploads a file for use by other operations.

Property Details

cancelRun

Cancels a run of an in progress thread.

cancelRun: (threadId: string, runId: string, options?: CancelRunOptionalParams) => Promise<ThreadRunOutput>

Property Value

(threadId: string, runId: string, options?: CancelRunOptionalParams) => Promise<ThreadRunOutput>

cancelVectorStoreFileBatch

Cancel a vector store file batch. This attempts to cancel the processing of files in this batch as soon as possible.

cancelVectorStoreFileBatch: (vectorStoreId: string, batchId: string, options?: CancelVectorStoreFileBatchOptionalParams) => Promise<VectorStoreFileBatchOutput>

Property Value

(vectorStoreId: string, batchId: string, options?: CancelVectorStoreFileBatchOptionalParams) => Promise<VectorStoreFileBatchOutput>

createAgent

Creates a new agent.

createAgent: (model: string, options?: CreateAgentOptionalParams) => Promise<AgentOutput>

Property Value

(model: string, options?: CreateAgentOptionalParams) => Promise<AgentOutput>

createMessage

Creates a new message on a specified thread.

createMessage: (threadId: string, messageOptions: ThreadMessageOptions, options?: CreateMessageOptionalParams) => Promise<ThreadMessageOutput>

Property Value

(threadId: string, messageOptions: ThreadMessageOptions, options?: CreateMessageOptionalParams) => Promise<ThreadMessageOutput>

createRun

Creates and starts a new run of the specified thread using the specified agent.

createRun: (threadId: string, assistantId: string, options?: CreateRunOptionalParams) => AgentRunResponse

Property Value

(threadId: string, assistantId: string, options?: CreateRunOptionalParams) => AgentRunResponse

createThread

Creates a new thread. Threads contain messages and can be run by agents.

createThread: (options?: CreateAgentThreadOptionalParams) => Promise<AgentThreadOutput>

Property Value

(options?: CreateAgentThreadOptionalParams) => Promise<AgentThreadOutput>

createThreadAndRun

Creates a new thread and immediately starts a run of that thread.

createThreadAndRun: (assistantId: string, options?: CreateAndRunThreadOptionalParams) => AgentRunResponse

Property Value

(assistantId: string, options?: CreateAndRunThreadOptionalParams) => AgentRunResponse

createVectorStore

Creates a vector store.

createVectorStore: (options?: CreateVectorStoreOptionalParams) => PollerLike<OperationState<VectorStoreOutput>, VectorStoreOutput>

Property Value

(options?: CreateVectorStoreOptionalParams) => PollerLike<OperationState<VectorStoreOutput>, VectorStoreOutput>

createVectorStoreAndPoll

Create vector store and poll.

createVectorStoreAndPoll: (options?: CreateVectorStoreOptionalParams) => PollerLike<OperationState<VectorStoreOutput>, VectorStoreOutput>

Property Value

(options?: CreateVectorStoreOptionalParams) => PollerLike<OperationState<VectorStoreOutput>, VectorStoreOutput>

createVectorStoreFile

Create a vector store file by attching a file to a vector store.

createVectorStoreFile: (vectorStoreId: string, options?: CreateVectorStoreFileOptionalParams) => PollerLike<OperationState<VectorStoreFileOutput>, VectorStoreFileOutput>

Property Value

(vectorStoreId: string, options?: CreateVectorStoreFileOptionalParams) => PollerLike<OperationState<VectorStoreFileOutput>, VectorStoreFileOutput>

createVectorStoreFileAndPoll

Create a vector store file by attaching a file to a vector store and poll.

createVectorStoreFileAndPoll: (vectorStoreId: string, options?: CreateVectorStoreFileOptionalParams) => PollerLike<OperationState<VectorStoreFileOutput>, VectorStoreFileOutput>

Property Value

(vectorStoreId: string, options?: CreateVectorStoreFileOptionalParams) => PollerLike<OperationState<VectorStoreFileOutput>, VectorStoreFileOutput>

createVectorStoreFileBatch

Create a vector store file batch.

createVectorStoreFileBatch: (vectorStoreId: string, options?: CreateVectorStoreFileBatchOptionalParams) => PollerLike<OperationState<VectorStoreFileBatchOutput>, VectorStoreFileBatchOutput>

Property Value

(vectorStoreId: string, options?: CreateVectorStoreFileBatchOptionalParams) => PollerLike<OperationState<VectorStoreFileBatchOutput>, VectorStoreFileBatchOutput>

createVectorStoreFileBatchAndPoll

Create a vector store file batch and poll.

createVectorStoreFileBatchAndPoll: (vectorStoreId: string, options?: CreateVectorStoreFileBatchOptionalParams) => PollerLike<OperationState<VectorStoreFileBatchOutput>, VectorStoreFileBatchOutput>

Property Value

(vectorStoreId: string, options?: CreateVectorStoreFileBatchOptionalParams) => PollerLike<OperationState<VectorStoreFileBatchOutput>, VectorStoreFileBatchOutput>

deleteAgent

Deletes an agent.

deleteAgent: (assistantId: string, options?: DeleteAgentOptionalParams) => Promise<AgentDeletionStatusOutput>

Property Value

(assistantId: string, options?: DeleteAgentOptionalParams) => Promise<AgentDeletionStatusOutput>

deleteFile

Delete a previously uploaded file.

deleteFile: (fileId: string, options?: DeleteFileOptionalParams) => Promise<FileDeletionStatusOutput>

Property Value

(fileId: string, options?: DeleteFileOptionalParams) => Promise<FileDeletionStatusOutput>

deleteThread

Deletes an existing thread.

deleteThread: (threadId: string, options?: DeleteAgentThreadOptionalParams) => Promise<ThreadDeletionStatusOutput>

Property Value

(threadId: string, options?: DeleteAgentThreadOptionalParams) => Promise<ThreadDeletionStatusOutput>

deleteVectorStore

Deletes the vector store object matching the specified ID.

deleteVectorStore: (vectorStoreId: string, options?: DeleteVectorStoreOptionalParams) => Promise<VectorStoreDeletionStatusOutput>

Property Value

(vectorStoreId: string, options?: DeleteVectorStoreOptionalParams) => Promise<VectorStoreDeletionStatusOutput>

deleteVectorStoreFile

Delete a vector store file. This will remove the file from the vector store but the file itself will not be deleted. To delete the file, use the delete file endpoint.

deleteVectorStoreFile: (vectorStoreId: string, fileId: string, options?: DeleteVectorStoreFileOptionalParams) => Promise<VectorStoreFileDeletionStatusOutput>

Property Value

(vectorStoreId: string, fileId: string, options?: DeleteVectorStoreFileOptionalParams) => Promise<VectorStoreFileDeletionStatusOutput>

getAgent

Retrieves an existing agent.

getAgent: (assistantId: string, options?: GetAgentOptionalParams) => Promise<AgentOutput>

Property Value

(assistantId: string, options?: GetAgentOptionalParams) => Promise<AgentOutput>

getFile

Returns information about a specific file. Does not retrieve file content.

getFile: (fileId: string, options?: GetFileOptionalParams) => Promise<OpenAIFileOutput>

Property Value

(fileId: string, options?: GetFileOptionalParams) => Promise<OpenAIFileOutput>

getFileContent

Returns the content of a specific file.

getFileContent: (fileId: string, options?: GetFileContentOptionalParams) => StreamableMethod<string | Uint8Array>

Property Value

(fileId: string, options?: GetFileContentOptionalParams) => StreamableMethod<string | Uint8Array>

getRun

Gets an existing run from an existing thread.

getRun: (threadId: string, runId: string, options?: GetRunOptionalParams) => Promise<ThreadRunOutput>

Property Value

(threadId: string, runId: string, options?: GetRunOptionalParams) => Promise<ThreadRunOutput>

getRunStep

Gets a single run step from a thread run.

getRunStep: (threadId: string, runId: string, stepId: string, options?: GetRunStepOptionalParams) => Promise<RunStepOutput>

Property Value

(threadId: string, runId: string, stepId: string, options?: GetRunStepOptionalParams) => Promise<RunStepOutput>

getThread

Gets information about an existing thread.

getThread: (threadId: string, options?: GetAgentThreadOptionalParams) => Promise<AgentThreadOutput>

Property Value

(threadId: string, options?: GetAgentThreadOptionalParams) => Promise<AgentThreadOutput>

getVectorStore

Returns the vector store object object matching the specific ID.

getVectorStore: (vectorStoreId: string, options?: DeleteVectorStoreOptionalParams) => Promise<VectorStoreOutput>

Property Value

(vectorStoreId: string, options?: DeleteVectorStoreOptionalParams) => Promise<VectorStoreOutput>

getVectorStoreFile

Retrieves a vector store file.

getVectorStoreFile: (vectorStoreId: string, fileId: string, options?: GetVectorStoreFileOptionalParams) => Promise<VectorStoreFileOutput>

Property Value

(vectorStoreId: string, fileId: string, options?: GetVectorStoreFileOptionalParams) => Promise<VectorStoreFileOutput>

getVectorStoreFileBatch

Retrieve a vector store file batch.

getVectorStoreFileBatch: (vectorStoreId: string, batchId: string, options?: GetVectorStoreFileBatchOptionalParams) => Promise<VectorStoreFileBatchOutput>

Property Value

(vectorStoreId: string, batchId: string, options?: GetVectorStoreFileBatchOptionalParams) => Promise<VectorStoreFileBatchOutput>

listAgents

Gets a list of agents that were previously created.

listAgents: (options?: ListAgentsOptionalParams) => Promise<OpenAIPageableListOfAgentOutput>

Property Value

(options?: ListAgentsOptionalParams) => Promise<OpenAIPageableListOfAgentOutput>

listFiles

Gets a list of previously uploaded files.

listFiles: (options?: ListFilesOptionalParams) => Promise<FileListResponseOutput>

Property Value

(options?: ListFilesOptionalParams) => Promise<FileListResponseOutput>

listMessages

Gets a list of messages that exist on a thread.

listMessages: (threadId: string, options?: ListMessagesOptionalParams) => Promise<OpenAIPageableListOfThreadMessageOutput>

Property Value

(threadId: string, options?: ListMessagesOptionalParams) => Promise<OpenAIPageableListOfThreadMessageOutput>

listRuns

Gets a list of runs for a specified thread.

listRuns: (threadId: string, options?: ListRunQueryOptionalParams) => Promise<OpenAIPageableListOfThreadRunOutput>

Property Value

(threadId: string, options?: ListRunQueryOptionalParams) => Promise<OpenAIPageableListOfThreadRunOutput>

listRunSteps

Gets a list of run steps from a thread run.

listRunSteps: (threadId: string, runId: string, options?: ListRunQueryOptionalParams) => Promise<OpenAIPageableListOfRunStepOutput>

Property Value

(threadId: string, runId: string, options?: ListRunQueryOptionalParams) => Promise<OpenAIPageableListOfRunStepOutput>

listThreads

Gets a list of threads that were previously created.

listThreads: (options?: ListAgentThreadOptionalParams) => Promise<OpenAIPageableListOfAgentThreadOutput>

Property Value

(options?: ListAgentThreadOptionalParams) => Promise<OpenAIPageableListOfAgentThreadOutput>

listVectorStoreFileBatchFiles

Returns a list of vector store files in a batch.

listVectorStoreFileBatchFiles: (vectorStoreId: string, batchId: string, options?: ListVectorStoreFileBatchFilesOptionalParams) => Promise<OpenAIPageableListOfVectorStoreFileOutput>

Property Value

(vectorStoreId: string, batchId: string, options?: ListVectorStoreFileBatchFilesOptionalParams) => Promise<OpenAIPageableListOfVectorStoreFileOutput>

listVectorStoreFiles

Returns a list of vector store files.

listVectorStoreFiles: (vectorStoreId: string, options?: ListVectorStoreFilesOptionalParams) => Promise<OpenAIPageableListOfVectorStoreFileOutput>

Property Value

(vectorStoreId: string, options?: ListVectorStoreFilesOptionalParams) => Promise<OpenAIPageableListOfVectorStoreFileOutput>

listVectorStores

Returns a list of vector stores.

listVectorStores: (options?: DeleteVectorStoreOptionalParams) => Promise<OpenAIPageableListOfVectorStoreOutput>

Property Value

(options?: DeleteVectorStoreOptionalParams) => Promise<OpenAIPageableListOfVectorStoreOutput>

modifyVectorStore

The ID of the vector store to modify.

modifyVectorStore: (vectorStoreId: string, options?: UpdateVectorStoreOptionalParams) => Promise<VectorStoreOutput>

Property Value

(vectorStoreId: string, options?: UpdateVectorStoreOptionalParams) => Promise<VectorStoreOutput>

submitToolOutputsToRun

Submits outputs from tools as requested by tool calls in a run. Runs that need submitted tool outputs will have a status of 'requires_action' with a required_action.type of 'submit_tool_outputs'.

submitToolOutputsToRun: (threadId: string, runId: string, toolOutputs: ToolOutput[], options?: SubmitToolOutputsToRunOptionalParams) => AgentRunResponse

Property Value

(threadId: string, runId: string, toolOutputs: ToolOutput[], options?: SubmitToolOutputsToRunOptionalParams) => AgentRunResponse

updateAgent

Modifies an existing agent.

updateAgent: (assistantId: string, options: UpdateAgentOptionalParams) => Promise<AgentOutput>

Property Value

(assistantId: string, options: UpdateAgentOptionalParams) => Promise<AgentOutput>

updateMessage

Modifies an existing message on an existing thread.

updateMessage: (threadId: string, messageId: string, options?: UpdateMessageOptionalParams) => Promise<ThreadMessageOutput>

Property Value

(threadId: string, messageId: string, options?: UpdateMessageOptionalParams) => Promise<ThreadMessageOutput>

updateRun

Modifies an existing thread run.

updateRun: (threadId: string, runId: string, options?: UpdateRunOptionalParams) => Promise<ThreadRunOutput>

Property Value

(threadId: string, runId: string, options?: UpdateRunOptionalParams) => Promise<ThreadRunOutput>

updateThread

Modifies an existing thread.

updateThread: (threadId: string, options?: UpdateAgentThreadOptionalParams) => Promise<AgentThreadOutput>

Property Value

(threadId: string, options?: UpdateAgentThreadOptionalParams) => Promise<AgentThreadOutput>

uploadFile

Uploads a file for use by other operations.

uploadFile: (data: ReadableStream<any> | ReadableStream, purpose: string, options?: UploadFileOptionalParams) => PollerLike<OperationState<OpenAIFileOutput>, OpenAIFileOutput>

Property Value

(data: ReadableStream<any> | ReadableStream, purpose: string, options?: UploadFileOptionalParams) => PollerLike<OperationState<OpenAIFileOutput>, OpenAIFileOutput>

uploadFileAndPoll

Uploads a file for use by other operations.

uploadFileAndPoll: (data: ReadableStream<any> | ReadableStream, purpose: string, options?: UploadFileOptionalParams) => PollerLike<OperationState<OpenAIFileOutput>, OpenAIFileOutput>

Property Value

(data: ReadableStream<any> | ReadableStream, purpose: string, options?: UploadFileOptionalParams) => PollerLike<OperationState<OpenAIFileOutput>, OpenAIFileOutput>