diff --git a/sdk/ai/ai-projects-1dp/src/clientDefinitions.ts b/sdk/ai/ai-projects-1dp/src/clientDefinitions.ts new file mode 100644 index 000000000000..960812be8b88 --- /dev/null +++ b/sdk/ai/ai-projects-1dp/src/clientDefinitions.ts @@ -0,0 +1,852 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { + AssistantsCreateAgentParameters, + AssistantsListAgentsParameters, + AssistantsGetAgentParameters, + AssistantsUpdateAgentParameters, + AssistantsDeleteAgentParameters, + AssistantsCreateThreadParameters, + AssistantsGetThreadParameters, + AssistantsUpdateThreadParameters, + AssistantsDeleteThreadParameters, + AssistantsCreateMessageParameters, + AssistantsListMessagesParameters, + AssistantsGetMessageParameters, + AssistantsUpdateMessageParameters, + AssistantsCreateRunParameters, + AssistantsListRunsParameters, + AssistantsGetRunParameters, + AssistantsUpdateRunParameters, + AssistantsSubmitToolOutputsToRunParameters, + AssistantsCancelRunParameters, + AssistantsCreateThreadAndRunParameters, + AssistantsGetRunStepParameters, + AssistantsListRunStepsParameters, + AssistantsListFilesParameters, + AssistantsUploadFileParameters, + AssistantsDeleteFileParameters, + AssistantsGetFileParameters, + AssistantsGetFileContentParameters, + AssistantsListVectorStoresParameters, + AssistantsCreateVectorStoreParameters, + AssistantsGetVectorStoreParameters, + AssistantsModifyVectorStoreParameters, + AssistantsDeleteVectorStoreParameters, + AssistantsListVectorStoreFilesParameters, + AssistantsCreateVectorStoreFileParameters, + AssistantsGetVectorStoreFileParameters, + AssistantsDeleteVectorStoreFileParameters, + AssistantsCreateVectorStoreFileBatchParameters, + AssistantsGetVectorStoreFileBatchParameters, + AssistantsCancelVectorStoreFileBatchParameters, + AssistantsListVectorStoreFileBatchFilesParameters, + ConnectionsGetParameters, + ConnectionsListParameters, + EvaluationsGetParameters, + EvaluationsListParameters, + EvaluationsCreateRunParameters, + DatasetsListVersionsParameters, + DatasetsCreateParameters, + DatasetsListLatestParameters, + DatasetsGetVersionParameters, + DatasetsDeleteVersionParameters, + DatasetsCreateVersionParameters, + DatasetsStartPendingUploadVersionParameters, + DatasetsStartPendingUploadParameters, + IndexesListVersionsParameters, + IndexesCreateParameters, + IndexesListLatestParameters, + IndexesGetVersionParameters, + IndexesDeleteVersionParameters, + IndexesCreateVersionParameters, + DeploymentsGetParameters, + DeploymentsListParameters, +} from "./parameters.js"; +import type { + AssistantsCreateAgent200Response, + AssistantsCreateAgentDefaultResponse, + AssistantsListAgents200Response, + AssistantsListAgentsDefaultResponse, + AssistantsGetAgent200Response, + AssistantsGetAgentDefaultResponse, + AssistantsUpdateAgent200Response, + AssistantsUpdateAgentDefaultResponse, + AssistantsDeleteAgent200Response, + AssistantsDeleteAgentDefaultResponse, + AssistantsCreateThread200Response, + AssistantsCreateThreadDefaultResponse, + AssistantsGetThread200Response, + AssistantsGetThreadDefaultResponse, + AssistantsUpdateThread200Response, + AssistantsUpdateThreadDefaultResponse, + AssistantsDeleteThread200Response, + AssistantsDeleteThreadDefaultResponse, + AssistantsCreateMessage200Response, + AssistantsCreateMessageDefaultResponse, + AssistantsListMessages200Response, + AssistantsListMessagesDefaultResponse, + AssistantsGetMessage200Response, + AssistantsGetMessageDefaultResponse, + AssistantsUpdateMessage200Response, + AssistantsUpdateMessageDefaultResponse, + AssistantsCreateRun200Response, + AssistantsCreateRunDefaultResponse, + AssistantsListRuns200Response, + AssistantsListRunsDefaultResponse, + AssistantsGetRun200Response, + AssistantsGetRunDefaultResponse, + AssistantsUpdateRun200Response, + AssistantsUpdateRunDefaultResponse, + AssistantsSubmitToolOutputsToRun200Response, + AssistantsSubmitToolOutputsToRunDefaultResponse, + AssistantsCancelRun200Response, + AssistantsCancelRunDefaultResponse, + AssistantsCreateThreadAndRun200Response, + AssistantsCreateThreadAndRunDefaultResponse, + AssistantsGetRunStep200Response, + AssistantsGetRunStepDefaultResponse, + AssistantsListRunSteps200Response, + AssistantsListRunStepsDefaultResponse, + AssistantsListFiles200Response, + AssistantsListFilesDefaultResponse, + AssistantsUploadFile200Response, + AssistantsUploadFileDefaultResponse, + AssistantsDeleteFile200Response, + AssistantsDeleteFileDefaultResponse, + AssistantsGetFile200Response, + AssistantsGetFileDefaultResponse, + AssistantsGetFileContent200Response, + AssistantsGetFileContentDefaultResponse, + AssistantsListVectorStores200Response, + AssistantsListVectorStoresDefaultResponse, + AssistantsCreateVectorStore200Response, + AssistantsCreateVectorStoreDefaultResponse, + AssistantsGetVectorStore200Response, + AssistantsGetVectorStoreDefaultResponse, + AssistantsModifyVectorStore200Response, + AssistantsModifyVectorStoreDefaultResponse, + AssistantsDeleteVectorStore200Response, + AssistantsDeleteVectorStoreDefaultResponse, + AssistantsListVectorStoreFiles200Response, + AssistantsListVectorStoreFilesDefaultResponse, + AssistantsCreateVectorStoreFile200Response, + AssistantsCreateVectorStoreFileDefaultResponse, + AssistantsGetVectorStoreFile200Response, + AssistantsGetVectorStoreFileDefaultResponse, + AssistantsDeleteVectorStoreFile200Response, + AssistantsDeleteVectorStoreFileDefaultResponse, + AssistantsCreateVectorStoreFileBatch200Response, + AssistantsCreateVectorStoreFileBatchDefaultResponse, + AssistantsGetVectorStoreFileBatch200Response, + AssistantsGetVectorStoreFileBatchDefaultResponse, + AssistantsCancelVectorStoreFileBatch200Response, + AssistantsCancelVectorStoreFileBatchDefaultResponse, + AssistantsListVectorStoreFileBatchFiles200Response, + AssistantsListVectorStoreFileBatchFilesDefaultResponse, + ConnectionsGet200Response, + ConnectionsGetDefaultResponse, + ConnectionsList200Response, + ConnectionsListDefaultResponse, + EvaluationsGet200Response, + EvaluationsGetDefaultResponse, + EvaluationsList200Response, + EvaluationsListDefaultResponse, + EvaluationsCreateRun200Response, + EvaluationsCreateRunDefaultResponse, + DatasetsListVersions200Response, + DatasetsListVersionsDefaultResponse, + DatasetsCreate200Response, + DatasetsCreateDefaultResponse, + DatasetsListLatest200Response, + DatasetsListLatestDefaultResponse, + DatasetsGetVersion200Response, + DatasetsGetVersionDefaultResponse, + DatasetsDeleteVersion204Response, + DatasetsDeleteVersionDefaultResponse, + DatasetsCreateVersion200Response, + DatasetsCreateVersion201Response, + DatasetsCreateVersionDefaultResponse, + DatasetsStartPendingUploadVersion200Response, + DatasetsStartPendingUploadVersionDefaultResponse, + DatasetsStartPendingUpload200Response, + DatasetsStartPendingUploadDefaultResponse, + IndexesListVersions200Response, + IndexesListVersionsDefaultResponse, + IndexesCreate200Response, + IndexesCreateDefaultResponse, + IndexesListLatest200Response, + IndexesListLatestDefaultResponse, + IndexesGetVersion200Response, + IndexesGetVersionDefaultResponse, + IndexesDeleteVersion204Response, + IndexesDeleteVersionDefaultResponse, + IndexesCreateVersion200Response, + IndexesCreateVersion201Response, + IndexesCreateVersionDefaultResponse, + DeploymentsGet200Response, + DeploymentsGetDefaultResponse, + DeploymentsList200Response, + DeploymentsListDefaultResponse, +} from "./responses.js"; +import type { Client, StreamableMethod } from "@azure-rest/core-client"; + +export interface AssistantsCreateAgent { + /** Creates a new agent. */ + post( + options: AssistantsCreateAgentParameters, + ): StreamableMethod< + AssistantsCreateAgent200Response | AssistantsCreateAgentDefaultResponse + >; + /** Gets a list of agents that were previously created. */ + get( + options?: AssistantsListAgentsParameters, + ): StreamableMethod< + AssistantsListAgents200Response | AssistantsListAgentsDefaultResponse + >; +} + +export interface AssistantsGetAgent { + /** Retrieves an existing agent. */ + get( + options?: AssistantsGetAgentParameters, + ): StreamableMethod< + AssistantsGetAgent200Response | AssistantsGetAgentDefaultResponse + >; + /** Modifies an existing agent. */ + post( + options: AssistantsUpdateAgentParameters, + ): StreamableMethod< + AssistantsUpdateAgent200Response | AssistantsUpdateAgentDefaultResponse + >; + /** Deletes an agent. */ + delete( + options?: AssistantsDeleteAgentParameters, + ): StreamableMethod< + AssistantsDeleteAgent200Response | AssistantsDeleteAgentDefaultResponse + >; +} + +export interface AssistantsCreateThread { + /** Creates a new thread. Threads contain messages and can be run by agents. */ + post( + options: AssistantsCreateThreadParameters, + ): StreamableMethod< + AssistantsCreateThread200Response | AssistantsCreateThreadDefaultResponse + >; +} + +export interface AssistantsGetThread { + /** Gets information about an existing thread. */ + get( + options?: AssistantsGetThreadParameters, + ): StreamableMethod< + AssistantsGetThread200Response | AssistantsGetThreadDefaultResponse + >; + /** Modifies an existing thread. */ + post( + options: AssistantsUpdateThreadParameters, + ): StreamableMethod< + AssistantsUpdateThread200Response | AssistantsUpdateThreadDefaultResponse + >; + /** Deletes an existing thread. */ + delete( + options?: AssistantsDeleteThreadParameters, + ): StreamableMethod< + AssistantsDeleteThread200Response | AssistantsDeleteThreadDefaultResponse + >; +} + +export interface AssistantsCreateMessage { + /** Creates a new message on a specified thread. */ + post( + options: AssistantsCreateMessageParameters, + ): StreamableMethod< + AssistantsCreateMessage200Response | AssistantsCreateMessageDefaultResponse + >; + /** Gets a list of messages that exist on a thread. */ + get( + options?: AssistantsListMessagesParameters, + ): StreamableMethod< + AssistantsListMessages200Response | AssistantsListMessagesDefaultResponse + >; +} + +export interface AssistantsGetMessage { + /** Gets an existing message from an existing thread. */ + get( + options?: AssistantsGetMessageParameters, + ): StreamableMethod< + AssistantsGetMessage200Response | AssistantsGetMessageDefaultResponse + >; + /** Modifies an existing message on an existing thread. */ + post( + options: AssistantsUpdateMessageParameters, + ): StreamableMethod< + AssistantsUpdateMessage200Response | AssistantsUpdateMessageDefaultResponse + >; +} + +export interface AssistantsCreateRun { + /** Creates a new run for an agent thread. */ + post( + options: AssistantsCreateRunParameters, + ): StreamableMethod< + AssistantsCreateRun200Response | AssistantsCreateRunDefaultResponse + >; + /** Gets a list of runs for a specified thread. */ + get( + options?: AssistantsListRunsParameters, + ): StreamableMethod< + AssistantsListRuns200Response | AssistantsListRunsDefaultResponse + >; +} + +export interface AssistantsGetRun { + /** Gets an existing run from an existing thread. */ + get( + options?: AssistantsGetRunParameters, + ): StreamableMethod< + AssistantsGetRun200Response | AssistantsGetRunDefaultResponse + >; + /** Modifies an existing thread run. */ + post( + options: AssistantsUpdateRunParameters, + ): StreamableMethod< + AssistantsUpdateRun200Response | AssistantsUpdateRunDefaultResponse + >; +} + +export interface AssistantsSubmitToolOutputsToRun { + /** 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'. */ + post( + options: AssistantsSubmitToolOutputsToRunParameters, + ): StreamableMethod< + | AssistantsSubmitToolOutputsToRun200Response + | AssistantsSubmitToolOutputsToRunDefaultResponse + >; +} + +export interface AssistantsCancelRun { + /** Cancels a run of an in progress thread. */ + post( + options?: AssistantsCancelRunParameters, + ): StreamableMethod< + AssistantsCancelRun200Response | AssistantsCancelRunDefaultResponse + >; +} + +export interface AssistantsCreateThreadAndRun { + /** Creates a new agent thread and immediately starts a run using that new thread. */ + post( + options: AssistantsCreateThreadAndRunParameters, + ): StreamableMethod< + | AssistantsCreateThreadAndRun200Response + | AssistantsCreateThreadAndRunDefaultResponse + >; +} + +export interface AssistantsGetRunStep { + /** Gets a single run step from a thread run. */ + get( + options?: AssistantsGetRunStepParameters, + ): StreamableMethod< + AssistantsGetRunStep200Response | AssistantsGetRunStepDefaultResponse + >; +} + +export interface AssistantsListRunSteps { + /** Gets a list of run steps from a thread run. */ + get( + options?: AssistantsListRunStepsParameters, + ): StreamableMethod< + AssistantsListRunSteps200Response | AssistantsListRunStepsDefaultResponse + >; +} + +export interface AssistantsListFiles { + /** Gets a list of previously uploaded files. */ + get( + options?: AssistantsListFilesParameters, + ): StreamableMethod< + AssistantsListFiles200Response | AssistantsListFilesDefaultResponse + >; + /** Uploads a file for use by other operations. */ + post( + options: AssistantsUploadFileParameters, + ): StreamableMethod< + AssistantsUploadFile200Response | AssistantsUploadFileDefaultResponse + >; +} + +export interface AssistantsDeleteFile { + /** Delete a previously uploaded file. */ + delete( + options?: AssistantsDeleteFileParameters, + ): StreamableMethod< + AssistantsDeleteFile200Response | AssistantsDeleteFileDefaultResponse + >; + /** Returns information about a specific file. Does not retrieve file content. */ + get( + options?: AssistantsGetFileParameters, + ): StreamableMethod< + AssistantsGetFile200Response | AssistantsGetFileDefaultResponse + >; +} + +export interface AssistantsGetFileContent { + /** Retrieves the raw content of a specific file. */ + get( + options?: AssistantsGetFileContentParameters, + ): StreamableMethod< + | AssistantsGetFileContent200Response + | AssistantsGetFileContentDefaultResponse + >; +} + +export interface AssistantsListVectorStores { + /** Returns a list of vector stores. */ + get( + options?: AssistantsListVectorStoresParameters, + ): StreamableMethod< + | AssistantsListVectorStores200Response + | AssistantsListVectorStoresDefaultResponse + >; + /** Creates a vector store. */ + post( + options: AssistantsCreateVectorStoreParameters, + ): StreamableMethod< + | AssistantsCreateVectorStore200Response + | AssistantsCreateVectorStoreDefaultResponse + >; +} + +export interface AssistantsGetVectorStore { + /** Returns the vector store object matching the specified ID. */ + get( + options?: AssistantsGetVectorStoreParameters, + ): StreamableMethod< + | AssistantsGetVectorStore200Response + | AssistantsGetVectorStoreDefaultResponse + >; + /** The ID of the vector store to modify. */ + post( + options: AssistantsModifyVectorStoreParameters, + ): StreamableMethod< + | AssistantsModifyVectorStore200Response + | AssistantsModifyVectorStoreDefaultResponse + >; + /** Deletes the vector store object matching the specified ID. */ + delete( + options?: AssistantsDeleteVectorStoreParameters, + ): StreamableMethod< + | AssistantsDeleteVectorStore200Response + | AssistantsDeleteVectorStoreDefaultResponse + >; +} + +export interface AssistantsListVectorStoreFiles { + /** Returns a list of vector store files. */ + get( + options?: AssistantsListVectorStoreFilesParameters, + ): StreamableMethod< + | AssistantsListVectorStoreFiles200Response + | AssistantsListVectorStoreFilesDefaultResponse + >; + /** Create a vector store file by attaching a file to a vector store. */ + post( + options: AssistantsCreateVectorStoreFileParameters, + ): StreamableMethod< + | AssistantsCreateVectorStoreFile200Response + | AssistantsCreateVectorStoreFileDefaultResponse + >; +} + +export interface AssistantsGetVectorStoreFile { + /** Retrieves a vector store file. */ + get( + options?: AssistantsGetVectorStoreFileParameters, + ): StreamableMethod< + | AssistantsGetVectorStoreFile200Response + | AssistantsGetVectorStoreFileDefaultResponse + >; + /** + * 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. + */ + delete( + options?: AssistantsDeleteVectorStoreFileParameters, + ): StreamableMethod< + | AssistantsDeleteVectorStoreFile200Response + | AssistantsDeleteVectorStoreFileDefaultResponse + >; +} + +export interface AssistantsCreateVectorStoreFileBatch { + /** Create a vector store file batch. */ + post( + options: AssistantsCreateVectorStoreFileBatchParameters, + ): StreamableMethod< + | AssistantsCreateVectorStoreFileBatch200Response + | AssistantsCreateVectorStoreFileBatchDefaultResponse + >; +} + +export interface AssistantsGetVectorStoreFileBatch { + /** Retrieve a vector store file batch. */ + get( + options?: AssistantsGetVectorStoreFileBatchParameters, + ): StreamableMethod< + | AssistantsGetVectorStoreFileBatch200Response + | AssistantsGetVectorStoreFileBatchDefaultResponse + >; +} + +export interface AssistantsCancelVectorStoreFileBatch { + /** Cancel a vector store file batch. This attempts to cancel the processing of files in this batch as soon as possible. */ + post( + options?: AssistantsCancelVectorStoreFileBatchParameters, + ): StreamableMethod< + | AssistantsCancelVectorStoreFileBatch200Response + | AssistantsCancelVectorStoreFileBatchDefaultResponse + >; +} + +export interface AssistantsListVectorStoreFileBatchFiles { + /** Returns a list of vector store files in a batch. */ + get( + options?: AssistantsListVectorStoreFileBatchFilesParameters, + ): StreamableMethod< + | AssistantsListVectorStoreFileBatchFiles200Response + | AssistantsListVectorStoreFileBatchFilesDefaultResponse + >; +} + +export interface ConnectionsGet { + /** Get a connection by name. */ + get( + options?: ConnectionsGetParameters, + ): StreamableMethod< + ConnectionsGet200Response | ConnectionsGetDefaultResponse + >; +} + +export interface ConnectionsList { + /** List all connections in the project */ + get( + options?: ConnectionsListParameters, + ): StreamableMethod< + ConnectionsList200Response | ConnectionsListDefaultResponse + >; +} + +export interface EvaluationsGet { + /** Get an evaluation run by name. */ + get( + options?: EvaluationsGetParameters, + ): StreamableMethod< + EvaluationsGet200Response | EvaluationsGetDefaultResponse + >; +} + +export interface EvaluationsList { + /** List evaluation runs */ + get( + options?: EvaluationsListParameters, + ): StreamableMethod< + EvaluationsList200Response | EvaluationsListDefaultResponse + >; +} + +export interface EvaluationsCreateRun { + /** Creates an evaluation run. */ + post( + options: EvaluationsCreateRunParameters, + ): StreamableMethod< + EvaluationsCreateRun200Response | EvaluationsCreateRunDefaultResponse + >; +} + +export interface DatasetsListVersions { + /** List all versions of the given DatasetVersion */ + get( + options?: DatasetsListVersionsParameters, + ): StreamableMethod< + DatasetsListVersions200Response | DatasetsListVersionsDefaultResponse + >; + /** Create a new DatasetVersion. The version id will be generated by the service. */ + post( + options: DatasetsCreateParameters, + ): StreamableMethod< + DatasetsCreate200Response | DatasetsCreateDefaultResponse + >; +} + +export interface DatasetsListLatest { + /** List the latest version of each DatasetVersion */ + get( + options?: DatasetsListLatestParameters, + ): StreamableMethod< + DatasetsListLatest200Response | DatasetsListLatestDefaultResponse + >; +} + +export interface DatasetsGetVersion { + /** Get the specific version of the DatasetVersion */ + get( + options?: DatasetsGetVersionParameters, + ): StreamableMethod< + DatasetsGetVersion200Response | DatasetsGetVersionDefaultResponse + >; + /** Delete the specific version of the DatasetVersion */ + delete( + options?: DatasetsDeleteVersionParameters, + ): StreamableMethod< + DatasetsDeleteVersion204Response | DatasetsDeleteVersionDefaultResponse + >; + /** Create a new or replace an existing DatasetVersion with the given version id */ + put( + options: DatasetsCreateVersionParameters, + ): StreamableMethod< + | DatasetsCreateVersion200Response + | DatasetsCreateVersion201Response + | DatasetsCreateVersionDefaultResponse + >; +} + +export interface DatasetsStartPendingUploadVersion { + /** Create or start a pending upload of a dataset for a specific version. */ + post( + options: DatasetsStartPendingUploadVersionParameters, + ): StreamableMethod< + | DatasetsStartPendingUploadVersion200Response + | DatasetsStartPendingUploadVersionDefaultResponse + >; +} + +export interface DatasetsStartPendingUpload { + /** Create or start a pending upload of a dataset. The version id will be generated by the service. */ + post( + options: DatasetsStartPendingUploadParameters, + ): StreamableMethod< + | DatasetsStartPendingUpload200Response + | DatasetsStartPendingUploadDefaultResponse + >; +} + +export interface IndexesListVersions { + /** List all versions of the given Index */ + get( + options?: IndexesListVersionsParameters, + ): StreamableMethod< + IndexesListVersions200Response | IndexesListVersionsDefaultResponse + >; + /** Create a new Index. The version id will be generated by the service. */ + post( + options: IndexesCreateParameters, + ): StreamableMethod; +} + +export interface IndexesListLatest { + /** List the latest version of each Index */ + get( + options?: IndexesListLatestParameters, + ): StreamableMethod< + IndexesListLatest200Response | IndexesListLatestDefaultResponse + >; +} + +export interface IndexesGetVersion { + /** Get the specific version of the Index */ + get( + options?: IndexesGetVersionParameters, + ): StreamableMethod< + IndexesGetVersion200Response | IndexesGetVersionDefaultResponse + >; + /** Delete the specific version of the Index */ + delete( + options?: IndexesDeleteVersionParameters, + ): StreamableMethod< + IndexesDeleteVersion204Response | IndexesDeleteVersionDefaultResponse + >; + /** Create a new or replace an existing Index with the given version id */ + put( + options: IndexesCreateVersionParameters, + ): StreamableMethod< + | IndexesCreateVersion200Response + | IndexesCreateVersion201Response + | IndexesCreateVersionDefaultResponse + >; +} + +export interface DeploymentsGet { + /** Get a deployed model. */ + get( + options?: DeploymentsGetParameters, + ): StreamableMethod< + DeploymentsGet200Response | DeploymentsGetDefaultResponse + >; +} + +export interface DeploymentsList { + /** List all deployed models in the project */ + get( + options?: DeploymentsListParameters, + ): StreamableMethod< + DeploymentsList200Response | DeploymentsListDefaultResponse + >; +} + +export interface Routes { + /** Resource for '/assistants' has methods for the following verbs: post, get */ + (path: "/assistants"): AssistantsCreateAgent; + /** Resource for '/assistants/\{assistantId\}' has methods for the following verbs: get, post, delete */ + (path: "/assistants/{assistantId}", assistantId: string): AssistantsGetAgent; + /** Resource for '/threads' has methods for the following verbs: post */ + (path: "/threads"): AssistantsCreateThread; + /** Resource for '/threads/\{threadId\}' has methods for the following verbs: get, post, delete */ + (path: "/threads/{threadId}", threadId: string): AssistantsGetThread; + /** Resource for '/threads/\{threadId\}/messages' has methods for the following verbs: post, get */ + ( + path: "/threads/{threadId}/messages", + threadId: string, + ): AssistantsCreateMessage; + /** Resource for '/threads/\{threadId\}/messages/\{messageId\}' has methods for the following verbs: get, post */ + ( + path: "/threads/{threadId}/messages/{messageId}", + threadId: string, + messageId: string, + ): AssistantsGetMessage; + /** Resource for '/threads/\{threadId\}/runs' has methods for the following verbs: post, get */ + (path: "/threads/{threadId}/runs", threadId: string): AssistantsCreateRun; + /** Resource for '/threads/\{threadId\}/runs/\{runId\}' has methods for the following verbs: get, post */ + ( + path: "/threads/{threadId}/runs/{runId}", + threadId: string, + runId: string, + ): AssistantsGetRun; + /** Resource for '/threads/\{threadId\}/runs/\{runId\}/submit_tool_outputs' has methods for the following verbs: post */ + ( + path: "/threads/{threadId}/runs/{runId}/submit_tool_outputs", + threadId: string, + runId: string, + ): AssistantsSubmitToolOutputsToRun; + /** Resource for '/threads/\{threadId\}/runs/\{runId\}/cancel' has methods for the following verbs: post */ + ( + path: "/threads/{threadId}/runs/{runId}/cancel", + threadId: string, + runId: string, + ): AssistantsCancelRun; + /** Resource for '/threads/runs' has methods for the following verbs: post */ + (path: "/threads/runs"): AssistantsCreateThreadAndRun; + /** Resource for '/threads/\{threadId\}/runs/\{runId\}/steps/\{stepId\}' has methods for the following verbs: get */ + ( + path: "/threads/{threadId}/runs/{runId}/steps/{stepId}", + threadId: string, + runId: string, + stepId: string, + ): AssistantsGetRunStep; + /** Resource for '/threads/\{threadId\}/runs/\{runId\}/steps' has methods for the following verbs: get */ + ( + path: "/threads/{threadId}/runs/{runId}/steps", + threadId: string, + runId: string, + ): AssistantsListRunSteps; + /** Resource for '/files' has methods for the following verbs: get, post */ + (path: "/files"): AssistantsListFiles; + /** Resource for '/files/\{fileId\}' has methods for the following verbs: delete, get */ + (path: "/files/{fileId}", fileId: string): AssistantsDeleteFile; + /** Resource for '/files/\{fileId\}/content' has methods for the following verbs: get */ + (path: "/files/{fileId}/content", fileId: string): AssistantsGetFileContent; + /** Resource for '/vector_stores' has methods for the following verbs: get, post */ + (path: "/vector_stores"): AssistantsListVectorStores; + /** Resource for '/vector_stores/\{vectorStoreId\}' has methods for the following verbs: get, post, delete */ + ( + path: "/vector_stores/{vectorStoreId}", + vectorStoreId: string, + ): AssistantsGetVectorStore; + /** Resource for '/vector_stores/\{vectorStoreId\}/files' has methods for the following verbs: get, post */ + ( + path: "/vector_stores/{vectorStoreId}/files", + vectorStoreId: string, + ): AssistantsListVectorStoreFiles; + /** Resource for '/vector_stores/\{vectorStoreId\}/files/\{fileId\}' has methods for the following verbs: get, delete */ + ( + path: "/vector_stores/{vectorStoreId}/files/{fileId}", + vectorStoreId: string, + fileId: string, + ): AssistantsGetVectorStoreFile; + /** Resource for '/vector_stores/\{vectorStoreId\}/file_batches' has methods for the following verbs: post */ + ( + path: "/vector_stores/{vectorStoreId}/file_batches", + vectorStoreId: string, + ): AssistantsCreateVectorStoreFileBatch; + /** Resource for '/vector_stores/\{vectorStoreId\}/file_batches/\{batchId\}' has methods for the following verbs: get */ + ( + path: "/vector_stores/{vectorStoreId}/file_batches/{batchId}", + vectorStoreId: string, + batchId: string, + ): AssistantsGetVectorStoreFileBatch; + /** Resource for '/vector_stores/\{vectorStoreId\}/file_batches/\{batchId\}/cancel' has methods for the following verbs: post */ + ( + path: "/vector_stores/{vectorStoreId}/file_batches/{batchId}/cancel", + vectorStoreId: string, + batchId: string, + ): AssistantsCancelVectorStoreFileBatch; + /** Resource for '/vector_stores/\{vectorStoreId\}/file_batches/\{batchId\}/files' has methods for the following verbs: get */ + ( + path: "/vector_stores/{vectorStoreId}/file_batches/{batchId}/files", + vectorStoreId: string, + batchId: string, + ): AssistantsListVectorStoreFileBatchFiles; + /** Resource for '/connections/\{name\}' has methods for the following verbs: get */ + (path: "/connections/{name}", name: string): ConnectionsGet; + /** Resource for '/connections' has methods for the following verbs: get */ + (path: "/connections"): ConnectionsList; + /** Resource for '/evaluations/runs/\{name\}' has methods for the following verbs: get */ + (path: "/evaluations/runs/{name}", name: string): EvaluationsGet; + /** Resource for '/evaluations/runs' has methods for the following verbs: get */ + (path: "/evaluations/runs"): EvaluationsList; + /** Resource for '/evaluations/runs:run' has methods for the following verbs: post */ + (path: "/evaluations/runs:run"): EvaluationsCreateRun; + /** Resource for '/datasets/\{name\}/versions' has methods for the following verbs: get, post */ + (path: "/datasets/{name}/versions", name: string): DatasetsListVersions; + /** Resource for '/datasets' has methods for the following verbs: get */ + (path: "/datasets"): DatasetsListLatest; + /** Resource for '/datasets/\{name\}/versions/\{version\}' has methods for the following verbs: get, delete, put */ + ( + path: "/datasets/{name}/versions/{version}", + name: string, + version: string, + ): DatasetsGetVersion; + /** Resource for '/datasets/\{name\}/versions/\{version\}/startPendingUploadVersion' has methods for the following verbs: post */ + ( + path: "/datasets/{name}/versions/{version}/startPendingUploadVersion", + name: string, + version: string, + ): DatasetsStartPendingUploadVersion; + /** Resource for '/datasets/\{name\}/startPendingUpload' has methods for the following verbs: post */ + ( + path: "/datasets/{name}/startPendingUpload", + name: string, + ): DatasetsStartPendingUpload; + /** Resource for '/indexes/\{name\}/versions' has methods for the following verbs: get, post */ + (path: "/indexes/{name}/versions", name: string): IndexesListVersions; + /** Resource for '/indexes' has methods for the following verbs: get */ + (path: "/indexes"): IndexesListLatest; + /** Resource for '/indexes/\{name\}/versions/\{version\}' has methods for the following verbs: get, delete, put */ + ( + path: "/indexes/{name}/versions/{version}", + name: string, + version: string, + ): IndexesGetVersion; + /** Resource for '/deployments/\{name\}' has methods for the following verbs: get */ + (path: "/deployments/{name}", name: string): DeploymentsGet; + /** Resource for '/deployments' has methods for the following verbs: get */ + (path: "/deployments"): DeploymentsList; +} + +export type ProjectsClient = Client & { + path: Routes; +}; diff --git a/sdk/ai/ai-projects-1dp/src/index.ts b/sdk/ai/ai-projects-1dp/src/index.ts new file mode 100644 index 000000000000..0afd734a7856 --- /dev/null +++ b/sdk/ai/ai-projects-1dp/src/index.ts @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import ProjectsClient from "./projectsClient.js"; + +export * from "./projectsClient.js"; +export * from "./parameters.js"; +export * from "./responses.js"; +export * from "./clientDefinitions.js"; +export * from "./isUnexpected.js"; +export * from "./models.js"; +export * from "./outputModels.js"; +export * from "./paginateHelper.js"; + +export default ProjectsClient; diff --git a/sdk/ai/ai-projects-1dp/src/isUnexpected.ts b/sdk/ai/ai-projects-1dp/src/isUnexpected.ts new file mode 100644 index 000000000000..c291e06092f7 --- /dev/null +++ b/sdk/ai/ai-projects-1dp/src/isUnexpected.ts @@ -0,0 +1,727 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { + AssistantsCreateAgent200Response, + AssistantsCreateAgentDefaultResponse, + AssistantsListAgents200Response, + AssistantsListAgentsDefaultResponse, + AssistantsGetAgent200Response, + AssistantsGetAgentDefaultResponse, + AssistantsUpdateAgent200Response, + AssistantsUpdateAgentDefaultResponse, + AssistantsDeleteAgent200Response, + AssistantsDeleteAgentDefaultResponse, + AssistantsCreateThread200Response, + AssistantsCreateThreadDefaultResponse, + AssistantsGetThread200Response, + AssistantsGetThreadDefaultResponse, + AssistantsUpdateThread200Response, + AssistantsUpdateThreadDefaultResponse, + AssistantsDeleteThread200Response, + AssistantsDeleteThreadDefaultResponse, + AssistantsCreateMessage200Response, + AssistantsCreateMessageDefaultResponse, + AssistantsListMessages200Response, + AssistantsListMessagesDefaultResponse, + AssistantsGetMessage200Response, + AssistantsGetMessageDefaultResponse, + AssistantsUpdateMessage200Response, + AssistantsUpdateMessageDefaultResponse, + AssistantsCreateRun200Response, + AssistantsCreateRunDefaultResponse, + AssistantsListRuns200Response, + AssistantsListRunsDefaultResponse, + AssistantsGetRun200Response, + AssistantsGetRunDefaultResponse, + AssistantsUpdateRun200Response, + AssistantsUpdateRunDefaultResponse, + AssistantsSubmitToolOutputsToRun200Response, + AssistantsSubmitToolOutputsToRunDefaultResponse, + AssistantsCancelRun200Response, + AssistantsCancelRunDefaultResponse, + AssistantsCreateThreadAndRun200Response, + AssistantsCreateThreadAndRunDefaultResponse, + AssistantsGetRunStep200Response, + AssistantsGetRunStepDefaultResponse, + AssistantsListRunSteps200Response, + AssistantsListRunStepsDefaultResponse, + AssistantsListFiles200Response, + AssistantsListFilesDefaultResponse, + AssistantsUploadFile200Response, + AssistantsUploadFileDefaultResponse, + AssistantsDeleteFile200Response, + AssistantsDeleteFileDefaultResponse, + AssistantsGetFile200Response, + AssistantsGetFileDefaultResponse, + AssistantsGetFileContent200Response, + AssistantsGetFileContentDefaultResponse, + AssistantsListVectorStores200Response, + AssistantsListVectorStoresDefaultResponse, + AssistantsCreateVectorStore200Response, + AssistantsCreateVectorStoreDefaultResponse, + AssistantsGetVectorStore200Response, + AssistantsGetVectorStoreDefaultResponse, + AssistantsModifyVectorStore200Response, + AssistantsModifyVectorStoreDefaultResponse, + AssistantsDeleteVectorStore200Response, + AssistantsDeleteVectorStoreDefaultResponse, + AssistantsListVectorStoreFiles200Response, + AssistantsListVectorStoreFilesDefaultResponse, + AssistantsCreateVectorStoreFile200Response, + AssistantsCreateVectorStoreFileDefaultResponse, + AssistantsGetVectorStoreFile200Response, + AssistantsGetVectorStoreFileDefaultResponse, + AssistantsDeleteVectorStoreFile200Response, + AssistantsDeleteVectorStoreFileDefaultResponse, + AssistantsCreateVectorStoreFileBatch200Response, + AssistantsCreateVectorStoreFileBatchDefaultResponse, + AssistantsGetVectorStoreFileBatch200Response, + AssistantsGetVectorStoreFileBatchDefaultResponse, + AssistantsCancelVectorStoreFileBatch200Response, + AssistantsCancelVectorStoreFileBatchDefaultResponse, + AssistantsListVectorStoreFileBatchFiles200Response, + AssistantsListVectorStoreFileBatchFilesDefaultResponse, + ConnectionsGet200Response, + ConnectionsGetDefaultResponse, + ConnectionsList200Response, + ConnectionsListDefaultResponse, + EvaluationsGet200Response, + EvaluationsGetDefaultResponse, + EvaluationsList200Response, + EvaluationsListDefaultResponse, + EvaluationsCreateRun200Response, + EvaluationsCreateRunDefaultResponse, + DatasetsListVersions200Response, + DatasetsListVersionsDefaultResponse, + DatasetsCreate200Response, + DatasetsCreateDefaultResponse, + DatasetsListLatest200Response, + DatasetsListLatestDefaultResponse, + DatasetsGetVersion200Response, + DatasetsGetVersionDefaultResponse, + DatasetsDeleteVersion204Response, + DatasetsDeleteVersionDefaultResponse, + DatasetsCreateVersion200Response, + DatasetsCreateVersion201Response, + DatasetsCreateVersionDefaultResponse, + DatasetsStartPendingUploadVersion200Response, + DatasetsStartPendingUploadVersionDefaultResponse, + DatasetsStartPendingUpload200Response, + DatasetsStartPendingUploadDefaultResponse, + IndexesListVersions200Response, + IndexesListVersionsDefaultResponse, + IndexesCreate200Response, + IndexesCreateDefaultResponse, + IndexesListLatest200Response, + IndexesListLatestDefaultResponse, + IndexesGetVersion200Response, + IndexesGetVersionDefaultResponse, + IndexesDeleteVersion204Response, + IndexesDeleteVersionDefaultResponse, + IndexesCreateVersion200Response, + IndexesCreateVersion201Response, + IndexesCreateVersionDefaultResponse, + DeploymentsGet200Response, + DeploymentsGetDefaultResponse, + DeploymentsList200Response, + DeploymentsListDefaultResponse, +} from "./responses.js"; + +const responseMap: Record = { + "POST /assistants": ["200"], + "GET /assistants": ["200"], + "GET /assistants/{assistantId}": ["200"], + "POST /assistants/{assistantId}": ["200"], + "DELETE /assistants/{assistantId}": ["200"], + "POST /threads": ["200"], + "GET /threads/{threadId}": ["200"], + "POST /threads/{threadId}": ["200"], + "DELETE /threads/{threadId}": ["200"], + "POST /threads/{threadId}/messages": ["200"], + "GET /threads/{threadId}/messages": ["200"], + "GET /threads/{threadId}/messages/{messageId}": ["200"], + "POST /threads/{threadId}/messages/{messageId}": ["200"], + "POST /threads/{threadId}/runs": ["200"], + "GET /threads/{threadId}/runs": ["200"], + "GET /threads/{threadId}/runs/{runId}": ["200"], + "POST /threads/{threadId}/runs/{runId}": ["200"], + "POST /threads/{threadId}/runs/{runId}/submit_tool_outputs": ["200"], + "POST /threads/{threadId}/runs/{runId}/cancel": ["200"], + "POST /threads/runs": ["200"], + "GET /threads/{threadId}/runs/{runId}/steps/{stepId}": ["200"], + "GET /threads/{threadId}/runs/{runId}/steps": ["200"], + "GET /files": ["200"], + "POST /files": ["200"], + "DELETE /files/{fileId}": ["200"], + "GET /files/{fileId}": ["200"], + "GET /files/{fileId}/content": ["200"], + "GET /vector_stores": ["200"], + "POST /vector_stores": ["200"], + "GET /vector_stores/{vectorStoreId}": ["200"], + "POST /vector_stores/{vectorStoreId}": ["200"], + "DELETE /vector_stores/{vectorStoreId}": ["200"], + "GET /vector_stores/{vectorStoreId}/files": ["200"], + "POST /vector_stores/{vectorStoreId}/files": ["200"], + "GET /vector_stores/{vectorStoreId}/files/{fileId}": ["200"], + "DELETE /vector_stores/{vectorStoreId}/files/{fileId}": ["200"], + "POST /vector_stores/{vectorStoreId}/file_batches": ["200"], + "GET /vector_stores/{vectorStoreId}/file_batches/{batchId}": ["200"], + "POST /vector_stores/{vectorStoreId}/file_batches/{batchId}/cancel": ["200"], + "GET /vector_stores/{vectorStoreId}/file_batches/{batchId}/files": ["200"], + "GET /connections/{name}": ["200"], + "GET /connections": ["200"], + "GET /evaluations/runs/{name}": ["200"], + "GET /evaluations/runs": ["200"], + "POST /evaluations/runs:run": ["200"], + "GET /datasets/{name}/versions": ["200"], + "POST /datasets/{name}/versions": ["200"], + "GET /datasets": ["200"], + "GET /datasets/{name}/versions/{version}": ["200"], + "DELETE /datasets/{name}/versions/{version}": ["204"], + "PUT /datasets/{name}/versions/{version}": ["200", "201"], + "POST /datasets/{name}/versions/{version}/startPendingUploadVersion": ["200"], + "POST /datasets/{name}/startPendingUpload": ["200"], + "GET /indexes/{name}/versions": ["200"], + "POST /indexes/{name}/versions": ["200"], + "GET /indexes": ["200"], + "GET /indexes/{name}/versions/{version}": ["200"], + "DELETE /indexes/{name}/versions/{version}": ["204"], + "PUT /indexes/{name}/versions/{version}": ["200", "201"], + "GET /deployments/{name}": ["200"], + "GET /deployments": ["200"], +}; + +export function isUnexpected( + response: + | AssistantsCreateAgent200Response + | AssistantsCreateAgentDefaultResponse, +): response is AssistantsCreateAgentDefaultResponse; +export function isUnexpected( + response: + | AssistantsListAgents200Response + | AssistantsListAgentsDefaultResponse, +): response is AssistantsListAgentsDefaultResponse; +export function isUnexpected( + response: AssistantsGetAgent200Response | AssistantsGetAgentDefaultResponse, +): response is AssistantsGetAgentDefaultResponse; +export function isUnexpected( + response: + | AssistantsUpdateAgent200Response + | AssistantsUpdateAgentDefaultResponse, +): response is AssistantsUpdateAgentDefaultResponse; +export function isUnexpected( + response: + | AssistantsDeleteAgent200Response + | AssistantsDeleteAgentDefaultResponse, +): response is AssistantsDeleteAgentDefaultResponse; +export function isUnexpected( + response: + | AssistantsCreateThread200Response + | AssistantsCreateThreadDefaultResponse, +): response is AssistantsCreateThreadDefaultResponse; +export function isUnexpected( + response: AssistantsGetThread200Response | AssistantsGetThreadDefaultResponse, +): response is AssistantsGetThreadDefaultResponse; +export function isUnexpected( + response: + | AssistantsUpdateThread200Response + | AssistantsUpdateThreadDefaultResponse, +): response is AssistantsUpdateThreadDefaultResponse; +export function isUnexpected( + response: + | AssistantsDeleteThread200Response + | AssistantsDeleteThreadDefaultResponse, +): response is AssistantsDeleteThreadDefaultResponse; +export function isUnexpected( + response: + | AssistantsCreateMessage200Response + | AssistantsCreateMessageDefaultResponse, +): response is AssistantsCreateMessageDefaultResponse; +export function isUnexpected( + response: + | AssistantsListMessages200Response + | AssistantsListMessagesDefaultResponse, +): response is AssistantsListMessagesDefaultResponse; +export function isUnexpected( + response: + | AssistantsGetMessage200Response + | AssistantsGetMessageDefaultResponse, +): response is AssistantsGetMessageDefaultResponse; +export function isUnexpected( + response: + | AssistantsUpdateMessage200Response + | AssistantsUpdateMessageDefaultResponse, +): response is AssistantsUpdateMessageDefaultResponse; +export function isUnexpected( + response: AssistantsCreateRun200Response | AssistantsCreateRunDefaultResponse, +): response is AssistantsCreateRunDefaultResponse; +export function isUnexpected( + response: AssistantsListRuns200Response | AssistantsListRunsDefaultResponse, +): response is AssistantsListRunsDefaultResponse; +export function isUnexpected( + response: AssistantsGetRun200Response | AssistantsGetRunDefaultResponse, +): response is AssistantsGetRunDefaultResponse; +export function isUnexpected( + response: AssistantsUpdateRun200Response | AssistantsUpdateRunDefaultResponse, +): response is AssistantsUpdateRunDefaultResponse; +export function isUnexpected( + response: + | AssistantsSubmitToolOutputsToRun200Response + | AssistantsSubmitToolOutputsToRunDefaultResponse, +): response is AssistantsSubmitToolOutputsToRunDefaultResponse; +export function isUnexpected( + response: AssistantsCancelRun200Response | AssistantsCancelRunDefaultResponse, +): response is AssistantsCancelRunDefaultResponse; +export function isUnexpected( + response: + | AssistantsCreateThreadAndRun200Response + | AssistantsCreateThreadAndRunDefaultResponse, +): response is AssistantsCreateThreadAndRunDefaultResponse; +export function isUnexpected( + response: + | AssistantsGetRunStep200Response + | AssistantsGetRunStepDefaultResponse, +): response is AssistantsGetRunStepDefaultResponse; +export function isUnexpected( + response: + | AssistantsListRunSteps200Response + | AssistantsListRunStepsDefaultResponse, +): response is AssistantsListRunStepsDefaultResponse; +export function isUnexpected( + response: AssistantsListFiles200Response | AssistantsListFilesDefaultResponse, +): response is AssistantsListFilesDefaultResponse; +export function isUnexpected( + response: + | AssistantsUploadFile200Response + | AssistantsUploadFileDefaultResponse, +): response is AssistantsUploadFileDefaultResponse; +export function isUnexpected( + response: + | AssistantsDeleteFile200Response + | AssistantsDeleteFileDefaultResponse, +): response is AssistantsDeleteFileDefaultResponse; +export function isUnexpected( + response: AssistantsGetFile200Response | AssistantsGetFileDefaultResponse, +): response is AssistantsGetFileDefaultResponse; +export function isUnexpected( + response: + | AssistantsGetFileContent200Response + | AssistantsGetFileContentDefaultResponse, +): response is AssistantsGetFileContentDefaultResponse; +export function isUnexpected( + response: + | AssistantsListVectorStores200Response + | AssistantsListVectorStoresDefaultResponse, +): response is AssistantsListVectorStoresDefaultResponse; +export function isUnexpected( + response: + | AssistantsCreateVectorStore200Response + | AssistantsCreateVectorStoreDefaultResponse, +): response is AssistantsCreateVectorStoreDefaultResponse; +export function isUnexpected( + response: + | AssistantsGetVectorStore200Response + | AssistantsGetVectorStoreDefaultResponse, +): response is AssistantsGetVectorStoreDefaultResponse; +export function isUnexpected( + response: + | AssistantsModifyVectorStore200Response + | AssistantsModifyVectorStoreDefaultResponse, +): response is AssistantsModifyVectorStoreDefaultResponse; +export function isUnexpected( + response: + | AssistantsDeleteVectorStore200Response + | AssistantsDeleteVectorStoreDefaultResponse, +): response is AssistantsDeleteVectorStoreDefaultResponse; +export function isUnexpected( + response: + | AssistantsListVectorStoreFiles200Response + | AssistantsListVectorStoreFilesDefaultResponse, +): response is AssistantsListVectorStoreFilesDefaultResponse; +export function isUnexpected( + response: + | AssistantsCreateVectorStoreFile200Response + | AssistantsCreateVectorStoreFileDefaultResponse, +): response is AssistantsCreateVectorStoreFileDefaultResponse; +export function isUnexpected( + response: + | AssistantsGetVectorStoreFile200Response + | AssistantsGetVectorStoreFileDefaultResponse, +): response is AssistantsGetVectorStoreFileDefaultResponse; +export function isUnexpected( + response: + | AssistantsDeleteVectorStoreFile200Response + | AssistantsDeleteVectorStoreFileDefaultResponse, +): response is AssistantsDeleteVectorStoreFileDefaultResponse; +export function isUnexpected( + response: + | AssistantsCreateVectorStoreFileBatch200Response + | AssistantsCreateVectorStoreFileBatchDefaultResponse, +): response is AssistantsCreateVectorStoreFileBatchDefaultResponse; +export function isUnexpected( + response: + | AssistantsGetVectorStoreFileBatch200Response + | AssistantsGetVectorStoreFileBatchDefaultResponse, +): response is AssistantsGetVectorStoreFileBatchDefaultResponse; +export function isUnexpected( + response: + | AssistantsCancelVectorStoreFileBatch200Response + | AssistantsCancelVectorStoreFileBatchDefaultResponse, +): response is AssistantsCancelVectorStoreFileBatchDefaultResponse; +export function isUnexpected( + response: + | AssistantsListVectorStoreFileBatchFiles200Response + | AssistantsListVectorStoreFileBatchFilesDefaultResponse, +): response is AssistantsListVectorStoreFileBatchFilesDefaultResponse; +export function isUnexpected( + response: ConnectionsGet200Response | ConnectionsGetDefaultResponse, +): response is ConnectionsGetDefaultResponse; +export function isUnexpected( + response: ConnectionsList200Response | ConnectionsListDefaultResponse, +): response is ConnectionsListDefaultResponse; +export function isUnexpected( + response: EvaluationsGet200Response | EvaluationsGetDefaultResponse, +): response is EvaluationsGetDefaultResponse; +export function isUnexpected( + response: EvaluationsList200Response | EvaluationsListDefaultResponse, +): response is EvaluationsListDefaultResponse; +export function isUnexpected( + response: + | EvaluationsCreateRun200Response + | EvaluationsCreateRunDefaultResponse, +): response is EvaluationsCreateRunDefaultResponse; +export function isUnexpected( + response: + | DatasetsListVersions200Response + | DatasetsListVersionsDefaultResponse, +): response is DatasetsListVersionsDefaultResponse; +export function isUnexpected( + response: DatasetsCreate200Response | DatasetsCreateDefaultResponse, +): response is DatasetsCreateDefaultResponse; +export function isUnexpected( + response: DatasetsListLatest200Response | DatasetsListLatestDefaultResponse, +): response is DatasetsListLatestDefaultResponse; +export function isUnexpected( + response: DatasetsGetVersion200Response | DatasetsGetVersionDefaultResponse, +): response is DatasetsGetVersionDefaultResponse; +export function isUnexpected( + response: + | DatasetsDeleteVersion204Response + | DatasetsDeleteVersionDefaultResponse, +): response is DatasetsDeleteVersionDefaultResponse; +export function isUnexpected( + response: + | DatasetsCreateVersion200Response + | DatasetsCreateVersion201Response + | DatasetsCreateVersionDefaultResponse, +): response is DatasetsCreateVersionDefaultResponse; +export function isUnexpected( + response: + | DatasetsStartPendingUploadVersion200Response + | DatasetsStartPendingUploadVersionDefaultResponse, +): response is DatasetsStartPendingUploadVersionDefaultResponse; +export function isUnexpected( + response: + | DatasetsStartPendingUpload200Response + | DatasetsStartPendingUploadDefaultResponse, +): response is DatasetsStartPendingUploadDefaultResponse; +export function isUnexpected( + response: IndexesListVersions200Response | IndexesListVersionsDefaultResponse, +): response is IndexesListVersionsDefaultResponse; +export function isUnexpected( + response: IndexesCreate200Response | IndexesCreateDefaultResponse, +): response is IndexesCreateDefaultResponse; +export function isUnexpected( + response: IndexesListLatest200Response | IndexesListLatestDefaultResponse, +): response is IndexesListLatestDefaultResponse; +export function isUnexpected( + response: IndexesGetVersion200Response | IndexesGetVersionDefaultResponse, +): response is IndexesGetVersionDefaultResponse; +export function isUnexpected( + response: + | IndexesDeleteVersion204Response + | IndexesDeleteVersionDefaultResponse, +): response is IndexesDeleteVersionDefaultResponse; +export function isUnexpected( + response: + | IndexesCreateVersion200Response + | IndexesCreateVersion201Response + | IndexesCreateVersionDefaultResponse, +): response is IndexesCreateVersionDefaultResponse; +export function isUnexpected( + response: DeploymentsGet200Response | DeploymentsGetDefaultResponse, +): response is DeploymentsGetDefaultResponse; +export function isUnexpected( + response: DeploymentsList200Response | DeploymentsListDefaultResponse, +): response is DeploymentsListDefaultResponse; +export function isUnexpected( + response: + | AssistantsCreateAgent200Response + | AssistantsCreateAgentDefaultResponse + | AssistantsListAgents200Response + | AssistantsListAgentsDefaultResponse + | AssistantsGetAgent200Response + | AssistantsGetAgentDefaultResponse + | AssistantsUpdateAgent200Response + | AssistantsUpdateAgentDefaultResponse + | AssistantsDeleteAgent200Response + | AssistantsDeleteAgentDefaultResponse + | AssistantsCreateThread200Response + | AssistantsCreateThreadDefaultResponse + | AssistantsGetThread200Response + | AssistantsGetThreadDefaultResponse + | AssistantsUpdateThread200Response + | AssistantsUpdateThreadDefaultResponse + | AssistantsDeleteThread200Response + | AssistantsDeleteThreadDefaultResponse + | AssistantsCreateMessage200Response + | AssistantsCreateMessageDefaultResponse + | AssistantsListMessages200Response + | AssistantsListMessagesDefaultResponse + | AssistantsGetMessage200Response + | AssistantsGetMessageDefaultResponse + | AssistantsUpdateMessage200Response + | AssistantsUpdateMessageDefaultResponse + | AssistantsCreateRun200Response + | AssistantsCreateRunDefaultResponse + | AssistantsListRuns200Response + | AssistantsListRunsDefaultResponse + | AssistantsGetRun200Response + | AssistantsGetRunDefaultResponse + | AssistantsUpdateRun200Response + | AssistantsUpdateRunDefaultResponse + | AssistantsSubmitToolOutputsToRun200Response + | AssistantsSubmitToolOutputsToRunDefaultResponse + | AssistantsCancelRun200Response + | AssistantsCancelRunDefaultResponse + | AssistantsCreateThreadAndRun200Response + | AssistantsCreateThreadAndRunDefaultResponse + | AssistantsGetRunStep200Response + | AssistantsGetRunStepDefaultResponse + | AssistantsListRunSteps200Response + | AssistantsListRunStepsDefaultResponse + | AssistantsListFiles200Response + | AssistantsListFilesDefaultResponse + | AssistantsUploadFile200Response + | AssistantsUploadFileDefaultResponse + | AssistantsDeleteFile200Response + | AssistantsDeleteFileDefaultResponse + | AssistantsGetFile200Response + | AssistantsGetFileDefaultResponse + | AssistantsGetFileContent200Response + | AssistantsGetFileContentDefaultResponse + | AssistantsListVectorStores200Response + | AssistantsListVectorStoresDefaultResponse + | AssistantsCreateVectorStore200Response + | AssistantsCreateVectorStoreDefaultResponse + | AssistantsGetVectorStore200Response + | AssistantsGetVectorStoreDefaultResponse + | AssistantsModifyVectorStore200Response + | AssistantsModifyVectorStoreDefaultResponse + | AssistantsDeleteVectorStore200Response + | AssistantsDeleteVectorStoreDefaultResponse + | AssistantsListVectorStoreFiles200Response + | AssistantsListVectorStoreFilesDefaultResponse + | AssistantsCreateVectorStoreFile200Response + | AssistantsCreateVectorStoreFileDefaultResponse + | AssistantsGetVectorStoreFile200Response + | AssistantsGetVectorStoreFileDefaultResponse + | AssistantsDeleteVectorStoreFile200Response + | AssistantsDeleteVectorStoreFileDefaultResponse + | AssistantsCreateVectorStoreFileBatch200Response + | AssistantsCreateVectorStoreFileBatchDefaultResponse + | AssistantsGetVectorStoreFileBatch200Response + | AssistantsGetVectorStoreFileBatchDefaultResponse + | AssistantsCancelVectorStoreFileBatch200Response + | AssistantsCancelVectorStoreFileBatchDefaultResponse + | AssistantsListVectorStoreFileBatchFiles200Response + | AssistantsListVectorStoreFileBatchFilesDefaultResponse + | ConnectionsGet200Response + | ConnectionsGetDefaultResponse + | ConnectionsList200Response + | ConnectionsListDefaultResponse + | EvaluationsGet200Response + | EvaluationsGetDefaultResponse + | EvaluationsList200Response + | EvaluationsListDefaultResponse + | EvaluationsCreateRun200Response + | EvaluationsCreateRunDefaultResponse + | DatasetsListVersions200Response + | DatasetsListVersionsDefaultResponse + | DatasetsCreate200Response + | DatasetsCreateDefaultResponse + | DatasetsListLatest200Response + | DatasetsListLatestDefaultResponse + | DatasetsGetVersion200Response + | DatasetsGetVersionDefaultResponse + | DatasetsDeleteVersion204Response + | DatasetsDeleteVersionDefaultResponse + | DatasetsCreateVersion200Response + | DatasetsCreateVersion201Response + | DatasetsCreateVersionDefaultResponse + | DatasetsStartPendingUploadVersion200Response + | DatasetsStartPendingUploadVersionDefaultResponse + | DatasetsStartPendingUpload200Response + | DatasetsStartPendingUploadDefaultResponse + | IndexesListVersions200Response + | IndexesListVersionsDefaultResponse + | IndexesCreate200Response + | IndexesCreateDefaultResponse + | IndexesListLatest200Response + | IndexesListLatestDefaultResponse + | IndexesGetVersion200Response + | IndexesGetVersionDefaultResponse + | IndexesDeleteVersion204Response + | IndexesDeleteVersionDefaultResponse + | IndexesCreateVersion200Response + | IndexesCreateVersion201Response + | IndexesCreateVersionDefaultResponse + | DeploymentsGet200Response + | DeploymentsGetDefaultResponse + | DeploymentsList200Response + | DeploymentsListDefaultResponse, +): response is + | AssistantsCreateAgentDefaultResponse + | AssistantsListAgentsDefaultResponse + | AssistantsGetAgentDefaultResponse + | AssistantsUpdateAgentDefaultResponse + | AssistantsDeleteAgentDefaultResponse + | AssistantsCreateThreadDefaultResponse + | AssistantsGetThreadDefaultResponse + | AssistantsUpdateThreadDefaultResponse + | AssistantsDeleteThreadDefaultResponse + | AssistantsCreateMessageDefaultResponse + | AssistantsListMessagesDefaultResponse + | AssistantsGetMessageDefaultResponse + | AssistantsUpdateMessageDefaultResponse + | AssistantsCreateRunDefaultResponse + | AssistantsListRunsDefaultResponse + | AssistantsGetRunDefaultResponse + | AssistantsUpdateRunDefaultResponse + | AssistantsSubmitToolOutputsToRunDefaultResponse + | AssistantsCancelRunDefaultResponse + | AssistantsCreateThreadAndRunDefaultResponse + | AssistantsGetRunStepDefaultResponse + | AssistantsListRunStepsDefaultResponse + | AssistantsListFilesDefaultResponse + | AssistantsUploadFileDefaultResponse + | AssistantsDeleteFileDefaultResponse + | AssistantsGetFileDefaultResponse + | AssistantsGetFileContentDefaultResponse + | AssistantsListVectorStoresDefaultResponse + | AssistantsCreateVectorStoreDefaultResponse + | AssistantsGetVectorStoreDefaultResponse + | AssistantsModifyVectorStoreDefaultResponse + | AssistantsDeleteVectorStoreDefaultResponse + | AssistantsListVectorStoreFilesDefaultResponse + | AssistantsCreateVectorStoreFileDefaultResponse + | AssistantsGetVectorStoreFileDefaultResponse + | AssistantsDeleteVectorStoreFileDefaultResponse + | AssistantsCreateVectorStoreFileBatchDefaultResponse + | AssistantsGetVectorStoreFileBatchDefaultResponse + | AssistantsCancelVectorStoreFileBatchDefaultResponse + | AssistantsListVectorStoreFileBatchFilesDefaultResponse + | ConnectionsGetDefaultResponse + | ConnectionsListDefaultResponse + | EvaluationsGetDefaultResponse + | EvaluationsListDefaultResponse + | EvaluationsCreateRunDefaultResponse + | DatasetsListVersionsDefaultResponse + | DatasetsCreateDefaultResponse + | DatasetsListLatestDefaultResponse + | DatasetsGetVersionDefaultResponse + | DatasetsDeleteVersionDefaultResponse + | DatasetsCreateVersionDefaultResponse + | DatasetsStartPendingUploadVersionDefaultResponse + | DatasetsStartPendingUploadDefaultResponse + | IndexesListVersionsDefaultResponse + | IndexesCreateDefaultResponse + | IndexesListLatestDefaultResponse + | IndexesGetVersionDefaultResponse + | IndexesDeleteVersionDefaultResponse + | IndexesCreateVersionDefaultResponse + | DeploymentsGetDefaultResponse + | DeploymentsListDefaultResponse { + const lroOriginal = response.headers["x-ms-original-url"]; + const url = new URL(lroOriginal ?? response.request.url); + const method = response.request.method; + let pathDetails = responseMap[`${method} ${url.pathname}`]; + if (!pathDetails) { + pathDetails = getParametrizedPathSuccess(method, url.pathname); + } + return !pathDetails.includes(response.status); +} + +function getParametrizedPathSuccess(method: string, path: string): string[] { + const pathParts = path.split("/"); + + // Traverse list to match the longest candidate + // matchedLen: the length of candidate path + // matchedValue: the matched status code array + let matchedLen = -1, + matchedValue: string[] = []; + + // Iterate the responseMap to find a match + for (const [key, value] of Object.entries(responseMap)) { + // Extracting the path from the map key which is in format + // GET /path/foo + if (!key.startsWith(method)) { + continue; + } + const candidatePath = getPathFromMapKey(key); + // Get each part of the url path + const candidateParts = candidatePath.split("/"); + + // track if we have found a match to return the values found. + let found = true; + for ( + let i = candidateParts.length - 1, j = pathParts.length - 1; + i >= 1 && j >= 1; + i--, j-- + ) { + if ( + candidateParts[i]?.startsWith("{") && + candidateParts[i]?.indexOf("}") !== -1 + ) { + const start = candidateParts[i]!.indexOf("}") + 1, + end = candidateParts[i]?.length; + // If the current part of the candidate is a "template" part + // Try to use the suffix of pattern to match the path + // {guid} ==> $ + // {guid}:export ==> :export$ + const isMatched = new RegExp( + `${candidateParts[i]?.slice(start, end)}`, + ).test(pathParts[j] || ""); + + if (!isMatched) { + found = false; + break; + } + continue; + } + + // If the candidate part is not a template and + // the parts don't match mark the candidate as not found + // to move on with the next candidate path. + if (candidateParts[i] !== pathParts[j]) { + found = false; + break; + } + } + + // We finished evaluating the current candidate parts + // Update the matched value if and only if we found the longer pattern + if (found && candidatePath.length > matchedLen) { + matchedLen = candidatePath.length; + matchedValue = value; + } + } + + return matchedValue; +} + +function getPathFromMapKey(mapKey: string): string { + const pathStart = mapKey.indexOf("/"); + return mapKey.slice(pathStart); +} diff --git a/sdk/ai/ai-projects-1dp/src/logger.ts b/sdk/ai/ai-projects-1dp/src/logger.ts new file mode 100644 index 000000000000..26856543a80b --- /dev/null +++ b/sdk/ai/ai-projects-1dp/src/logger.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { createClientLogger } from "@azure/logger"; +export const logger = createClientLogger("ai-projects-1dp"); diff --git a/sdk/ai/ai-projects-1dp/src/models.ts b/sdk/ai/ai-projects-1dp/src/models.ts new file mode 100644 index 000000000000..bcbf247ea3b0 --- /dev/null +++ b/sdk/ai/ai-projects-1dp/src/models.ts @@ -0,0 +1,936 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** The request details to use when creating a new agent. */ +export interface CreateAgentOptions { + /** The ID of the model to use. */ + model: string; + /** The name of the new agent. */ + name?: string | null; + /** The description of the new agent. */ + description?: string | null; + /** The system instructions for the new agent to use. */ + instructions?: string | null; + /** The collection of tools to enable for the new agent. */ + tools?: Array; + /** + * A set of resources that are used by the agent's tools. The resources are specific to the type of tool. For example, the `code_interpreter` + * tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. + */ + tool_resources?: ToolResources | null; + /** + * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, + * while lower values like 0.2 will make it more focused and deterministic. + */ + temperature?: number | null; + /** + * An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. + * So 0.1 means only the tokens comprising the top 10% probability mass are considered. + * + * We generally recommend altering this or temperature but not both. + */ + top_p?: number | null; + /** The response format of the tool calls used by this agent. */ + response_format?: AgentsApiResponseFormatOption | null; + /** A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. */ + metadata?: Record | null; +} + +/** An abstract representation of an input tool definition that an agent can use. */ +export interface ToolDefinitionParent { + type: string; +} + +/** The input definition information for a code interpreter tool as used to configure an agent. */ +export interface CodeInterpreterToolDefinition extends ToolDefinitionParent { + /** The object type, which is always 'code_interpreter'. */ + type: "code_interpreter"; +} + +/** The input definition information for a file search tool as used to configure an agent. */ +export interface FileSearchToolDefinition extends ToolDefinitionParent { + /** The object type, which is always 'file_search'. */ + type: "file_search"; + /** Options overrides for the file search tool. */ + file_search?: FileSearchToolDefinitionDetails; +} + +/** Options overrides for the file search tool. */ +export interface FileSearchToolDefinitionDetails { + /** + * The maximum number of results the file search tool should output. The default is 20 for gpt-4* models and 5 for gpt-3.5-turbo. This number should be between 1 and 50 inclusive. + * + * Note that the file search tool may output fewer than `max_num_results` results. See the file search tool documentation for more information. + */ + max_num_results?: number; + /** Ranking options for file search. */ + ranking_options?: FileSearchRankingOptions; +} + +/** Ranking options for file search. */ +export interface FileSearchRankingOptions { + /** File search ranker. */ + ranker: string; + /** Ranker search threshold. */ + score_threshold: number; +} + +/** The input definition information for a function tool as used to configure an agent. */ +export interface FunctionToolDefinition extends ToolDefinitionParent { + /** The object type, which is always 'function'. */ + type: "function"; + /** The definition of the concrete function that the function tool should call. */ + function: FunctionDefinition; +} + +/** The input definition information for a function. */ +export interface FunctionDefinition { + /** The name of the function to be called. */ + name: string; + /** A description of what the function does, used by the model to choose when and how to call the function. */ + description?: string; + /** The parameters the functions accepts, described as a JSON Schema object. */ + parameters: unknown; +} + +/** The input definition information for a bing grounding search tool as used to configure an agent. */ +export interface BingGroundingToolDefinition extends ToolDefinitionParent { + /** The object type, which is always 'bing_grounding'. */ + type: "bing_grounding"; + /** The list of connections used by the bing grounding tool. */ + bing_grounding: ToolConnectionList; +} + +/** A set of connection resources currently used by either the `bing_grounding`, `fabric_dataagent`, or `sharepoint_grounding` tools. */ +export interface ToolConnectionList { + /** + * The connections attached to this tool. There can be a maximum of 1 connection + * resource attached to the tool. + */ + connections?: Array; +} + +/** A connection resource. */ +export interface ToolConnection { + /** A connection in a ToolConnectionList attached to this tool. */ + connection_id: string; +} + +/** The input definition information for a Microsoft Fabric tool as used to configure an agent. */ +export interface MicrosoftFabricToolDefinition extends ToolDefinitionParent { + /** The object type, which is always 'fabric_dataagent'. */ + type: "fabric_dataagent"; + /** The list of connections used by the Microsoft Fabric tool. */ + fabric_dataagent: ToolConnectionList; +} + +/** The input definition information for a sharepoint tool as used to configure an agent. */ +export interface SharepointToolDefinition extends ToolDefinitionParent { + /** The object type, which is always 'sharepoint_grounding'. */ + type: "sharepoint_grounding"; + /** The list of connections used by the SharePoint tool. */ + sharepoint_grounding: ToolConnectionList; +} + +/** The input definition information for an Azure AI search tool as used to configure an agent. */ +export interface AzureAISearchToolDefinition extends ToolDefinitionParent { + /** The object type, which is always 'azure_ai_search'. */ + type: "azure_ai_search"; +} + +/** The input definition information for an OpenAPI tool as used to configure an agent. */ +export interface OpenApiToolDefinition extends ToolDefinitionParent { + /** The object type, which is always 'openapi'. */ + type: "openapi"; + /** The openapi function definition. */ + openapi: OpenApiFunctionDefinition; +} + +/** The input definition information for an openapi function. */ +export interface OpenApiFunctionDefinition { + /** The name of the function to be called. */ + name: string; + /** A description of what the function does, used by the model to choose when and how to call the function. */ + description?: string; + /** The openapi function shape, described as a JSON Schema object. */ + spec: unknown; + /** Open API authentication details */ + auth: OpenApiAuthDetails; +} + +/** authentication details for OpenApiFunctionDefinition */ +export interface OpenApiAuthDetailsParent { + type: OpenApiAuthType; +} + +/** Security details for OpenApi anonymous authentication */ +export interface OpenApiAnonymousAuthDetails extends OpenApiAuthDetailsParent { + /** The object type, which is always 'anonymous'. */ + type: "anonymous"; +} + +/** Security details for OpenApi connection authentication */ +export interface OpenApiConnectionAuthDetails extends OpenApiAuthDetailsParent { + /** The object type, which is always 'connection'. */ + type: "connection"; + /** Connection auth security details */ + security_scheme: OpenApiConnectionSecurityScheme; +} + +/** Security scheme for OpenApi managed_identity authentication */ +export interface OpenApiConnectionSecurityScheme { + /** Connection id for Connection auth type */ + connection_id: string; +} + +/** Security details for OpenApi managed_identity authentication */ +export interface OpenApiManagedAuthDetails extends OpenApiAuthDetailsParent { + /** The object type, which is always 'managed_identity'. */ + type: "managed_identity"; + /** Connection auth security details */ + security_scheme: OpenApiManagedSecurityScheme; +} + +/** Security scheme for OpenApi managed_identity authentication */ +export interface OpenApiManagedSecurityScheme { + /** Authentication scope for managed_identity auth type */ + audience: string; +} + +/** The input definition information for a azure function tool as used to configure an agent. */ +export interface AzureFunctionToolDefinition extends ToolDefinitionParent { + /** The object type, which is always 'azure_function'. */ + type: "azure_function"; + /** The definition of the concrete function that the function tool should call. */ + azure_function: AzureFunctionDefinition; +} + +/** The definition of Azure function. */ +export interface AzureFunctionDefinition { + /** The definition of azure function and its parameters. */ + function: FunctionDefinition; + /** Input storage queue. The queue storage trigger runs a function as messages are added to it. */ + input_binding: AzureFunctionBinding; + /** Output storage queue. The function writes output to this queue when the input items are processed. */ + output_binding: AzureFunctionBinding; +} + +/** The structure for keeping storage queue name and URI. */ +export interface AzureFunctionBinding { + /** The type of binding, which is always 'storage_queue'. */ + type: "storage_queue"; + /** Storage queue. */ + storage_queue: AzureFunctionStorageQueue; +} + +/** The structure for keeping storage queue name and URI. */ +export interface AzureFunctionStorageQueue { + /** URI to the Azure Storage Queue service allowing you to manipulate a queue. */ + queue_service_endpoint: string; + /** The name of an Azure function storage queue. */ + queue_name: string; +} + +/** + * A set of resources that are used by the agent's tools. The resources are specific to the type of + * tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` + * tool requires a list of vector store IDs. + */ +export interface ToolResources { + /** Resources to be used by the `code_interpreter` tool consisting of file IDs. */ + code_interpreter?: CodeInterpreterToolResource; + /** Resources to be used by the `file_search` tool consisting of vector store IDs. */ + file_search?: FileSearchToolResource; + /** Resources to be used by the `azure_ai_search` tool consisting of index IDs and names. */ + azure_ai_search?: AzureAISearchResource; +} + +/** A set of resources that are used by the `code_interpreter` tool. */ +export interface CodeInterpreterToolResource { + /** + * A list of file IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files + * associated with the tool. + */ + file_ids?: string[]; + /** The data sources to be used. This option is mutually exclusive with the `fileIds` property. */ + data_sources?: Array; +} + +/** + * The structure, containing Azure asset URI path and the asset type of the file used as a data source + * for the enterprise file search. + */ +export interface VectorStoreDataSource { + /** Asset URI. */ + uri: string; + /** + * The asset type + * + * Possible values: "uri_asset", "id_asset" + */ + type: VectorStoreDataSourceAssetType; +} + +/** A set of resources that are used by the `file_search` tool. */ +export interface FileSearchToolResource { + /** + * The ID of the vector store attached to this agent. There can be a maximum of 1 vector + * store attached to the agent. + */ + vector_store_ids?: string[]; + /** + * The list of vector store configuration objects from Azure. + * This list is limited to one element. + * The only element of this list contains the list of azure asset IDs used by the search tool. + */ + vector_stores?: Array; +} + +/** The structure, containing the list of vector storage configurations i.e. the list of azure asset IDs. */ +export interface VectorStoreConfigurations { + /** Name */ + name: string; + /** Configurations */ + configuration: VectorStoreConfiguration; +} + +/** + * Vector storage configuration is the list of data sources, used when multiple + * files can be used for the enterprise file search. + */ +export interface VectorStoreConfiguration { + /** Data sources */ + data_sources: Array; +} + +/** A set of index resources used by the `azure_ai_search` tool. */ +export interface AzureAISearchResource { + /** + * The indices attached to this agent. There can be a maximum of 1 index + * resource attached to the agent. + */ + indexes?: Array; +} + +/** A AI Search Index resource. */ +export interface AISearchIndexResource { + /** An index connection id in an IndexResource attached to this agent. */ + index_connection_id: string; + /** The name of an index in an IndexResource attached to this agent. */ + index_name: string; + /** + * Type of query in an AIIndexResource attached to this agent. + * + * Possible values: "simple", "semantic", "vector", "vector_simple_hybrid", "vector_semantic_hybrid" + */ + query_type?: AzureAISearchQueryType; + /** Number of documents to retrieve from search and present to the model. */ + top_k?: number; + /** Odata filter string for search resource. */ + filter?: string; +} + +/** + * An object describing the expected output of the model. If `json_object` only `function` type `tools` are allowed to be passed to the Run. + * If `text` the model can return text or any value needed. + */ +export interface AgentsApiResponseFormat { + /** + * Must be one of `text` or `json_object`. + * + * Possible values: "text", "json_object" + */ + type?: ResponseFormat; +} + +/** The type of response format being defined: `json_schema` */ +export interface ResponseFormatJsonSchemaType { + /** Type */ + type: "json_schema"; + /** The JSON schema, describing response format. */ + json_schema: ResponseFormatJsonSchema; +} + +/** A description of what the response format is for, used by the model to determine how to respond in the format. */ +export interface ResponseFormatJsonSchema { + /** A description of what the response format is for, used by the model to determine how to respond in the format. */ + description?: string; + /** The name of a schema. */ + name: string; + /** The JSON schema object, describing the response format. */ + schema: unknown; +} + +/** The request details to use when modifying an existing agent. */ +export interface UpdateAgentOptions { + /** The ID of the model to use. */ + model?: string; + /** The modified name for the agent to use. */ + name?: string | null; + /** The modified description for the agent to use. */ + description?: string | null; + /** The modified system instructions for the new agent to use. */ + instructions?: string | null; + /** The modified collection of tools to enable for the agent. */ + tools?: Array; + /** + * A set of resources that are used by the agent's tools. The resources are specific to the type of tool. For example, + * the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. + */ + tool_resources?: ToolResources; + /** + * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, + * while lower values like 0.2 will make it more focused and deterministic. + */ + temperature?: number | null; + /** + * An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. + * So 0.1 means only the tokens comprising the top 10% probability mass are considered. + * + * We generally recommend altering this or temperature but not both. + */ + top_p?: number | null; + /** The response format of the tool calls used by this agent. */ + response_format?: AgentsApiResponseFormatOption | null; + /** A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. */ + metadata?: Record | null; +} + +/** The details used to create a new agent thread. */ +export interface AgentThreadCreationOptions { + /** The initial messages to associate with the new thread. */ + messages?: Array; + /** + * A set of resources that are made available to the agent's tools in this thread. The resources are specific to the + * type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires + * a list of vector store IDs. + */ + tool_resources?: ToolResources | null; + /** A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. */ + metadata?: Record | null; +} + +/** A single message within an agent thread, as provided during that thread's creation for its initial state. */ +export interface ThreadMessageOptions { + /** + * The role of the entity that is creating the message. Allowed values include: + * - `user`: Indicates the message is sent by an actual user and should be used in most + * cases to represent user-generated messages. + * - `assistant`: Indicates the message is generated by the agent. Use this value to insert + * messages from the agent into the + * conversation. + * + * Possible values: "user", "assistant" + */ + role: MessageRole; + /** + * The textual content of the initial message. Currently, robust input including images and annotated text may only be provided via + * a separate call to the create message API. + */ + content: string; + /** A list of files attached to the message, and the tools they should be added to. */ + attachments?: Array | null; + /** A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. */ + metadata?: Record | null; +} + +/** This describes to which tools a file has been attached. */ +export interface MessageAttachment { + /** The ID of the file to attach to the message. */ + file_id?: string; + /** Azure asset ID. */ + data_source?: VectorStoreDataSource; + /** The tools to add to this file. */ + tools: Array; +} + +/** The details used to update an existing agent thread */ +export interface UpdateAgentThreadOptions { + /** + * A set of resources that are made available to the agent's tools in this thread. The resources are specific to the + * type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires + * a list of vector store IDs + */ + tool_resources?: ToolResources | null; + /** A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. */ + metadata?: Record | null; +} + +/** The details used when creating a new run of an agent thread. */ +export interface CreateRunOptions { + /** The ID of the agent that should run the thread. */ + assistant_id: string; + /** The overridden model name that the agent should use to run the thread. */ + model?: string | null; + /** The overridden system instructions that the agent should use to run the thread. */ + instructions?: string | null; + /** + * Additional instructions to append at the end of the instructions for the run. This is useful for modifying the behavior + * on a per-run basis without overriding other instructions. + */ + additional_instructions?: string | null; + /** Adds additional messages to the thread before creating the run. */ + additional_messages?: Array | null; + /** The overridden list of enabled tools that the agent should use to run the thread. */ + tools?: Array | null; + /** + * If `true`, returns a stream of events that happen during the Run as server-sent events, + * terminating when the Run enters a terminal state with a `data: [DONE]` message. + */ + stream?: boolean; + /** + * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output + * more random, while lower values like 0.2 will make it more focused and deterministic. + */ + temperature?: number | null; + /** + * An alternative to sampling with temperature, called nucleus sampling, where the model + * considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens + * comprising the top 10% probability mass are considered. + * + * We generally recommend altering this or temperature but not both. + */ + top_p?: number | null; + /** + * The maximum number of prompt tokens that may be used over the course of the run. The run will make a best effort to use only + * the number of prompt tokens specified, across multiple turns of the run. If the run exceeds the number of prompt tokens specified, + * the run will end with status `incomplete`. See `incomplete_details` for more info. + */ + max_prompt_tokens?: number | null; + /** + * The maximum number of completion tokens that may be used over the course of the run. The run will make a best effort + * to use only the number of completion tokens specified, across multiple turns of the run. If the run exceeds the number of + * completion tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info. + */ + max_completion_tokens?: number | null; + /** The strategy to use for dropping messages as the context windows moves forward. */ + truncation_strategy?: TruncationObject | null; + /** Controls whether or not and which tool is called by the model. */ + tool_choice?: AgentsApiToolChoiceOption | null; + /** Specifies the format that the model must output. */ + response_format?: AgentsApiResponseFormatOption | null; + /** If `true` functions will run in parallel during tool use. */ + parallel_tool_calls?: boolean; + /** A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. */ + metadata?: Record | null; +} + +/** + * Controls for how a thread will be truncated prior to the run. Use this to control the initial + * context window of the run. + */ +export interface TruncationObject { + /** + * The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will + * be truncated to the `lastMessages` count most recent messages in the thread. When set to `auto`, messages in the middle of the thread + * will be dropped to fit the context length of the model, `max_prompt_tokens`. + * + * Possible values: "auto", "last_messages" + */ + type: TruncationStrategy; + /** The number of most recent messages from the thread when constructing the context for the run. */ + last_messages?: number | null; +} + +/** Specifies a tool the model should use. Use to force the model to call a specific tool. */ +export interface AgentsNamedToolChoice { + /** + * the type of tool. If type is `function`, the function name must be set. + * + * Possible values: "function", "code_interpreter", "file_search", "bing_grounding", "fabric_dataagent", "sharepoint_grounding", "azure_ai_search" + */ + type: AgentsNamedToolChoiceType; + /** The name of the function to call */ + function?: FunctionName; +} + +/** The function name that will be used, if using the `function` tool */ +export interface FunctionName { + /** The name of the function to call */ + name: string; +} + +/** + * Request object. A set of resources that are used by the agent's tools. The resources are specific to the type of tool. + * For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of + * vector store IDs. + */ +export interface UpdateToolResourcesOptions { + /** + * Overrides the list of file IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files + * associated with the tool. + */ + code_interpreter?: UpdateCodeInterpreterToolResourceOptions; + /** Overrides the vector store attached to this agent. There can be a maximum of 1 vector store attached to the agent. */ + file_search?: UpdateFileSearchToolResourceOptions; + /** Overrides the resources to be used by the `azure_ai_search` tool consisting of index IDs and names. */ + azure_ai_search?: AzureAISearchResource; +} + +/** Request object to update `code_interpreted` tool resources. */ +export interface UpdateCodeInterpreterToolResourceOptions { + /** A list of file IDs to override the current list of the agent. */ + file_ids?: string[]; +} + +/** Request object to update `file_search` tool resources. */ +export interface UpdateFileSearchToolResourceOptions { + /** A list of vector store IDs to override the current list of the agent. */ + vector_store_ids?: string[]; +} + +/** The data provided during a tool outputs submission to resolve pending tool calls and allow the model to continue. */ +export interface ToolOutput { + /** The ID of the tool call being resolved, as provided in the tool calls of a required action from a run. */ + tool_call_id?: string; + /** The output from the tool to be submitted. */ + output?: string; +} + +/** The details used when creating and immediately running a new agent thread. */ +export interface CreateAndRunThreadOptions { + /** The ID of the agent for which the thread should be created. */ + assistant_id: string; + /** The details used to create the new thread. If no thread is provided, an empty one will be created. */ + thread?: AgentThreadCreationOptions; + /** The overridden model that the agent should use to run the thread. */ + model?: string | null; + /** The overridden system instructions the agent should use to run the thread. */ + instructions?: string | null; + /** The overridden list of enabled tools the agent should use to run the thread. */ + tools?: Array | null; + /** Override the tools the agent can use for this run. This is useful for modifying the behavior on a per-run basis */ + tool_resources?: UpdateToolResourcesOptions | null; + /** + * If `true`, returns a stream of events that happen during the Run as server-sent events, + * terminating when the Run enters a terminal state with a `data: [DONE]` message. + */ + stream?: boolean; + /** + * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output + * more random, while lower values like 0.2 will make it more focused and deterministic. + */ + temperature?: number | null; + /** + * An alternative to sampling with temperature, called nucleus sampling, where the model + * considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens + * comprising the top 10% probability mass are considered. + * + * We generally recommend altering this or temperature but not both. + */ + top_p?: number | null; + /** + * The maximum number of prompt tokens that may be used over the course of the run. The run will make a best effort to use only + * the number of prompt tokens specified, across multiple turns of the run. If the run exceeds the number of prompt tokens specified, + * the run will end with status `incomplete`. See `incomplete_details` for more info. + */ + max_prompt_tokens?: number | null; + /** + * The maximum number of completion tokens that may be used over the course of the run. The run will make a best effort to use only + * the number of completion tokens specified, across multiple turns of the run. If the run exceeds the number of completion tokens + * specified, the run will end with status `incomplete`. See `incomplete_details` for more info. + */ + max_completion_tokens?: number | null; + /** The strategy to use for dropping messages as the context windows moves forward. */ + truncation_strategy?: TruncationObject | null; + /** Controls whether or not and which tool is called by the model. */ + tool_choice?: AgentsApiToolChoiceOption | null; + /** Specifies the format that the model must output. */ + response_format?: AgentsApiResponseFormatOption | null; + /** If `true` functions will run in parallel during tool use. */ + parallel_tool_calls?: boolean; + /** A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. */ + metadata?: Record | null; +} + +export interface HttpPartFile {} + +export interface HttpPartFilePurpose {} + +export interface HttpPartString {} + +/** The expiration policy for a vector store. */ +export interface VectorStoreExpirationPolicy { + /** + * Anchor timestamp after which the expiration policy applies. Supported anchors: `last_active_at`. + * + * Possible values: "last_active_at" + */ + anchor: VectorStoreExpirationPolicyAnchor; + /** The anchor timestamp after which the expiration policy applies. */ + days: number; +} + +/** Request object for creating a vector store. */ +export interface VectorStoreOptions { + /** A list of file IDs that the vector store should use. Useful for tools like `file_search` that can access files. */ + file_ids?: string[]; + /** The name of the vector store. */ + name?: string; + /** The vector store configuration, used when vector store is created from Azure asset URIs. */ + configuration?: VectorStoreConfiguration; + /** Details on when this vector store expires */ + expires_after?: VectorStoreExpirationPolicy; + /** The chunking strategy used to chunk the file(s). If not set, will use the auto strategy. Only applicable if file_ids is non-empty. */ + chunking_strategy?: VectorStoreChunkingStrategyRequest; + /** A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. */ + metadata?: Record | null; +} + +/** An abstract representation of a vector store chunking strategy configuration. */ +export interface VectorStoreChunkingStrategyRequestParent { + type: VectorStoreChunkingStrategyRequestType; +} + +/** The default strategy. This strategy currently uses a max_chunk_size_tokens of 800 and chunk_overlap_tokens of 400. */ +export interface VectorStoreAutoChunkingStrategyRequest + extends VectorStoreChunkingStrategyRequestParent { + /** The object type, which is always 'auto'. */ + type: "auto"; +} + +/** A statically configured chunking strategy. */ +export interface VectorStoreStaticChunkingStrategyRequest + extends VectorStoreChunkingStrategyRequestParent { + /** The object type, which is always 'static'. */ + type: "static"; + /** The options for the static chunking strategy. */ + static: VectorStoreStaticChunkingStrategyOptions; +} + +/** Options to configure a vector store static chunking strategy. */ +export interface VectorStoreStaticChunkingStrategyOptions { + /** The maximum number of tokens in each chunk. The default value is 800. The minimum value is 100 and the maximum value is 4096. */ + max_chunk_size_tokens: number; + /** + * The number of tokens that overlap between chunks. The default value is 400. + * Note that the overlap must not exceed half of max_chunk_size_tokens. + */ + chunk_overlap_tokens: number; +} + +/** Request object for updating a vector store. */ +export interface VectorStoreUpdateOptions { + /** The name of the vector store. */ + name?: string | null; + /** Details on when this vector store expires */ + expires_after?: VectorStoreExpirationPolicy | null; + /** A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. */ + metadata?: Record | null; +} + +/** Evaluation Definition */ +export interface Evaluation { + /** Data for evaluation. */ + data: InputData; + /** Display Name for evaluation. It helps to find the evaluation easily in AI Foundry. It does not need to be unique. */ + displayName?: string; + /** Description of the evaluation. It can be used to store additional information about the evaluation and is mutable. */ + description?: string; + /** Evaluation's tags. Unlike properties, tags are fully mutable. */ + tags?: Record; + /** Evaluation's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed. */ + properties?: Record; + /** Evaluators to be used for the evaluation. */ + evaluators: Record; +} + +/** Abstract data class. */ +export interface InputDataParent { + type: string; +} + +/** Dataset as source for evaluation. */ +export interface InputDataset extends InputDataParent { + type: "dataset"; + /** Evaluation input data */ + id: string; +} + +/** Evaluator Configuration */ +export interface EvaluatorConfiguration { + /** Identifier of the evaluator. */ + id: string; + /** Initialization parameters of the evaluator. */ + initParams?: Record; + /** Data parameters of the evaluator. */ + dataMapping?: Record; +} + +/** DatasetVersion Definition */ +export interface DatasetVersionParent { + /** [Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330 */ + datasetUri: string; + /** Asset stage */ + stage?: string; + /** The asset description text. */ + description?: string; + /** Tag dictionary. Tags can be added, removed, and updated. */ + tags?: Record; + type: DatasetType; +} + +/** FileDatasetVersion Definition */ +export interface FileDatasetVersion extends DatasetVersionParent { + /** Dataset type */ + type: "uri_file"; + /** Indicates OpenAI Purpose. FileDatasets created with this field will be compatible with OpenAI-specific features */ + openAIPurpose: string; +} + +/** FileDatasetVersion Definition */ +export interface FolderDatasetVersion extends DatasetVersionParent { + /** Dataset type */ + type: "uri_folder"; +} + +/** Represents a request for a pending upload. */ +export interface PendingUploadRequest { + /** If PendingUploadId is not provided, a random GUID will be used. */ + pendingUploadId?: string; + /** Name of Azure blob storage connection to use for generating temporary SAS token */ + connectionName?: string; + /** TemporaryBlobReference is the only supported type. */ + pendingUploadType: "TemporaryBlobReference"; +} + +/** Index resource Definition */ +export interface IndexParent { + /** Asset stage */ + stage?: string; + /** The asset description text. */ + description?: string; + /** Tag dictionary. Tags can be added, removed, and updated. */ + tags?: Record; + type: IndexType; +} + +/** Azure AI Search Index Definition */ +export interface AzureAISearchIndex extends IndexParent { + /** Type of index */ + type: "AzureSearch"; + /** Name of connection to Azure AI Search */ + connectionName: string; + /** Name of index in Azure AI Search resource to attach */ + indexName: string; +} + +/** Managed Azure AI Search Index Definition */ +export interface ManagedAzureAISearchIndex extends IndexParent { + /** Type of index */ + type: "ManagedAzureSearch"; + /** Vector store id of managed index */ + vectorStoreId: string; +} + +/** CosmosDB Vector Store Index Definition */ +export interface CosmosDBIndex extends IndexParent { + /** Type of index */ + type: "CosmosDBNoSqlVectorStore"; + /** Name of connection to CosmosDB */ + connectionName: string; + /** Name of the CosmosDB Database */ + databaseName: string; + /** Name of CosmosDB Container */ + containerName: string; + /** Embedding model configuration */ + embeddingConfiguration: EmbeddingConfiguration; +} + +/** Embedding configuration class */ +export interface EmbeddingConfiguration { + /** Deployment name of embedding model. It can point to a model deployment either in the parent AIServices or a connection. */ + modelDeploymentName: string; + /** Embedding field */ + embeddingField: string; +} + +/** An abstract representation of an input tool definition that an agent can use. */ +export type ToolDefinition = + | ToolDefinitionParent + | CodeInterpreterToolDefinition + | FileSearchToolDefinition + | FunctionToolDefinition + | BingGroundingToolDefinition + | MicrosoftFabricToolDefinition + | SharepointToolDefinition + | AzureAISearchToolDefinition + | OpenApiToolDefinition + | AzureFunctionToolDefinition; +/** authentication details for OpenApiFunctionDefinition */ +export type OpenApiAuthDetails = + | OpenApiAuthDetailsParent + | OpenApiAnonymousAuthDetails + | OpenApiConnectionAuthDetails + | OpenApiManagedAuthDetails; +/** An abstract representation of a vector store chunking strategy configuration. */ +export type VectorStoreChunkingStrategyRequest = + | VectorStoreChunkingStrategyRequestParent + | VectorStoreAutoChunkingStrategyRequest + | VectorStoreStaticChunkingStrategyRequest; +/** Abstract data class. */ +export type InputData = InputDataParent | InputDataset; +/** DatasetVersion Definition */ +export type DatasetVersion = + | DatasetVersionParent + | FileDatasetVersion + | FolderDatasetVersion; +/** Index resource Definition */ +export type Index = + | IndexParent + | AzureAISearchIndex + | ManagedAzureAISearchIndex + | CosmosDBIndex; +/** Alias for OpenApiAuthType */ +export type OpenApiAuthType = string; +/** Alias for VectorStoreDataSourceAssetType */ +export type VectorStoreDataSourceAssetType = string; +/** Alias for AzureAISearchQueryType */ +export type AzureAISearchQueryType = string; +/** Alias for AgentsApiResponseFormatMode */ +export type AgentsApiResponseFormatMode = string; +/** Alias for ResponseFormat */ +export type ResponseFormat = string; +/** Alias for AgentsApiResponseFormatOption */ +export type AgentsApiResponseFormatOption = + | string + | AgentsApiResponseFormatMode + | AgentsApiResponseFormat + | ResponseFormatJsonSchemaType; +/** Alias for ListSortOrder */ +export type ListSortOrder = string; +/** Alias for MessageRole */ +export type MessageRole = string; +/** Alias for MessageAttachmentToolDefinition */ +export type MessageAttachmentToolDefinition = + | CodeInterpreterToolDefinition + | FileSearchToolDefinition; +/** Alias for RunAdditionalFieldList */ +export type RunAdditionalFieldList = string; +/** Alias for TruncationStrategy */ +export type TruncationStrategy = string; +/** Alias for AgentsApiToolChoiceOptionMode */ +export type AgentsApiToolChoiceOptionMode = string; +/** Alias for AgentsNamedToolChoiceType */ +export type AgentsNamedToolChoiceType = string; +/** Alias for AgentsApiToolChoiceOption */ +export type AgentsApiToolChoiceOption = + | string + | AgentsApiToolChoiceOptionMode + | AgentsNamedToolChoice; +/** Alias for FilePurpose */ +export type FilePurpose = string; +/** Alias for VectorStoreExpirationPolicyAnchor */ +export type VectorStoreExpirationPolicyAnchor = string; +/** Alias for VectorStoreChunkingStrategyRequestType */ +export type VectorStoreChunkingStrategyRequestType = string; +/** Alias for VectorStoreFileStatusFilter */ +export type VectorStoreFileStatusFilter = string; +/** Alias for ConnectionType */ +export type ConnectionType = string; +/** Alias for ListViewType */ +export type ListViewType = string; +/** Alias for DatasetType */ +export type DatasetType = string; +/** Alias for IndexType */ +export type IndexType = string; diff --git a/sdk/ai/ai-projects-1dp/src/outputModels.ts b/sdk/ai/ai-projects-1dp/src/outputModels.ts new file mode 100644 index 000000000000..f6f580b81bba --- /dev/null +++ b/sdk/ai/ai-projects-1dp/src/outputModels.ts @@ -0,0 +1,1787 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** An abstract representation of an input tool definition that an agent can use. */ +export interface ToolDefinitionOutputParent { + type: string; +} + +/** The input definition information for a code interpreter tool as used to configure an agent. */ +export interface CodeInterpreterToolDefinitionOutput + extends ToolDefinitionOutputParent { + /** The object type, which is always 'code_interpreter'. */ + type: "code_interpreter"; +} + +/** The input definition information for a file search tool as used to configure an agent. */ +export interface FileSearchToolDefinitionOutput + extends ToolDefinitionOutputParent { + /** The object type, which is always 'file_search'. */ + type: "file_search"; + /** Options overrides for the file search tool. */ + file_search?: FileSearchToolDefinitionDetailsOutput; +} + +/** Options overrides for the file search tool. */ +export interface FileSearchToolDefinitionDetailsOutput { + /** + * The maximum number of results the file search tool should output. The default is 20 for gpt-4* models and 5 for gpt-3.5-turbo. This number should be between 1 and 50 inclusive. + * + * Note that the file search tool may output fewer than `max_num_results` results. See the file search tool documentation for more information. + */ + max_num_results?: number; + /** Ranking options for file search. */ + ranking_options?: FileSearchRankingOptionsOutput; +} + +/** Ranking options for file search. */ +export interface FileSearchRankingOptionsOutput { + /** File search ranker. */ + ranker: string; + /** Ranker search threshold. */ + score_threshold: number; +} + +/** The input definition information for a function tool as used to configure an agent. */ +export interface FunctionToolDefinitionOutput + extends ToolDefinitionOutputParent { + /** The object type, which is always 'function'. */ + type: "function"; + /** The definition of the concrete function that the function tool should call. */ + function: FunctionDefinitionOutput; +} + +/** The input definition information for a function. */ +export interface FunctionDefinitionOutput { + /** The name of the function to be called. */ + name: string; + /** A description of what the function does, used by the model to choose when and how to call the function. */ + description?: string; + /** The parameters the functions accepts, described as a JSON Schema object. */ + parameters: any; +} + +/** The input definition information for a bing grounding search tool as used to configure an agent. */ +export interface BingGroundingToolDefinitionOutput + extends ToolDefinitionOutputParent { + /** The object type, which is always 'bing_grounding'. */ + type: "bing_grounding"; + /** The list of connections used by the bing grounding tool. */ + bing_grounding: ToolConnectionListOutput; +} + +/** A set of connection resources currently used by either the `bing_grounding`, `fabric_dataagent`, or `sharepoint_grounding` tools. */ +export interface ToolConnectionListOutput { + /** + * The connections attached to this tool. There can be a maximum of 1 connection + * resource attached to the tool. + */ + connections?: Array; +} + +/** A connection resource. */ +export interface ToolConnectionOutput { + /** A connection in a ToolConnectionList attached to this tool. */ + connection_id: string; +} + +/** The input definition information for a Microsoft Fabric tool as used to configure an agent. */ +export interface MicrosoftFabricToolDefinitionOutput + extends ToolDefinitionOutputParent { + /** The object type, which is always 'fabric_dataagent'. */ + type: "fabric_dataagent"; + /** The list of connections used by the Microsoft Fabric tool. */ + fabric_dataagent: ToolConnectionListOutput; +} + +/** The input definition information for a sharepoint tool as used to configure an agent. */ +export interface SharepointToolDefinitionOutput + extends ToolDefinitionOutputParent { + /** The object type, which is always 'sharepoint_grounding'. */ + type: "sharepoint_grounding"; + /** The list of connections used by the SharePoint tool. */ + sharepoint_grounding: ToolConnectionListOutput; +} + +/** The input definition information for an Azure AI search tool as used to configure an agent. */ +export interface AzureAISearchToolDefinitionOutput + extends ToolDefinitionOutputParent { + /** The object type, which is always 'azure_ai_search'. */ + type: "azure_ai_search"; +} + +/** The input definition information for an OpenAPI tool as used to configure an agent. */ +export interface OpenApiToolDefinitionOutput + extends ToolDefinitionOutputParent { + /** The object type, which is always 'openapi'. */ + type: "openapi"; + /** The openapi function definition. */ + openapi: OpenApiFunctionDefinitionOutput; +} + +/** The input definition information for an openapi function. */ +export interface OpenApiFunctionDefinitionOutput { + /** The name of the function to be called. */ + name: string; + /** A description of what the function does, used by the model to choose when and how to call the function. */ + description?: string; + /** The openapi function shape, described as a JSON Schema object. */ + spec: any; + /** Open API authentication details */ + auth: OpenApiAuthDetailsOutput; +} + +/** authentication details for OpenApiFunctionDefinition */ +export interface OpenApiAuthDetailsOutputParent { + type: OpenApiAuthTypeOutput; +} + +/** Security details for OpenApi anonymous authentication */ +export interface OpenApiAnonymousAuthDetailsOutput + extends OpenApiAuthDetailsOutputParent { + /** The object type, which is always 'anonymous'. */ + type: "anonymous"; +} + +/** Security details for OpenApi connection authentication */ +export interface OpenApiConnectionAuthDetailsOutput + extends OpenApiAuthDetailsOutputParent { + /** The object type, which is always 'connection'. */ + type: "connection"; + /** Connection auth security details */ + security_scheme: OpenApiConnectionSecuritySchemeOutput; +} + +/** Security scheme for OpenApi managed_identity authentication */ +export interface OpenApiConnectionSecuritySchemeOutput { + /** Connection id for Connection auth type */ + connection_id: string; +} + +/** Security details for OpenApi managed_identity authentication */ +export interface OpenApiManagedAuthDetailsOutput + extends OpenApiAuthDetailsOutputParent { + /** The object type, which is always 'managed_identity'. */ + type: "managed_identity"; + /** Connection auth security details */ + security_scheme: OpenApiManagedSecuritySchemeOutput; +} + +/** Security scheme for OpenApi managed_identity authentication */ +export interface OpenApiManagedSecuritySchemeOutput { + /** Authentication scope for managed_identity auth type */ + audience: string; +} + +/** The input definition information for a azure function tool as used to configure an agent. */ +export interface AzureFunctionToolDefinitionOutput + extends ToolDefinitionOutputParent { + /** The object type, which is always 'azure_function'. */ + type: "azure_function"; + /** The definition of the concrete function that the function tool should call. */ + azure_function: AzureFunctionDefinitionOutput; +} + +/** The definition of Azure function. */ +export interface AzureFunctionDefinitionOutput { + /** The definition of azure function and its parameters. */ + function: FunctionDefinitionOutput; + /** Input storage queue. The queue storage trigger runs a function as messages are added to it. */ + input_binding: AzureFunctionBindingOutput; + /** Output storage queue. The function writes output to this queue when the input items are processed. */ + output_binding: AzureFunctionBindingOutput; +} + +/** The structure for keeping storage queue name and URI. */ +export interface AzureFunctionBindingOutput { + /** The type of binding, which is always 'storage_queue'. */ + type: "storage_queue"; + /** Storage queue. */ + storage_queue: AzureFunctionStorageQueueOutput; +} + +/** The structure for keeping storage queue name and URI. */ +export interface AzureFunctionStorageQueueOutput { + /** URI to the Azure Storage Queue service allowing you to manipulate a queue. */ + queue_service_endpoint: string; + /** The name of an Azure function storage queue. */ + queue_name: string; +} + +/** + * A set of resources that are used by the agent's tools. The resources are specific to the type of + * tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` + * tool requires a list of vector store IDs. + */ +export interface ToolResourcesOutput { + /** Resources to be used by the `code_interpreter` tool consisting of file IDs. */ + code_interpreter?: CodeInterpreterToolResourceOutput; + /** Resources to be used by the `file_search` tool consisting of vector store IDs. */ + file_search?: FileSearchToolResourceOutput; + /** Resources to be used by the `azure_ai_search` tool consisting of index IDs and names. */ + azure_ai_search?: AzureAISearchResourceOutput; +} + +/** A set of resources that are used by the `code_interpreter` tool. */ +export interface CodeInterpreterToolResourceOutput { + /** + * A list of file IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files + * associated with the tool. + */ + file_ids?: string[]; + /** The data sources to be used. This option is mutually exclusive with the `fileIds` property. */ + data_sources?: Array; +} + +/** + * The structure, containing Azure asset URI path and the asset type of the file used as a data source + * for the enterprise file search. + */ +export interface VectorStoreDataSourceOutput { + /** Asset URI. */ + uri: string; + /** + * The asset type + * + * Possible values: "uri_asset", "id_asset" + */ + type: VectorStoreDataSourceAssetTypeOutput; +} + +/** A set of resources that are used by the `file_search` tool. */ +export interface FileSearchToolResourceOutput { + /** + * The ID of the vector store attached to this agent. There can be a maximum of 1 vector + * store attached to the agent. + */ + vector_store_ids?: string[]; + /** + * The list of vector store configuration objects from Azure. + * This list is limited to one element. + * The only element of this list contains the list of azure asset IDs used by the search tool. + */ + vector_stores?: Array; +} + +/** The structure, containing the list of vector storage configurations i.e. the list of azure asset IDs. */ +export interface VectorStoreConfigurationsOutput { + /** Name */ + name: string; + /** Configurations */ + configuration: VectorStoreConfigurationOutput; +} + +/** + * Vector storage configuration is the list of data sources, used when multiple + * files can be used for the enterprise file search. + */ +export interface VectorStoreConfigurationOutput { + /** Data sources */ + data_sources: Array; +} + +/** A set of index resources used by the `azure_ai_search` tool. */ +export interface AzureAISearchResourceOutput { + /** + * The indices attached to this agent. There can be a maximum of 1 index + * resource attached to the agent. + */ + indexes?: Array; +} + +/** A AI Search Index resource. */ +export interface AISearchIndexResourceOutput { + /** An index connection id in an IndexResource attached to this agent. */ + index_connection_id: string; + /** The name of an index in an IndexResource attached to this agent. */ + index_name: string; + /** + * Type of query in an AIIndexResource attached to this agent. + * + * Possible values: "simple", "semantic", "vector", "vector_simple_hybrid", "vector_semantic_hybrid" + */ + query_type?: AzureAISearchQueryTypeOutput; + /** Number of documents to retrieve from search and present to the model. */ + top_k?: number; + /** Odata filter string for search resource. */ + filter?: string; +} + +/** + * An object describing the expected output of the model. If `json_object` only `function` type `tools` are allowed to be passed to the Run. + * If `text` the model can return text or any value needed. + */ +export interface AgentsApiResponseFormatOutput { + /** + * Must be one of `text` or `json_object`. + * + * Possible values: "text", "json_object" + */ + type?: ResponseFormatOutput; +} + +/** The type of response format being defined: `json_schema` */ +export interface ResponseFormatJsonSchemaTypeOutput { + /** Type */ + type: "json_schema"; + /** The JSON schema, describing response format. */ + json_schema: ResponseFormatJsonSchemaOutput; +} + +/** A description of what the response format is for, used by the model to determine how to respond in the format. */ +export interface ResponseFormatJsonSchemaOutput { + /** A description of what the response format is for, used by the model to determine how to respond in the format. */ + description?: string; + /** The name of a schema. */ + name: string; + /** The JSON schema object, describing the response format. */ + schema: any; +} + +/** Represents an agent that can call the model and use tools. */ +export interface AgentOutput { + /** The identifier, which can be referenced in API endpoints. */ + id: string; + /** The object type, which is always assistant. */ + object: "assistant"; + /** The Unix timestamp, in seconds, representing when this object was created. */ + created_at: number; + /** The name of the agent. */ + name: string | null; + /** The description of the agent. */ + description: string | null; + /** The ID of the model to use. */ + model: string; + /** The system instructions for the agent to use. */ + instructions: string | null; + /** The collection of tools enabled for the agent. */ + tools: Array; + /** + * A set of resources that are used by the agent's tools. The resources are specific to the type of tool. For example, the `code_interpreter` + * tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. + */ + tool_resources: ToolResourcesOutput | null; + /** + * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, + * while lower values like 0.2 will make it more focused and deterministic. + */ + temperature: number | null; + /** + * An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. + * So 0.1 means only the tokens comprising the top 10% probability mass are considered. + * + * We generally recommend altering this or temperature but not both. + */ + top_p: number | null; + /** The response format of the tool calls used by this agent. */ + response_format?: AgentsApiResponseFormatOptionOutput | null; + /** A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. */ + metadata: Record | null; +} + +/** The response data for a requested list of items. */ +export interface OpenAIPageableListOfAgentOutput { + /** The object type, which is always list. */ + object: "list"; + /** The requested list of items. */ + data: Array; + /** The first ID represented in this list. */ + first_id: string; + /** The last ID represented in this list. */ + last_id: string; + /** A value indicating whether there are additional values available not captured in this list. */ + has_more: boolean; +} + +/** The status of an agent deletion operation. */ +export interface AgentDeletionStatusOutput { + /** The ID of the resource specified for deletion. */ + id: string; + /** A value indicating whether deletion was successful. */ + deleted: boolean; + /** The object type, which is always 'assistant.deleted'. */ + object: "assistant.deleted"; +} + +/** This describes to which tools a file has been attached. */ +export interface MessageAttachmentOutput { + /** The ID of the file to attach to the message. */ + file_id?: string; + /** Azure asset ID. */ + data_source?: VectorStoreDataSourceOutput; + /** The tools to add to this file. */ + tools: Array; +} + +/** Information about a single thread associated with an agent. */ +export interface AgentThreadOutput { + /** The identifier, which can be referenced in API endpoints. */ + id: string; + /** The object type, which is always 'thread'. */ + object: "thread"; + /** The Unix timestamp, in seconds, representing when this object was created. */ + created_at: number; + /** + * A set of resources that are made available to the agent's tools in this thread. The resources are specific to the type + * of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list + * of vector store IDs. + */ + tool_resources: ToolResourcesOutput | null; + /** A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. */ + metadata: Record | null; +} + +/** The status of a thread deletion operation. */ +export interface ThreadDeletionStatusOutput { + /** The ID of the resource specified for deletion. */ + id: string; + /** A value indicating whether deletion was successful. */ + deleted: boolean; + /** The object type, which is always 'thread.deleted'. */ + object: "thread.deleted"; +} + +/** A single, existing message within an agent thread. */ +export interface ThreadMessageOutput { + /** The identifier, which can be referenced in API endpoints. */ + id: string; + /** The object type, which is always 'thread.message'. */ + object: "thread.message"; + /** The Unix timestamp, in seconds, representing when this object was created. */ + created_at: number; + /** The ID of the thread that this message belongs to. */ + thread_id: string; + /** + * The status of the message. + * + * Possible values: "in_progress", "incomplete", "completed" + */ + status: MessageStatusOutput; + /** On an incomplete message, details about why the message is incomplete. */ + incomplete_details: MessageIncompleteDetailsOutput | null; + /** The Unix timestamp (in seconds) for when the message was completed. */ + completed_at: number | null; + /** The Unix timestamp (in seconds) for when the message was marked as incomplete. */ + incomplete_at: number | null; + /** + * The role associated with the agent thread message. + * + * Possible values: "user", "assistant" + */ + role: MessageRoleOutput; + /** The list of content items associated with the agent thread message. */ + content: Array; + /** If applicable, the ID of the agent that authored this message. */ + assistant_id: string | null; + /** If applicable, the ID of the run associated with the authoring of this message. */ + run_id: string | null; + /** A list of files attached to the message, and the tools they were added to. */ + attachments: Array | null; + /** A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. */ + metadata: Record | null; +} + +/** Information providing additional detail about a message entering an incomplete status. */ +export interface MessageIncompleteDetailsOutput { + /** + * The provided reason describing why the message was marked as incomplete. + * + * Possible values: "content_filter", "max_tokens", "run_cancelled", "run_failed", "run_expired" + */ + reason: MessageIncompleteDetailsReasonOutput; +} + +/** An abstract representation of a single item of thread message content. */ +export interface MessageContentOutputParent { + type: string; +} + +/** A representation of a textual item of thread message content. */ +export interface MessageTextContentOutput extends MessageContentOutputParent { + /** The object type, which is always 'text'. */ + type: "text"; + /** The text and associated annotations for this thread message content item. */ + text: MessageTextDetailsOutput; +} + +/** The text and associated annotations for a single item of agent thread message content. */ +export interface MessageTextDetailsOutput { + /** The text data. */ + value: string; + /** A list of annotations associated with this text. */ + annotations: Array; +} + +/** An abstract representation of an annotation to text thread message content. */ +export interface MessageTextAnnotationOutputParent { + /** The textual content associated with this text annotation item. */ + text: string; + type: string; +} + +/** A citation within the message that points to a specific URL associated with the message. Generated when the agent uses tools such as 'bing_grounding' to search the Internet. */ +export interface MessageTextUrlCitationAnnotationOutput + extends MessageTextAnnotationOutputParent { + /** The object type, which is always 'url_citation'. */ + type: "url_citation"; + /** The details of the URL citation. */ + url_citation: MessageTextUrlCitationDetailsOutput; + /** The first text index associated with this text annotation. */ + start_index?: number; + /** The last text index associated with this text annotation. */ + end_index?: number; +} + +/** A representation of a URL citation, as used in text thread message content. */ +export interface MessageTextUrlCitationDetailsOutput { + /** The URL associated with this citation. */ + url: string; + /** The title of the URL. */ + title?: string; +} + +/** A citation within the message that points to a specific quote from a specific File associated with the agent or the message. Generated when the agent uses the 'file_search' tool to search files. */ +export interface MessageTextFileCitationAnnotationOutput + extends MessageTextAnnotationOutputParent { + /** The object type, which is always 'file_citation'. */ + type: "file_citation"; + /** + * A citation within the message that points to a specific quote from a specific file. + * Generated when the agent uses the "file_search" tool to search files. + */ + file_citation: MessageTextFileCitationDetailsOutput; + /** The first text index associated with this text annotation. */ + start_index?: number; + /** The last text index associated with this text annotation. */ + end_index?: number; +} + +/** A representation of a file-based text citation, as used in a file-based annotation of text thread message content. */ +export interface MessageTextFileCitationDetailsOutput { + /** The ID of the file associated with this citation. */ + file_id: string; + /** The specific quote cited in the associated file. */ + quote: string; +} + +/** A citation within the message that points to a file located at a specific path. */ +export interface MessageTextFilePathAnnotationOutput + extends MessageTextAnnotationOutputParent { + /** The object type, which is always 'file_path'. */ + type: "file_path"; + /** A URL for the file that's generated when the agent used the code_interpreter tool to generate a file. */ + file_path: MessageTextFilePathDetailsOutput; + /** The first text index associated with this text annotation. */ + start_index?: number; + /** The last text index associated with this text annotation. */ + end_index?: number; +} + +/** An encapsulation of an image file ID, as used by message image content. */ +export interface MessageTextFilePathDetailsOutput { + /** The ID of the specific file that the citation is from. */ + file_id: string; +} + +/** A representation of image file content in a thread message. */ +export interface MessageImageFileContentOutput + extends MessageContentOutputParent { + /** The object type, which is always 'image_file'. */ + type: "image_file"; + /** The image file for this thread message content item. */ + image_file: MessageImageFileDetailsOutput; +} + +/** An image reference, as represented in thread message content. */ +export interface MessageImageFileDetailsOutput { + /** The ID for the file associated with this image. */ + file_id: string; +} + +/** The response data for a requested list of items. */ +export interface OpenAIPageableListOfThreadMessageOutput { + /** The object type, which is always list. */ + object: "list"; + /** The requested list of items. */ + data: Array; + /** The first ID represented in this list. */ + first_id: string; + /** The last ID represented in this list. */ + last_id: string; + /** A value indicating whether there are additional values available not captured in this list. */ + has_more: boolean; +} + +/** + * Controls for how a thread will be truncated prior to the run. Use this to control the initial + * context window of the run. + */ +export interface TruncationObjectOutput { + /** + * The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will + * be truncated to the `lastMessages` count most recent messages in the thread. When set to `auto`, messages in the middle of the thread + * will be dropped to fit the context length of the model, `max_prompt_tokens`. + * + * Possible values: "auto", "last_messages" + */ + type: TruncationStrategyOutput; + /** The number of most recent messages from the thread when constructing the context for the run. */ + last_messages?: number | null; +} + +/** Specifies a tool the model should use. Use to force the model to call a specific tool. */ +export interface AgentsNamedToolChoiceOutput { + /** + * the type of tool. If type is `function`, the function name must be set. + * + * Possible values: "function", "code_interpreter", "file_search", "bing_grounding", "fabric_dataagent", "sharepoint_grounding", "azure_ai_search" + */ + type: AgentsNamedToolChoiceTypeOutput; + /** The name of the function to call */ + function?: FunctionNameOutput; +} + +/** The function name that will be used, if using the `function` tool */ +export interface FunctionNameOutput { + /** The name of the function to call */ + name: string; +} + +/** Data representing a single evaluation run of an agent thread. */ +export interface ThreadRunOutput { + /** The identifier, which can be referenced in API endpoints. */ + id: string; + /** The object type, which is always 'thread.run'. */ + object: "thread.run"; + /** The ID of the thread associated with this run. */ + thread_id: string; + /** The ID of the agent associated with the thread this run was performed against. */ + assistant_id: string; + /** + * The status of the agent thread run. + * + * Possible values: "queued", "in_progress", "requires_action", "cancelling", "cancelled", "failed", "completed", "expired" + */ + status: RunStatusOutput; + /** The details of the action required for the agent thread run to continue. */ + required_action?: RequiredActionOutput | null; + /** The last error, if any, encountered by this agent thread run. */ + last_error: RunErrorOutput | null; + /** The ID of the model to use. */ + model: string; + /** The overridden system instructions used for this agent thread run. */ + instructions: string; + /** The overridden enabled tools used for this agent thread run. */ + tools: Array; + /** The Unix timestamp, in seconds, representing when this object was created. */ + created_at: number; + /** The Unix timestamp, in seconds, representing when this item expires. */ + expires_at: number | null; + /** The Unix timestamp, in seconds, representing when this item was started. */ + started_at: number | null; + /** The Unix timestamp, in seconds, representing when this completed. */ + completed_at: number | null; + /** The Unix timestamp, in seconds, representing when this was cancelled. */ + cancelled_at: number | null; + /** The Unix timestamp, in seconds, representing when this failed. */ + failed_at: number | null; + /** Details on why the run is incomplete. Will be `null` if the run is not incomplete. */ + incomplete_details: IncompleteRunDetailsOutput | null; + /** Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.). */ + usage: RunCompletionUsageOutput | null; + /** The sampling temperature used for this run. If not set, defaults to 1. */ + temperature?: number | null; + /** The nucleus sampling value used for this run. If not set, defaults to 1. */ + top_p?: number | null; + /** The maximum number of prompt tokens specified to have been used over the course of the run. */ + max_prompt_tokens: number | null; + /** The maximum number of completion tokens specified to have been used over the course of the run. */ + max_completion_tokens: number | null; + /** The strategy to use for dropping messages as the context windows moves forward. */ + truncation_strategy: TruncationObjectOutput | null; + /** Controls whether or not and which tool is called by the model. */ + tool_choice: AgentsApiToolChoiceOptionOutput | null; + /** The response format of the tool calls used in this run. */ + response_format: AgentsApiResponseFormatOptionOutput | null; + /** A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. */ + metadata: Record | null; + /** Override the tools the agent can use for this run. This is useful for modifying the behavior on a per-run basis */ + tool_resources?: UpdateToolResourcesOptionsOutput | null; + /** Determines if tools can be executed in parallel within the run. */ + parallel_tool_calls: boolean; +} + +/** An abstract representation of a required action for an agent thread run to continue. */ +export interface RequiredActionOutputParent { + type: string; +} + +/** The details for required tool calls that must be submitted for an agent thread run to continue. */ +export interface SubmitToolOutputsActionOutput + extends RequiredActionOutputParent { + /** The object type, which is always 'submit_tool_outputs'. */ + type: "submit_tool_outputs"; + /** The details describing tools that should be called to submit tool outputs. */ + submit_tool_outputs: SubmitToolOutputsDetailsOutput; +} + +/** The details describing tools that should be called to submit tool outputs. */ +export interface SubmitToolOutputsDetailsOutput { + /** The list of tool calls that must be resolved for the agent thread run to continue. */ + tool_calls: Array; +} + +/** An abstract representation of a tool invocation needed by the model to continue a run. */ +export interface RequiredToolCallOutputParent { + /** The ID of the tool call. This ID must be referenced when submitting tool outputs. */ + id: string; + type: string; +} + +/** A representation of a requested call to a function tool, needed by the model to continue evaluation of a run. */ +export interface RequiredFunctionToolCallOutput + extends RequiredToolCallOutputParent { + /** The object type of the required tool call. Always 'function' for function tools. */ + type: "function"; + /** Detailed information about the function to be executed by the tool that includes name and arguments. */ + function: RequiredFunctionToolCallDetailsOutput; +} + +/** The detailed information for a function invocation, as provided by a required action invoking a function tool, that includes the name of and arguments to the function. */ +export interface RequiredFunctionToolCallDetailsOutput { + /** The name of the function. */ + name: string; + /** The arguments to use when invoking the named function, as provided by the model. Arguments are presented as a JSON document that should be validated and parsed for evaluation. */ + arguments: string; +} + +/** The details of an error as encountered by an agent thread run. */ +export interface RunErrorOutput { + /** The status for the error. */ + code: string; + /** The human-readable text associated with the error. */ + message: string; +} + +/** Details on why the run is incomplete. Will be `null` if the run is not incomplete. */ +export interface IncompleteRunDetailsOutput { + /** + * The reason why the run is incomplete. This indicates which specific token limit was reached during the run. + * + * Possible values: "max_completion_tokens", "max_prompt_tokens" + */ + reason: IncompleteDetailsReasonOutput; +} + +/** Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.). */ +export interface RunCompletionUsageOutput { + /** Number of completion tokens used over the course of the run. */ + completion_tokens: number; + /** Number of prompt tokens used over the course of the run. */ + prompt_tokens: number; + /** Total number of tokens used (prompt + completion). */ + total_tokens: number; +} + +/** + * Request object. A set of resources that are used by the agent's tools. The resources are specific to the type of tool. + * For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of + * vector store IDs. + */ +export interface UpdateToolResourcesOptionsOutput { + /** + * Overrides the list of file IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files + * associated with the tool. + */ + code_interpreter?: UpdateCodeInterpreterToolResourceOptionsOutput; + /** Overrides the vector store attached to this agent. There can be a maximum of 1 vector store attached to the agent. */ + file_search?: UpdateFileSearchToolResourceOptionsOutput; + /** Overrides the resources to be used by the `azure_ai_search` tool consisting of index IDs and names. */ + azure_ai_search?: AzureAISearchResourceOutput; +} + +/** Request object to update `code_interpreted` tool resources. */ +export interface UpdateCodeInterpreterToolResourceOptionsOutput { + /** A list of file IDs to override the current list of the agent. */ + file_ids?: string[]; +} + +/** Request object to update `file_search` tool resources. */ +export interface UpdateFileSearchToolResourceOptionsOutput { + /** A list of vector store IDs to override the current list of the agent. */ + vector_store_ids?: string[]; +} + +/** The response data for a requested list of items. */ +export interface OpenAIPageableListOfThreadRunOutput { + /** The object type, which is always list. */ + object: "list"; + /** The requested list of items. */ + data: Array; + /** The first ID represented in this list. */ + first_id: string; + /** The last ID represented in this list. */ + last_id: string; + /** A value indicating whether there are additional values available not captured in this list. */ + has_more: boolean; +} + +/** Detailed information about a single step of an agent thread run. */ +export interface RunStepOutput { + /** The identifier, which can be referenced in API endpoints. */ + id: string; + /** The object type, which is always 'thread.run.step'. */ + object: "thread.run.step"; + /** + * The type of run step, which can be either message_creation or tool_calls. + * + * Possible values: "message_creation", "tool_calls" + */ + type: RunStepTypeOutput; + /** The ID of the agent associated with the run step. */ + assistant_id: string; + /** The ID of the thread that was run. */ + thread_id: string; + /** The ID of the run that this run step is a part of. */ + run_id: string; + /** + * The status of this run step. + * + * Possible values: "in_progress", "cancelled", "failed", "completed", "expired" + */ + status: RunStepStatusOutput; + /** The details for this run step. */ + step_details: RunStepDetailsOutput; + /** If applicable, information about the last error encountered by this run step. */ + last_error: RunStepErrorOutput | null; + /** The Unix timestamp, in seconds, representing when this object was created. */ + created_at: number; + /** The Unix timestamp, in seconds, representing when this item expired. */ + expired_at: number | null; + /** The Unix timestamp, in seconds, representing when this completed. */ + completed_at: number | null; + /** The Unix timestamp, in seconds, representing when this was cancelled. */ + cancelled_at: number | null; + /** The Unix timestamp, in seconds, representing when this failed. */ + failed_at: number | null; + /** Usage statistics related to the run step. This value will be `null` while the run step's status is `in_progress`. */ + usage?: RunStepCompletionUsageOutput | null; + /** A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. */ + metadata: Record | null; +} + +/** An abstract representation of the details for a run step. */ +export interface RunStepDetailsOutputParent { + type: RunStepTypeOutput; +} + +/** The detailed information associated with a message creation run step. */ +export interface RunStepMessageCreationDetailsOutput + extends RunStepDetailsOutputParent { + /** The object type, which is always 'message_creation'. */ + type: "message_creation"; + /** Information about the message creation associated with this run step. */ + message_creation: RunStepMessageCreationReferenceOutput; +} + +/** The details of a message created as a part of a run step. */ +export interface RunStepMessageCreationReferenceOutput { + /** The ID of the message created by this run step. */ + message_id: string; +} + +/** The detailed information associated with a run step calling tools. */ +export interface RunStepToolCallDetailsOutput + extends RunStepDetailsOutputParent { + /** The object type, which is always 'tool_calls'. */ + type: "tool_calls"; + /** A list of tool call details for this run step. */ + tool_calls: Array; +} + +/** An abstract representation of a detailed tool call as recorded within a run step for an existing run. */ +export interface RunStepToolCallOutputParent { + /** The ID of the tool call. This ID must be referenced when you submit tool outputs. */ + id: string; + type: string; +} + +/** + * A record of a call to a code interpreter tool, issued by the model in evaluation of a defined tool, that + * represents inputs and outputs consumed and emitted by the code interpreter. + */ +export interface RunStepCodeInterpreterToolCallOutput + extends RunStepToolCallOutputParent { + /** The object type, which is always 'code_interpreter'. */ + type: "code_interpreter"; + /** The details of the tool call to the code interpreter tool. */ + code_interpreter: RunStepCodeInterpreterToolCallDetailsOutput; +} + +/** The detailed information about a code interpreter invocation by the model. */ +export interface RunStepCodeInterpreterToolCallDetailsOutput { + /** The input provided by the model to the code interpreter tool. */ + input: string; + /** The outputs produced by the code interpreter tool back to the model in response to the tool call. */ + outputs: Array; +} + +/** An abstract representation of an emitted output from a code interpreter tool. */ +export interface RunStepCodeInterpreterToolCallOutputOutputParent { + type: string; +} + +/** A representation of a log output emitted by a code interpreter tool in response to a tool call by the model. */ +export interface RunStepCodeInterpreterLogOutputOutput + extends RunStepCodeInterpreterToolCallOutputOutputParent { + /** The object type, which is always 'logs'. */ + type: "logs"; + /** The serialized log output emitted by the code interpreter. */ + logs: string; +} + +/** A representation of an image output emitted by a code interpreter tool in response to a tool call by the model. */ +export interface RunStepCodeInterpreterImageOutputOutput + extends RunStepCodeInterpreterToolCallOutputOutputParent { + /** The object type, which is always 'image'. */ + type: "image"; + /** Referential information for the image associated with this output. */ + image: RunStepCodeInterpreterImageReferenceOutput; +} + +/** An image reference emitted by a code interpreter tool in response to a tool call by the model. */ +export interface RunStepCodeInterpreterImageReferenceOutput { + /** The ID of the file associated with this image. */ + file_id: string; +} + +/** + * A record of a call to a file search tool, issued by the model in evaluation of a defined tool, that represents + * executed file search. + */ +export interface RunStepFileSearchToolCallOutput + extends RunStepToolCallOutputParent { + /** The object type, which is always 'file_search'. */ + type: "file_search"; + /** The ID of the tool call. This ID must be referenced when you submit tool outputs. */ + id: string; + /** For now, this is always going to be an empty object. */ + file_search: RunStepFileSearchToolCallResultsOutput; +} + +/** The results of the file search. */ +export interface RunStepFileSearchToolCallResultsOutput { + /** Ranking options for file search. */ + ranking_options?: FileSearchRankingOptionsOutput; + /** The array of a file search results */ + results: Array; +} + +/** File search tool call result. */ +export interface RunStepFileSearchToolCallResultOutput { + /** The ID of the file that result was found in. */ + file_id: string; + /** The name of the file that result was found in. */ + file_name: string; + /** The score of the result. All values must be a floating point number between 0 and 1. */ + score: number; + /** The content of the result that was found. The content is only included if requested via the include query parameter. */ + content?: Array; +} + +/** The file search result content object. */ +export interface FileSearchToolCallContentOutput { + /** The type of the content. */ + type: "text"; + /** The text content of the file. */ + text: string; +} + +/** + * A record of a call to a bing grounding tool, issued by the model in evaluation of a defined tool, that represents + * executed search with bing grounding. + */ +export interface RunStepBingGroundingToolCallOutput + extends RunStepToolCallOutputParent { + /** The object type, which is always 'bing_grounding'. */ + type: "bing_grounding"; + /** Reserved for future use. */ + bing_grounding: Record; +} + +/** + * A record of a call to an Azure AI Search tool, issued by the model in evaluation of a defined tool, that represents + * executed Azure AI search. + */ +export interface RunStepAzureAISearchToolCallOutput + extends RunStepToolCallOutputParent { + /** The object type, which is always 'azure_ai_search'. */ + type: "azure_ai_search"; + /** Reserved for future use. */ + azure_ai_search: Record; +} + +/** + * A record of a call to a SharePoint tool, issued by the model in evaluation of a defined tool, that represents + * executed SharePoint actions. + */ +export interface RunStepSharepointToolCallOutput + extends RunStepToolCallOutputParent { + /** The object type, which is always 'sharepoint_grounding'. */ + type: "sharepoint_grounding"; + /** Reserved for future use. */ + sharepoint_grounding: Record; +} + +/** + * A record of a call to a Microsoft Fabric tool, issued by the model in evaluation of a defined tool, that represents + * executed Microsoft Fabric operations. + */ +export interface RunStepMicrosoftFabricToolCallOutput + extends RunStepToolCallOutputParent { + /** The object type, which is always 'fabric_dataagent'. */ + type: "fabric_dataagent"; + /** Reserved for future use. */ + fabric_dataagent: Record; +} + +/** + * A record of a call to a function tool, issued by the model in evaluation of a defined tool, that represents the inputs + * and output consumed and emitted by the specified function. + */ +export interface RunStepFunctionToolCallOutput + extends RunStepToolCallOutputParent { + /** The object type, which is always 'function'. */ + type: "function"; + /** The detailed information about the function called by the model. */ + function: RunStepFunctionToolCallDetailsOutput; +} + +/** The detailed information about the function called by the model. */ +export interface RunStepFunctionToolCallDetailsOutput { + /** The name of the function. */ + name: string; + /** The arguments that the model requires are provided to the named function. */ + arguments: string; + /** The output of the function, only populated for function calls that have already have had their outputs submitted. */ + output: string | null; +} + +/** The error information associated with a failed run step. */ +export interface RunStepErrorOutput { + /** + * The error code for this error. + * + * Possible values: "server_error", "rate_limit_exceeded" + */ + code: RunStepErrorCodeOutput; + /** The human-readable text associated with this error. */ + message: string; +} + +/** Usage statistics related to the run step. */ +export interface RunStepCompletionUsageOutput { + /** Number of completion tokens used over the course of the run step. */ + completion_tokens: number; + /** Number of prompt tokens used over the course of the run step. */ + prompt_tokens: number; + /** Total number of tokens used (prompt + completion). */ + total_tokens: number; +} + +/** The response data for a requested list of items. */ +export interface OpenAIPageableListOfRunStepOutput { + /** The object type, which is always list. */ + object: "list"; + /** The requested list of items. */ + data: Array; + /** The first ID represented in this list. */ + first_id: string; + /** The last ID represented in this list. */ + last_id: string; + /** A value indicating whether there are additional values available not captured in this list. */ + has_more: boolean; +} + +/** The response data from a file list operation. */ +export interface FileListResponseOutput { + /** The object type, which is always 'list'. */ + object: "list"; + /** The files returned for the request. */ + data: Array; +} + +/** Represents an agent that can call the model and use tools. */ +export interface OpenAIFileOutput { + /** The object type, which is always 'file'. */ + object: "file"; + /** The identifier, which can be referenced in API endpoints. */ + id: string; + /** The size of the file, in bytes. */ + bytes: number; + /** The name of the file. */ + filename: string; + /** The Unix timestamp, in seconds, representing when this object was created. */ + created_at: number; + /** + * The intended purpose of a file. + * + * Possible values: "fine-tune", "fine-tune-results", "assistants", "assistants_output", "batch", "batch_output", "vision" + */ + purpose: FilePurposeOutput; + /** + * The state of the file. This field is available in Azure OpenAI only. + * + * Possible values: "uploaded", "pending", "running", "processed", "error", "deleting", "deleted" + */ + status?: FileStateOutput; + /** The error message with details in case processing of this file failed. This field is available in Azure OpenAI only. */ + status_details?: string; +} + +/** A status response from a file deletion operation. */ +export interface FileDeletionStatusOutput { + /** The ID of the resource specified for deletion. */ + id: string; + /** A value indicating whether deletion was successful. */ + deleted: boolean; + /** The object type, which is always 'file'. */ + object: "file"; +} + +/** The response data for a requested list of items. */ +export interface OpenAIPageableListOfVectorStoreOutput { + /** The object type, which is always list. */ + object: "list"; + /** The requested list of items. */ + data: Array; + /** The first ID represented in this list. */ + first_id: string; + /** The last ID represented in this list. */ + last_id: string; + /** A value indicating whether there are additional values available not captured in this list. */ + has_more: boolean; +} + +/** A vector store is a collection of processed files can be used by the `file_search` tool. */ +export interface VectorStoreOutput { + /** The identifier, which can be referenced in API endpoints. */ + id: string; + /** The object type, which is always `vector_store` */ + object: "vector_store"; + /** The Unix timestamp (in seconds) for when the vector store was created. */ + created_at: number; + /** The name of the vector store. */ + name: string; + /** The total number of bytes used by the files in the vector store. */ + usage_bytes: number; + /** Files count grouped by status processed or being processed by this vector store. */ + file_counts: VectorStoreFileCountOutput; + /** + * The status of the vector store, which can be either `expired`, `in_progress`, or `completed`. A status of `completed` indicates that the vector store is ready for use. + * + * Possible values: "expired", "in_progress", "completed" + */ + status: VectorStoreStatusOutput; + /** Details on when this vector store expires */ + expires_after?: VectorStoreExpirationPolicyOutput; + /** The Unix timestamp (in seconds) for when the vector store will expire. */ + expires_at?: number | null; + /** The Unix timestamp (in seconds) for when the vector store was last active. */ + last_active_at: number | null; + /** A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. */ + metadata: Record | null; +} + +/** Counts of files processed or being processed by this vector store grouped by status. */ +export interface VectorStoreFileCountOutput { + /** The number of files that are currently being processed. */ + in_progress: number; + /** The number of files that have been successfully processed. */ + completed: number; + /** The number of files that have failed to process. */ + failed: number; + /** The number of files that were cancelled. */ + cancelled: number; + /** The total number of files. */ + total: number; +} + +/** The expiration policy for a vector store. */ +export interface VectorStoreExpirationPolicyOutput { + /** + * Anchor timestamp after which the expiration policy applies. Supported anchors: `last_active_at`. + * + * Possible values: "last_active_at" + */ + anchor: VectorStoreExpirationPolicyAnchorOutput; + /** The anchor timestamp after which the expiration policy applies. */ + days: number; +} + +/** Options to configure a vector store static chunking strategy. */ +export interface VectorStoreStaticChunkingStrategyOptionsOutput { + /** The maximum number of tokens in each chunk. The default value is 800. The minimum value is 100 and the maximum value is 4096. */ + max_chunk_size_tokens: number; + /** + * The number of tokens that overlap between chunks. The default value is 400. + * Note that the overlap must not exceed half of max_chunk_size_tokens. + */ + chunk_overlap_tokens: number; +} + +/** Response object for deleting a vector store. */ +export interface VectorStoreDeletionStatusOutput { + /** The ID of the resource specified for deletion. */ + id: string; + /** A value indicating whether deletion was successful. */ + deleted: boolean; + /** The object type, which is always 'vector_store.deleted'. */ + object: "vector_store.deleted"; +} + +/** The response data for a requested list of items. */ +export interface OpenAIPageableListOfVectorStoreFileOutput { + /** The object type, which is always list. */ + object: "list"; + /** The requested list of items. */ + data: Array; + /** The first ID represented in this list. */ + first_id: string; + /** The last ID represented in this list. */ + last_id: string; + /** A value indicating whether there are additional values available not captured in this list. */ + has_more: boolean; +} + +/** Description of a file attached to a vector store. */ +export interface VectorStoreFileOutput { + /** The identifier, which can be referenced in API endpoints. */ + id: string; + /** The object type, which is always `vector_store.file`. */ + object: "vector_store.file"; + /** + * The total vector store usage in bytes. Note that this may be different from the original file + * size. + */ + usage_bytes: number; + /** The Unix timestamp (in seconds) for when the vector store file was created. */ + created_at: number; + /** The ID of the vector store that the file is attached to. */ + vector_store_id: string; + /** + * The status of the vector store file, which can be either `in_progress`, `completed`, `cancelled`, or `failed`. The status `completed` indicates that the vector store file is ready for use. + * + * Possible values: "in_progress", "completed", "failed", "cancelled" + */ + status: VectorStoreFileStatusOutput; + /** The last error associated with this vector store file. Will be `null` if there are no errors. */ + last_error: VectorStoreFileErrorOutput | null; + /** The strategy used to chunk the file. */ + chunking_strategy: VectorStoreChunkingStrategyResponseOutput; +} + +/** Details on the error that may have occurred while processing a file for this vector store */ +export interface VectorStoreFileErrorOutput { + /** + * One of `server_error` or `rate_limit_exceeded`. + * + * Possible values: "server_error", "invalid_file", "unsupported_file" + */ + code: VectorStoreFileErrorCodeOutput; + /** A human-readable description of the error. */ + message: string; +} + +/** An abstract representation of a vector store chunking strategy configuration. */ +export interface VectorStoreChunkingStrategyResponseOutputParent { + type: VectorStoreChunkingStrategyResponseTypeOutput; +} + +/** This is returned when the chunking strategy is unknown. Typically, this is because the file was indexed before the chunking_strategy concept was introduced in the API. */ +export interface VectorStoreAutoChunkingStrategyResponseOutput + extends VectorStoreChunkingStrategyResponseOutputParent { + /** The object type, which is always 'other'. */ + type: "other"; +} + +/** A statically configured chunking strategy. */ +export interface VectorStoreStaticChunkingStrategyResponseOutput + extends VectorStoreChunkingStrategyResponseOutputParent { + /** The object type, which is always 'static'. */ + type: "static"; + /** The options for the static chunking strategy. */ + static: VectorStoreStaticChunkingStrategyOptionsOutput; +} + +/** Response object for deleting a vector store file relationship. */ +export interface VectorStoreFileDeletionStatusOutput { + /** The ID of the resource specified for deletion. */ + id: string; + /** A value indicating whether deletion was successful. */ + deleted: boolean; + /** The object type, which is always 'vector_store.deleted'. */ + object: "vector_store.file.deleted"; +} + +/** A batch of files attached to a vector store. */ +export interface VectorStoreFileBatchOutput { + /** The identifier, which can be referenced in API endpoints. */ + id: string; + /** The object type, which is always `vector_store.file_batch`. */ + object: "vector_store.files_batch"; + /** The Unix timestamp (in seconds) for when the vector store files batch was created. */ + created_at: number; + /** The ID of the vector store that the file is attached to. */ + vector_store_id: string; + /** + * The status of the vector store files batch, which can be either `in_progress`, `completed`, `cancelled` or `failed`. + * + * Possible values: "in_progress", "completed", "cancelled", "failed" + */ + status: VectorStoreFileBatchStatusOutput; + /** Files count grouped by status processed or being processed by this vector store. */ + file_counts: VectorStoreFileCountOutput; +} + +/** Response from the listSecrets operation */ +export interface ConnectionOutput { + /** The name of the resource */ + readonly name: string; + /** + * Category of the connection + * + * Possible values: "AzureOpenAI", "AzureBlob", "CognitiveSearch", "CosmosDB", "ApiKey", "AppInsights", "CustomKeys" + */ + readonly type: ConnectionTypeOutput; + /** The connection URL to be used for this service */ + readonly target: string; + /** + * The authentication type used by the connection + * + * Possible values: "ApiKey", "AAD", "SAS", "CustomKeys", "None" + */ + authType: AuthenticationTypeOutput; + /** Metadata of the connection */ + metadata: Record; +} + +/** Paged collection of Connection items */ +export interface PagedConnectionOutput { + /** The Connection items on this page */ + value: Array; + /** The link to the next page of items */ + nextLink?: string; +} + +/** Evaluation Definition */ +export interface EvaluationOutput { + /** Identifier of the evaluation. */ + readonly id: string; + /** Data for evaluation. */ + data: InputDataOutput; + /** Display Name for evaluation. It helps to find the evaluation easily in AI Foundry. It does not need to be unique. */ + displayName?: string; + /** Description of the evaluation. It can be used to store additional information about the evaluation and is mutable. */ + description?: string; + /** Status of the evaluation. It is set by service and is read-only. */ + readonly status?: string; + /** Evaluation's tags. Unlike properties, tags are fully mutable. */ + tags?: Record; + /** Evaluation's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed. */ + properties?: Record; + /** Evaluators to be used for the evaluation. */ + evaluators: Record; +} + +/** Abstract data class. */ +export interface InputDataOutputParent { + type: string; +} + +/** Dataset as source for evaluation. */ +export interface InputDatasetOutput extends InputDataOutputParent { + type: "dataset"; + /** Evaluation input data */ + id: string; +} + +/** Evaluator Configuration */ +export interface EvaluatorConfigurationOutput { + /** Identifier of the evaluator. */ + id: string; + /** Initialization parameters of the evaluator. */ + initParams?: Record; + /** Data parameters of the evaluator. */ + dataMapping?: Record; +} + +/** Paged collection of Evaluation items */ +export interface PagedEvaluationOutput { + /** The Evaluation items on this page */ + value: Array; + /** The link to the next page of items */ + nextLink?: string; +} + +/** Paged collection of DatasetVersion items */ +export interface PagedDatasetVersionOutput { + /** The DatasetVersion items on this page */ + value: Array; + /** The link to the next page of items */ + nextLink?: string; +} + +/** DatasetVersion Definition */ +export interface DatasetVersionOutputParent { + /** [Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330 */ + datasetUri: string; + /** Indicates if dataset is reference only or managed by dataset service. If true, the underlying data will be deleted when the dataset version is deleted */ + readonly isReference?: boolean; + /** Asset stage */ + stage?: string; + /** A unique identifier for the asset, assetId probably? */ + readonly id?: string; + /** The name of the resource */ + readonly name: string; + /** The version of the resource */ + readonly version: string; + /** The asset description text. */ + description?: string; + /** Tag dictionary. Tags can be added, removed, and updated. */ + tags?: Record; + type: DatasetTypeOutput; +} + +/** FileDatasetVersion Definition */ +export interface FileDatasetVersionOutput extends DatasetVersionOutputParent { + /** Dataset type */ + type: "uri_file"; + /** Indicates OpenAI Purpose. FileDatasets created with this field will be compatible with OpenAI-specific features */ + openAIPurpose: string; +} + +/** FileDatasetVersion Definition */ +export interface FolderDatasetVersionOutput extends DatasetVersionOutputParent { + /** Dataset type */ + type: "uri_folder"; +} + +/** Represents the response for a pending upload request */ +export interface PendingUploadResponseOutput { + /** Container-level read, write, list SAS. */ + blobReferenceForConsumption: BlobReferenceForConsumptionOutput; + /** ID for this upload request. */ + pendingUploadId: string; + /** Version of dataset to be created if user did not specify version when initially creating upload */ + datasetVersion?: string; + /** TemporaryBlobReference is the only supported type */ + pendingUploadType: "TemporaryBlobReference"; +} + +/** Represents a reference to a blob for consumption */ +export interface BlobReferenceForConsumptionOutput { + /** Blob URI path for client to upload data. Example: https://blob.windows.core.net/Container/Path */ + blobUri: string; + /** ARM ID of the storage account to use. */ + storageAccountArmId: string; + /** Credential info to access the storage account. */ + credential: SasCredentialOutput; +} + +/** SAS Credential definition */ +export interface SasCredentialOutput extends BaseCredentialOutputParent { + /** SAS Token */ + readonly sasToken: string; + readonly type: "SAS"; +} + +/** Base Credential definition */ +export interface BaseCredentialOutputParent { + type: CredentialTypeOutput; +} + +/** ApiKey Credential definition */ +export interface ApiKeyCredentialOutput extends BaseCredentialOutputParent { + /** API Key */ + readonly apiKey: string; + readonly type: "ApiKey"; +} + +/** AAD Credential definition */ +export interface AadCredentialOutput extends BaseCredentialOutputParent { + readonly type: "AAD"; +} + +/** Paged collection of Index items */ +export interface PagedIndexOutput { + /** The Index items on this page */ + value: Array; + /** The link to the next page of items */ + nextLink?: string; +} + +/** Index resource Definition */ +export interface IndexOutputParent { + /** Asset stage */ + stage?: string; + /** A unique identifier for the asset, assetId probably? */ + readonly id?: string; + /** The name of the resource */ + readonly name: string; + /** The version of the resource */ + readonly version: string; + /** The asset description text. */ + description?: string; + /** Tag dictionary. Tags can be added, removed, and updated. */ + tags?: Record; + type: IndexTypeOutput; +} + +/** Azure AI Search Index Definition */ +export interface AzureAISearchIndexOutput extends IndexOutputParent { + /** Type of index */ + type: "AzureSearch"; + /** Name of connection to Azure AI Search */ + connectionName: string; + /** Name of index in Azure AI Search resource to attach */ + indexName: string; +} + +/** Managed Azure AI Search Index Definition */ +export interface ManagedAzureAISearchIndexOutput extends IndexOutputParent { + /** Type of index */ + type: "ManagedAzureSearch"; + /** Vector store id of managed index */ + vectorStoreId: string; +} + +/** CosmosDB Vector Store Index Definition */ +export interface CosmosDBIndexOutput extends IndexOutputParent { + /** Type of index */ + type: "CosmosDBNoSqlVectorStore"; + /** Name of connection to CosmosDB */ + connectionName: string; + /** Name of the CosmosDB Database */ + databaseName: string; + /** Name of CosmosDB Container */ + containerName: string; + /** Embedding model configuration */ + embeddingConfiguration: EmbeddingConfigurationOutput; +} + +/** Embedding configuration class */ +export interface EmbeddingConfigurationOutput { + /** Deployment name of embedding model. It can point to a model deployment either in the parent AIServices or a connection. */ + modelDeploymentName: string; + /** Embedding field */ + embeddingField: string; +} + +/** Model Deployment Definition */ +export interface DeploymentOutputParent { + /** Name of the deployment */ + readonly name: string; + type: DeploymentTypeOutput; +} + +/** Paged collection of Deployment items */ +export interface PagedDeploymentOutput { + /** The Deployment items on this page */ + value: Array; + /** The link to the next page of items */ + nextLink?: string; +} + +/** Model Deployment Definition */ +export interface ModelDeploymentOutput extends DeploymentOutputParent { + /** The type of the deployment */ + type: "ModelDeployment"; + /** Publisher-specific name of the deployed model */ + readonly modelName: string; + /** Publisher-specific version of the deployed model */ + readonly modelVersion: string; + /** Name of the deployed model's publisher */ + readonly modelPublisher: string; + /** Capabilities of deployed model */ + readonly capabilities: Record; + /** Sku of the model deployment */ + readonly sku: SkuOutput; + /** Name of the connection the deployment comes from */ + readonly connectionName?: string; +} + +/** Sku information */ +export interface SkuOutput { + /** Sku capacity */ + capacity: number; + /** Sku family */ + family: string; + /** Sku name */ + name: string; + /** Sku size */ + size: string; + /** Sku tier */ + tier: string; +} + +/** An abstract representation of an input tool definition that an agent can use. */ +export type ToolDefinitionOutput = + | ToolDefinitionOutputParent + | CodeInterpreterToolDefinitionOutput + | FileSearchToolDefinitionOutput + | FunctionToolDefinitionOutput + | BingGroundingToolDefinitionOutput + | MicrosoftFabricToolDefinitionOutput + | SharepointToolDefinitionOutput + | AzureAISearchToolDefinitionOutput + | OpenApiToolDefinitionOutput + | AzureFunctionToolDefinitionOutput; +/** authentication details for OpenApiFunctionDefinition */ +export type OpenApiAuthDetailsOutput = + | OpenApiAuthDetailsOutputParent + | OpenApiAnonymousAuthDetailsOutput + | OpenApiConnectionAuthDetailsOutput + | OpenApiManagedAuthDetailsOutput; +/** An abstract representation of a single item of thread message content. */ +export type MessageContentOutput = + | MessageContentOutputParent + | MessageTextContentOutput + | MessageImageFileContentOutput; +/** An abstract representation of an annotation to text thread message content. */ +export type MessageTextAnnotationOutput = + | MessageTextAnnotationOutputParent + | MessageTextUrlCitationAnnotationOutput + | MessageTextFileCitationAnnotationOutput + | MessageTextFilePathAnnotationOutput; +/** An abstract representation of a required action for an agent thread run to continue. */ +export type RequiredActionOutput = + | RequiredActionOutputParent + | SubmitToolOutputsActionOutput; +/** An abstract representation of a tool invocation needed by the model to continue a run. */ +export type RequiredToolCallOutput = + | RequiredToolCallOutputParent + | RequiredFunctionToolCallOutput; +/** An abstract representation of the details for a run step. */ +export type RunStepDetailsOutput = + | RunStepDetailsOutputParent + | RunStepMessageCreationDetailsOutput + | RunStepToolCallDetailsOutput; +/** An abstract representation of a detailed tool call as recorded within a run step for an existing run. */ +export type RunStepToolCallOutput = + | RunStepToolCallOutputParent + | RunStepCodeInterpreterToolCallOutput + | RunStepFileSearchToolCallOutput + | RunStepBingGroundingToolCallOutput + | RunStepAzureAISearchToolCallOutput + | RunStepSharepointToolCallOutput + | RunStepMicrosoftFabricToolCallOutput + | RunStepFunctionToolCallOutput; +/** An abstract representation of an emitted output from a code interpreter tool. */ +export type RunStepCodeInterpreterToolCallOutputOutput = + | RunStepCodeInterpreterToolCallOutputOutputParent + | RunStepCodeInterpreterLogOutputOutput + | RunStepCodeInterpreterImageOutputOutput; +/** An abstract representation of a vector store chunking strategy configuration. */ +export type VectorStoreChunkingStrategyResponseOutput = + | VectorStoreChunkingStrategyResponseOutputParent + | VectorStoreAutoChunkingStrategyResponseOutput + | VectorStoreStaticChunkingStrategyResponseOutput; +/** Abstract data class. */ +export type InputDataOutput = InputDataOutputParent | InputDatasetOutput; +/** DatasetVersion Definition */ +export type DatasetVersionOutput = + | DatasetVersionOutputParent + | FileDatasetVersionOutput + | FolderDatasetVersionOutput; +/** Base Credential definition */ +export type BaseCredentialOutput = + | BaseCredentialOutputParent + | ApiKeyCredentialOutput + | AadCredentialOutput + | SasCredentialOutput; +/** Index resource Definition */ +export type IndexOutput = + | IndexOutputParent + | AzureAISearchIndexOutput + | ManagedAzureAISearchIndexOutput + | CosmosDBIndexOutput; +/** Model Deployment Definition */ +export type DeploymentOutput = DeploymentOutputParent | ModelDeploymentOutput; +/** Alias for OpenApiAuthTypeOutput */ +export type OpenApiAuthTypeOutput = string; +/** Alias for VectorStoreDataSourceAssetTypeOutput */ +export type VectorStoreDataSourceAssetTypeOutput = string; +/** Alias for AzureAISearchQueryTypeOutput */ +export type AzureAISearchQueryTypeOutput = string; +/** Alias for AgentsApiResponseFormatModeOutput */ +export type AgentsApiResponseFormatModeOutput = string; +/** Alias for ResponseFormatOutput */ +export type ResponseFormatOutput = string; +/** Alias for AgentsApiResponseFormatOptionOutput */ +export type AgentsApiResponseFormatOptionOutput = + | string + | AgentsApiResponseFormatModeOutput + | AgentsApiResponseFormatOutput + | ResponseFormatJsonSchemaTypeOutput; +/** Alias for MessageRoleOutput */ +export type MessageRoleOutput = string; +/** Alias for MessageAttachmentToolDefinitionOutput */ +export type MessageAttachmentToolDefinitionOutput = + | CodeInterpreterToolDefinitionOutput + | FileSearchToolDefinitionOutput; +/** Alias for MessageStatusOutput */ +export type MessageStatusOutput = string; +/** Alias for MessageIncompleteDetailsReasonOutput */ +export type MessageIncompleteDetailsReasonOutput = string; +/** Alias for TruncationStrategyOutput */ +export type TruncationStrategyOutput = string; +/** Alias for AgentsApiToolChoiceOptionModeOutput */ +export type AgentsApiToolChoiceOptionModeOutput = string; +/** Alias for AgentsNamedToolChoiceTypeOutput */ +export type AgentsNamedToolChoiceTypeOutput = string; +/** Alias for AgentsApiToolChoiceOptionOutput */ +export type AgentsApiToolChoiceOptionOutput = + | string + | AgentsApiToolChoiceOptionModeOutput + | AgentsNamedToolChoiceOutput; +/** Alias for RunStatusOutput */ +export type RunStatusOutput = string; +/** Alias for IncompleteDetailsReasonOutput */ +export type IncompleteDetailsReasonOutput = string; +/** Alias for RunStepTypeOutput */ +export type RunStepTypeOutput = string; +/** Alias for RunStepStatusOutput */ +export type RunStepStatusOutput = string; +/** Alias for RunStepErrorCodeOutput */ +export type RunStepErrorCodeOutput = string; +/** Alias for FilePurposeOutput */ +export type FilePurposeOutput = string; +/** Alias for FileStateOutput */ +export type FileStateOutput = string; +/** Alias for VectorStoreStatusOutput */ +export type VectorStoreStatusOutput = string; +/** Alias for VectorStoreExpirationPolicyAnchorOutput */ +export type VectorStoreExpirationPolicyAnchorOutput = string; +/** Alias for VectorStoreFileStatusOutput */ +export type VectorStoreFileStatusOutput = string; +/** Alias for VectorStoreFileErrorCodeOutput */ +export type VectorStoreFileErrorCodeOutput = string; +/** Alias for VectorStoreChunkingStrategyResponseTypeOutput */ +export type VectorStoreChunkingStrategyResponseTypeOutput = string; +/** Alias for VectorStoreFileBatchStatusOutput */ +export type VectorStoreFileBatchStatusOutput = string; +/** Alias for ConnectionTypeOutput */ +export type ConnectionTypeOutput = string; +/** Alias for AuthenticationTypeOutput */ +export type AuthenticationTypeOutput = string; +/** Alias for DatasetTypeOutput */ +export type DatasetTypeOutput = string; +/** Alias for RepeatabilityResultOutput */ +export type RepeatabilityResultOutput = "accepted" | "rejected"; +/** Alias for CredentialTypeOutput */ +export type CredentialTypeOutput = string; +/** Alias for IndexTypeOutput */ +export type IndexTypeOutput = string; +/** Alias for DeploymentTypeOutput */ +export type DeploymentTypeOutput = string; diff --git a/sdk/ai/ai-projects-1dp/src/paginateHelper.ts b/sdk/ai/ai-projects-1dp/src/paginateHelper.ts new file mode 100644 index 000000000000..70694e2c93c6 --- /dev/null +++ b/sdk/ai/ai-projects-1dp/src/paginateHelper.ts @@ -0,0 +1,294 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { Client, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError } from "@azure-rest/core-client"; + +/** + * returns an async iterator that iterates over results. It also has a `byPage` + * method that returns pages of items at once. + * + * @param pagedResult - an object that specifies how to get pages. + * @returns a paged async iterator that iterates over results. + */ +function getPagedAsyncIterator< + TElement, + TPage = TElement[], + TPageSettings = PageSettings, + TLink = string, +>( + pagedResult: PagedResult, +): PagedAsyncIterableIterator { + const iter = getItemAsyncIterator( + pagedResult, + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: + pagedResult?.byPage ?? + (((settings?: PageSettings) => { + const { continuationToken } = settings ?? {}; + return getPageAsyncIterator(pagedResult, { + pageLink: continuationToken as unknown as TLink | undefined, + }); + }) as unknown as ( + settings?: TPageSettings, + ) => AsyncIterableIterator), + }; +} + +async function* getItemAsyncIterator( + pagedResult: PagedResult, +): AsyncIterableIterator { + const pages = getPageAsyncIterator(pagedResult); + const firstVal = await pages.next(); + // if the result does not have an array shape, i.e. TPage = TElement, then we return it as is + if (!Array.isArray(firstVal.value)) { + // can extract elements from this page + const { toElements } = pagedResult; + if (toElements) { + yield* toElements(firstVal.value) as TElement[]; + for await (const page of pages) { + yield* toElements(page) as TElement[]; + } + } else { + yield firstVal.value; + // `pages` is of type `AsyncIterableIterator` but TPage = TElement in this case + yield* pages as unknown as AsyncIterableIterator; + } + } else { + yield* firstVal.value; + for await (const page of pages) { + // pages is of type `AsyncIterableIterator` so `page` is of type `TPage`. In this branch, + // it must be the case that `TPage = TElement[]` + yield* page as unknown as TElement[]; + } + } +} + +async function* getPageAsyncIterator( + pagedResult: PagedResult, + options: { + pageLink?: TLink; + } = {}, +): AsyncIterableIterator { + const { pageLink } = options; + let response = await pagedResult.getPage( + pageLink ?? pagedResult.firstPageLink, + ); + if (!response) { + return; + } + yield response.page; + while (response.nextPageLink) { + response = await pagedResult.getPage(response.nextPageLink); + if (!response) { + return; + } + yield response.page; + } +} + +/** + * An interface that tracks the settings for paged iteration + */ +export interface PageSettings { + /** + * The token that keeps track of where to continue the iterator + */ + continuationToken?: string; +} + +/** + * An interface that allows async iterable iteration both to completion and by page. + */ +export interface PagedAsyncIterableIterator< + TElement, + TPage = TElement[], + TPageSettings = PageSettings, +> { + /** + * The next method, part of the iteration protocol + */ + next(): Promise>; + /** + * The connection to the async iterator, part of the iteration protocol + */ + [Symbol.asyncIterator](): PagedAsyncIterableIterator< + TElement, + TPage, + TPageSettings + >; + /** + * Return an AsyncIterableIterator that works a page at a time + */ + byPage: (settings?: TPageSettings) => AsyncIterableIterator; +} + +/** + * An interface that describes how to communicate with the service. + */ +interface PagedResult { + /** + * Link to the first page of results. + */ + firstPageLink: TLink; + /** + * A method that returns a page of results. + */ + getPage: ( + pageLink: TLink, + ) => Promise<{ page: TPage; nextPageLink?: TLink } | undefined>; + /** + * a function to implement the `byPage` method on the paged async iterator. + */ + byPage?: (settings?: TPageSettings) => AsyncIterableIterator; + + /** + * A function to extract elements from a page. + */ + toElements?: (page: TPage) => unknown[]; +} + +/** + * Helper type to extract the type of an array + */ +export type GetArrayType = T extends Array ? TData : never; + +/** + * The type of a custom function that defines how to get a page and a link to the next one if any. + */ +export type GetPage = (pageLink: string) => Promise<{ + page: TPage; + nextPageLink?: string; +}>; + +/** + * Options for the paging helper + */ +export interface PagingOptions { + /** + * Custom function to extract pagination details for crating the PagedAsyncIterableIterator + */ + customGetPage?: GetPage[]>; +} + +/** + * Helper type to infer the Type of the paged elements from the response type + * This type is generated based on the swagger information for x-ms-pageable + * specifically on the itemName property which indicates the property of the response + * where the page items are found. The default value is `value`. + * This type will allow us to provide strongly typed Iterator based on the response we get as second parameter + */ +export type PaginateReturn = TResult extends { + body: { value?: infer TPage }; +} + ? GetArrayType + : Array; + +/** + * Helper to paginate results from an initial response that follows the specification of Autorest `x-ms-pageable` extension + * @param client - Client to use for sending the next page requests + * @param initialResponse - Initial response containing the nextLink and current page of elements + * @param customGetPage - Optional - Function to define how to extract the page and next link to be used to paginate the results + * @returns - PagedAsyncIterableIterator to iterate the elements + */ +export function paginate( + client: Client, + initialResponse: TResponse, + options: PagingOptions = {}, +): PagedAsyncIterableIterator> { + // Extract element type from initial response + type TElement = PaginateReturn; + let firstRun = true; + const itemName = "value"; + const nextLinkName = "nextLink"; + const { customGetPage } = options; + const pagedResult: PagedResult = { + firstPageLink: "", + getPage: + typeof customGetPage === "function" + ? customGetPage + : async (pageLink: string) => { + const result = firstRun + ? initialResponse + : await client.pathUnchecked(pageLink).get(); + firstRun = false; + checkPagingRequest(result); + const nextLink = getNextLink(result.body, nextLinkName); + const values = getElements(result.body, itemName); + return { + page: values, + nextPageLink: nextLink, + }; + }, + }; + + return getPagedAsyncIterator(pagedResult); +} + +/** + * Gets for the value of nextLink in the body + */ +function getNextLink(body: unknown, nextLinkName?: string): string | undefined { + if (!nextLinkName) { + return undefined; + } + + const nextLink = (body as Record)[nextLinkName]; + + if (typeof nextLink !== "string" && typeof nextLink !== "undefined") { + throw new Error( + `Body Property ${nextLinkName} should be a string or undefined`, + ); + } + + return nextLink; +} + +/** + * Gets the elements of the current request in the body. + */ +function getElements(body: unknown, itemName: string): T[] { + const value = (body as Record)[itemName] as T[]; + + // value has to be an array according to the x-ms-pageable extension. + // The fact that this must be an array is used above to calculate the + // type of elements in the page in PaginateReturn + if (!Array.isArray(value)) { + throw new Error( + `Couldn't paginate response\n Body doesn't contain an array property with name: ${itemName}`, + ); + } + + return value ?? []; +} + +/** + * Checks if a request failed + */ +function checkPagingRequest(response: PathUncheckedResponse): void { + const Http2xxStatusCodes = [ + "200", + "201", + "202", + "203", + "204", + "205", + "206", + "207", + "208", + "226", + ]; + if (!Http2xxStatusCodes.includes(response.status)) { + throw createRestError( + `Pagination failed with unexpected statusCode ${response.status}`, + response, + ); + } +} diff --git a/sdk/ai/ai-projects-1dp/src/parameters.ts b/sdk/ai/ai-projects-1dp/src/parameters.ts new file mode 100644 index 000000000000..44d18799b847 --- /dev/null +++ b/sdk/ai/ai-projects-1dp/src/parameters.ts @@ -0,0 +1,736 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { RawHttpHeadersInput } from "@azure/core-rest-pipeline"; +import type { RequestParameters } from "@azure-rest/core-client"; +import type { + CreateAgentOptions, + ListSortOrder, + UpdateAgentOptions, + AgentThreadCreationOptions, + UpdateAgentThreadOptions, + ThreadMessageOptions, + RunAdditionalFieldList, + CreateRunOptions, + ToolOutput, + CreateAndRunThreadOptions, + FilePurpose, + HttpPartFile, + HttpPartFilePurpose, + HttpPartString, + VectorStoreOptions, + VectorStoreUpdateOptions, + VectorStoreFileStatusFilter, + VectorStoreDataSource, + VectorStoreChunkingStrategyRequest, + ConnectionType, + Evaluation, + ListViewType, + DatasetVersion, + PendingUploadRequest, + Index, +} from "./models.js"; + +export interface AssistantsCreateAgentBodyParam { + body: CreateAgentOptions; +} + +export type AssistantsCreateAgentParameters = AssistantsCreateAgentBodyParam & + RequestParameters; + +export interface AssistantsListAgentsQueryParamProperties { + /** A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. */ + limit?: number; + /** + * Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order. + * + * Possible values: "asc", "desc" + */ + order?: ListSortOrder; + /** A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. */ + after?: string; + /** A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. */ + before?: string; +} + +export interface AssistantsListAgentsQueryParam { + queryParameters?: AssistantsListAgentsQueryParamProperties; +} + +export type AssistantsListAgentsParameters = AssistantsListAgentsQueryParam & + RequestParameters; +export type AssistantsGetAgentParameters = RequestParameters; + +export interface AssistantsUpdateAgentBodyParam { + body: UpdateAgentOptions; +} + +export type AssistantsUpdateAgentParameters = AssistantsUpdateAgentBodyParam & + RequestParameters; +export type AssistantsDeleteAgentParameters = RequestParameters; + +export interface AssistantsCreateThreadBodyParam { + body: AgentThreadCreationOptions; +} + +export type AssistantsCreateThreadParameters = AssistantsCreateThreadBodyParam & + RequestParameters; +export type AssistantsGetThreadParameters = RequestParameters; + +export interface AssistantsUpdateThreadBodyParam { + body: UpdateAgentThreadOptions; +} + +export type AssistantsUpdateThreadParameters = AssistantsUpdateThreadBodyParam & + RequestParameters; +export type AssistantsDeleteThreadParameters = RequestParameters; + +export interface AssistantsCreateMessageBodyParam { + body: ThreadMessageOptions; +} + +export type AssistantsCreateMessageParameters = + AssistantsCreateMessageBodyParam & RequestParameters; + +export interface AssistantsListMessagesQueryParamProperties { + /** Filter messages by the run ID that generated them. */ + runId?: string; + /** A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. */ + limit?: number; + /** + * Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order. + * + * Possible values: "asc", "desc" + */ + order?: ListSortOrder; + /** A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. */ + after?: string; + /** A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. */ + before?: string; +} + +export interface AssistantsListMessagesQueryParam { + queryParameters?: AssistantsListMessagesQueryParamProperties; +} + +export type AssistantsListMessagesParameters = + AssistantsListMessagesQueryParam & RequestParameters; +export type AssistantsGetMessageParameters = RequestParameters; + +export interface AssistantsUpdateMessageBodyParam { + body: { metadata?: Record | null }; +} + +export type AssistantsUpdateMessageParameters = + AssistantsUpdateMessageBodyParam & RequestParameters; + +export interface AssistantsCreateRunBodyParam { + body: CreateRunOptions; +} + +/** This is the wrapper object for the parameter `include[]` with explode set to false and style set to form. */ +export interface AssistantsCreateRunIncludeQueryParam { + /** Value of the parameter */ + value: RunAdditionalFieldList[]; + /** Should we explode the value? */ + explode: false; + /** Style of the value */ + style: "form"; +} + +export interface AssistantsCreateRunQueryParamProperties { + /** + * A list of additional fields to include in the response. + * Currently the only supported value is `step_details.tool_calls[*].file_search.results[*].content` to fetch the file search result content. + */ + "include[]"?: RunAdditionalFieldList[] | AssistantsCreateRunIncludeQueryParam; +} + +export interface AssistantsCreateRunQueryParam { + queryParameters?: AssistantsCreateRunQueryParamProperties; +} + +export type AssistantsCreateRunParameters = AssistantsCreateRunQueryParam & + AssistantsCreateRunBodyParam & + RequestParameters; + +export interface AssistantsListRunsQueryParamProperties { + /** A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. */ + limit?: number; + /** + * Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order. + * + * Possible values: "asc", "desc" + */ + order?: ListSortOrder; + /** A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. */ + after?: string; + /** A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. */ + before?: string; +} + +export interface AssistantsListRunsQueryParam { + queryParameters?: AssistantsListRunsQueryParamProperties; +} + +export type AssistantsListRunsParameters = AssistantsListRunsQueryParam & + RequestParameters; +export type AssistantsGetRunParameters = RequestParameters; + +export interface AssistantsUpdateRunBodyParam { + body: { metadata?: Record | null }; +} + +export type AssistantsUpdateRunParameters = AssistantsUpdateRunBodyParam & + RequestParameters; + +export interface AssistantsSubmitToolOutputsToRunBodyParam { + body: { tool_outputs: Array; stream?: boolean | null }; +} + +export type AssistantsSubmitToolOutputsToRunParameters = + AssistantsSubmitToolOutputsToRunBodyParam & RequestParameters; +export type AssistantsCancelRunParameters = RequestParameters; + +export interface AssistantsCreateThreadAndRunBodyParam { + body: CreateAndRunThreadOptions; +} + +export type AssistantsCreateThreadAndRunParameters = + AssistantsCreateThreadAndRunBodyParam & RequestParameters; + +/** This is the wrapper object for the parameter `include[]` with explode set to false and style set to form. */ +export interface AssistantsGetRunStepIncludeQueryParam { + /** Value of the parameter */ + value: RunAdditionalFieldList[]; + /** Should we explode the value? */ + explode: false; + /** Style of the value */ + style: "form"; +} + +export interface AssistantsGetRunStepQueryParamProperties { + /** + * A list of additional fields to include in the response. + * Currently the only supported value is `step_details.tool_calls[*].file_search.results[*].content` to fetch the file search result content. + */ + "include[]"?: + | RunAdditionalFieldList[] + | AssistantsGetRunStepIncludeQueryParam; +} + +export interface AssistantsGetRunStepQueryParam { + queryParameters?: AssistantsGetRunStepQueryParamProperties; +} + +export type AssistantsGetRunStepParameters = AssistantsGetRunStepQueryParam & + RequestParameters; + +/** This is the wrapper object for the parameter `include[]` with explode set to false and style set to form. */ +export interface AssistantsListRunStepsIncludeQueryParam { + /** Value of the parameter */ + value: RunAdditionalFieldList[]; + /** Should we explode the value? */ + explode: false; + /** Style of the value */ + style: "form"; +} + +export interface AssistantsListRunStepsQueryParamProperties { + /** + * A list of additional fields to include in the response. + * Currently the only supported value is `step_details.tool_calls[*].file_search.results[*].content` to fetch the file search result content. + */ + "include[]"?: + | RunAdditionalFieldList[] + | AssistantsListRunStepsIncludeQueryParam; + /** A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. */ + limit?: number; + /** + * Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order. + * + * Possible values: "asc", "desc" + */ + order?: ListSortOrder; + /** A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. */ + after?: string; + /** A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. */ + before?: string; +} + +export interface AssistantsListRunStepsQueryParam { + queryParameters?: AssistantsListRunStepsQueryParamProperties; +} + +export type AssistantsListRunStepsParameters = + AssistantsListRunStepsQueryParam & RequestParameters; + +export interface AssistantsListFilesQueryParamProperties { + /** + * The purpose of the file. + * + * Possible values: "fine-tune", "fine-tune-results", "assistants", "assistants_output", "batch", "batch_output", "vision" + */ + purpose?: FilePurpose; +} + +export interface AssistantsListFilesQueryParam { + queryParameters?: AssistantsListFilesQueryParamProperties; +} + +export type AssistantsListFilesParameters = AssistantsListFilesQueryParam & + RequestParameters; + +export interface AssistantsUploadFileBodyParam { + /** Multipart body */ + body: + | FormData + | Array< + | { + name: "file"; + body: HttpPartFile; + filename?: string; + contentType?: string; + } + | { + name: "purpose"; + body: HttpPartFilePurpose; + filename?: string; + contentType?: string; + } + | { name: "filename"; body: HttpPartString } + >; +} + +export interface AssistantsUploadFileMediaTypesParam { + /** The name of the file to upload. */ + contentType: "multipart/form-data"; +} + +export type AssistantsUploadFileParameters = + AssistantsUploadFileMediaTypesParam & + AssistantsUploadFileBodyParam & + RequestParameters; +export type AssistantsDeleteFileParameters = RequestParameters; +export type AssistantsGetFileParameters = RequestParameters; +export type AssistantsGetFileContentParameters = RequestParameters; + +export interface AssistantsListVectorStoresQueryParamProperties { + /** A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. */ + limit?: number; + /** + * Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order. + * + * Possible values: "asc", "desc" + */ + order?: ListSortOrder; + /** A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. */ + after?: string; + /** A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. */ + before?: string; +} + +export interface AssistantsListVectorStoresQueryParam { + queryParameters?: AssistantsListVectorStoresQueryParamProperties; +} + +export type AssistantsListVectorStoresParameters = + AssistantsListVectorStoresQueryParam & RequestParameters; + +export interface AssistantsCreateVectorStoreBodyParam { + body: VectorStoreOptions; +} + +export type AssistantsCreateVectorStoreParameters = + AssistantsCreateVectorStoreBodyParam & RequestParameters; +export type AssistantsGetVectorStoreParameters = RequestParameters; + +export interface AssistantsModifyVectorStoreBodyParam { + body: VectorStoreUpdateOptions; +} + +export type AssistantsModifyVectorStoreParameters = + AssistantsModifyVectorStoreBodyParam & RequestParameters; +export type AssistantsDeleteVectorStoreParameters = RequestParameters; + +export interface AssistantsListVectorStoreFilesQueryParamProperties { + /** + * Filter by file status. + * + * Possible values: "in_progress", "completed", "failed", "cancelled" + */ + filter?: VectorStoreFileStatusFilter; + /** A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. */ + limit?: number; + /** + * Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order. + * + * Possible values: "asc", "desc" + */ + order?: ListSortOrder; + /** A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. */ + after?: string; + /** A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. */ + before?: string; +} + +export interface AssistantsListVectorStoreFilesQueryParam { + queryParameters?: AssistantsListVectorStoreFilesQueryParamProperties; +} + +export type AssistantsListVectorStoreFilesParameters = + AssistantsListVectorStoreFilesQueryParam & RequestParameters; + +export interface AssistantsCreateVectorStoreFileBodyParam { + body: { + file_id?: string; + data_source?: VectorStoreDataSource; + chunking_strategy?: VectorStoreChunkingStrategyRequest; + }; +} + +export type AssistantsCreateVectorStoreFileParameters = + AssistantsCreateVectorStoreFileBodyParam & RequestParameters; +export type AssistantsGetVectorStoreFileParameters = RequestParameters; +export type AssistantsDeleteVectorStoreFileParameters = RequestParameters; + +export interface AssistantsCreateVectorStoreFileBatchBodyParam { + body: { + file_ids?: string[]; + data_sources?: Array; + chunking_strategy?: VectorStoreChunkingStrategyRequest; + }; +} + +export type AssistantsCreateVectorStoreFileBatchParameters = + AssistantsCreateVectorStoreFileBatchBodyParam & RequestParameters; +export type AssistantsGetVectorStoreFileBatchParameters = RequestParameters; +export type AssistantsCancelVectorStoreFileBatchParameters = RequestParameters; + +export interface AssistantsListVectorStoreFileBatchFilesQueryParamProperties { + /** + * Filter by file status. + * + * Possible values: "in_progress", "completed", "failed", "cancelled" + */ + filter?: VectorStoreFileStatusFilter; + /** A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. */ + limit?: number; + /** + * Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order. + * + * Possible values: "asc", "desc" + */ + order?: ListSortOrder; + /** A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. */ + after?: string; + /** A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. */ + before?: string; +} + +export interface AssistantsListVectorStoreFileBatchFilesQueryParam { + queryParameters?: AssistantsListVectorStoreFileBatchFilesQueryParamProperties; +} + +export type AssistantsListVectorStoreFileBatchFilesParameters = + AssistantsListVectorStoreFileBatchFilesQueryParam & RequestParameters; + +export interface ConnectionsGetHeaders { + /** An opaque, globally-unique, client-generated string identifier for the request. */ + "x-ms-client-request-id"?: string; +} + +export interface ConnectionsGetHeaderParam { + headers?: RawHttpHeadersInput & ConnectionsGetHeaders; +} + +export type ConnectionsGetParameters = ConnectionsGetHeaderParam & + RequestParameters; + +export interface ConnectionsListHeaders { + /** An opaque, globally-unique, client-generated string identifier for the request. */ + "x-ms-client-request-id"?: string; +} + +export interface ConnectionsListQueryParamProperties { + /** + * Specific type of connection to return in list + * + * Possible values: "AzureOpenAI", "AzureBlob", "CognitiveSearch", "CosmosDB", "ApiKey", "AppInsights", "CustomKeys" + */ + connectionType?: ConnectionType; + /** The number of result items to return. */ + top?: number; + /** The number of result items to skip. */ + skip?: number; + /** The maximum number of result items per page. */ + maxpagesize?: number; +} + +export interface ConnectionsListQueryParam { + queryParameters?: ConnectionsListQueryParamProperties; +} + +export interface ConnectionsListHeaderParam { + headers?: RawHttpHeadersInput & ConnectionsListHeaders; +} + +export type ConnectionsListParameters = ConnectionsListQueryParam & + ConnectionsListHeaderParam & + RequestParameters; + +export interface EvaluationsGetHeaders { + /** An opaque, globally-unique, client-generated string identifier for the request. */ + "x-ms-client-request-id"?: string; +} + +export interface EvaluationsGetHeaderParam { + headers?: RawHttpHeadersInput & EvaluationsGetHeaders; +} + +export type EvaluationsGetParameters = EvaluationsGetHeaderParam & + RequestParameters; + +export interface EvaluationsListHeaders { + /** An opaque, globally-unique, client-generated string identifier for the request. */ + "x-ms-client-request-id"?: string; +} + +export interface EvaluationsListQueryParamProperties { + /** The number of result items to return. */ + top?: number; + /** The number of result items to skip. */ + skip?: number; + /** The maximum number of result items per page. */ + maxpagesize?: number; +} + +export interface EvaluationsListQueryParam { + queryParameters?: EvaluationsListQueryParamProperties; +} + +export interface EvaluationsListHeaderParam { + headers?: RawHttpHeadersInput & EvaluationsListHeaders; +} + +export type EvaluationsListParameters = EvaluationsListQueryParam & + EvaluationsListHeaderParam & + RequestParameters; + +export interface EvaluationsCreateRunBodyParam { + /** Evaluation to be run */ + body: Evaluation; +} + +export type EvaluationsCreateRunParameters = EvaluationsCreateRunBodyParam & + RequestParameters; + +export interface DatasetsListVersionsQueryParamProperties { + /** Top count of results, top count cannot be greater than the page size. If topCount > page size, results with be default page size count will be returned */ + top?: number; + /** Continuation token for pagination. */ + skip?: string; + /** Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2 */ + tags?: string; + /** + * [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All] View type for including/excluding (for example) archived entities. + * + * Possible values: "ActiveOnly", "ArchivedOnly", "All" + */ + listViewType?: ListViewType; +} + +export interface DatasetsListVersionsQueryParam { + queryParameters?: DatasetsListVersionsQueryParamProperties; +} + +export type DatasetsListVersionsParameters = DatasetsListVersionsQueryParam & + RequestParameters; + +export interface DatasetsListLatestQueryParamProperties { + /** Top count of results, top count cannot be greater than the page size. If topCount > page size, results with be default page size count will be returned */ + top?: number; + /** Continuation token for pagination. */ + skip?: string; + /** Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2 */ + tags?: string; + /** + * [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All] View type for including/excluding (for example) archived entities. + * + * Possible values: "ActiveOnly", "ArchivedOnly", "All" + */ + listViewType?: ListViewType; +} + +export interface DatasetsListLatestQueryParam { + queryParameters?: DatasetsListLatestQueryParamProperties; +} + +export type DatasetsListLatestParameters = DatasetsListLatestQueryParam & + RequestParameters; +export type DatasetsGetVersionParameters = RequestParameters; +export type DatasetsDeleteVersionParameters = RequestParameters; + +export interface DatasetsCreateHeaders { + /** An opaque, globally-unique, client-generated string identifier for the request. */ + "Repeatability-Request-ID"?: string; + /** Specifies the date and time at which the request was first created. */ + "Repeatability-First-Sent"?: string; + /** An opaque, globally-unique, client-generated string identifier for the request. */ + "x-ms-client-request-id"?: string; +} + +export interface DatasetsCreateBodyParam { + /** The definition of the DatasetVersion to create */ + body: DatasetVersion; +} + +export interface DatasetsCreateHeaderParam { + headers?: RawHttpHeadersInput & DatasetsCreateHeaders; +} + +export type DatasetsCreateParameters = DatasetsCreateHeaderParam & + DatasetsCreateBodyParam & + RequestParameters; + +export interface DatasetsCreateVersionBodyParam { + /** The definition of the DatasetVersion to create */ + body: DatasetVersion; +} + +export type DatasetsCreateVersionParameters = DatasetsCreateVersionBodyParam & + RequestParameters; + +export interface DatasetsStartPendingUploadVersionBodyParam { + /** Parameters for the action */ + body: PendingUploadRequest; +} + +export type DatasetsStartPendingUploadVersionParameters = + DatasetsStartPendingUploadVersionBodyParam & RequestParameters; + +export interface DatasetsStartPendingUploadBodyParam { + /** Parameters for the action */ + body: PendingUploadRequest; +} + +export type DatasetsStartPendingUploadParameters = + DatasetsStartPendingUploadBodyParam & RequestParameters; + +export interface IndexesListVersionsQueryParamProperties { + /** Top count of results, top count cannot be greater than the page size. If topCount > page size, results with be default page size count will be returned */ + top?: number; + /** Continuation token for pagination. */ + skip?: string; + /** Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2 */ + tags?: string; + /** + * [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All] View type for including/excluding (for example) archived entities. + * + * Possible values: "ActiveOnly", "ArchivedOnly", "All" + */ + listViewType?: ListViewType; +} + +export interface IndexesListVersionsQueryParam { + queryParameters?: IndexesListVersionsQueryParamProperties; +} + +export type IndexesListVersionsParameters = IndexesListVersionsQueryParam & + RequestParameters; + +export interface IndexesListLatestQueryParamProperties { + /** Top count of results, top count cannot be greater than the page size. If topCount > page size, results with be default page size count will be returned */ + top?: number; + /** Continuation token for pagination. */ + skip?: string; + /** Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2 */ + tags?: string; + /** + * [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All] View type for including/excluding (for example) archived entities. + * + * Possible values: "ActiveOnly", "ArchivedOnly", "All" + */ + listViewType?: ListViewType; +} + +export interface IndexesListLatestQueryParam { + queryParameters?: IndexesListLatestQueryParamProperties; +} + +export type IndexesListLatestParameters = IndexesListLatestQueryParam & + RequestParameters; +export type IndexesGetVersionParameters = RequestParameters; +export type IndexesDeleteVersionParameters = RequestParameters; + +export interface IndexesCreateHeaders { + /** An opaque, globally-unique, client-generated string identifier for the request. */ + "Repeatability-Request-ID"?: string; + /** Specifies the date and time at which the request was first created. */ + "Repeatability-First-Sent"?: string; + /** An opaque, globally-unique, client-generated string identifier for the request. */ + "x-ms-client-request-id"?: string; +} + +export interface IndexesCreateBodyParam { + /** The definition of the Index to create */ + body: Index; +} + +export interface IndexesCreateHeaderParam { + headers?: RawHttpHeadersInput & IndexesCreateHeaders; +} + +export type IndexesCreateParameters = IndexesCreateHeaderParam & + IndexesCreateBodyParam & + RequestParameters; + +export interface IndexesCreateVersionBodyParam { + /** The definition of the Index to create */ + body: Index; +} + +export type IndexesCreateVersionParameters = IndexesCreateVersionBodyParam & + RequestParameters; + +export interface DeploymentsGetHeaders { + /** An opaque, globally-unique, client-generated string identifier for the request. */ + "x-ms-client-request-id"?: string; +} + +export interface DeploymentsGetHeaderParam { + headers?: RawHttpHeadersInput & DeploymentsGetHeaders; +} + +export type DeploymentsGetParameters = DeploymentsGetHeaderParam & + RequestParameters; + +export interface DeploymentsListHeaders { + /** An opaque, globally-unique, client-generated string identifier for the request. */ + "x-ms-client-request-id"?: string; +} + +export interface DeploymentsListQueryParamProperties { + /** Model publisher to filter models by */ + modelPublisher?: string; + /** Model name (the publisher specific name) to filter models by */ + modelName?: string; + /** The number of result items to return. */ + top?: number; + /** The number of result items to skip. */ + skip?: number; + /** The maximum number of result items per page. */ + maxpagesize?: number; +} + +export interface DeploymentsListQueryParam { + queryParameters?: DeploymentsListQueryParamProperties; +} + +export interface DeploymentsListHeaderParam { + headers?: RawHttpHeadersInput & DeploymentsListHeaders; +} + +export type DeploymentsListParameters = DeploymentsListQueryParam & + DeploymentsListHeaderParam & + RequestParameters; diff --git a/sdk/ai/ai-projects-1dp/src/projectsClient.ts b/sdk/ai/ai-projects-1dp/src/projectsClient.ts new file mode 100644 index 000000000000..9a32e9b58dcf --- /dev/null +++ b/sdk/ai/ai-projects-1dp/src/projectsClient.ts @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ClientOptions } from "@azure-rest/core-client"; +import { getClient } from "@azure-rest/core-client"; +import { logger } from "./logger.js"; +import type { + TokenCredential, + KeyCredential, + isKeyCredential, +} from "@azure/core-auth"; +import type { ProjectsClient } from "./clientDefinitions.js"; + +/** The optional parameters for the client */ +export interface ProjectsClientOptions extends ClientOptions { + /** The api version option of the client */ + apiVersion?: string; +} + +/** + * Initialize a new instance of `ProjectsClient` + * @param endpointParam - Project endpoint in the form of: https://.services.ai.azure.com/api/projects/ + * @param credentials - uniquely identify client credential + * @param options - the parameter for all optional parameters + */ +export default function createClient( + endpointParam: string, + credentials: TokenCredential | KeyCredential, + { apiVersion = "2025-05-01-preview", ...options }: ProjectsClientOptions = {}, +): ProjectsClient { + const endpointUrl = options.endpoint ?? options.baseUrl ?? `${endpointParam}`; + const userAgentInfo = `azsdk-js-ai-projects-1dp-rest/1.0.0-beta.1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}` + : `${userAgentInfo}`; + options = { + ...options, + userAgentOptions: { + userAgentPrefix, + }, + loggingOptions: { + logger: options.loggingOptions?.logger ?? logger.info, + }, + credentials: { + scopes: options.credentials?.scopes ?? [ + "https://cognitiveservices.azure.com/.default", + ], + }, + }; + const client = getClient(endpointUrl, credentials, options) as ProjectsClient; + + client.pipeline.removePolicy({ name: "ApiVersionPolicy" }); + client.pipeline.addPolicy({ + name: "ClientApiVersionPolicy", + sendRequest: (req, next) => { + // Use the apiVersion defined in request url directly + // Append one if there is no apiVersion and we have one at client options + const url = new URL(req.url); + if (!url.searchParams.get("api-version") && apiVersion) { + req.url = `${req.url}${ + Array.from(url.searchParams.keys()).length > 0 ? "&" : "?" + }api-version=${apiVersion}`; + } + + return next(req); + }, + }); + if (isKeyCredential(credentials)) { + client.pipeline.addPolicy({ + name: "customKeyCredentialPolicy", + async sendRequest(request, next) { + request.headers.set("Authorization", "Bearer " + credentials.key); + return next(request); + }, + }); + } + + return client; +} diff --git a/sdk/ai/ai-projects-1dp/src/responses.ts b/sdk/ai/ai-projects-1dp/src/responses.ts new file mode 100644 index 000000000000..4aa16fbf930f --- /dev/null +++ b/sdk/ai/ai-projects-1dp/src/responses.ts @@ -0,0 +1,1166 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { RawHttpHeaders } from "@azure/core-rest-pipeline"; +import type { HttpResponse, ErrorResponse } from "@azure-rest/core-client"; +import type { + AgentOutput, + OpenAIPageableListOfAgentOutput, + AgentDeletionStatusOutput, + AgentThreadOutput, + ThreadDeletionStatusOutput, + ThreadMessageOutput, + OpenAIPageableListOfThreadMessageOutput, + ThreadRunOutput, + OpenAIPageableListOfThreadRunOutput, + RunStepOutput, + OpenAIPageableListOfRunStepOutput, + FileListResponseOutput, + OpenAIFileOutput, + FileDeletionStatusOutput, + OpenAIPageableListOfVectorStoreOutput, + VectorStoreOutput, + VectorStoreDeletionStatusOutput, + OpenAIPageableListOfVectorStoreFileOutput, + VectorStoreFileOutput, + VectorStoreFileDeletionStatusOutput, + VectorStoreFileBatchOutput, + ConnectionOutput, + PagedConnectionOutput, + EvaluationOutput, + PagedEvaluationOutput, + PagedDatasetVersionOutput, + DatasetVersionOutput, + RepeatabilityResultOutput, + PendingUploadResponseOutput, + PagedIndexOutput, + IndexOutput, + DeploymentOutput, + PagedDeploymentOutput, +} from "./outputModels.js"; + +/** The new agent instance. */ +export interface AssistantsCreateAgent200Response extends HttpResponse { + status: "200"; + body: AgentOutput; +} + +export interface AssistantsCreateAgentDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AssistantsCreateAgentDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AssistantsCreateAgentDefaultHeaders; +} + +/** The requested list of agents. */ +export interface AssistantsListAgents200Response extends HttpResponse { + status: "200"; + body: OpenAIPageableListOfAgentOutput; +} + +export interface AssistantsListAgentsDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AssistantsListAgentsDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AssistantsListAgentsDefaultHeaders; +} + +/** The requested agent instance. */ +export interface AssistantsGetAgent200Response extends HttpResponse { + status: "200"; + body: AgentOutput; +} + +export interface AssistantsGetAgentDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AssistantsGetAgentDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AssistantsGetAgentDefaultHeaders; +} + +/** The updated agent instance. */ +export interface AssistantsUpdateAgent200Response extends HttpResponse { + status: "200"; + body: AgentOutput; +} + +export interface AssistantsUpdateAgentDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AssistantsUpdateAgentDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AssistantsUpdateAgentDefaultHeaders; +} + +/** Status information about the requested deletion operation. */ +export interface AssistantsDeleteAgent200Response extends HttpResponse { + status: "200"; + body: AgentDeletionStatusOutput; +} + +export interface AssistantsDeleteAgentDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AssistantsDeleteAgentDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AssistantsDeleteAgentDefaultHeaders; +} + +/** Information about the newly created thread. */ +export interface AssistantsCreateThread200Response extends HttpResponse { + status: "200"; + body: AgentThreadOutput; +} + +export interface AssistantsCreateThreadDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AssistantsCreateThreadDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AssistantsCreateThreadDefaultHeaders; +} + +/** Information about the requested thread. */ +export interface AssistantsGetThread200Response extends HttpResponse { + status: "200"; + body: AgentThreadOutput; +} + +export interface AssistantsGetThreadDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AssistantsGetThreadDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AssistantsGetThreadDefaultHeaders; +} + +/** Information about the modified thread. */ +export interface AssistantsUpdateThread200Response extends HttpResponse { + status: "200"; + body: AgentThreadOutput; +} + +export interface AssistantsUpdateThreadDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AssistantsUpdateThreadDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AssistantsUpdateThreadDefaultHeaders; +} + +/** Status information about the requested thread deletion operation. */ +export interface AssistantsDeleteThread200Response extends HttpResponse { + status: "200"; + body: ThreadDeletionStatusOutput; +} + +export interface AssistantsDeleteThreadDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AssistantsDeleteThreadDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AssistantsDeleteThreadDefaultHeaders; +} + +/** A representation of the new message. */ +export interface AssistantsCreateMessage200Response extends HttpResponse { + status: "200"; + body: ThreadMessageOutput; +} + +export interface AssistantsCreateMessageDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AssistantsCreateMessageDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AssistantsCreateMessageDefaultHeaders; +} + +/** The requested list of messages. */ +export interface AssistantsListMessages200Response extends HttpResponse { + status: "200"; + body: OpenAIPageableListOfThreadMessageOutput; +} + +export interface AssistantsListMessagesDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AssistantsListMessagesDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AssistantsListMessagesDefaultHeaders; +} + +/** A representation of the requested message. */ +export interface AssistantsGetMessage200Response extends HttpResponse { + status: "200"; + body: ThreadMessageOutput; +} + +export interface AssistantsGetMessageDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AssistantsGetMessageDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AssistantsGetMessageDefaultHeaders; +} + +/** A representation of the modified message. */ +export interface AssistantsUpdateMessage200Response extends HttpResponse { + status: "200"; + body: ThreadMessageOutput; +} + +export interface AssistantsUpdateMessageDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AssistantsUpdateMessageDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AssistantsUpdateMessageDefaultHeaders; +} + +/** Information about the new thread run. */ +export interface AssistantsCreateRun200Response extends HttpResponse { + status: "200"; + body: ThreadRunOutput; +} + +export interface AssistantsCreateRunDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AssistantsCreateRunDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AssistantsCreateRunDefaultHeaders; +} + +/** The requested list of thread runs. */ +export interface AssistantsListRuns200Response extends HttpResponse { + status: "200"; + body: OpenAIPageableListOfThreadRunOutput; +} + +export interface AssistantsListRunsDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AssistantsListRunsDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AssistantsListRunsDefaultHeaders; +} + +/** The requested information about the specified thread run. */ +export interface AssistantsGetRun200Response extends HttpResponse { + status: "200"; + body: ThreadRunOutput; +} + +export interface AssistantsGetRunDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AssistantsGetRunDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AssistantsGetRunDefaultHeaders; +} + +/** Information about the modified run. */ +export interface AssistantsUpdateRun200Response extends HttpResponse { + status: "200"; + body: ThreadRunOutput; +} + +export interface AssistantsUpdateRunDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AssistantsUpdateRunDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AssistantsUpdateRunDefaultHeaders; +} + +/** Updated information about the run. */ +export interface AssistantsSubmitToolOutputsToRun200Response + extends HttpResponse { + status: "200"; + body: ThreadRunOutput; +} + +export interface AssistantsSubmitToolOutputsToRunDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AssistantsSubmitToolOutputsToRunDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AssistantsSubmitToolOutputsToRunDefaultHeaders; +} + +/** Updated information about the cancelled run. */ +export interface AssistantsCancelRun200Response extends HttpResponse { + status: "200"; + body: ThreadRunOutput; +} + +export interface AssistantsCancelRunDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AssistantsCancelRunDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AssistantsCancelRunDefaultHeaders; +} + +/** Information about the newly created thread. */ +export interface AssistantsCreateThreadAndRun200Response extends HttpResponse { + status: "200"; + body: ThreadRunOutput; +} + +export interface AssistantsCreateThreadAndRunDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AssistantsCreateThreadAndRunDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AssistantsCreateThreadAndRunDefaultHeaders; +} + +/** Information about the requested run step. */ +export interface AssistantsGetRunStep200Response extends HttpResponse { + status: "200"; + body: RunStepOutput; +} + +export interface AssistantsGetRunStepDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AssistantsGetRunStepDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AssistantsGetRunStepDefaultHeaders; +} + +/** The requested list of run steps. */ +export interface AssistantsListRunSteps200Response extends HttpResponse { + status: "200"; + body: OpenAIPageableListOfRunStepOutput; +} + +export interface AssistantsListRunStepsDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AssistantsListRunStepsDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AssistantsListRunStepsDefaultHeaders; +} + +/** The requested list of files. */ +export interface AssistantsListFiles200Response extends HttpResponse { + status: "200"; + body: FileListResponseOutput; +} + +export interface AssistantsListFilesDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AssistantsListFilesDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AssistantsListFilesDefaultHeaders; +} + +/** A representation of the uploaded file. */ +export interface AssistantsUploadFile200Response extends HttpResponse { + status: "200"; + body: OpenAIFileOutput; +} + +export interface AssistantsUploadFileDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AssistantsUploadFileDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AssistantsUploadFileDefaultHeaders; +} + +/** The request has succeeded. */ +export interface AssistantsDeleteFile200Response extends HttpResponse { + status: "200"; + body: FileDeletionStatusOutput; +} + +export interface AssistantsDeleteFileDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AssistantsDeleteFileDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AssistantsDeleteFileDefaultHeaders; +} + +/** The request has succeeded. */ +export interface AssistantsGetFile200Response extends HttpResponse { + status: "200"; + body: OpenAIFileOutput; +} + +export interface AssistantsGetFileDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AssistantsGetFileDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AssistantsGetFileDefaultHeaders; +} + +/** The request has succeeded. */ +export interface AssistantsGetFileContent200Response extends HttpResponse { + status: "200"; + /** Value may contain any sequence of octets */ + body: Uint8Array; +} + +export interface AssistantsGetFileContentDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AssistantsGetFileContentDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AssistantsGetFileContentDefaultHeaders; +} + +/** The request has succeeded. */ +export interface AssistantsListVectorStores200Response extends HttpResponse { + status: "200"; + body: OpenAIPageableListOfVectorStoreOutput; +} + +export interface AssistantsListVectorStoresDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AssistantsListVectorStoresDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AssistantsListVectorStoresDefaultHeaders; +} + +/** The request has succeeded. */ +export interface AssistantsCreateVectorStore200Response extends HttpResponse { + status: "200"; + body: VectorStoreOutput; +} + +export interface AssistantsCreateVectorStoreDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AssistantsCreateVectorStoreDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AssistantsCreateVectorStoreDefaultHeaders; +} + +/** The request has succeeded. */ +export interface AssistantsGetVectorStore200Response extends HttpResponse { + status: "200"; + body: VectorStoreOutput; +} + +export interface AssistantsGetVectorStoreDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AssistantsGetVectorStoreDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AssistantsGetVectorStoreDefaultHeaders; +} + +/** The request has succeeded. */ +export interface AssistantsModifyVectorStore200Response extends HttpResponse { + status: "200"; + body: VectorStoreOutput; +} + +export interface AssistantsModifyVectorStoreDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AssistantsModifyVectorStoreDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AssistantsModifyVectorStoreDefaultHeaders; +} + +/** The request has succeeded. */ +export interface AssistantsDeleteVectorStore200Response extends HttpResponse { + status: "200"; + body: VectorStoreDeletionStatusOutput; +} + +export interface AssistantsDeleteVectorStoreDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AssistantsDeleteVectorStoreDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AssistantsDeleteVectorStoreDefaultHeaders; +} + +/** The request has succeeded. */ +export interface AssistantsListVectorStoreFiles200Response + extends HttpResponse { + status: "200"; + body: OpenAIPageableListOfVectorStoreFileOutput; +} + +export interface AssistantsListVectorStoreFilesDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AssistantsListVectorStoreFilesDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AssistantsListVectorStoreFilesDefaultHeaders; +} + +/** The request has succeeded. */ +export interface AssistantsCreateVectorStoreFile200Response + extends HttpResponse { + status: "200"; + body: VectorStoreFileOutput; +} + +export interface AssistantsCreateVectorStoreFileDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AssistantsCreateVectorStoreFileDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AssistantsCreateVectorStoreFileDefaultHeaders; +} + +/** The request has succeeded. */ +export interface AssistantsGetVectorStoreFile200Response extends HttpResponse { + status: "200"; + body: VectorStoreFileOutput; +} + +export interface AssistantsGetVectorStoreFileDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AssistantsGetVectorStoreFileDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AssistantsGetVectorStoreFileDefaultHeaders; +} + +/** The request has succeeded. */ +export interface AssistantsDeleteVectorStoreFile200Response + extends HttpResponse { + status: "200"; + body: VectorStoreFileDeletionStatusOutput; +} + +export interface AssistantsDeleteVectorStoreFileDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AssistantsDeleteVectorStoreFileDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AssistantsDeleteVectorStoreFileDefaultHeaders; +} + +/** The request has succeeded. */ +export interface AssistantsCreateVectorStoreFileBatch200Response + extends HttpResponse { + status: "200"; + body: VectorStoreFileBatchOutput; +} + +export interface AssistantsCreateVectorStoreFileBatchDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AssistantsCreateVectorStoreFileBatchDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AssistantsCreateVectorStoreFileBatchDefaultHeaders; +} + +/** The request has succeeded. */ +export interface AssistantsGetVectorStoreFileBatch200Response + extends HttpResponse { + status: "200"; + body: VectorStoreFileBatchOutput; +} + +export interface AssistantsGetVectorStoreFileBatchDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AssistantsGetVectorStoreFileBatchDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AssistantsGetVectorStoreFileBatchDefaultHeaders; +} + +/** The request has succeeded. */ +export interface AssistantsCancelVectorStoreFileBatch200Response + extends HttpResponse { + status: "200"; + body: VectorStoreFileBatchOutput; +} + +export interface AssistantsCancelVectorStoreFileBatchDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AssistantsCancelVectorStoreFileBatchDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AssistantsCancelVectorStoreFileBatchDefaultHeaders; +} + +/** The request has succeeded. */ +export interface AssistantsListVectorStoreFileBatchFiles200Response + extends HttpResponse { + status: "200"; + body: OpenAIPageableListOfVectorStoreFileOutput; +} + +export interface AssistantsListVectorStoreFileBatchFilesDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AssistantsListVectorStoreFileBatchFilesDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & + AssistantsListVectorStoreFileBatchFilesDefaultHeaders; +} + +export interface ConnectionsGet200Headers { + /** An opaque, globally-unique, client-generated string identifier for the request. */ + "x-ms-client-request-id"?: string; +} + +/** The request has succeeded. */ +export interface ConnectionsGet200Response extends HttpResponse { + status: "200"; + body: ConnectionOutput; + headers: RawHttpHeaders & ConnectionsGet200Headers; +} + +export interface ConnectionsGetDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface ConnectionsGetDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & ConnectionsGetDefaultHeaders; +} + +export interface ConnectionsList200Headers { + /** An opaque, globally-unique, client-generated string identifier for the request. */ + "x-ms-client-request-id"?: string; +} + +/** The request has succeeded. */ +export interface ConnectionsList200Response extends HttpResponse { + status: "200"; + body: PagedConnectionOutput; + headers: RawHttpHeaders & ConnectionsList200Headers; +} + +export interface ConnectionsListDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface ConnectionsListDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & ConnectionsListDefaultHeaders; +} + +export interface EvaluationsGet200Headers { + /** An opaque, globally-unique, client-generated string identifier for the request. */ + "x-ms-client-request-id"?: string; +} + +/** The request has succeeded. */ +export interface EvaluationsGet200Response extends HttpResponse { + status: "200"; + body: EvaluationOutput; + headers: RawHttpHeaders & EvaluationsGet200Headers; +} + +export interface EvaluationsGetDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface EvaluationsGetDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & EvaluationsGetDefaultHeaders; +} + +export interface EvaluationsList200Headers { + /** An opaque, globally-unique, client-generated string identifier for the request. */ + "x-ms-client-request-id"?: string; +} + +/** The request has succeeded. */ +export interface EvaluationsList200Response extends HttpResponse { + status: "200"; + body: PagedEvaluationOutput; + headers: RawHttpHeaders & EvaluationsList200Headers; +} + +export interface EvaluationsListDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface EvaluationsListDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & EvaluationsListDefaultHeaders; +} + +/** The request has succeeded. */ +export interface EvaluationsCreateRun200Response extends HttpResponse { + status: "200"; + body: EvaluationOutput; +} + +export interface EvaluationsCreateRunDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface EvaluationsCreateRunDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & EvaluationsCreateRunDefaultHeaders; +} + +/** The request has succeeded. */ +export interface DatasetsListVersions200Response extends HttpResponse { + status: "200"; + body: PagedDatasetVersionOutput; +} + +export interface DatasetsListVersionsDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface DatasetsListVersionsDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & DatasetsListVersionsDefaultHeaders; +} + +/** The request has succeeded. */ +export interface DatasetsListLatest200Response extends HttpResponse { + status: "200"; + body: PagedDatasetVersionOutput; +} + +export interface DatasetsListLatestDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface DatasetsListLatestDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & DatasetsListLatestDefaultHeaders; +} + +/** The request has succeeded. */ +export interface DatasetsGetVersion200Response extends HttpResponse { + status: "200"; + body: DatasetVersionOutput; +} + +export interface DatasetsGetVersionDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface DatasetsGetVersionDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & DatasetsGetVersionDefaultHeaders; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface DatasetsDeleteVersion204Response extends HttpResponse { + status: "204"; +} + +export interface DatasetsDeleteVersionDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface DatasetsDeleteVersionDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & DatasetsDeleteVersionDefaultHeaders; +} + +export interface DatasetsCreate200Headers { + /** Indicates whether the repeatable request was accepted or rejected. */ + "repeatability-result"?: RepeatabilityResultOutput; + /** An opaque, globally-unique, client-generated string identifier for the request. */ + "x-ms-client-request-id"?: string; +} + +/** The request has succeeded. */ +export interface DatasetsCreate200Response extends HttpResponse { + status: "200"; + body: DatasetVersionOutput; + headers: RawHttpHeaders & DatasetsCreate200Headers; +} + +export interface DatasetsCreateDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface DatasetsCreateDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & DatasetsCreateDefaultHeaders; +} + +/** The request has succeeded. */ +export interface DatasetsCreateVersion200Response extends HttpResponse { + status: "200"; + body: DatasetVersionOutput; +} + +/** The request has succeeded and a new resource has been created as a result. */ +export interface DatasetsCreateVersion201Response extends HttpResponse { + status: "201"; + body: DatasetVersionOutput; +} + +export interface DatasetsCreateVersionDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface DatasetsCreateVersionDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & DatasetsCreateVersionDefaultHeaders; +} + +/** The request has succeeded. */ +export interface DatasetsStartPendingUploadVersion200Response + extends HttpResponse { + status: "200"; + body: PendingUploadResponseOutput; +} + +export interface DatasetsStartPendingUploadVersionDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface DatasetsStartPendingUploadVersionDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & DatasetsStartPendingUploadVersionDefaultHeaders; +} + +/** The request has succeeded. */ +export interface DatasetsStartPendingUpload200Response extends HttpResponse { + status: "200"; + body: PendingUploadResponseOutput; +} + +export interface DatasetsStartPendingUploadDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface DatasetsStartPendingUploadDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & DatasetsStartPendingUploadDefaultHeaders; +} + +/** The request has succeeded. */ +export interface IndexesListVersions200Response extends HttpResponse { + status: "200"; + body: PagedIndexOutput; +} + +export interface IndexesListVersionsDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface IndexesListVersionsDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & IndexesListVersionsDefaultHeaders; +} + +/** The request has succeeded. */ +export interface IndexesListLatest200Response extends HttpResponse { + status: "200"; + body: PagedIndexOutput; +} + +export interface IndexesListLatestDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface IndexesListLatestDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & IndexesListLatestDefaultHeaders; +} + +/** The request has succeeded. */ +export interface IndexesGetVersion200Response extends HttpResponse { + status: "200"; + body: IndexOutput; +} + +export interface IndexesGetVersionDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface IndexesGetVersionDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & IndexesGetVersionDefaultHeaders; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface IndexesDeleteVersion204Response extends HttpResponse { + status: "204"; +} + +export interface IndexesDeleteVersionDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface IndexesDeleteVersionDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & IndexesDeleteVersionDefaultHeaders; +} + +export interface IndexesCreate200Headers { + /** Indicates whether the repeatable request was accepted or rejected. */ + "repeatability-result"?: RepeatabilityResultOutput; + /** An opaque, globally-unique, client-generated string identifier for the request. */ + "x-ms-client-request-id"?: string; +} + +/** The request has succeeded. */ +export interface IndexesCreate200Response extends HttpResponse { + status: "200"; + body: IndexOutput; + headers: RawHttpHeaders & IndexesCreate200Headers; +} + +export interface IndexesCreateDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface IndexesCreateDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & IndexesCreateDefaultHeaders; +} + +/** The request has succeeded. */ +export interface IndexesCreateVersion200Response extends HttpResponse { + status: "200"; + body: IndexOutput; +} + +/** The request has succeeded and a new resource has been created as a result. */ +export interface IndexesCreateVersion201Response extends HttpResponse { + status: "201"; + body: IndexOutput; +} + +export interface IndexesCreateVersionDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface IndexesCreateVersionDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & IndexesCreateVersionDefaultHeaders; +} + +export interface DeploymentsGet200Headers { + /** An opaque, globally-unique, client-generated string identifier for the request. */ + "x-ms-client-request-id"?: string; +} + +/** The request has succeeded. */ +export interface DeploymentsGet200Response extends HttpResponse { + status: "200"; + body: DeploymentOutput; + headers: RawHttpHeaders & DeploymentsGet200Headers; +} + +export interface DeploymentsGetDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface DeploymentsGetDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & DeploymentsGetDefaultHeaders; +} + +export interface DeploymentsList200Headers { + /** An opaque, globally-unique, client-generated string identifier for the request. */ + "x-ms-client-request-id"?: string; +} + +/** The request has succeeded. */ +export interface DeploymentsList200Response extends HttpResponse { + status: "200"; + body: PagedDeploymentOutput; + headers: RawHttpHeaders & DeploymentsList200Headers; +} + +export interface DeploymentsListDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface DeploymentsListDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & DeploymentsListDefaultHeaders; +} diff --git a/sdk/ai/ai-projects-1dp/test/public/sampleTest.spec.ts b/sdk/ai/ai-projects-1dp/test/public/sampleTest.spec.ts new file mode 100644 index 000000000000..d4919ac91ac5 --- /dev/null +++ b/sdk/ai/ai-projects-1dp/test/public/sampleTest.spec.ts @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { createRecorder } from "./utils/recordedClient.js"; +import { assert, beforeEach, afterEach, it, describe } from "vitest"; + +describe("My test", () => { + // let recorder: Recorder; + + beforeEach(async function () { + // recorder = await createRecorder(this); + }); + + afterEach(async function () { + // await recorder.stop(); + }); + + it("sample test", async function () { + assert.equal(1, 1); + }); +}); diff --git a/sdk/ai/ai-projects-1dp/test/public/utils/recordedClient.ts b/sdk/ai/ai-projects-1dp/test/public/utils/recordedClient.ts new file mode 100644 index 000000000000..6e425fdcfdf9 --- /dev/null +++ b/sdk/ai/ai-projects-1dp/test/public/utils/recordedClient.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { + Recorder, + RecorderStartOptions, + VitestTestContext, +} from "@azure-tools/test-recorder"; + +const replaceableVariables: Record = { + SUBSCRIPTION_ID: "azure_subscription_id", +}; + +const recorderEnvSetup: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables, +}; + +/** + * creates the recorder and reads the environment variables from the `.env` file. + * Should be called first in the test suite to make sure environment variables are + * read before they are being used. + */ +export async function createRecorder( + context: VitestTestContext, +): Promise { + const recorder = new Recorder(context); + await recorder.start(recorderEnvSetup); + return recorder; +} diff --git a/sdk/ai/ai-projects-1dp/tsp-location.yaml b/sdk/ai/ai-projects-1dp/tsp-location.yaml new file mode 100644 index 000000000000..afe052f6be36 --- /dev/null +++ b/sdk/ai/ai-projects-1dp/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/ai/Azure.AI.Projects +commit: bf3473e47d29644502efd1e937de2f97dce128e2 +repo: /mnt/vss/_work/1/s/azure-rest-api-specs +additionalDirectories: