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..d41433a0b466 --- /dev/null +++ b/sdk/ai/ai-projects-1dp/src/clientDefinitions.ts @@ -0,0 +1,787 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { + AgentsCreateAgentParameters, + AgentsListAgentsParameters, + AgentsGetAgentParameters, + AgentsUpdateAgentParameters, + AgentsDeleteAgentParameters, + AgentsCreateThreadParameters, + AgentsGetThreadParameters, + AgentsUpdateThreadParameters, + AgentsDeleteThreadParameters, + AgentsCreateMessageParameters, + AgentsListMessagesParameters, + AgentsGetMessageParameters, + AgentsUpdateMessageParameters, + AgentsCreateRunParameters, + AgentsListRunsParameters, + AgentsGetRunParameters, + AgentsUpdateRunParameters, + AgentsSubmitToolOutputsToRunParameters, + AgentsCancelRunParameters, + AgentsCreateThreadAndRunParameters, + AgentsGetRunStepParameters, + AgentsListRunStepsParameters, + AgentsListFilesParameters, + AgentsUploadFileParameters, + AgentsDeleteFileParameters, + AgentsGetFileParameters, + AgentsGetFileContentParameters, + AgentsListVectorStoresParameters, + AgentsCreateVectorStoreParameters, + AgentsGetVectorStoreParameters, + AgentsModifyVectorStoreParameters, + AgentsDeleteVectorStoreParameters, + AgentsListVectorStoreFilesParameters, + AgentsCreateVectorStoreFileParameters, + AgentsGetVectorStoreFileParameters, + AgentsDeleteVectorStoreFileParameters, + AgentsCreateVectorStoreFileBatchParameters, + AgentsGetVectorStoreFileBatchParameters, + AgentsCancelVectorStoreFileBatchParameters, + AgentsListVectorStoreFileBatchFilesParameters, + ConnectionsGetParameters, + ConnectionsListParameters, + EvaluationsGetParameters, + EvaluationsListParameters, + EvaluationsCreateRunParameters, + DatasetsListLatestDatasetsParameters, + DatasetsListDatasetVersionsParameters, + DatasetsDeleteVersionParameters, + DatasetsGetVersionParameters, + DatasetsCreateOrUpdateParameters, + DatasetsCreateOrGetStartPendingUploadParameters, + IndexesListLatestIndexesParameters, + IndexesGetParameters, + IndexesDeleteVersionParameters, + IndexesCreateIndexParameters, + IndexesListIndexVersionsParameters, + DeploymentsGetParameters, + DeploymentsListParameters, +} from "./parameters.js"; +import type { + AgentsCreateAgent200Response, + AgentsCreateAgentDefaultResponse, + AgentsListAgents200Response, + AgentsListAgentsDefaultResponse, + AgentsGetAgent200Response, + AgentsGetAgentDefaultResponse, + AgentsUpdateAgent200Response, + AgentsUpdateAgentDefaultResponse, + AgentsDeleteAgent200Response, + AgentsDeleteAgentDefaultResponse, + AgentsCreateThread200Response, + AgentsCreateThreadDefaultResponse, + AgentsGetThread200Response, + AgentsGetThreadDefaultResponse, + AgentsUpdateThread200Response, + AgentsUpdateThreadDefaultResponse, + AgentsDeleteThread200Response, + AgentsDeleteThreadDefaultResponse, + AgentsCreateMessage200Response, + AgentsCreateMessageDefaultResponse, + AgentsListMessages200Response, + AgentsListMessagesDefaultResponse, + AgentsGetMessage200Response, + AgentsGetMessageDefaultResponse, + AgentsUpdateMessage200Response, + AgentsUpdateMessageDefaultResponse, + AgentsCreateRun200Response, + AgentsCreateRunDefaultResponse, + AgentsListRuns200Response, + AgentsListRunsDefaultResponse, + AgentsGetRun200Response, + AgentsGetRunDefaultResponse, + AgentsUpdateRun200Response, + AgentsUpdateRunDefaultResponse, + AgentsSubmitToolOutputsToRun200Response, + AgentsSubmitToolOutputsToRunDefaultResponse, + AgentsCancelRun200Response, + AgentsCancelRunDefaultResponse, + AgentsCreateThreadAndRun200Response, + AgentsCreateThreadAndRunDefaultResponse, + AgentsGetRunStep200Response, + AgentsGetRunStepDefaultResponse, + AgentsListRunSteps200Response, + AgentsListRunStepsDefaultResponse, + AgentsListFiles200Response, + AgentsListFilesDefaultResponse, + AgentsUploadFile200Response, + AgentsUploadFileDefaultResponse, + AgentsDeleteFile200Response, + AgentsDeleteFileDefaultResponse, + AgentsGetFile200Response, + AgentsGetFileDefaultResponse, + AgentsGetFileContent200Response, + AgentsGetFileContentDefaultResponse, + AgentsListVectorStores200Response, + AgentsListVectorStoresDefaultResponse, + AgentsCreateVectorStore200Response, + AgentsCreateVectorStoreDefaultResponse, + AgentsGetVectorStore200Response, + AgentsGetVectorStoreDefaultResponse, + AgentsModifyVectorStore200Response, + AgentsModifyVectorStoreDefaultResponse, + AgentsDeleteVectorStore200Response, + AgentsDeleteVectorStoreDefaultResponse, + AgentsListVectorStoreFiles200Response, + AgentsListVectorStoreFilesDefaultResponse, + AgentsCreateVectorStoreFile200Response, + AgentsCreateVectorStoreFileDefaultResponse, + AgentsGetVectorStoreFile200Response, + AgentsGetVectorStoreFileDefaultResponse, + AgentsDeleteVectorStoreFile200Response, + AgentsDeleteVectorStoreFileDefaultResponse, + AgentsCreateVectorStoreFileBatch200Response, + AgentsCreateVectorStoreFileBatchDefaultResponse, + AgentsGetVectorStoreFileBatch200Response, + AgentsGetVectorStoreFileBatchDefaultResponse, + AgentsCancelVectorStoreFileBatch200Response, + AgentsCancelVectorStoreFileBatchDefaultResponse, + AgentsListVectorStoreFileBatchFiles200Response, + AgentsListVectorStoreFileBatchFilesDefaultResponse, + ConnectionsGet200Response, + ConnectionsGetDefaultResponse, + ConnectionsList200Response, + ConnectionsListDefaultResponse, + EvaluationsGet200Response, + EvaluationsGetDefaultResponse, + EvaluationsList200Response, + EvaluationsListDefaultResponse, + EvaluationsCreateRun200Response, + EvaluationsCreateRunDefaultResponse, + DatasetsListLatestDatasets200Response, + DatasetsListDatasetVersions200Response, + DatasetsDeleteVersion204Response, + DatasetsGetVersion200Response, + DatasetsCreateOrUpdate200Response, + DatasetsCreateOrGetStartPendingUpload200Response, + IndexesListLatestIndexes200Response, + IndexesGet200Response, + IndexesGetDefaultResponse, + IndexesDeleteVersion204Response, + IndexesCreateIndex200Response, + IndexesCreateIndex201Response, + IndexesCreateIndexDefaultResponse, + IndexesListIndexVersions200Response, + IndexesListIndexVersionsDefaultResponse, + DeploymentsGet200Response, + DeploymentsGetDefaultResponse, + DeploymentsList200Response, + DeploymentsListDefaultResponse, +} from "./responses.js"; +import type { Client, StreamableMethod } from "@azure-rest/core-client"; + +export interface AgentsCreateAgent { + /** Creates a new agent. */ + post( + options: AgentsCreateAgentParameters, + ): StreamableMethod< + AgentsCreateAgent200Response | AgentsCreateAgentDefaultResponse + >; + /** Gets a list of agents that were previously created. */ + get( + options?: AgentsListAgentsParameters, + ): StreamableMethod< + AgentsListAgents200Response | AgentsListAgentsDefaultResponse + >; +} + +export interface AgentsGetAgent { + /** Retrieves an existing agent. */ + get( + options?: AgentsGetAgentParameters, + ): StreamableMethod< + AgentsGetAgent200Response | AgentsGetAgentDefaultResponse + >; + /** Modifies an existing agent. */ + post( + options: AgentsUpdateAgentParameters, + ): StreamableMethod< + AgentsUpdateAgent200Response | AgentsUpdateAgentDefaultResponse + >; + /** Deletes an agent. */ + delete( + options?: AgentsDeleteAgentParameters, + ): StreamableMethod< + AgentsDeleteAgent200Response | AgentsDeleteAgentDefaultResponse + >; +} + +export interface AgentsCreateThread { + /** Creates a new thread. Threads contain messages and can be run by agents. */ + post( + options: AgentsCreateThreadParameters, + ): StreamableMethod< + AgentsCreateThread200Response | AgentsCreateThreadDefaultResponse + >; +} + +export interface AgentsGetThread { + /** Gets information about an existing thread. */ + get( + options?: AgentsGetThreadParameters, + ): StreamableMethod< + AgentsGetThread200Response | AgentsGetThreadDefaultResponse + >; + /** Modifies an existing thread. */ + post( + options: AgentsUpdateThreadParameters, + ): StreamableMethod< + AgentsUpdateThread200Response | AgentsUpdateThreadDefaultResponse + >; + /** Deletes an existing thread. */ + delete( + options?: AgentsDeleteThreadParameters, + ): StreamableMethod< + AgentsDeleteThread200Response | AgentsDeleteThreadDefaultResponse + >; +} + +export interface AgentsCreateMessage { + /** Creates a new message on a specified thread. */ + post( + options: AgentsCreateMessageParameters, + ): StreamableMethod< + AgentsCreateMessage200Response | AgentsCreateMessageDefaultResponse + >; + /** Gets a list of messages that exist on a thread. */ + get( + options?: AgentsListMessagesParameters, + ): StreamableMethod< + AgentsListMessages200Response | AgentsListMessagesDefaultResponse + >; +} + +export interface AgentsGetMessage { + /** Gets an existing message from an existing thread. */ + get( + options?: AgentsGetMessageParameters, + ): StreamableMethod< + AgentsGetMessage200Response | AgentsGetMessageDefaultResponse + >; + /** Modifies an existing message on an existing thread. */ + post( + options: AgentsUpdateMessageParameters, + ): StreamableMethod< + AgentsUpdateMessage200Response | AgentsUpdateMessageDefaultResponse + >; +} + +export interface AgentsCreateRun { + /** Creates a new run for an agent thread. */ + post( + options: AgentsCreateRunParameters, + ): StreamableMethod< + AgentsCreateRun200Response | AgentsCreateRunDefaultResponse + >; + /** Gets a list of runs for a specified thread. */ + get( + options?: AgentsListRunsParameters, + ): StreamableMethod< + AgentsListRuns200Response | AgentsListRunsDefaultResponse + >; +} + +export interface AgentsGetRun { + /** Gets an existing run from an existing thread. */ + get( + options?: AgentsGetRunParameters, + ): StreamableMethod; + /** Modifies an existing thread run. */ + post( + options: AgentsUpdateRunParameters, + ): StreamableMethod< + AgentsUpdateRun200Response | AgentsUpdateRunDefaultResponse + >; +} + +export interface AgentsSubmitToolOutputsToRun { + /** 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: AgentsSubmitToolOutputsToRunParameters, + ): StreamableMethod< + | AgentsSubmitToolOutputsToRun200Response + | AgentsSubmitToolOutputsToRunDefaultResponse + >; +} + +export interface AgentsCancelRun { + /** Cancels a run of an in progress thread. */ + post( + options?: AgentsCancelRunParameters, + ): StreamableMethod< + AgentsCancelRun200Response | AgentsCancelRunDefaultResponse + >; +} + +export interface AgentsCreateThreadAndRun { + /** Creates a new agent thread and immediately starts a run using that new thread. */ + post( + options: AgentsCreateThreadAndRunParameters, + ): StreamableMethod< + | AgentsCreateThreadAndRun200Response + | AgentsCreateThreadAndRunDefaultResponse + >; +} + +export interface AgentsGetRunStep { + /** Gets a single run step from a thread run. */ + get( + options?: AgentsGetRunStepParameters, + ): StreamableMethod< + AgentsGetRunStep200Response | AgentsGetRunStepDefaultResponse + >; +} + +export interface AgentsListRunSteps { + /** Gets a list of run steps from a thread run. */ + get( + options?: AgentsListRunStepsParameters, + ): StreamableMethod< + AgentsListRunSteps200Response | AgentsListRunStepsDefaultResponse + >; +} + +export interface AgentsListFiles { + /** Gets a list of previously uploaded files. */ + get( + options?: AgentsListFilesParameters, + ): StreamableMethod< + AgentsListFiles200Response | AgentsListFilesDefaultResponse + >; + /** Uploads a file for use by other operations. */ + post( + options: AgentsUploadFileParameters, + ): StreamableMethod< + AgentsUploadFile200Response | AgentsUploadFileDefaultResponse + >; +} + +export interface AgentsDeleteFile { + /** Delete a previously uploaded file. */ + delete( + options?: AgentsDeleteFileParameters, + ): StreamableMethod< + AgentsDeleteFile200Response | AgentsDeleteFileDefaultResponse + >; + /** Returns information about a specific file. Does not retrieve file content. */ + get( + options?: AgentsGetFileParameters, + ): StreamableMethod; +} + +export interface AgentsGetFileContent { + /** Retrieves the raw content of a specific file. */ + get( + options?: AgentsGetFileContentParameters, + ): StreamableMethod< + AgentsGetFileContent200Response | AgentsGetFileContentDefaultResponse + >; +} + +export interface AgentsListVectorStores { + /** Returns a list of vector stores. */ + get( + options?: AgentsListVectorStoresParameters, + ): StreamableMethod< + AgentsListVectorStores200Response | AgentsListVectorStoresDefaultResponse + >; + /** Creates a vector store. */ + post( + options: AgentsCreateVectorStoreParameters, + ): StreamableMethod< + AgentsCreateVectorStore200Response | AgentsCreateVectorStoreDefaultResponse + >; +} + +export interface AgentsGetVectorStore { + /** Returns the vector store object matching the specified ID. */ + get( + options?: AgentsGetVectorStoreParameters, + ): StreamableMethod< + AgentsGetVectorStore200Response | AgentsGetVectorStoreDefaultResponse + >; + /** The ID of the vector store to modify. */ + post( + options: AgentsModifyVectorStoreParameters, + ): StreamableMethod< + AgentsModifyVectorStore200Response | AgentsModifyVectorStoreDefaultResponse + >; + /** Deletes the vector store object matching the specified ID. */ + delete( + options?: AgentsDeleteVectorStoreParameters, + ): StreamableMethod< + AgentsDeleteVectorStore200Response | AgentsDeleteVectorStoreDefaultResponse + >; +} + +export interface AgentsListVectorStoreFiles { + /** Returns a list of vector store files. */ + get( + options?: AgentsListVectorStoreFilesParameters, + ): StreamableMethod< + | AgentsListVectorStoreFiles200Response + | AgentsListVectorStoreFilesDefaultResponse + >; + /** Create a vector store file by attaching a file to a vector store. */ + post( + options: AgentsCreateVectorStoreFileParameters, + ): StreamableMethod< + | AgentsCreateVectorStoreFile200Response + | AgentsCreateVectorStoreFileDefaultResponse + >; +} + +export interface AgentsGetVectorStoreFile { + /** Retrieves a vector store file. */ + get( + options?: AgentsGetVectorStoreFileParameters, + ): StreamableMethod< + | AgentsGetVectorStoreFile200Response + | AgentsGetVectorStoreFileDefaultResponse + >; + /** + * 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?: AgentsDeleteVectorStoreFileParameters, + ): StreamableMethod< + | AgentsDeleteVectorStoreFile200Response + | AgentsDeleteVectorStoreFileDefaultResponse + >; +} + +export interface AgentsCreateVectorStoreFileBatch { + /** Create a vector store file batch. */ + post( + options: AgentsCreateVectorStoreFileBatchParameters, + ): StreamableMethod< + | AgentsCreateVectorStoreFileBatch200Response + | AgentsCreateVectorStoreFileBatchDefaultResponse + >; +} + +export interface AgentsGetVectorStoreFileBatch { + /** Retrieve a vector store file batch. */ + get( + options?: AgentsGetVectorStoreFileBatchParameters, + ): StreamableMethod< + | AgentsGetVectorStoreFileBatch200Response + | AgentsGetVectorStoreFileBatchDefaultResponse + >; +} + +export interface AgentsCancelVectorStoreFileBatch { + /** Cancel a vector store file batch. This attempts to cancel the processing of files in this batch as soon as possible. */ + post( + options?: AgentsCancelVectorStoreFileBatchParameters, + ): StreamableMethod< + | AgentsCancelVectorStoreFileBatch200Response + | AgentsCancelVectorStoreFileBatchDefaultResponse + >; +} + +export interface AgentsListVectorStoreFileBatchFiles { + /** Returns a list of vector store files in a batch. */ + get( + options?: AgentsListVectorStoreFileBatchFilesParameters, + ): StreamableMethod< + | AgentsListVectorStoreFileBatchFiles200Response + | AgentsListVectorStoreFileBatchFilesDefaultResponse + >; +} + +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 DatasetsListLatestDatasets { + /** List latest version of each dataset in a project. */ + get( + options?: DatasetsListLatestDatasetsParameters, + ): StreamableMethod; +} + +export interface DatasetsListDatasetVersions { + /** List dataset versions of a specific dataset */ + get( + options?: DatasetsListDatasetVersionsParameters, + ): StreamableMethod; +} + +export interface DatasetsDeleteVersion { + /** Delete version. */ + delete( + options?: DatasetsDeleteVersionParameters, + ): StreamableMethod; + /** Get dataset version. */ + get( + options?: DatasetsGetVersionParameters, + ): StreamableMethod; + /** Create or update version. */ + put( + options: DatasetsCreateOrUpdateParameters, + ): StreamableMethod; +} + +export interface DatasetsCreateOrGetStartPendingUpload { + /** Start pending upload. */ + post( + options: DatasetsCreateOrGetStartPendingUploadParameters, + ): StreamableMethod; +} + +export interface IndexesListLatestIndexes { + /** List latest version of each dataset in a project. */ + get( + options?: IndexesListLatestIndexesParameters, + ): StreamableMethod; +} + +export interface IndexesGet { + /** Get a specific version of an Index. */ + get( + options?: IndexesGetParameters, + ): StreamableMethod; + /** Delete version. */ + delete( + options?: IndexesDeleteVersionParameters, + ): StreamableMethod; +} + +export interface IndexesCreateIndex { + /** Creates or updates a IndexVersion. */ + post( + options: IndexesCreateIndexParameters, + ): StreamableMethod< + | IndexesCreateIndex200Response + | IndexesCreateIndex201Response + | IndexesCreateIndexDefaultResponse + >; +} + +export interface IndexesListIndexVersions { + /** List the versions of an Index given the name. */ + get( + options: IndexesListIndexVersionsParameters, + ): StreamableMethod< + | IndexesListIndexVersions200Response + | IndexesListIndexVersionsDefaultResponse + >; +} + +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"): AgentsCreateAgent; + /** Resource for '/assistants/\{assistantId\}' has methods for the following verbs: get, post, delete */ + (path: "/assistants/{assistantId}", assistantId: string): AgentsGetAgent; + /** Resource for '/threads' has methods for the following verbs: post */ + (path: "/threads"): AgentsCreateThread; + /** Resource for '/threads/\{threadId\}' has methods for the following verbs: get, post, delete */ + (path: "/threads/{threadId}", threadId: string): AgentsGetThread; + /** Resource for '/threads/\{threadId\}/messages' has methods for the following verbs: post, get */ + (path: "/threads/{threadId}/messages", threadId: string): AgentsCreateMessage; + /** Resource for '/threads/\{threadId\}/messages/\{messageId\}' has methods for the following verbs: get, post */ + ( + path: "/threads/{threadId}/messages/{messageId}", + threadId: string, + messageId: string, + ): AgentsGetMessage; + /** Resource for '/threads/\{threadId\}/runs' has methods for the following verbs: post, get */ + (path: "/threads/{threadId}/runs", threadId: string): AgentsCreateRun; + /** Resource for '/threads/\{threadId\}/runs/\{runId\}' has methods for the following verbs: get, post */ + ( + path: "/threads/{threadId}/runs/{runId}", + threadId: string, + runId: string, + ): AgentsGetRun; + /** 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, + ): AgentsSubmitToolOutputsToRun; + /** Resource for '/threads/\{threadId\}/runs/\{runId\}/cancel' has methods for the following verbs: post */ + ( + path: "/threads/{threadId}/runs/{runId}/cancel", + threadId: string, + runId: string, + ): AgentsCancelRun; + /** Resource for '/threads/runs' has methods for the following verbs: post */ + (path: "/threads/runs"): AgentsCreateThreadAndRun; + /** 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, + ): AgentsGetRunStep; + /** Resource for '/threads/\{threadId\}/runs/\{runId\}/steps' has methods for the following verbs: get */ + ( + path: "/threads/{threadId}/runs/{runId}/steps", + threadId: string, + runId: string, + ): AgentsListRunSteps; + /** Resource for '/files' has methods for the following verbs: get, post */ + (path: "/files"): AgentsListFiles; + /** Resource for '/files/\{fileId\}' has methods for the following verbs: delete, get */ + (path: "/files/{fileId}", fileId: string): AgentsDeleteFile; + /** Resource for '/files/\{fileId\}/content' has methods for the following verbs: get */ + (path: "/files/{fileId}/content", fileId: string): AgentsGetFileContent; + /** Resource for '/vector_stores' has methods for the following verbs: get, post */ + (path: "/vector_stores"): AgentsListVectorStores; + /** Resource for '/vector_stores/\{vectorStoreId\}' has methods for the following verbs: get, post, delete */ + ( + path: "/vector_stores/{vectorStoreId}", + vectorStoreId: string, + ): AgentsGetVectorStore; + /** Resource for '/vector_stores/\{vectorStoreId\}/files' has methods for the following verbs: get, post */ + ( + path: "/vector_stores/{vectorStoreId}/files", + vectorStoreId: string, + ): AgentsListVectorStoreFiles; + /** 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, + ): AgentsGetVectorStoreFile; + /** Resource for '/vector_stores/\{vectorStoreId\}/file_batches' has methods for the following verbs: post */ + ( + path: "/vector_stores/{vectorStoreId}/file_batches", + vectorStoreId: string, + ): AgentsCreateVectorStoreFileBatch; + /** 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, + ): AgentsGetVectorStoreFileBatch; + /** 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, + ): AgentsCancelVectorStoreFileBatch; + /** 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, + ): AgentsListVectorStoreFileBatchFiles; + /** Resource for '/connections/\{connectionName\}' has methods for the following verbs: get */ + ( + path: "/connections/{connectionName}", + connectionName: 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' has methods for the following verbs: get */ + (path: "/datasets"): DatasetsListLatestDatasets; + /** Resource for '/datasets/\{name\}/versions' has methods for the following verbs: get */ + ( + path: "/datasets/{name}/versions", + name: string, + ): DatasetsListDatasetVersions; + /** Resource for '/datasets/\{name\}/versions/\{version\}' has methods for the following verbs: delete, get, put */ + ( + path: "/datasets/{name}/versions/{version}", + name: string, + version: string, + ): DatasetsDeleteVersion; + /** Resource for '/datasets/\{name\}/versions/\{version\}/startPendingUpload' has methods for the following verbs: post */ + ( + path: "/datasets/{name}/versions/{version}/startPendingUpload", + name: string, + version: string, + ): DatasetsCreateOrGetStartPendingUpload; + /** Resource for '/indexes' has methods for the following verbs: get */ + (path: "/indexes"): IndexesListLatestIndexes; + /** Resource for '/indexes/\{name\}/versions/\{version\}' has methods for the following verbs: get, delete */ + ( + path: "/indexes/{name}/versions/{version}", + name: string, + version: string, + ): IndexesGet; + /** Resource for '/indexes/\{name\}:create' has methods for the following verbs: post */ + (path: "/indexes/{name}:create", name: string): IndexesCreateIndex; + /** Resource for '/indexes/\{name\}/versions' has methods for the following verbs: get */ + (path: "/indexes/{name}/versions", name: string): IndexesListIndexVersions; + /** 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..79c30433d3d6 --- /dev/null +++ b/sdk/ai/ai-projects-1dp/src/isUnexpected.ts @@ -0,0 +1,593 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { + AgentsCreateAgent200Response, + AgentsCreateAgentDefaultResponse, + AgentsListAgents200Response, + AgentsListAgentsDefaultResponse, + AgentsGetAgent200Response, + AgentsGetAgentDefaultResponse, + AgentsUpdateAgent200Response, + AgentsUpdateAgentDefaultResponse, + AgentsDeleteAgent200Response, + AgentsDeleteAgentDefaultResponse, + AgentsCreateThread200Response, + AgentsCreateThreadDefaultResponse, + AgentsGetThread200Response, + AgentsGetThreadDefaultResponse, + AgentsUpdateThread200Response, + AgentsUpdateThreadDefaultResponse, + AgentsDeleteThread200Response, + AgentsDeleteThreadDefaultResponse, + AgentsCreateMessage200Response, + AgentsCreateMessageDefaultResponse, + AgentsListMessages200Response, + AgentsListMessagesDefaultResponse, + AgentsGetMessage200Response, + AgentsGetMessageDefaultResponse, + AgentsUpdateMessage200Response, + AgentsUpdateMessageDefaultResponse, + AgentsCreateRun200Response, + AgentsCreateRunDefaultResponse, + AgentsListRuns200Response, + AgentsListRunsDefaultResponse, + AgentsGetRun200Response, + AgentsGetRunDefaultResponse, + AgentsUpdateRun200Response, + AgentsUpdateRunDefaultResponse, + AgentsSubmitToolOutputsToRun200Response, + AgentsSubmitToolOutputsToRunDefaultResponse, + AgentsCancelRun200Response, + AgentsCancelRunDefaultResponse, + AgentsCreateThreadAndRun200Response, + AgentsCreateThreadAndRunDefaultResponse, + AgentsGetRunStep200Response, + AgentsGetRunStepDefaultResponse, + AgentsListRunSteps200Response, + AgentsListRunStepsDefaultResponse, + AgentsListFiles200Response, + AgentsListFilesDefaultResponse, + AgentsUploadFile200Response, + AgentsUploadFileDefaultResponse, + AgentsDeleteFile200Response, + AgentsDeleteFileDefaultResponse, + AgentsGetFile200Response, + AgentsGetFileDefaultResponse, + AgentsGetFileContent200Response, + AgentsGetFileContentDefaultResponse, + AgentsListVectorStores200Response, + AgentsListVectorStoresDefaultResponse, + AgentsCreateVectorStore200Response, + AgentsCreateVectorStoreDefaultResponse, + AgentsGetVectorStore200Response, + AgentsGetVectorStoreDefaultResponse, + AgentsModifyVectorStore200Response, + AgentsModifyVectorStoreDefaultResponse, + AgentsDeleteVectorStore200Response, + AgentsDeleteVectorStoreDefaultResponse, + AgentsListVectorStoreFiles200Response, + AgentsListVectorStoreFilesDefaultResponse, + AgentsCreateVectorStoreFile200Response, + AgentsCreateVectorStoreFileDefaultResponse, + AgentsGetVectorStoreFile200Response, + AgentsGetVectorStoreFileDefaultResponse, + AgentsDeleteVectorStoreFile200Response, + AgentsDeleteVectorStoreFileDefaultResponse, + AgentsCreateVectorStoreFileBatch200Response, + AgentsCreateVectorStoreFileBatchDefaultResponse, + AgentsGetVectorStoreFileBatch200Response, + AgentsGetVectorStoreFileBatchDefaultResponse, + AgentsCancelVectorStoreFileBatch200Response, + AgentsCancelVectorStoreFileBatchDefaultResponse, + AgentsListVectorStoreFileBatchFiles200Response, + AgentsListVectorStoreFileBatchFilesDefaultResponse, + ConnectionsGet200Response, + ConnectionsGetDefaultResponse, + ConnectionsList200Response, + ConnectionsListDefaultResponse, + EvaluationsGet200Response, + EvaluationsGetDefaultResponse, + EvaluationsList200Response, + EvaluationsListDefaultResponse, + EvaluationsCreateRun200Response, + EvaluationsCreateRunDefaultResponse, + IndexesGet200Response, + IndexesGetDefaultResponse, + IndexesCreateIndex200Response, + IndexesCreateIndex201Response, + IndexesCreateIndexDefaultResponse, + IndexesListIndexVersions200Response, + IndexesListIndexVersionsDefaultResponse, + 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/{connectionName}": ["200"], + "GET /connections": ["200"], + "GET /evaluations/runs/{name}": ["200"], + "GET /evaluations/runs": ["200"], + "POST /evaluations/runs:run": ["200"], + "GET /datasets": ["200"], + "GET /datasets/{name}/versions": ["200"], + "DELETE /datasets/{name}/versions/{version}": ["204"], + "GET /datasets/{name}/versions/{version}": ["200"], + "PUT /datasets/{name}/versions/{version}": ["200"], + "POST /datasets/{name}/versions/{version}/startPendingUpload": ["200"], + "GET /indexes": ["200"], + "GET /indexes/{name}/versions/{version}": ["200"], + "DELETE /indexes/{name}/versions/{version}": ["204"], + "POST /indexes/{name}:create": ["200", "201"], + "GET /indexes/{name}/versions": ["200"], + "GET /deployments/{name}": ["200"], + "GET /deployments": ["200"], +}; + +export function isUnexpected( + response: AgentsCreateAgent200Response | AgentsCreateAgentDefaultResponse, +): response is AgentsCreateAgentDefaultResponse; +export function isUnexpected( + response: AgentsListAgents200Response | AgentsListAgentsDefaultResponse, +): response is AgentsListAgentsDefaultResponse; +export function isUnexpected( + response: AgentsGetAgent200Response | AgentsGetAgentDefaultResponse, +): response is AgentsGetAgentDefaultResponse; +export function isUnexpected( + response: AgentsUpdateAgent200Response | AgentsUpdateAgentDefaultResponse, +): response is AgentsUpdateAgentDefaultResponse; +export function isUnexpected( + response: AgentsDeleteAgent200Response | AgentsDeleteAgentDefaultResponse, +): response is AgentsDeleteAgentDefaultResponse; +export function isUnexpected( + response: AgentsCreateThread200Response | AgentsCreateThreadDefaultResponse, +): response is AgentsCreateThreadDefaultResponse; +export function isUnexpected( + response: AgentsGetThread200Response | AgentsGetThreadDefaultResponse, +): response is AgentsGetThreadDefaultResponse; +export function isUnexpected( + response: AgentsUpdateThread200Response | AgentsUpdateThreadDefaultResponse, +): response is AgentsUpdateThreadDefaultResponse; +export function isUnexpected( + response: AgentsDeleteThread200Response | AgentsDeleteThreadDefaultResponse, +): response is AgentsDeleteThreadDefaultResponse; +export function isUnexpected( + response: AgentsCreateMessage200Response | AgentsCreateMessageDefaultResponse, +): response is AgentsCreateMessageDefaultResponse; +export function isUnexpected( + response: AgentsListMessages200Response | AgentsListMessagesDefaultResponse, +): response is AgentsListMessagesDefaultResponse; +export function isUnexpected( + response: AgentsGetMessage200Response | AgentsGetMessageDefaultResponse, +): response is AgentsGetMessageDefaultResponse; +export function isUnexpected( + response: AgentsUpdateMessage200Response | AgentsUpdateMessageDefaultResponse, +): response is AgentsUpdateMessageDefaultResponse; +export function isUnexpected( + response: AgentsCreateRun200Response | AgentsCreateRunDefaultResponse, +): response is AgentsCreateRunDefaultResponse; +export function isUnexpected( + response: AgentsListRuns200Response | AgentsListRunsDefaultResponse, +): response is AgentsListRunsDefaultResponse; +export function isUnexpected( + response: AgentsGetRun200Response | AgentsGetRunDefaultResponse, +): response is AgentsGetRunDefaultResponse; +export function isUnexpected( + response: AgentsUpdateRun200Response | AgentsUpdateRunDefaultResponse, +): response is AgentsUpdateRunDefaultResponse; +export function isUnexpected( + response: + | AgentsSubmitToolOutputsToRun200Response + | AgentsSubmitToolOutputsToRunDefaultResponse, +): response is AgentsSubmitToolOutputsToRunDefaultResponse; +export function isUnexpected( + response: AgentsCancelRun200Response | AgentsCancelRunDefaultResponse, +): response is AgentsCancelRunDefaultResponse; +export function isUnexpected( + response: + | AgentsCreateThreadAndRun200Response + | AgentsCreateThreadAndRunDefaultResponse, +): response is AgentsCreateThreadAndRunDefaultResponse; +export function isUnexpected( + response: AgentsGetRunStep200Response | AgentsGetRunStepDefaultResponse, +): response is AgentsGetRunStepDefaultResponse; +export function isUnexpected( + response: AgentsListRunSteps200Response | AgentsListRunStepsDefaultResponse, +): response is AgentsListRunStepsDefaultResponse; +export function isUnexpected( + response: AgentsListFiles200Response | AgentsListFilesDefaultResponse, +): response is AgentsListFilesDefaultResponse; +export function isUnexpected( + response: AgentsUploadFile200Response | AgentsUploadFileDefaultResponse, +): response is AgentsUploadFileDefaultResponse; +export function isUnexpected( + response: AgentsDeleteFile200Response | AgentsDeleteFileDefaultResponse, +): response is AgentsDeleteFileDefaultResponse; +export function isUnexpected( + response: AgentsGetFile200Response | AgentsGetFileDefaultResponse, +): response is AgentsGetFileDefaultResponse; +export function isUnexpected( + response: + | AgentsGetFileContent200Response + | AgentsGetFileContentDefaultResponse, +): response is AgentsGetFileContentDefaultResponse; +export function isUnexpected( + response: + | AgentsListVectorStores200Response + | AgentsListVectorStoresDefaultResponse, +): response is AgentsListVectorStoresDefaultResponse; +export function isUnexpected( + response: + | AgentsCreateVectorStore200Response + | AgentsCreateVectorStoreDefaultResponse, +): response is AgentsCreateVectorStoreDefaultResponse; +export function isUnexpected( + response: + | AgentsGetVectorStore200Response + | AgentsGetVectorStoreDefaultResponse, +): response is AgentsGetVectorStoreDefaultResponse; +export function isUnexpected( + response: + | AgentsModifyVectorStore200Response + | AgentsModifyVectorStoreDefaultResponse, +): response is AgentsModifyVectorStoreDefaultResponse; +export function isUnexpected( + response: + | AgentsDeleteVectorStore200Response + | AgentsDeleteVectorStoreDefaultResponse, +): response is AgentsDeleteVectorStoreDefaultResponse; +export function isUnexpected( + response: + | AgentsListVectorStoreFiles200Response + | AgentsListVectorStoreFilesDefaultResponse, +): response is AgentsListVectorStoreFilesDefaultResponse; +export function isUnexpected( + response: + | AgentsCreateVectorStoreFile200Response + | AgentsCreateVectorStoreFileDefaultResponse, +): response is AgentsCreateVectorStoreFileDefaultResponse; +export function isUnexpected( + response: + | AgentsGetVectorStoreFile200Response + | AgentsGetVectorStoreFileDefaultResponse, +): response is AgentsGetVectorStoreFileDefaultResponse; +export function isUnexpected( + response: + | AgentsDeleteVectorStoreFile200Response + | AgentsDeleteVectorStoreFileDefaultResponse, +): response is AgentsDeleteVectorStoreFileDefaultResponse; +export function isUnexpected( + response: + | AgentsCreateVectorStoreFileBatch200Response + | AgentsCreateVectorStoreFileBatchDefaultResponse, +): response is AgentsCreateVectorStoreFileBatchDefaultResponse; +export function isUnexpected( + response: + | AgentsGetVectorStoreFileBatch200Response + | AgentsGetVectorStoreFileBatchDefaultResponse, +): response is AgentsGetVectorStoreFileBatchDefaultResponse; +export function isUnexpected( + response: + | AgentsCancelVectorStoreFileBatch200Response + | AgentsCancelVectorStoreFileBatchDefaultResponse, +): response is AgentsCancelVectorStoreFileBatchDefaultResponse; +export function isUnexpected( + response: + | AgentsListVectorStoreFileBatchFiles200Response + | AgentsListVectorStoreFileBatchFilesDefaultResponse, +): response is AgentsListVectorStoreFileBatchFilesDefaultResponse; +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: IndexesGet200Response | IndexesGetDefaultResponse, +): response is IndexesGetDefaultResponse; +export function isUnexpected( + response: + | IndexesCreateIndex200Response + | IndexesCreateIndex201Response + | IndexesCreateIndexDefaultResponse, +): response is IndexesCreateIndexDefaultResponse; +export function isUnexpected( + response: + | IndexesListIndexVersions200Response + | IndexesListIndexVersionsDefaultResponse, +): response is IndexesListIndexVersionsDefaultResponse; +export function isUnexpected( + response: DeploymentsGet200Response | DeploymentsGetDefaultResponse, +): response is DeploymentsGetDefaultResponse; +export function isUnexpected( + response: DeploymentsList200Response | DeploymentsListDefaultResponse, +): response is DeploymentsListDefaultResponse; +export function isUnexpected( + response: + | AgentsCreateAgent200Response + | AgentsCreateAgentDefaultResponse + | AgentsListAgents200Response + | AgentsListAgentsDefaultResponse + | AgentsGetAgent200Response + | AgentsGetAgentDefaultResponse + | AgentsUpdateAgent200Response + | AgentsUpdateAgentDefaultResponse + | AgentsDeleteAgent200Response + | AgentsDeleteAgentDefaultResponse + | AgentsCreateThread200Response + | AgentsCreateThreadDefaultResponse + | AgentsGetThread200Response + | AgentsGetThreadDefaultResponse + | AgentsUpdateThread200Response + | AgentsUpdateThreadDefaultResponse + | AgentsDeleteThread200Response + | AgentsDeleteThreadDefaultResponse + | AgentsCreateMessage200Response + | AgentsCreateMessageDefaultResponse + | AgentsListMessages200Response + | AgentsListMessagesDefaultResponse + | AgentsGetMessage200Response + | AgentsGetMessageDefaultResponse + | AgentsUpdateMessage200Response + | AgentsUpdateMessageDefaultResponse + | AgentsCreateRun200Response + | AgentsCreateRunDefaultResponse + | AgentsListRuns200Response + | AgentsListRunsDefaultResponse + | AgentsGetRun200Response + | AgentsGetRunDefaultResponse + | AgentsUpdateRun200Response + | AgentsUpdateRunDefaultResponse + | AgentsSubmitToolOutputsToRun200Response + | AgentsSubmitToolOutputsToRunDefaultResponse + | AgentsCancelRun200Response + | AgentsCancelRunDefaultResponse + | AgentsCreateThreadAndRun200Response + | AgentsCreateThreadAndRunDefaultResponse + | AgentsGetRunStep200Response + | AgentsGetRunStepDefaultResponse + | AgentsListRunSteps200Response + | AgentsListRunStepsDefaultResponse + | AgentsListFiles200Response + | AgentsListFilesDefaultResponse + | AgentsUploadFile200Response + | AgentsUploadFileDefaultResponse + | AgentsDeleteFile200Response + | AgentsDeleteFileDefaultResponse + | AgentsGetFile200Response + | AgentsGetFileDefaultResponse + | AgentsGetFileContent200Response + | AgentsGetFileContentDefaultResponse + | AgentsListVectorStores200Response + | AgentsListVectorStoresDefaultResponse + | AgentsCreateVectorStore200Response + | AgentsCreateVectorStoreDefaultResponse + | AgentsGetVectorStore200Response + | AgentsGetVectorStoreDefaultResponse + | AgentsModifyVectorStore200Response + | AgentsModifyVectorStoreDefaultResponse + | AgentsDeleteVectorStore200Response + | AgentsDeleteVectorStoreDefaultResponse + | AgentsListVectorStoreFiles200Response + | AgentsListVectorStoreFilesDefaultResponse + | AgentsCreateVectorStoreFile200Response + | AgentsCreateVectorStoreFileDefaultResponse + | AgentsGetVectorStoreFile200Response + | AgentsGetVectorStoreFileDefaultResponse + | AgentsDeleteVectorStoreFile200Response + | AgentsDeleteVectorStoreFileDefaultResponse + | AgentsCreateVectorStoreFileBatch200Response + | AgentsCreateVectorStoreFileBatchDefaultResponse + | AgentsGetVectorStoreFileBatch200Response + | AgentsGetVectorStoreFileBatchDefaultResponse + | AgentsCancelVectorStoreFileBatch200Response + | AgentsCancelVectorStoreFileBatchDefaultResponse + | AgentsListVectorStoreFileBatchFiles200Response + | AgentsListVectorStoreFileBatchFilesDefaultResponse + | ConnectionsGet200Response + | ConnectionsGetDefaultResponse + | ConnectionsList200Response + | ConnectionsListDefaultResponse + | EvaluationsGet200Response + | EvaluationsGetDefaultResponse + | EvaluationsList200Response + | EvaluationsListDefaultResponse + | EvaluationsCreateRun200Response + | EvaluationsCreateRunDefaultResponse + | IndexesGet200Response + | IndexesGetDefaultResponse + | IndexesCreateIndex200Response + | IndexesCreateIndex201Response + | IndexesCreateIndexDefaultResponse + | IndexesListIndexVersions200Response + | IndexesListIndexVersionsDefaultResponse + | DeploymentsGet200Response + | DeploymentsGetDefaultResponse + | DeploymentsList200Response + | DeploymentsListDefaultResponse, +): response is + | AgentsCreateAgentDefaultResponse + | AgentsListAgentsDefaultResponse + | AgentsGetAgentDefaultResponse + | AgentsUpdateAgentDefaultResponse + | AgentsDeleteAgentDefaultResponse + | AgentsCreateThreadDefaultResponse + | AgentsGetThreadDefaultResponse + | AgentsUpdateThreadDefaultResponse + | AgentsDeleteThreadDefaultResponse + | AgentsCreateMessageDefaultResponse + | AgentsListMessagesDefaultResponse + | AgentsGetMessageDefaultResponse + | AgentsUpdateMessageDefaultResponse + | AgentsCreateRunDefaultResponse + | AgentsListRunsDefaultResponse + | AgentsGetRunDefaultResponse + | AgentsUpdateRunDefaultResponse + | AgentsSubmitToolOutputsToRunDefaultResponse + | AgentsCancelRunDefaultResponse + | AgentsCreateThreadAndRunDefaultResponse + | AgentsGetRunStepDefaultResponse + | AgentsListRunStepsDefaultResponse + | AgentsListFilesDefaultResponse + | AgentsUploadFileDefaultResponse + | AgentsDeleteFileDefaultResponse + | AgentsGetFileDefaultResponse + | AgentsGetFileContentDefaultResponse + | AgentsListVectorStoresDefaultResponse + | AgentsCreateVectorStoreDefaultResponse + | AgentsGetVectorStoreDefaultResponse + | AgentsModifyVectorStoreDefaultResponse + | AgentsDeleteVectorStoreDefaultResponse + | AgentsListVectorStoreFilesDefaultResponse + | AgentsCreateVectorStoreFileDefaultResponse + | AgentsGetVectorStoreFileDefaultResponse + | AgentsDeleteVectorStoreFileDefaultResponse + | AgentsCreateVectorStoreFileBatchDefaultResponse + | AgentsGetVectorStoreFileBatchDefaultResponse + | AgentsCancelVectorStoreFileBatchDefaultResponse + | AgentsListVectorStoreFileBatchFilesDefaultResponse + | ConnectionsGetDefaultResponse + | ConnectionsListDefaultResponse + | EvaluationsGetDefaultResponse + | EvaluationsListDefaultResponse + | EvaluationsCreateRunDefaultResponse + | IndexesGetDefaultResponse + | IndexesCreateIndexDefaultResponse + | IndexesListIndexVersionsDefaultResponse + | 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..5b50daba6ee8 --- /dev/null +++ b/sdk/ai/ai-projects-1dp/src/models.ts @@ -0,0 +1,905 @@ +// 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_aiskill`, 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_aiskill'. */ + type: "fabric_aiskill"; + /** The list of connections used by the Microsoft Fabric tool. */ + fabric_aiskill: 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 Index resource. */ +export interface IndexResource { + /** 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; +} + +/** + * 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_aiskill", "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; +} + +/** 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; +} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemData {} + +/** 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 DatasetVersion { + /** [Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330 */ + datasetUri: string; + /** + * Data type + * + * Possible values: "uri_file" + */ + datasetType: DatasetType; + /** Asset stage */ + stage?: string; + /** The asset description text. */ + description?: string; + /** Tag dictionary. Tags can be added, removed, and updated. */ + tags?: Record; +} + +/** Represents a request for a pending upload. */ +export interface PendingUploadRequest { + /** If PendingUploadId is not provided, a random GUID will be used. */ + pendingUploadId?: 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; +/** 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 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..32e382d7bbcd --- /dev/null +++ b/sdk/ai/ai-projects-1dp/src/outputModels.ts @@ -0,0 +1,1732 @@ +// 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_aiskill`, 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_aiskill'. */ + type: "fabric_aiskill"; + /** The list of connections used by the Microsoft Fabric tool. */ + fabric_aiskill: 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 Index resource. */ +export interface IndexResourceOutput { + /** 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; +} + +/** + * 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 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_aiskill", "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_aiskill'. */ + type: "fabric_aiskill"; + /** Reserved for future use. */ + fabric_aiskill: 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; + /** A collection of properties of the connection */ + properties: 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; + /** Metadata containing createdBy and modifiedBy information. */ + readonly systemData?: SystemDataOutput; + /** 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; +} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemDataOutput { + /** The timestamp the resource was created at. */ + readonly createdAt?: string; + /** The identity that created the resource. */ + readonly createdBy?: string; + /** The identity type that created the resource. */ + readonly createdByType?: string; + /** The timestamp of resource last modification (UTC) */ + readonly lastModifiedAt?: 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; +} + +/** PagedDataVersionBase Definition */ +export interface PagedDatasetVersionOutput { + /** The list of DatasetVersions. */ + value: Array; + /** The link to the next page of results, if any. */ + nextLink?: string; +} + +/** DatasetVersion Definition */ +export interface DatasetVersionOutput { + /** [Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330 */ + datasetUri: string; + /** + * Data type + * + * Possible values: "uri_file" + */ + datasetType: DatasetTypeOutput; + /** 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; + /** System data of the resource */ + readonly systemData?: SystemDataOutput; +} + +/** 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; + /** 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"; +} + +/** 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; + /** System data of the resource */ + readonly systemData?: SystemDataOutput; + 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; +} + +/** Paged collection of Index items. */ +export interface PagedIndexOutput { + /** The list of Indexes. */ + value: Array; + /** The link to the next page of items */ + nextLink?: string; +} + +/** Model Deployment Definition */ +export interface DeploymentOutput { + /** Name of the deployment */ + readonly name: string; + /** 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; +} + +/** 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; +} + +/** 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 + | 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; +/** Base Credential definition */ +export type BaseCredentialOutput = + | BaseCredentialOutputParent + | ApiKeyCredentialOutput + | AadCredentialOutput + | SasCredentialOutput; +/** Index resource Definition */ +export type IndexOutput = + | IndexOutputParent + | AzureAISearchIndexOutput + | ManagedAzureAISearchIndexOutput + | CosmosDBIndexOutput; +/** Alias for OpenApiAuthTypeOutput */ +export type OpenApiAuthTypeOutput = string; +/** Alias for VectorStoreDataSourceAssetTypeOutput */ +export type VectorStoreDataSourceAssetTypeOutput = 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 DatasetTypeOutput */ +export type DatasetTypeOutput = string; +/** Alias for CredentialTypeOutput */ +export type CredentialTypeOutput = string; +/** Alias for IndexTypeOutput */ +export type IndexTypeOutput = 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..6f69099ec96f --- /dev/null +++ b/sdk/ai/ai-projects-1dp/src/parameters.ts @@ -0,0 +1,1087 @@ +// 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, + VectorStoreOptions, + VectorStoreUpdateOptions, + VectorStoreFileStatusFilter, + VectorStoreDataSource, + VectorStoreChunkingStrategyRequest, + ConnectionType, + Evaluation, + ListViewType, + DatasetVersion, + PendingUploadRequest, + Index, +} from "./models.js"; + +export interface AgentsCreateAgentBodyParam { + body: CreateAgentOptions; +} + +export interface AgentsCreateAgentQueryParamProperties { + /** The API version to use for this operation. */ + "api-version": string; +} + +export interface AgentsCreateAgentQueryParam { + queryParameters: AgentsCreateAgentQueryParamProperties; +} + +export type AgentsCreateAgentParameters = AgentsCreateAgentQueryParam & + AgentsCreateAgentBodyParam & + RequestParameters; + +export interface AgentsListAgentsQueryParamProperties { + /** The API version to use for this operation. */ + "api-version": 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 AgentsListAgentsQueryParam { + queryParameters: AgentsListAgentsQueryParamProperties; +} + +export type AgentsListAgentsParameters = AgentsListAgentsQueryParam & + RequestParameters; + +export interface AgentsGetAgentQueryParamProperties { + /** The API version to use for this operation. */ + "api-version": string; +} + +export interface AgentsGetAgentQueryParam { + queryParameters: AgentsGetAgentQueryParamProperties; +} + +export type AgentsGetAgentParameters = AgentsGetAgentQueryParam & + RequestParameters; + +export interface AgentsUpdateAgentBodyParam { + body: UpdateAgentOptions; +} + +export interface AgentsUpdateAgentQueryParamProperties { + /** The API version to use for this operation. */ + "api-version": string; +} + +export interface AgentsUpdateAgentQueryParam { + queryParameters: AgentsUpdateAgentQueryParamProperties; +} + +export type AgentsUpdateAgentParameters = AgentsUpdateAgentQueryParam & + AgentsUpdateAgentBodyParam & + RequestParameters; + +export interface AgentsDeleteAgentQueryParamProperties { + /** The API version to use for this operation. */ + "api-version": string; +} + +export interface AgentsDeleteAgentQueryParam { + queryParameters: AgentsDeleteAgentQueryParamProperties; +} + +export type AgentsDeleteAgentParameters = AgentsDeleteAgentQueryParam & + RequestParameters; + +export interface AgentsCreateThreadBodyParam { + body: AgentThreadCreationOptions; +} + +export interface AgentsCreateThreadQueryParamProperties { + /** The API version to use for this operation. */ + "api-version": string; +} + +export interface AgentsCreateThreadQueryParam { + queryParameters: AgentsCreateThreadQueryParamProperties; +} + +export type AgentsCreateThreadParameters = AgentsCreateThreadQueryParam & + AgentsCreateThreadBodyParam & + RequestParameters; + +export interface AgentsGetThreadQueryParamProperties { + /** The API version to use for this operation. */ + "api-version": string; +} + +export interface AgentsGetThreadQueryParam { + queryParameters: AgentsGetThreadQueryParamProperties; +} + +export type AgentsGetThreadParameters = AgentsGetThreadQueryParam & + RequestParameters; + +export interface AgentsUpdateThreadBodyParam { + body: UpdateAgentThreadOptions; +} + +export interface AgentsUpdateThreadQueryParamProperties { + /** The API version to use for this operation. */ + "api-version": string; +} + +export interface AgentsUpdateThreadQueryParam { + queryParameters: AgentsUpdateThreadQueryParamProperties; +} + +export type AgentsUpdateThreadParameters = AgentsUpdateThreadQueryParam & + AgentsUpdateThreadBodyParam & + RequestParameters; + +export interface AgentsDeleteThreadQueryParamProperties { + /** The API version to use for this operation. */ + "api-version": string; +} + +export interface AgentsDeleteThreadQueryParam { + queryParameters: AgentsDeleteThreadQueryParamProperties; +} + +export type AgentsDeleteThreadParameters = AgentsDeleteThreadQueryParam & + RequestParameters; + +export interface AgentsCreateMessageBodyParam { + body: ThreadMessageOptions; +} + +export interface AgentsCreateMessageQueryParamProperties { + /** The API version to use for this operation. */ + "api-version": string; +} + +export interface AgentsCreateMessageQueryParam { + queryParameters: AgentsCreateMessageQueryParamProperties; +} + +export type AgentsCreateMessageParameters = AgentsCreateMessageQueryParam & + AgentsCreateMessageBodyParam & + RequestParameters; + +export interface AgentsListMessagesQueryParamProperties { + /** The API version to use for this operation. */ + "api-version": string; + /** 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 AgentsListMessagesQueryParam { + queryParameters: AgentsListMessagesQueryParamProperties; +} + +export type AgentsListMessagesParameters = AgentsListMessagesQueryParam & + RequestParameters; + +export interface AgentsGetMessageQueryParamProperties { + /** The API version to use for this operation. */ + "api-version": string; +} + +export interface AgentsGetMessageQueryParam { + queryParameters: AgentsGetMessageQueryParamProperties; +} + +export type AgentsGetMessageParameters = AgentsGetMessageQueryParam & + RequestParameters; + +export interface AgentsUpdateMessageBodyParam { + body: { metadata?: Record | null }; +} + +export interface AgentsUpdateMessageQueryParamProperties { + /** The API version to use for this operation. */ + "api-version": string; +} + +export interface AgentsUpdateMessageQueryParam { + queryParameters: AgentsUpdateMessageQueryParamProperties; +} + +export type AgentsUpdateMessageParameters = AgentsUpdateMessageQueryParam & + AgentsUpdateMessageBodyParam & + RequestParameters; + +export interface AgentsCreateRunBodyParam { + body: CreateRunOptions; +} + +/** This is the wrapper object for the parameter `include[]` with explode set to false and style set to form. */ +export interface AgentsCreateRunIncludeQueryParam { + /** Value of the parameter */ + value: RunAdditionalFieldList[]; + /** Should we explode the value? */ + explode: false; + /** Style of the value */ + style: "form"; +} + +export interface AgentsCreateRunQueryParamProperties { + /** The API version to use for this operation. */ + "api-version": string; + /** + * 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[] | AgentsCreateRunIncludeQueryParam; +} + +export interface AgentsCreateRunQueryParam { + queryParameters: AgentsCreateRunQueryParamProperties; +} + +export type AgentsCreateRunParameters = AgentsCreateRunQueryParam & + AgentsCreateRunBodyParam & + RequestParameters; + +export interface AgentsListRunsQueryParamProperties { + /** The API version to use for this operation. */ + "api-version": 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 AgentsListRunsQueryParam { + queryParameters: AgentsListRunsQueryParamProperties; +} + +export type AgentsListRunsParameters = AgentsListRunsQueryParam & + RequestParameters; + +export interface AgentsGetRunQueryParamProperties { + /** The API version to use for this operation. */ + "api-version": string; +} + +export interface AgentsGetRunQueryParam { + queryParameters: AgentsGetRunQueryParamProperties; +} + +export type AgentsGetRunParameters = AgentsGetRunQueryParam & RequestParameters; + +export interface AgentsUpdateRunBodyParam { + body: { metadata?: Record | null }; +} + +export interface AgentsUpdateRunQueryParamProperties { + /** The API version to use for this operation. */ + "api-version": string; +} + +export interface AgentsUpdateRunQueryParam { + queryParameters: AgentsUpdateRunQueryParamProperties; +} + +export type AgentsUpdateRunParameters = AgentsUpdateRunQueryParam & + AgentsUpdateRunBodyParam & + RequestParameters; + +export interface AgentsSubmitToolOutputsToRunBodyParam { + body: { tool_outputs: Array; stream?: boolean | null }; +} + +export interface AgentsSubmitToolOutputsToRunQueryParamProperties { + /** The API version to use for this operation. */ + "api-version": string; +} + +export interface AgentsSubmitToolOutputsToRunQueryParam { + queryParameters: AgentsSubmitToolOutputsToRunQueryParamProperties; +} + +export type AgentsSubmitToolOutputsToRunParameters = + AgentsSubmitToolOutputsToRunQueryParam & + AgentsSubmitToolOutputsToRunBodyParam & + RequestParameters; + +export interface AgentsCancelRunQueryParamProperties { + /** The API version to use for this operation. */ + "api-version": string; +} + +export interface AgentsCancelRunQueryParam { + queryParameters: AgentsCancelRunQueryParamProperties; +} + +export type AgentsCancelRunParameters = AgentsCancelRunQueryParam & + RequestParameters; + +export interface AgentsCreateThreadAndRunBodyParam { + body: CreateAndRunThreadOptions; +} + +export interface AgentsCreateThreadAndRunQueryParamProperties { + /** The API version to use for this operation. */ + "api-version": string; +} + +export interface AgentsCreateThreadAndRunQueryParam { + queryParameters: AgentsCreateThreadAndRunQueryParamProperties; +} + +export type AgentsCreateThreadAndRunParameters = + AgentsCreateThreadAndRunQueryParam & + AgentsCreateThreadAndRunBodyParam & + RequestParameters; + +/** This is the wrapper object for the parameter `include[]` with explode set to false and style set to form. */ +export interface AgentsGetRunStepIncludeQueryParam { + /** Value of the parameter */ + value: RunAdditionalFieldList[]; + /** Should we explode the value? */ + explode: false; + /** Style of the value */ + style: "form"; +} + +export interface AgentsGetRunStepQueryParamProperties { + /** The API version to use for this operation. */ + "api-version": string; + /** + * 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[] | AgentsGetRunStepIncludeQueryParam; +} + +export interface AgentsGetRunStepQueryParam { + queryParameters: AgentsGetRunStepQueryParamProperties; +} + +export type AgentsGetRunStepParameters = AgentsGetRunStepQueryParam & + RequestParameters; + +/** This is the wrapper object for the parameter `include[]` with explode set to false and style set to form. */ +export interface AgentsListRunStepsIncludeQueryParam { + /** Value of the parameter */ + value: RunAdditionalFieldList[]; + /** Should we explode the value? */ + explode: false; + /** Style of the value */ + style: "form"; +} + +export interface AgentsListRunStepsQueryParamProperties { + /** The API version to use for this operation. */ + "api-version": string; + /** + * 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[] | AgentsListRunStepsIncludeQueryParam; + /** 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 AgentsListRunStepsQueryParam { + queryParameters: AgentsListRunStepsQueryParamProperties; +} + +export type AgentsListRunStepsParameters = AgentsListRunStepsQueryParam & + RequestParameters; + +export interface AgentsListFilesQueryParamProperties { + /** The API version to use for this operation. */ + "api-version": string; + /** + * The purpose of the file. + * + * Possible values: "fine-tune", "fine-tune-results", "assistants", "assistants_output", "batch", "batch_output", "vision" + */ + purpose?: FilePurpose; +} + +export interface AgentsListFilesQueryParam { + queryParameters: AgentsListFilesQueryParamProperties; +} + +export type AgentsListFilesParameters = AgentsListFilesQueryParam & + RequestParameters; + +export interface AgentsUploadFileBodyParam { + body: + | FormData + | Array< + | { + name: "file"; + body: + | string + | Uint8Array + | ReadableStream + | NodeJS.ReadableStream + | File; + filename?: string; + contentType?: string; + } + | { + name: "purpose"; + body: FilePurpose; + filename?: string; + contentType?: string; + } + | { name: "filename"; body: string } + >; +} + +export interface AgentsUploadFileQueryParamProperties { + /** The API version to use for this operation. */ + "api-version": string; +} + +export interface AgentsUploadFileQueryParam { + queryParameters: AgentsUploadFileQueryParamProperties; +} + +export interface AgentsUploadFileMediaTypesParam { + /** The name of the file to upload. */ + contentType: "multipart/form-data"; +} + +export type AgentsUploadFileParameters = AgentsUploadFileQueryParam & + AgentsUploadFileMediaTypesParam & + AgentsUploadFileBodyParam & + RequestParameters; + +export interface AgentsDeleteFileQueryParamProperties { + /** The API version to use for this operation. */ + "api-version": string; +} + +export interface AgentsDeleteFileQueryParam { + queryParameters: AgentsDeleteFileQueryParamProperties; +} + +export type AgentsDeleteFileParameters = AgentsDeleteFileQueryParam & + RequestParameters; + +export interface AgentsGetFileQueryParamProperties { + /** The API version to use for this operation. */ + "api-version": string; +} + +export interface AgentsGetFileQueryParam { + queryParameters: AgentsGetFileQueryParamProperties; +} + +export type AgentsGetFileParameters = AgentsGetFileQueryParam & + RequestParameters; + +export interface AgentsGetFileContentQueryParamProperties { + /** The API version to use for this operation. */ + "api-version": string; +} + +export interface AgentsGetFileContentQueryParam { + queryParameters: AgentsGetFileContentQueryParamProperties; +} + +export type AgentsGetFileContentParameters = AgentsGetFileContentQueryParam & + RequestParameters; + +export interface AgentsListVectorStoresQueryParamProperties { + /** The API version to use for this operation. */ + "api-version": 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 AgentsListVectorStoresQueryParam { + queryParameters: AgentsListVectorStoresQueryParamProperties; +} + +export type AgentsListVectorStoresParameters = + AgentsListVectorStoresQueryParam & RequestParameters; + +export interface AgentsCreateVectorStoreBodyParam { + body: VectorStoreOptions; +} + +export interface AgentsCreateVectorStoreQueryParamProperties { + /** The API version to use for this operation. */ + "api-version": string; +} + +export interface AgentsCreateVectorStoreQueryParam { + queryParameters: AgentsCreateVectorStoreQueryParamProperties; +} + +export type AgentsCreateVectorStoreParameters = + AgentsCreateVectorStoreQueryParam & + AgentsCreateVectorStoreBodyParam & + RequestParameters; + +export interface AgentsGetVectorStoreQueryParamProperties { + /** The API version to use for this operation. */ + "api-version": string; +} + +export interface AgentsGetVectorStoreQueryParam { + queryParameters: AgentsGetVectorStoreQueryParamProperties; +} + +export type AgentsGetVectorStoreParameters = AgentsGetVectorStoreQueryParam & + RequestParameters; + +export interface AgentsModifyVectorStoreBodyParam { + body: VectorStoreUpdateOptions; +} + +export interface AgentsModifyVectorStoreQueryParamProperties { + /** The API version to use for this operation. */ + "api-version": string; +} + +export interface AgentsModifyVectorStoreQueryParam { + queryParameters: AgentsModifyVectorStoreQueryParamProperties; +} + +export type AgentsModifyVectorStoreParameters = + AgentsModifyVectorStoreQueryParam & + AgentsModifyVectorStoreBodyParam & + RequestParameters; + +export interface AgentsDeleteVectorStoreQueryParamProperties { + /** The API version to use for this operation. */ + "api-version": string; +} + +export interface AgentsDeleteVectorStoreQueryParam { + queryParameters: AgentsDeleteVectorStoreQueryParamProperties; +} + +export type AgentsDeleteVectorStoreParameters = + AgentsDeleteVectorStoreQueryParam & RequestParameters; + +export interface AgentsListVectorStoreFilesQueryParamProperties { + /** The API version to use for this operation. */ + "api-version": string; + /** + * 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 AgentsListVectorStoreFilesQueryParam { + queryParameters: AgentsListVectorStoreFilesQueryParamProperties; +} + +export type AgentsListVectorStoreFilesParameters = + AgentsListVectorStoreFilesQueryParam & RequestParameters; + +export interface AgentsCreateVectorStoreFileBodyParam { + body: { + file_id?: string; + data_source?: VectorStoreDataSource; + chunking_strategy?: VectorStoreChunkingStrategyRequest; + }; +} + +export interface AgentsCreateVectorStoreFileQueryParamProperties { + /** The API version to use for this operation. */ + "api-version": string; +} + +export interface AgentsCreateVectorStoreFileQueryParam { + queryParameters: AgentsCreateVectorStoreFileQueryParamProperties; +} + +export type AgentsCreateVectorStoreFileParameters = + AgentsCreateVectorStoreFileQueryParam & + AgentsCreateVectorStoreFileBodyParam & + RequestParameters; + +export interface AgentsGetVectorStoreFileQueryParamProperties { + /** The API version to use for this operation. */ + "api-version": string; +} + +export interface AgentsGetVectorStoreFileQueryParam { + queryParameters: AgentsGetVectorStoreFileQueryParamProperties; +} + +export type AgentsGetVectorStoreFileParameters = + AgentsGetVectorStoreFileQueryParam & RequestParameters; + +export interface AgentsDeleteVectorStoreFileQueryParamProperties { + /** The API version to use for this operation. */ + "api-version": string; +} + +export interface AgentsDeleteVectorStoreFileQueryParam { + queryParameters: AgentsDeleteVectorStoreFileQueryParamProperties; +} + +export type AgentsDeleteVectorStoreFileParameters = + AgentsDeleteVectorStoreFileQueryParam & RequestParameters; + +export interface AgentsCreateVectorStoreFileBatchBodyParam { + body: { + file_ids?: string[]; + data_sources?: Array; + chunking_strategy?: VectorStoreChunkingStrategyRequest; + }; +} + +export interface AgentsCreateVectorStoreFileBatchQueryParamProperties { + /** The API version to use for this operation. */ + "api-version": string; +} + +export interface AgentsCreateVectorStoreFileBatchQueryParam { + queryParameters: AgentsCreateVectorStoreFileBatchQueryParamProperties; +} + +export type AgentsCreateVectorStoreFileBatchParameters = + AgentsCreateVectorStoreFileBatchQueryParam & + AgentsCreateVectorStoreFileBatchBodyParam & + RequestParameters; + +export interface AgentsGetVectorStoreFileBatchQueryParamProperties { + /** The API version to use for this operation. */ + "api-version": string; +} + +export interface AgentsGetVectorStoreFileBatchQueryParam { + queryParameters: AgentsGetVectorStoreFileBatchQueryParamProperties; +} + +export type AgentsGetVectorStoreFileBatchParameters = + AgentsGetVectorStoreFileBatchQueryParam & RequestParameters; + +export interface AgentsCancelVectorStoreFileBatchQueryParamProperties { + /** The API version to use for this operation. */ + "api-version": string; +} + +export interface AgentsCancelVectorStoreFileBatchQueryParam { + queryParameters: AgentsCancelVectorStoreFileBatchQueryParamProperties; +} + +export type AgentsCancelVectorStoreFileBatchParameters = + AgentsCancelVectorStoreFileBatchQueryParam & RequestParameters; + +export interface AgentsListVectorStoreFileBatchFilesQueryParamProperties { + /** The API version to use for this operation. */ + "api-version": string; + /** + * 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 AgentsListVectorStoreFileBatchFilesQueryParam { + queryParameters: AgentsListVectorStoreFileBatchFilesQueryParamProperties; +} + +export type AgentsListVectorStoreFileBatchFilesParameters = + AgentsListVectorStoreFileBatchFilesQueryParam & RequestParameters; + +export interface ConnectionsGetHeaders { + /** An opaque, globally-unique, client-generated string identifier for the request. */ + "x-ms-client-request-id"?: string; +} + +export interface ConnectionsGetQueryParamProperties { + /** The API version to use for this operation. */ + "api-version": string; +} + +export interface ConnectionsGetQueryParam { + queryParameters: ConnectionsGetQueryParamProperties; +} + +export interface ConnectionsGetHeaderParam { + headers?: RawHttpHeadersInput & ConnectionsGetHeaders; +} + +export type ConnectionsGetParameters = ConnectionsGetQueryParam & + 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 { + /** The API version to use for this operation. */ + "api-version": string; + /** + * 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 EvaluationsGetQueryParamProperties { + /** The API version to use for this operation. */ + "api-version": string; +} + +export interface EvaluationsGetQueryParam { + queryParameters: EvaluationsGetQueryParamProperties; +} + +export interface EvaluationsGetHeaderParam { + headers?: RawHttpHeadersInput & EvaluationsGetHeaders; +} + +export type EvaluationsGetParameters = EvaluationsGetQueryParam & + 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 API version to use for this operation. */ + "api-version": 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 EvaluationsListQueryParam { + queryParameters: EvaluationsListQueryParamProperties; +} + +export interface EvaluationsListHeaderParam { + headers?: RawHttpHeadersInput & EvaluationsListHeaders; +} + +export type EvaluationsListParameters = EvaluationsListQueryParam & + EvaluationsListHeaderParam & + RequestParameters; + +export interface EvaluationsCreateRunBodyParam { + /** Evalution to be run */ + body: Evaluation; +} + +export interface EvaluationsCreateRunQueryParamProperties { + /** The API version to use for this operation. */ + "api-version": string; +} + +export interface EvaluationsCreateRunQueryParam { + queryParameters: EvaluationsCreateRunQueryParamProperties; +} + +export type EvaluationsCreateRunParameters = EvaluationsCreateRunQueryParam & + EvaluationsCreateRunBodyParam & + RequestParameters; + +export interface DatasetsListLatestDatasetsQueryParamProperties { + /** Continuation token for pagination. This is the nextLink from the previous response. */ + $continuationToken?: string; + /** + * View type for including/excluding (for example) archived entities. + * + * Possible values: "ActiveOnly", "ArchivedOnly", "All" + */ + listViewType?: ListViewType; +} + +export interface DatasetsListLatestDatasetsQueryParam { + queryParameters?: DatasetsListLatestDatasetsQueryParamProperties; +} + +export type DatasetsListLatestDatasetsParameters = + DatasetsListLatestDatasetsQueryParam & RequestParameters; + +export interface DatasetsListDatasetVersionsQueryParamProperties { + /** Please choose OrderBy value from ['createdtime', 'modifiedtime'] */ + $orderBy?: string; + /** 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 DatasetsListDatasetVersionsQueryParam { + queryParameters?: DatasetsListDatasetVersionsQueryParamProperties; +} + +export type DatasetsListDatasetVersionsParameters = + DatasetsListDatasetVersionsQueryParam & RequestParameters; +export type DatasetsDeleteVersionParameters = RequestParameters; +export type DatasetsGetVersionParameters = RequestParameters; + +export interface DatasetsCreateOrUpdateBodyParam { + /** Version entity to create or update. */ + body: DatasetVersion; +} + +export type DatasetsCreateOrUpdateParameters = DatasetsCreateOrUpdateBodyParam & + RequestParameters; + +export interface DatasetsCreateOrGetStartPendingUploadBodyParam { + /** Pensing upload request. */ + body: PendingUploadRequest; +} + +export type DatasetsCreateOrGetStartPendingUploadParameters = + DatasetsCreateOrGetStartPendingUploadBodyParam & RequestParameters; + +export interface IndexesListLatestIndexesQueryParamProperties { + /** Continuation token for pagination. This is the nextLink from the previous response. */ + $continuationToken?: string; + /** + * View type for including/excluding (for example) archived entities. + * + * Possible values: "ActiveOnly", "ArchivedOnly", "All" + */ + listViewType?: ListViewType; +} + +export interface IndexesListLatestIndexesQueryParam { + queryParameters?: IndexesListLatestIndexesQueryParamProperties; +} + +export type IndexesListLatestIndexesParameters = + IndexesListLatestIndexesQueryParam & RequestParameters; + +export interface IndexesGetQueryParamProperties { + /** The API version to use for this operation. */ + "api-version": string; +} + +export interface IndexesGetQueryParam { + queryParameters: IndexesGetQueryParamProperties; +} + +export type IndexesGetParameters = IndexesGetQueryParam & RequestParameters; + +export interface IndexesCreateIndexBodyParam { + /** Properties of an Index Version. */ + body: Index; +} + +export interface IndexesCreateIndexQueryParamProperties { + /** The API version to use for this operation. */ + "api-version": string; +} + +export interface IndexesCreateIndexQueryParam { + queryParameters: IndexesCreateIndexQueryParamProperties; +} + +export type IndexesCreateIndexParameters = IndexesCreateIndexQueryParam & + IndexesCreateIndexBodyParam & + RequestParameters; + +export interface IndexesListIndexVersionsQueryParamProperties { + /** The API version to use for this operation. */ + "api-version": string; + /** View type for including/excluding (for example) archived entities. */ + listViewType: string; + /** Ordering of list: Please choose orderby value from ['createdAt', 'lastModifiedAt']. */ + orderBy?: string; + /** Ordering of list: Please choose orderby value from ['createdAt', 'lastModifiedAt']. */ + orderby?: string; + /** Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. */ + tags?: 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 IndexesListIndexVersionsQueryParam { + queryParameters: IndexesListIndexVersionsQueryParamProperties; +} + +export type IndexesListIndexVersionsParameters = + IndexesListIndexVersionsQueryParam & RequestParameters; +export type IndexesDeleteVersionParameters = RequestParameters; + +export interface DeploymentsGetHeaders { + /** An opaque, globally-unique, client-generated string identifier for the request. */ + "x-ms-client-request-id"?: string; +} + +export interface DeploymentsGetQueryParamProperties { + /** The API version to use for this operation. */ + "api-version": string; +} + +export interface DeploymentsGetQueryParam { + queryParameters: DeploymentsGetQueryParamProperties; +} + +export interface DeploymentsGetHeaderParam { + headers?: RawHttpHeadersInput & DeploymentsGetHeaders; +} + +export type DeploymentsGetParameters = DeploymentsGetQueryParam & + 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 { + /** The API version to use for this operation. */ + "api-version": string; + /** Model publisher to filter models by */ + $modelPublisher?: string; + /** Model name (the publisher specific name) to filter models by */ + $modelName?: string; + /** Flag to include models from connections in response. */ + $includeConnectedModels?: boolean; + /** 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..4ef490a5029d --- /dev/null +++ b/sdk/ai/ai-projects-1dp/src/projectsClient.ts @@ -0,0 +1,54 @@ +// 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 } from "@azure/core-auth"; +import type { ProjectsClient } from "./clientDefinitions.js"; + +/** The optional parameters for the client */ +export interface ProjectsClientOptions extends ClientOptions {} + +/** + * Initialize a new instance of `ProjectsClient` + * @param endpointParam - Project endpoint in the form of: https://.services.ai.azure.com/projects/ + * @param credentials - uniquely identify client credential + * @param options - the parameter for all optional parameters + */ +export default function createClient( + endpointParam: string, + credentials: TokenCredential, + 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" }); + if (options.apiVersion) { + logger.warning( + "This client does not support client api-version, please change it at the operation level", + ); + } + + 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..9557e9420b73 --- /dev/null +++ b/sdk/ai/ai-projects-1dp/src/responses.ts @@ -0,0 +1,989 @@ +// 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, + PendingUploadResponseOutput, + IndexOutput, + PagedIndexOutput, + DeploymentOutput, + PagedDeploymentOutput, +} from "./outputModels.js"; + +/** The new agent instance. */ +export interface AgentsCreateAgent200Response extends HttpResponse { + status: "200"; + body: AgentOutput; +} + +export interface AgentsCreateAgentDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AgentsCreateAgentDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AgentsCreateAgentDefaultHeaders; +} + +/** The requested list of agents. */ +export interface AgentsListAgents200Response extends HttpResponse { + status: "200"; + body: OpenAIPageableListOfAgentOutput; +} + +export interface AgentsListAgentsDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AgentsListAgentsDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AgentsListAgentsDefaultHeaders; +} + +/** The requested agent instance. */ +export interface AgentsGetAgent200Response extends HttpResponse { + status: "200"; + body: AgentOutput; +} + +export interface AgentsGetAgentDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AgentsGetAgentDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AgentsGetAgentDefaultHeaders; +} + +/** The updated agent instance. */ +export interface AgentsUpdateAgent200Response extends HttpResponse { + status: "200"; + body: AgentOutput; +} + +export interface AgentsUpdateAgentDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AgentsUpdateAgentDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AgentsUpdateAgentDefaultHeaders; +} + +/** Status information about the requested deletion operation. */ +export interface AgentsDeleteAgent200Response extends HttpResponse { + status: "200"; + body: AgentDeletionStatusOutput; +} + +export interface AgentsDeleteAgentDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AgentsDeleteAgentDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AgentsDeleteAgentDefaultHeaders; +} + +/** Information about the newly created thread. */ +export interface AgentsCreateThread200Response extends HttpResponse { + status: "200"; + body: AgentThreadOutput; +} + +export interface AgentsCreateThreadDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AgentsCreateThreadDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AgentsCreateThreadDefaultHeaders; +} + +/** Information about the requested thread. */ +export interface AgentsGetThread200Response extends HttpResponse { + status: "200"; + body: AgentThreadOutput; +} + +export interface AgentsGetThreadDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AgentsGetThreadDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AgentsGetThreadDefaultHeaders; +} + +/** Information about the modified thread. */ +export interface AgentsUpdateThread200Response extends HttpResponse { + status: "200"; + body: AgentThreadOutput; +} + +export interface AgentsUpdateThreadDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AgentsUpdateThreadDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AgentsUpdateThreadDefaultHeaders; +} + +/** Status information about the requested thread deletion operation. */ +export interface AgentsDeleteThread200Response extends HttpResponse { + status: "200"; + body: ThreadDeletionStatusOutput; +} + +export interface AgentsDeleteThreadDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AgentsDeleteThreadDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AgentsDeleteThreadDefaultHeaders; +} + +/** A representation of the new message. */ +export interface AgentsCreateMessage200Response extends HttpResponse { + status: "200"; + body: ThreadMessageOutput; +} + +export interface AgentsCreateMessageDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AgentsCreateMessageDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AgentsCreateMessageDefaultHeaders; +} + +/** The requested list of messages. */ +export interface AgentsListMessages200Response extends HttpResponse { + status: "200"; + body: OpenAIPageableListOfThreadMessageOutput; +} + +export interface AgentsListMessagesDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AgentsListMessagesDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AgentsListMessagesDefaultHeaders; +} + +/** A representation of the requested message. */ +export interface AgentsGetMessage200Response extends HttpResponse { + status: "200"; + body: ThreadMessageOutput; +} + +export interface AgentsGetMessageDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AgentsGetMessageDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AgentsGetMessageDefaultHeaders; +} + +/** A representation of the modified message. */ +export interface AgentsUpdateMessage200Response extends HttpResponse { + status: "200"; + body: ThreadMessageOutput; +} + +export interface AgentsUpdateMessageDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AgentsUpdateMessageDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AgentsUpdateMessageDefaultHeaders; +} + +/** Information about the new thread run. */ +export interface AgentsCreateRun200Response extends HttpResponse { + status: "200"; + body: ThreadRunOutput; +} + +export interface AgentsCreateRunDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AgentsCreateRunDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AgentsCreateRunDefaultHeaders; +} + +/** The requested list of thread runs. */ +export interface AgentsListRuns200Response extends HttpResponse { + status: "200"; + body: OpenAIPageableListOfThreadRunOutput; +} + +export interface AgentsListRunsDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AgentsListRunsDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AgentsListRunsDefaultHeaders; +} + +/** The requested information about the specified thread run. */ +export interface AgentsGetRun200Response extends HttpResponse { + status: "200"; + body: ThreadRunOutput; +} + +export interface AgentsGetRunDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AgentsGetRunDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AgentsGetRunDefaultHeaders; +} + +/** Information about the modified run. */ +export interface AgentsUpdateRun200Response extends HttpResponse { + status: "200"; + body: ThreadRunOutput; +} + +export interface AgentsUpdateRunDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AgentsUpdateRunDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AgentsUpdateRunDefaultHeaders; +} + +/** Updated information about the run. */ +export interface AgentsSubmitToolOutputsToRun200Response extends HttpResponse { + status: "200"; + body: ThreadRunOutput; +} + +export interface AgentsSubmitToolOutputsToRunDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AgentsSubmitToolOutputsToRunDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AgentsSubmitToolOutputsToRunDefaultHeaders; +} + +/** Updated information about the cancelled run. */ +export interface AgentsCancelRun200Response extends HttpResponse { + status: "200"; + body: ThreadRunOutput; +} + +export interface AgentsCancelRunDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AgentsCancelRunDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AgentsCancelRunDefaultHeaders; +} + +/** Information about the newly created thread. */ +export interface AgentsCreateThreadAndRun200Response extends HttpResponse { + status: "200"; + body: ThreadRunOutput; +} + +export interface AgentsCreateThreadAndRunDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AgentsCreateThreadAndRunDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AgentsCreateThreadAndRunDefaultHeaders; +} + +/** Information about the requested run step. */ +export interface AgentsGetRunStep200Response extends HttpResponse { + status: "200"; + body: RunStepOutput; +} + +export interface AgentsGetRunStepDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AgentsGetRunStepDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AgentsGetRunStepDefaultHeaders; +} + +/** The requested list of run steps. */ +export interface AgentsListRunSteps200Response extends HttpResponse { + status: "200"; + body: OpenAIPageableListOfRunStepOutput; +} + +export interface AgentsListRunStepsDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AgentsListRunStepsDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AgentsListRunStepsDefaultHeaders; +} + +/** The requested list of files. */ +export interface AgentsListFiles200Response extends HttpResponse { + status: "200"; + body: FileListResponseOutput; +} + +export interface AgentsListFilesDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AgentsListFilesDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AgentsListFilesDefaultHeaders; +} + +/** A representation of the uploaded file. */ +export interface AgentsUploadFile200Response extends HttpResponse { + status: "200"; + body: OpenAIFileOutput; +} + +export interface AgentsUploadFileDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AgentsUploadFileDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AgentsUploadFileDefaultHeaders; +} + +/** The request has succeeded. */ +export interface AgentsDeleteFile200Response extends HttpResponse { + status: "200"; + body: FileDeletionStatusOutput; +} + +export interface AgentsDeleteFileDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AgentsDeleteFileDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AgentsDeleteFileDefaultHeaders; +} + +/** The request has succeeded. */ +export interface AgentsGetFile200Response extends HttpResponse { + status: "200"; + body: OpenAIFileOutput; +} + +export interface AgentsGetFileDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AgentsGetFileDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AgentsGetFileDefaultHeaders; +} + +/** The request has succeeded. */ +export interface AgentsGetFileContent200Response extends HttpResponse { + status: "200"; + body: string; +} + +export interface AgentsGetFileContentDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AgentsGetFileContentDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AgentsGetFileContentDefaultHeaders; +} + +/** The request has succeeded. */ +export interface AgentsListVectorStores200Response extends HttpResponse { + status: "200"; + body: OpenAIPageableListOfVectorStoreOutput; +} + +export interface AgentsListVectorStoresDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AgentsListVectorStoresDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AgentsListVectorStoresDefaultHeaders; +} + +/** The request has succeeded. */ +export interface AgentsCreateVectorStore200Response extends HttpResponse { + status: "200"; + body: VectorStoreOutput; +} + +export interface AgentsCreateVectorStoreDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AgentsCreateVectorStoreDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AgentsCreateVectorStoreDefaultHeaders; +} + +/** The request has succeeded. */ +export interface AgentsGetVectorStore200Response extends HttpResponse { + status: "200"; + body: VectorStoreOutput; +} + +export interface AgentsGetVectorStoreDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AgentsGetVectorStoreDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AgentsGetVectorStoreDefaultHeaders; +} + +/** The request has succeeded. */ +export interface AgentsModifyVectorStore200Response extends HttpResponse { + status: "200"; + body: VectorStoreOutput; +} + +export interface AgentsModifyVectorStoreDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AgentsModifyVectorStoreDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AgentsModifyVectorStoreDefaultHeaders; +} + +/** The request has succeeded. */ +export interface AgentsDeleteVectorStore200Response extends HttpResponse { + status: "200"; + body: VectorStoreDeletionStatusOutput; +} + +export interface AgentsDeleteVectorStoreDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AgentsDeleteVectorStoreDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AgentsDeleteVectorStoreDefaultHeaders; +} + +/** The request has succeeded. */ +export interface AgentsListVectorStoreFiles200Response extends HttpResponse { + status: "200"; + body: OpenAIPageableListOfVectorStoreFileOutput; +} + +export interface AgentsListVectorStoreFilesDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AgentsListVectorStoreFilesDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AgentsListVectorStoreFilesDefaultHeaders; +} + +/** The request has succeeded. */ +export interface AgentsCreateVectorStoreFile200Response extends HttpResponse { + status: "200"; + body: VectorStoreFileOutput; +} + +export interface AgentsCreateVectorStoreFileDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AgentsCreateVectorStoreFileDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AgentsCreateVectorStoreFileDefaultHeaders; +} + +/** The request has succeeded. */ +export interface AgentsGetVectorStoreFile200Response extends HttpResponse { + status: "200"; + body: VectorStoreFileOutput; +} + +export interface AgentsGetVectorStoreFileDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AgentsGetVectorStoreFileDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AgentsGetVectorStoreFileDefaultHeaders; +} + +/** The request has succeeded. */ +export interface AgentsDeleteVectorStoreFile200Response extends HttpResponse { + status: "200"; + body: VectorStoreFileDeletionStatusOutput; +} + +export interface AgentsDeleteVectorStoreFileDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AgentsDeleteVectorStoreFileDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AgentsDeleteVectorStoreFileDefaultHeaders; +} + +/** The request has succeeded. */ +export interface AgentsCreateVectorStoreFileBatch200Response + extends HttpResponse { + status: "200"; + body: VectorStoreFileBatchOutput; +} + +export interface AgentsCreateVectorStoreFileBatchDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AgentsCreateVectorStoreFileBatchDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AgentsCreateVectorStoreFileBatchDefaultHeaders; +} + +/** The request has succeeded. */ +export interface AgentsGetVectorStoreFileBatch200Response extends HttpResponse { + status: "200"; + body: VectorStoreFileBatchOutput; +} + +export interface AgentsGetVectorStoreFileBatchDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AgentsGetVectorStoreFileBatchDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AgentsGetVectorStoreFileBatchDefaultHeaders; +} + +/** The request has succeeded. */ +export interface AgentsCancelVectorStoreFileBatch200Response + extends HttpResponse { + status: "200"; + body: VectorStoreFileBatchOutput; +} + +export interface AgentsCancelVectorStoreFileBatchDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AgentsCancelVectorStoreFileBatchDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AgentsCancelVectorStoreFileBatchDefaultHeaders; +} + +/** The request has succeeded. */ +export interface AgentsListVectorStoreFileBatchFiles200Response + extends HttpResponse { + status: "200"; + body: OpenAIPageableListOfVectorStoreFileOutput; +} + +export interface AgentsListVectorStoreFileBatchFilesDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AgentsListVectorStoreFileBatchFilesDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AgentsListVectorStoreFileBatchFilesDefaultHeaders; +} + +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 DatasetsListLatestDatasets200Response extends HttpResponse { + status: "200"; + body: PagedDatasetVersionOutput; +} + +/** The request has succeeded. */ +export interface DatasetsListDatasetVersions200Response extends HttpResponse { + status: "200"; + body: PagedDatasetVersionOutput; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface DatasetsDeleteVersion204Response extends HttpResponse { + status: "204"; +} + +/** The request has succeeded. */ +export interface DatasetsGetVersion200Response extends HttpResponse { + status: "200"; + body: DatasetVersionOutput; +} + +/** The request has succeeded. */ +export interface DatasetsCreateOrUpdate200Response extends HttpResponse { + status: "200"; + body: DatasetVersionOutput; +} + +/** The request has succeeded. */ +export interface DatasetsCreateOrGetStartPendingUpload200Response + extends HttpResponse { + status: "200"; + body: PendingUploadResponseOutput; +} + +/** The request has succeeded. */ +export interface IndexesListLatestIndexes200Response extends HttpResponse { + status: "200"; + body: PagedDatasetVersionOutput; +} + +/** The request has succeeded. */ +export interface IndexesGet200Response extends HttpResponse { + status: "200"; + body: IndexOutput; +} + +export interface IndexesGetDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface IndexesGetDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & IndexesGetDefaultHeaders; +} + +/** The request has succeeded. */ +export interface IndexesCreateIndex200Response extends HttpResponse { + status: "200"; + body: IndexOutput; +} + +/** The request has succeeded and a new resource has been created as a result. */ +export interface IndexesCreateIndex201Response extends HttpResponse { + status: "201"; + body: IndexOutput; +} + +export interface IndexesCreateIndexDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface IndexesCreateIndexDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & IndexesCreateIndexDefaultHeaders; +} + +/** The request has succeeded. */ +export interface IndexesListIndexVersions200Response extends HttpResponse { + status: "200"; + body: PagedIndexOutput; +} + +export interface IndexesListIndexVersionsDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface IndexesListIndexVersionsDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & IndexesListIndexVersionsDefaultHeaders; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface IndexesDeleteVersion204Response extends HttpResponse { + status: "204"; +} + +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..464dd0360354 --- /dev/null +++ b/sdk/ai/ai-projects-1dp/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/ai/Azure.AI.Projects +commit: 29fea8d1a3d36b4773d2183551d8518f809a83a2 +repo: /mnt/vss/_work/1/s/azure-rest-api-specs +additionalDirectories: