@azure/ai-projects 1.0.0-alpha.20250418.1 → 1.0.0-alpha.20250422.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +157 -0
- package/dist/browser/agents/customModels.d.ts +6 -1
- package/dist/browser/agents/customModels.d.ts.map +1 -1
- package/dist/browser/agents/customModels.js.map +1 -1
- package/dist/browser/agents/index.d.ts +4 -2
- package/dist/browser/agents/index.d.ts.map +1 -1
- package/dist/browser/agents/index.js +2 -1
- package/dist/browser/agents/index.js.map +1 -1
- package/dist/browser/agents/inputOutputs.d.ts +4 -4
- package/dist/browser/agents/inputOutputs.d.ts.map +1 -1
- package/dist/browser/agents/inputOutputs.js.map +1 -1
- package/dist/browser/agents/messages.js +1 -1
- package/dist/browser/agents/messages.js.map +1 -1
- package/dist/browser/agents/threads.d.ts +4 -2
- package/dist/browser/agents/threads.d.ts.map +1 -1
- package/dist/browser/agents/threads.js +23 -0
- package/dist/browser/agents/threads.js.map +1 -1
- package/dist/browser/agents/utils.d.ts +1 -1
- package/dist/browser/agents/utils.d.ts.map +1 -1
- package/dist/browser/agents/utils.js.map +1 -1
- package/dist/browser/customization/convertOutputModelsFromWire.d.ts +1 -0
- package/dist/browser/customization/convertOutputModelsFromWire.d.ts.map +1 -1
- package/dist/browser/customization/convertOutputModelsFromWire.js +10 -0
- package/dist/browser/customization/convertOutputModelsFromWire.js.map +1 -1
- package/dist/browser/customization/models.d.ts +112 -5
- package/dist/browser/customization/models.d.ts.map +1 -1
- package/dist/browser/customization/models.js.map +1 -1
- package/dist/browser/customization/outputModels.d.ts +13 -0
- package/dist/browser/customization/outputModels.d.ts.map +1 -1
- package/dist/browser/customization/outputModels.js.map +1 -1
- package/dist/browser/customization/parameters.d.ts +18 -0
- package/dist/browser/customization/parameters.d.ts.map +1 -1
- package/dist/browser/customization/parameters.js.map +1 -1
- package/dist/browser/generated/src/clientDefinitions.d.ts +5 -3
- package/dist/browser/generated/src/clientDefinitions.d.ts.map +1 -1
- package/dist/browser/generated/src/clientDefinitions.js.map +1 -1
- package/dist/browser/generated/src/isUnexpected.d.ts +2 -1
- package/dist/browser/generated/src/isUnexpected.d.ts.map +1 -1
- package/dist/browser/generated/src/isUnexpected.js +1 -0
- package/dist/browser/generated/src/isUnexpected.js.map +1 -1
- package/dist/browser/generated/src/models.d.ts +89 -13
- package/dist/browser/generated/src/models.d.ts.map +1 -1
- package/dist/browser/generated/src/models.js.map +1 -1
- package/dist/browser/generated/src/outputModels.d.ts +46 -5
- package/dist/browser/generated/src/outputModels.d.ts.map +1 -1
- package/dist/browser/generated/src/outputModels.js.map +1 -1
- package/dist/browser/generated/src/parameters.d.ts +18 -0
- package/dist/browser/generated/src/parameters.d.ts.map +1 -1
- package/dist/browser/generated/src/parameters.js.map +1 -1
- package/dist/browser/generated/src/projectsClient.js +1 -1
- package/dist/browser/generated/src/projectsClient.js.map +1 -1
- package/dist/browser/generated/src/responses.d.ts +15 -1
- package/dist/browser/generated/src/responses.d.ts.map +1 -1
- package/dist/browser/generated/src/responses.js.map +1 -1
- package/dist/commonjs/agents/customModels.d.ts +6 -1
- package/dist/commonjs/agents/customModels.d.ts.map +1 -1
- package/dist/commonjs/agents/customModels.js.map +1 -1
- package/dist/commonjs/agents/index.d.ts +4 -2
- package/dist/commonjs/agents/index.d.ts.map +1 -1
- package/dist/commonjs/agents/index.js +1 -0
- package/dist/commonjs/agents/index.js.map +1 -1
- package/dist/commonjs/agents/inputOutputs.d.ts +4 -4
- package/dist/commonjs/agents/inputOutputs.d.ts.map +1 -1
- package/dist/commonjs/agents/inputOutputs.js.map +1 -1
- package/dist/commonjs/agents/messages.js +1 -1
- package/dist/commonjs/agents/messages.js.map +1 -1
- package/dist/commonjs/agents/threads.d.ts +4 -2
- package/dist/commonjs/agents/threads.d.ts.map +1 -1
- package/dist/commonjs/agents/threads.js +24 -0
- package/dist/commonjs/agents/threads.js.map +1 -1
- package/dist/commonjs/agents/utils.d.ts +1 -1
- package/dist/commonjs/agents/utils.d.ts.map +1 -1
- package/dist/commonjs/agents/utils.js.map +1 -1
- package/dist/commonjs/customization/convertOutputModelsFromWire.d.ts +1 -0
- package/dist/commonjs/customization/convertOutputModelsFromWire.d.ts.map +1 -1
- package/dist/commonjs/customization/convertOutputModelsFromWire.js +11 -0
- package/dist/commonjs/customization/convertOutputModelsFromWire.js.map +1 -1
- package/dist/commonjs/customization/models.d.ts +112 -5
- package/dist/commonjs/customization/models.d.ts.map +1 -1
- package/dist/commonjs/customization/models.js.map +1 -1
- package/dist/commonjs/customization/outputModels.d.ts +13 -0
- package/dist/commonjs/customization/outputModels.d.ts.map +1 -1
- package/dist/commonjs/customization/outputModels.js.map +1 -1
- package/dist/commonjs/customization/parameters.d.ts +18 -0
- package/dist/commonjs/customization/parameters.d.ts.map +1 -1
- package/dist/commonjs/customization/parameters.js.map +1 -1
- package/dist/commonjs/generated/src/clientDefinitions.d.ts +5 -3
- package/dist/commonjs/generated/src/clientDefinitions.d.ts.map +1 -1
- package/dist/commonjs/generated/src/clientDefinitions.js.map +1 -1
- package/dist/commonjs/generated/src/isUnexpected.d.ts +2 -1
- package/dist/commonjs/generated/src/isUnexpected.d.ts.map +1 -1
- package/dist/commonjs/generated/src/isUnexpected.js +1 -0
- package/dist/commonjs/generated/src/isUnexpected.js.map +1 -1
- package/dist/commonjs/generated/src/models.d.ts +89 -13
- package/dist/commonjs/generated/src/models.d.ts.map +1 -1
- package/dist/commonjs/generated/src/models.js.map +1 -1
- package/dist/commonjs/generated/src/outputModels.d.ts +46 -5
- package/dist/commonjs/generated/src/outputModels.d.ts.map +1 -1
- package/dist/commonjs/generated/src/outputModels.js.map +1 -1
- package/dist/commonjs/generated/src/parameters.d.ts +18 -0
- package/dist/commonjs/generated/src/parameters.d.ts.map +1 -1
- package/dist/commonjs/generated/src/parameters.js.map +1 -1
- package/dist/commonjs/generated/src/projectsClient.js +1 -1
- package/dist/commonjs/generated/src/projectsClient.js.map +1 -1
- package/dist/commonjs/generated/src/responses.d.ts +15 -1
- package/dist/commonjs/generated/src/responses.d.ts.map +1 -1
- package/dist/commonjs/generated/src/responses.js.map +1 -1
- package/dist/esm/agents/customModels.d.ts +6 -1
- package/dist/esm/agents/customModels.d.ts.map +1 -1
- package/dist/esm/agents/customModels.js.map +1 -1
- package/dist/esm/agents/index.d.ts +4 -2
- package/dist/esm/agents/index.d.ts.map +1 -1
- package/dist/esm/agents/index.js +2 -1
- package/dist/esm/agents/index.js.map +1 -1
- package/dist/esm/agents/inputOutputs.d.ts +4 -4
- package/dist/esm/agents/inputOutputs.d.ts.map +1 -1
- package/dist/esm/agents/inputOutputs.js.map +1 -1
- package/dist/esm/agents/messages.js +1 -1
- package/dist/esm/agents/messages.js.map +1 -1
- package/dist/esm/agents/threads.d.ts +4 -2
- package/dist/esm/agents/threads.d.ts.map +1 -1
- package/dist/esm/agents/threads.js +23 -0
- package/dist/esm/agents/threads.js.map +1 -1
- package/dist/esm/agents/utils.d.ts +1 -1
- package/dist/esm/agents/utils.d.ts.map +1 -1
- package/dist/esm/agents/utils.js.map +1 -1
- package/dist/esm/customization/convertOutputModelsFromWire.d.ts +1 -0
- package/dist/esm/customization/convertOutputModelsFromWire.d.ts.map +1 -1
- package/dist/esm/customization/convertOutputModelsFromWire.js +10 -0
- package/dist/esm/customization/convertOutputModelsFromWire.js.map +1 -1
- package/dist/esm/customization/models.d.ts +112 -5
- package/dist/esm/customization/models.d.ts.map +1 -1
- package/dist/esm/customization/models.js.map +1 -1
- package/dist/esm/customization/outputModels.d.ts +13 -0
- package/dist/esm/customization/outputModels.d.ts.map +1 -1
- package/dist/esm/customization/outputModels.js.map +1 -1
- package/dist/esm/customization/parameters.d.ts +18 -0
- package/dist/esm/customization/parameters.d.ts.map +1 -1
- package/dist/esm/customization/parameters.js.map +1 -1
- package/dist/esm/generated/src/clientDefinitions.d.ts +5 -3
- package/dist/esm/generated/src/clientDefinitions.d.ts.map +1 -1
- package/dist/esm/generated/src/clientDefinitions.js.map +1 -1
- package/dist/esm/generated/src/isUnexpected.d.ts +2 -1
- package/dist/esm/generated/src/isUnexpected.d.ts.map +1 -1
- package/dist/esm/generated/src/isUnexpected.js +1 -0
- package/dist/esm/generated/src/isUnexpected.js.map +1 -1
- package/dist/esm/generated/src/models.d.ts +89 -13
- package/dist/esm/generated/src/models.d.ts.map +1 -1
- package/dist/esm/generated/src/models.js.map +1 -1
- package/dist/esm/generated/src/outputModels.d.ts +46 -5
- package/dist/esm/generated/src/outputModels.d.ts.map +1 -1
- package/dist/esm/generated/src/outputModels.js.map +1 -1
- package/dist/esm/generated/src/parameters.d.ts +18 -0
- package/dist/esm/generated/src/parameters.d.ts.map +1 -1
- package/dist/esm/generated/src/parameters.js.map +1 -1
- package/dist/esm/generated/src/projectsClient.js +1 -1
- package/dist/esm/generated/src/projectsClient.js.map +1 -1
- package/dist/esm/generated/src/responses.d.ts +15 -1
- package/dist/esm/generated/src/responses.d.ts.map +1 -1
- package/dist/esm/generated/src/responses.js.map +1 -1
- package/dist/react-native/agents/customModels.d.ts +6 -1
- package/dist/react-native/agents/customModels.d.ts.map +1 -1
- package/dist/react-native/agents/customModels.js.map +1 -1
- package/dist/react-native/agents/index.d.ts +4 -2
- package/dist/react-native/agents/index.d.ts.map +1 -1
- package/dist/react-native/agents/index.js +2 -1
- package/dist/react-native/agents/index.js.map +1 -1
- package/dist/react-native/agents/inputOutputs.d.ts +4 -4
- package/dist/react-native/agents/inputOutputs.d.ts.map +1 -1
- package/dist/react-native/agents/inputOutputs.js.map +1 -1
- package/dist/react-native/agents/messages.js +1 -1
- package/dist/react-native/agents/messages.js.map +1 -1
- package/dist/react-native/agents/threads.d.ts +4 -2
- package/dist/react-native/agents/threads.d.ts.map +1 -1
- package/dist/react-native/agents/threads.js +23 -0
- package/dist/react-native/agents/threads.js.map +1 -1
- package/dist/react-native/agents/utils.d.ts +1 -1
- package/dist/react-native/agents/utils.d.ts.map +1 -1
- package/dist/react-native/agents/utils.js.map +1 -1
- package/dist/react-native/customization/convertOutputModelsFromWire.d.ts +1 -0
- package/dist/react-native/customization/convertOutputModelsFromWire.d.ts.map +1 -1
- package/dist/react-native/customization/convertOutputModelsFromWire.js +10 -0
- package/dist/react-native/customization/convertOutputModelsFromWire.js.map +1 -1
- package/dist/react-native/customization/models.d.ts +112 -5
- package/dist/react-native/customization/models.d.ts.map +1 -1
- package/dist/react-native/customization/models.js.map +1 -1
- package/dist/react-native/customization/outputModels.d.ts +13 -0
- package/dist/react-native/customization/outputModels.d.ts.map +1 -1
- package/dist/react-native/customization/outputModels.js.map +1 -1
- package/dist/react-native/customization/parameters.d.ts +18 -0
- package/dist/react-native/customization/parameters.d.ts.map +1 -1
- package/dist/react-native/customization/parameters.js.map +1 -1
- package/dist/react-native/generated/src/clientDefinitions.d.ts +5 -3
- package/dist/react-native/generated/src/clientDefinitions.d.ts.map +1 -1
- package/dist/react-native/generated/src/clientDefinitions.js.map +1 -1
- package/dist/react-native/generated/src/isUnexpected.d.ts +2 -1
- package/dist/react-native/generated/src/isUnexpected.d.ts.map +1 -1
- package/dist/react-native/generated/src/isUnexpected.js +1 -0
- package/dist/react-native/generated/src/isUnexpected.js.map +1 -1
- package/dist/react-native/generated/src/models.d.ts +89 -13
- package/dist/react-native/generated/src/models.d.ts.map +1 -1
- package/dist/react-native/generated/src/models.js.map +1 -1
- package/dist/react-native/generated/src/outputModels.d.ts +46 -5
- package/dist/react-native/generated/src/outputModels.d.ts.map +1 -1
- package/dist/react-native/generated/src/outputModels.js.map +1 -1
- package/dist/react-native/generated/src/parameters.d.ts +18 -0
- package/dist/react-native/generated/src/parameters.d.ts.map +1 -1
- package/dist/react-native/generated/src/parameters.js.map +1 -1
- package/dist/react-native/generated/src/projectsClient.js +1 -1
- package/dist/react-native/generated/src/projectsClient.js.map +1 -1
- package/dist/react-native/generated/src/responses.d.ts +15 -1
- package/dist/react-native/generated/src/responses.d.ts.map +1 -1
- package/dist/react-native/generated/src/responses.js.map +1 -1
- package/package.json +1 -1
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AE,CAC1B,aAAqB,EACrB,OAAkD,EAClD,EAAE,CAAC,IAAA,uDAA0B,EAAC,OAAO,EAAE,aAAa,EAAE,OAAO,CAAC;QAChE,uBAAuB,EAAE,CACvB,aAAqB,EACrB,OAAe,EACf,OAA+C,EAC/C,EAAE,CAAC,IAAA,oDAAuB,EAAC,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,CAAC;QACtE,0BAA0B,EAAE,CAC1B,aAAqB,EACrB,OAAe,EACf,OAAkD,EAClD,EAAE,CAAC,IAAA,uDAA0B,EAAC,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,CAAC;QACzE,6BAA6B,EAAE,CAC7B,aAAqB,EACrB,OAAe,EACf,OAAqD,EACrD,EAAE,CAAC,IAAA,0DAA6B,EAAC,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,CAAC;QAC5E,iCAAiC,EAAE,CACjC,aAAqB,EACrB,OAAkD,EAClD,EAAE,CAAC,IAAA,8DAAiC,EAAC,OAAO,EAAE,aAAa,EAAE,OAAO,CAAC;QAEvE,UAAU,EAAE,CACV,QAAgB,EAChB,KAAa,EACb,MAAc,EACd,OAAkC,EAClC,EAAE,CAAC,IAAA,wBAAU,EAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC;QAC1D,YAAY,EAAE,CAAC,QAAgB,EAAE,KAAa,EAAE,OAAoC,EAAE,EAAE,CACtF,IAAA,0BAAY,EAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,CAAC;KAClD,CAAC;AACJ,CAAC;AAED,SAAgB,mBAAmB,CAAC,OAAe;IACjD,yBACK,SAAS,CAAC,OAAO,CAAC,EACrB;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { type Client, type StreamableMethod } from \"@azure-rest/core-client\";\nimport type {\n FileDeletionStatusOutput,\n FileListResponseOutput,\n OpenAIFileOutput,\n} from \"../customization/outputModels.js\";\nimport type {\n OpenAIPageableListOfThreadRunOutput,\n ThreadRunOutput,\n AgentThreadOutput,\n RunStepOutput,\n OpenAIPageableListOfRunStepOutput,\n ThreadMessageOutput,\n ThreadDeletionStatusOutput,\n OpenAIPageableListOfThreadMessageOutput,\n OpenAIPageableListOfVectorStoreOutput,\n VectorStoreOutput,\n VectorStoreFileOutput,\n VectorStoreDeletionStatusOutput,\n VectorStoreFileDeletionStatusOutput,\n VectorStoreFileBatchOutput,\n OpenAIPageableListOfVectorStoreFileOutput,\n AgentDeletionStatusOutput,\n AgentOutput,\n OpenAIPageableListOfAgentOutput,\n} from \"../customization/outputModels.js\";\nimport { createAgent, deleteAgent, getAgent, listAgents, updateAgent } from \"./assistants.js\";\nimport {\n deleteFile,\n getFile,\n getFileContent,\n listFiles,\n uploadFile,\n uploadFileAndPoll,\n} from \"./files.js\";\nimport { createThread, deleteThread, getThread, updateThread } from \"./threads.js\";\nimport {\n cancelRun,\n createRun,\n createThreadAndRun,\n getRun,\n listRuns,\n submitToolOutputsToRun,\n updateRun,\n} from \"./runs.js\";\nimport { createMessage, listMessages, updateMessage } from \"./messages.js\";\nimport type { FilePurpose } from \"../customization/models.js\";\nimport {\n createVectorStore,\n createVectorStoreAndPoll,\n deleteVectorStore,\n getVectorStore,\n listVectorStores,\n modifyVectorStore,\n} from \"./vectorStores.js\";\nimport { getRunStep, listRunSteps } from \"./runSteps.js\";\nimport {\n createVectorStoreFile,\n createVectorStoreFileAndPoll,\n deleteVectorStoreFile,\n getVectorStoreFile,\n listVectorStoreFiles,\n} from \"./vectorStoresFiles.js\";\nimport {\n cancelVectorStoreFileBatch,\n createVectorStoreFileBatch,\n createVectorStoreFileBatchAndPoll,\n getVectorStoreFileBatch,\n listVectorStoreFileBatchFiles,\n} from \"./vectorStoresFileBatches.js\";\nimport type {\n AgentRunResponse,\n CreateRunOptionalParams,\n GetRunOptionalParams,\n CancelRunOptionalParams,\n SubmitToolOutputsToRunOptionalParams,\n UpdateRunOptionalParams,\n ListRunQueryOptionalParams,\n CreateAndRunThreadOptionalParams,\n CreateAgentThreadOptionalParams,\n GetAgentThreadOptionalParams,\n UpdateAgentThreadOptionalParams,\n DeleteAgentThreadOptionalParams,\n GetRunStepOptionalParams,\n ListRunStepsOptionalParams,\n CreateMessageOptionalParams,\n ListMessagesOptionalParams,\n UpdateMessageOptionalParams,\n GetVectorStoreOptionalParams,\n ListVectorStoresOptionalParams,\n UpdateVectorStoreOptionalParams,\n DeleteVectorStoreOptionalParams,\n CreateVectorStoreOptionalParams,\n CreateVectorStoreFileOptionalParams,\n ListVectorStoreFilesOptionalParams,\n GetVectorStoreFileOptionalParams,\n DeleteVectorStoreFileOptionalParams,\n CreateVectorStoreFileBatchOptionalParams,\n GetVectorStoreFileBatchOptionalParams,\n ListVectorStoreFileBatchFilesOptionalParams,\n CreateAgentOptionalParams,\n ListAgentsOptionalParams,\n GetAgentOptionalParams,\n UpdateAgentOptionalParams,\n DeleteFileOptionalParams,\n GetFileOptionalParams,\n GetFileContentOptionalParams,\n ListFilesOptionalParams,\n UploadFileOptionalParams,\n CancelVectorStoreFileBatchOptionalParams,\n DeleteAgentOptionalParams,\n} from \"./customModels.js\";\nimport type { ThreadMessageOptions, ToolOutput } from \"../customization/models.js\";\nimport type { PollerLike, OperationState } from \"@azure/core-lro\";\n\n/**\n * Agents Interface Contains operations for creating, listing, updating, and deleting agents, threads, runs, messages, and files.\n */\nexport interface AgentsOperations {\n /** Creates a new agent. */\n createAgent: (model: string, options?: CreateAgentOptionalParams) => Promise<AgentOutput>;\n\n /** Gets a list of agents that were previously created. */\n listAgents: (options?: ListAgentsOptionalParams) => Promise<OpenAIPageableListOfAgentOutput>;\n /** Retrieves an existing agent. */\n getAgent: (assistantId: string, options?: GetAgentOptionalParams) => Promise<AgentOutput>;\n /** Modifies an existing agent. */\n updateAgent: (assistantId: string, options: UpdateAgentOptionalParams) => Promise<AgentOutput>;\n /** Deletes an agent. */\n deleteAgent: (\n assistantId: string,\n options?: DeleteAgentOptionalParams,\n ) => Promise<AgentDeletionStatusOutput>;\n\n /** Creates a new thread. Threads contain messages and can be run by agents. */\n createThread: (options?: CreateAgentThreadOptionalParams) => Promise<AgentThreadOutput>;\n /** Gets information about an existing thread. */\n getThread: (\n threadId: string,\n options?: GetAgentThreadOptionalParams,\n ) => Promise<AgentThreadOutput>;\n /** Modifies an existing thread. */\n updateThread: (\n threadId: string,\n options?: UpdateAgentThreadOptionalParams,\n ) => Promise<AgentThreadOutput>;\n /** Deletes an existing thread. */\n deleteThread: (\n threadId: string,\n options?: DeleteAgentThreadOptionalParams,\n ) => Promise<ThreadDeletionStatusOutput>;\n\n /** Creates and starts a new run of the specified thread using the specified agent. */\n createRun: (\n threadId: string,\n assistantId: string,\n options?: CreateRunOptionalParams,\n ) => AgentRunResponse;\n\n /** Gets a list of runs for a specified thread. */\n listRuns: (\n threadId: string,\n options?: ListRunQueryOptionalParams,\n ) => Promise<OpenAIPageableListOfThreadRunOutput>;\n /** Gets an existing run from an existing thread. */\n getRun: (\n threadId: string,\n runId: string,\n options?: GetRunOptionalParams,\n ) => Promise<ThreadRunOutput>;\n /** Modifies an existing thread run. */\n updateRun: (\n threadId: string,\n runId: string,\n options?: UpdateRunOptionalParams,\n ) => Promise<ThreadRunOutput>;\n /** 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'. */\n submitToolOutputsToRun: (\n threadId: string,\n runId: string,\n toolOutputs: Array<ToolOutput>,\n options?: SubmitToolOutputsToRunOptionalParams,\n ) => AgentRunResponse;\n\n /** Cancels a run of an in progress thread. */\n cancelRun: (\n threadId: string,\n runId: string,\n options?: CancelRunOptionalParams,\n ) => Promise<ThreadRunOutput>;\n /** Creates a new thread and immediately starts a run of that thread. */\n createThreadAndRun: (\n assistantId: string,\n options?: CreateAndRunThreadOptionalParams,\n ) => AgentRunResponse;\n\n /** Creates a new message on a specified thread. */\n createMessage: (\n threadId: string,\n messageOptions: ThreadMessageOptions,\n options?: CreateMessageOptionalParams,\n ) => Promise<ThreadMessageOutput>;\n /** Gets a list of messages that exist on a thread. */\n listMessages: (\n threadId: string,\n options?: ListMessagesOptionalParams,\n ) => Promise<OpenAIPageableListOfThreadMessageOutput>;\n /** Modifies an existing message on an existing thread. */\n updateMessage: (\n threadId: string,\n messageId: string,\n options?: UpdateMessageOptionalParams,\n ) => Promise<ThreadMessageOutput>;\n\n /** Gets a list of previously uploaded files. */\n listFiles: (options?: ListFilesOptionalParams) => Promise<FileListResponseOutput>;\n /** Uploads a file for use by other operations. */\n uploadFile: (\n data: ReadableStream | NodeJS.ReadableStream,\n purpose: FilePurpose,\n options?: UploadFileOptionalParams,\n ) => PollerLike<OperationState<OpenAIFileOutput>, OpenAIFileOutput>;\n\n /** Uploads a file for use by other operations. */\n uploadFileAndPoll: (\n data: ReadableStream | NodeJS.ReadableStream,\n purpose: FilePurpose,\n options?: UploadFileOptionalParams,\n ) => PollerLike<OperationState<OpenAIFileOutput>, OpenAIFileOutput>;\n /** Delete a previously uploaded file. */\n deleteFile: (\n fileId: string,\n options?: DeleteFileOptionalParams,\n ) => Promise<FileDeletionStatusOutput>;\n /** Returns information about a specific file. Does not retrieve file content. */\n getFile: (fileId: string, options?: GetFileOptionalParams) => Promise<OpenAIFileOutput>;\n /** Returns the content of a specific file. */\n getFileContent: (\n fileId: string,\n options?: GetFileContentOptionalParams,\n ) => StreamableMethod<string | Uint8Array>;\n\n /** Returns a list of vector stores. */\n listVectorStores: (\n options?: DeleteVectorStoreOptionalParams,\n ) => Promise<OpenAIPageableListOfVectorStoreOutput>;\n /** Creates a vector store. */\n createVectorStore: (\n options?: CreateVectorStoreOptionalParams,\n ) => PollerLike<OperationState<VectorStoreOutput>, VectorStoreOutput>;\n /** Returns the vector store object object matching the specific ID. */\n getVectorStore: (\n vectorStoreId: string,\n options?: DeleteVectorStoreOptionalParams,\n ) => Promise<VectorStoreOutput>;\n /** The ID of the vector store to modify. */\n modifyVectorStore: (\n vectorStoreId: string,\n options?: UpdateVectorStoreOptionalParams,\n ) => Promise<VectorStoreOutput>;\n /** Deletes the vector store object matching the specified ID. */\n deleteVectorStore: (\n vectorStoreId: string,\n options?: DeleteVectorStoreOptionalParams,\n ) => Promise<VectorStoreDeletionStatusOutput>;\n\n /** Create vector store and poll. */\n createVectorStoreAndPoll: (\n options?: CreateVectorStoreOptionalParams,\n ) => PollerLike<OperationState<VectorStoreOutput>, VectorStoreOutput>;\n\n /** Create a vector store file by attching a file to a vector store. */\n createVectorStoreFile: (\n vectorStoreId: string,\n options?: CreateVectorStoreFileOptionalParams,\n ) => PollerLike<OperationState<VectorStoreFileOutput>, VectorStoreFileOutput>;\n /** Retrieves a vector store file. */\n getVectorStoreFile: (\n vectorStoreId: string,\n fileId: string,\n options?: GetVectorStoreFileOptionalParams,\n ) => Promise<VectorStoreFileOutput>;\n /** Returns a list of vector store files. */\n listVectorStoreFiles: (\n vectorStoreId: string,\n options?: ListVectorStoreFilesOptionalParams,\n ) => Promise<OpenAIPageableListOfVectorStoreFileOutput>;\n /**\n * Delete a vector store file. This will remove the file from the vector store but the file itself will not be deleted.\n * To delete the file, use the delete file endpoint.\n */\n deleteVectorStoreFile: (\n vectorStoreId: string,\n fileId: string,\n options?: DeleteVectorStoreFileOptionalParams,\n ) => Promise<VectorStoreFileDeletionStatusOutput>;\n /** Create a vector store file by attaching a file to a vector store and poll. */\n createVectorStoreFileAndPoll: (\n vectorStoreId: string,\n options?: CreateVectorStoreFileOptionalParams,\n ) => PollerLike<OperationState<VectorStoreFileOutput>, VectorStoreFileOutput>;\n\n /** Create a vector store file batch. */\n createVectorStoreFileBatch: (\n vectorStoreId: string,\n options?: CreateVectorStoreFileBatchOptionalParams,\n ) => PollerLike<OperationState<VectorStoreFileBatchOutput>, VectorStoreFileBatchOutput>;\n /** Retrieve a vector store file batch. */\n getVectorStoreFileBatch: (\n vectorStoreId: string,\n batchId: string,\n options?: GetVectorStoreFileBatchOptionalParams,\n ) => Promise<VectorStoreFileBatchOutput>;\n /** Cancel a vector store file batch. This attempts to cancel the processing of files in this batch as soon as possible. */\n cancelVectorStoreFileBatch: (\n vectorStoreId: string,\n batchId: string,\n options?: CancelVectorStoreFileBatchOptionalParams,\n ) => Promise<VectorStoreFileBatchOutput>;\n /** Returns a list of vector store files in a batch. */\n listVectorStoreFileBatchFiles: (\n vectorStoreId: string,\n batchId: string,\n options?: ListVectorStoreFileBatchFilesOptionalParams,\n ) => Promise<OpenAIPageableListOfVectorStoreFileOutput>;\n /** Create a vector store file batch and poll. */\n createVectorStoreFileBatchAndPoll: (\n vectorStoreId: string,\n options?: CreateVectorStoreFileBatchOptionalParams,\n ) => PollerLike<OperationState<VectorStoreFileBatchOutput>, VectorStoreFileBatchOutput>;\n\n /** Gets a single run step from a thread run. */\n getRunStep: (\n threadId: string,\n runId: string,\n stepId: string,\n options?: GetRunStepOptionalParams,\n ) => Promise<RunStepOutput>;\n /** Gets a list of run steps from a thread run. */\n listRunSteps: (\n threadId: string,\n runId: string,\n options?: ListRunQueryOptionalParams,\n ) => Promise<OpenAIPageableListOfRunStepOutput>;\n}\n\nfunction getAgents(context: Client): AgentsOperations {\n return {\n createAgent: (model: string, options?: CreateAgentOptionalParams) =>\n createAgent(context, model, options),\n listAgents: (options?: ListAgentsOptionalParams) => listAgents(context, options),\n getAgent: (assistantId: string, options?: GetAgentOptionalParams) =>\n getAgent(context, assistantId, options),\n updateAgent: (assistantId: string, options: UpdateAgentOptionalParams) =>\n updateAgent(context, assistantId, options),\n deleteAgent: (assistantId: string, options?: DeleteAgentOptionalParams) =>\n deleteAgent(context, assistantId, options),\n\n createThread: (options?: CreateAgentThreadOptionalParams) => createThread(context, options),\n getThread: (threadId: string, options?: GetAgentThreadOptionalParams) =>\n getThread(context, threadId, options),\n updateThread: (threadId: string, options?: UpdateAgentThreadOptionalParams) =>\n updateThread(context, threadId, options),\n deleteThread: (threadId: string, options?: DeleteAgentThreadOptionalParams) =>\n deleteThread(context, threadId, options),\n\n createRun: (threadId: string, assistantId: string, options?: CreateRunOptionalParams) =>\n createRun(context, threadId, assistantId, options ?? {}),\n listRuns: (threadId: string, options?: ListRunQueryOptionalParams) =>\n listRuns(context, threadId, options ?? {}),\n getRun: (threadId: string, runId: string, options?: GetRunOptionalParams) =>\n getRun(context, threadId, runId, options),\n updateRun: (threadId: string, runId: string, options?: UpdateRunOptionalParams) =>\n updateRun(context, threadId, runId, options),\n submitToolOutputsToRun: (\n threadId: string,\n runId: string,\n toolOutputs: Array<ToolOutput>,\n options?: SubmitToolOutputsToRunOptionalParams,\n ) => submitToolOutputsToRun(context, threadId, runId, toolOutputs, options),\n cancelRun: (threadId: string, runId: string, options?: CancelRunOptionalParams) =>\n cancelRun(context, threadId, runId, options),\n createThreadAndRun: (assistantId: string, options?: CreateAndRunThreadOptionalParams) =>\n createThreadAndRun(context, assistantId, options ?? {}),\n\n createMessage: (\n threadId: string,\n messageOptions: ThreadMessageOptions,\n options?: CreateMessageOptionalParams,\n ) => createMessage(context, threadId, messageOptions, options),\n listMessages: (threadId: string, options?: ListMessagesOptionalParams) =>\n listMessages(context, threadId, options),\n updateMessage: (threadId: string, messageId: string, options?: UpdateMessageOptionalParams) =>\n updateMessage(context, threadId, messageId, options),\n\n listFiles: (options?: ListFilesOptionalParams) => listFiles(context, options),\n uploadFile: (\n content: ReadableStream | NodeJS.ReadableStream,\n purpose: FilePurpose,\n options?: UploadFileOptionalParams,\n ) => uploadFile(context, content, purpose, options),\n uploadFileAndPoll: (\n content: ReadableStream | NodeJS.ReadableStream,\n purpose: FilePurpose,\n options?: UploadFileOptionalParams,\n ) => uploadFileAndPoll(context, content, purpose, options),\n deleteFile: (fileId: string, options?: DeleteFileOptionalParams) =>\n deleteFile(context, fileId, options),\n getFile: (fileId: string, options?: GetFileOptionalParams) => getFile(context, fileId, options),\n getFileContent: (fileId: string, options?: GetFileContentOptionalParams) =>\n getFileContent(context, fileId, options),\n\n listVectorStores: (options?: ListVectorStoresOptionalParams) =>\n listVectorStores(context, options),\n createVectorStore: (options?: CreateVectorStoreOptionalParams) =>\n createVectorStore(context, options),\n getVectorStore: (vectorStoreId: string, options?: GetVectorStoreOptionalParams) =>\n getVectorStore(context, vectorStoreId, options),\n modifyVectorStore: (vectorStoreId: string, options?: UpdateVectorStoreOptionalParams) =>\n modifyVectorStore(context, vectorStoreId, options),\n deleteVectorStore: (vectorStoreId: string, options?: DeleteVectorStoreOptionalParams) =>\n deleteVectorStore(context, vectorStoreId, options),\n createVectorStoreAndPoll: (options?: CreateVectorStoreOptionalParams) =>\n createVectorStoreAndPoll(context, options),\n\n createVectorStoreFile: (vectorStoreId: string, options?: CreateVectorStoreFileOptionalParams) =>\n createVectorStoreFile(context, vectorStoreId, options),\n getVectorStoreFile: (\n vectorStoreId: string,\n fileId: string,\n options?: GetVectorStoreFileOptionalParams,\n ) => getVectorStoreFile(context, vectorStoreId, fileId, options),\n listVectorStoreFiles: (vectorStoreId: string, options?: ListVectorStoreFilesOptionalParams) =>\n listVectorStoreFiles(context, vectorStoreId, options),\n deleteVectorStoreFile: (\n vectorStoreId: string,\n fileId: string,\n options?: DeleteVectorStoreFileOptionalParams,\n ) => deleteVectorStoreFile(context, vectorStoreId, fileId, options),\n createVectorStoreFileAndPoll: (\n vectorStoreId: string,\n options?: CreateVectorStoreFileOptionalParams,\n ) => createVectorStoreFileAndPoll(context, vectorStoreId, options),\n\n createVectorStoreFileBatch: (\n vectorStoreId: string,\n options?: CreateVectorStoreFileBatchOptionalParams,\n ) => createVectorStoreFileBatch(context, vectorStoreId, options),\n getVectorStoreFileBatch: (\n vectorStoreId: string,\n batchId: string,\n options?: GetVectorStoreFileBatchOptionalParams,\n ) => getVectorStoreFileBatch(context, vectorStoreId, batchId, options),\n cancelVectorStoreFileBatch: (\n vectorStoreId: string,\n batchId: string,\n options?: CancelVectorStoreFileBatchOptionalParams,\n ) => cancelVectorStoreFileBatch(context, vectorStoreId, batchId, options),\n listVectorStoreFileBatchFiles: (\n vectorStoreId: string,\n batchId: string,\n options?: ListVectorStoreFileBatchFilesOptionalParams,\n ) => listVectorStoreFileBatchFiles(context, vectorStoreId, batchId, options),\n createVectorStoreFileBatchAndPoll: (\n vectorStoreId: string,\n options?: CreateVectorStoreFileBatchOptionalParams,\n ) => createVectorStoreFileBatchAndPoll(context, vectorStoreId, options),\n\n getRunStep: (\n threadId: string,\n runId: string,\n stepId: string,\n options?: GetRunStepOptionalParams,\n ) => getRunStep(context, threadId, runId, stepId, options),\n listRunSteps: (threadId: string, runId: string, options?: ListRunStepsOptionalParams) =>\n listRunSteps(context, threadId, runId, options),\n };\n}\n\nexport function getAgentsOperations(context: Client): AgentsOperations {\n return {\n ...getAgents(context),\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/agents/index.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAwelC,kDAIC;AA/cD,mDAA8F;AAC9F,yCAOoB;AACpB,6CAAgG;AAChG,uCAQmB;AACnB,+CAA2E;AAE3E,uDAO2B;AAC3B,+CAAyD;AACzD,iEAMgC;AAChC,6EAMsC;AA0RtC,SAAS,SAAS,CAAC,OAAe;IAChC,OAAO;QACL,WAAW,EAAE,CAAC,KAAa,EAAE,OAAmC,EAAE,EAAE,CAClE,IAAA,2BAAW,EAAC,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC;QACtC,UAAU,EAAE,CAAC,OAAkC,EAAE,EAAE,CAAC,IAAA,0BAAU,EAAC,OAAO,EAAE,OAAO,CAAC;QAChF,QAAQ,EAAE,CAAC,WAAmB,EAAE,OAAgC,EAAE,EAAE,CAClE,IAAA,wBAAQ,EAAC,OAAO,EAAE,WAAW,EAAE,OAAO,CAAC;QACzC,WAAW,EAAE,CAAC,WAAmB,EAAE,OAAkC,EAAE,EAAE,CACvE,IAAA,2BAAW,EAAC,OAAO,EAAE,WAAW,EAAE,OAAO,CAAC;QAC5C,WAAW,EAAE,CAAC,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B,EAChB,KAAa,EACb,MAAc,EACd,OAAkC,EAClC,EAAE,CAAC,IAAA,wBAAU,EAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC;QAC1D,YAAY,EAAE,CAAC,QAAgB,EAAE,KAAa,EAAE,OAAoC,EAAE,EAAE,CACtF,IAAA,0BAAY,EAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,CAAC;KAClD,CAAC;AACJ,CAAC;AAED,SAAgB,mBAAmB,CAAC,OAAe;IACjD,yBACK,SAAS,CAAC,OAAO,CAAC,EACrB;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { type Client, type StreamableMethod } from \"@azure-rest/core-client\";\nimport type {\n FileDeletionStatusOutput,\n FileListResponseOutput,\n OpenAIFileOutput,\n} from \"../customization/outputModels.js\";\nimport type {\n OpenAIPageableListOfThreadRunOutput,\n ThreadRunOutput,\n AgentThreadOutput,\n RunStepOutput,\n OpenAIPageableListOfRunStepOutput,\n ThreadMessageOutput,\n ThreadDeletionStatusOutput,\n OpenAIPageableListOfThreadMessageOutput,\n OpenAIPageableListOfVectorStoreOutput,\n VectorStoreOutput,\n VectorStoreFileOutput,\n VectorStoreDeletionStatusOutput,\n VectorStoreFileDeletionStatusOutput,\n VectorStoreFileBatchOutput,\n OpenAIPageableListOfVectorStoreFileOutput,\n AgentDeletionStatusOutput,\n AgentOutput,\n OpenAIPageableListOfAgentOutput,\n OpenAIPageableListOfAgentThreadOutput,\n} from \"../customization/outputModels.js\";\nimport { createAgent, deleteAgent, getAgent, listAgents, updateAgent } from \"./assistants.js\";\nimport {\n deleteFile,\n getFile,\n getFileContent,\n listFiles,\n uploadFile,\n uploadFileAndPoll,\n} from \"./files.js\";\nimport { createThread, deleteThread, getThread, listThreads, updateThread } from \"./threads.js\";\nimport {\n cancelRun,\n createRun,\n createThreadAndRun,\n getRun,\n listRuns,\n submitToolOutputsToRun,\n updateRun,\n} from \"./runs.js\";\nimport { createMessage, listMessages, updateMessage } from \"./messages.js\";\nimport type { FilePurpose } from \"../customization/models.js\";\nimport {\n createVectorStore,\n createVectorStoreAndPoll,\n deleteVectorStore,\n getVectorStore,\n listVectorStores,\n modifyVectorStore,\n} from \"./vectorStores.js\";\nimport { getRunStep, listRunSteps } from \"./runSteps.js\";\nimport {\n createVectorStoreFile,\n createVectorStoreFileAndPoll,\n deleteVectorStoreFile,\n getVectorStoreFile,\n listVectorStoreFiles,\n} from \"./vectorStoresFiles.js\";\nimport {\n cancelVectorStoreFileBatch,\n createVectorStoreFileBatch,\n createVectorStoreFileBatchAndPoll,\n getVectorStoreFileBatch,\n listVectorStoreFileBatchFiles,\n} from \"./vectorStoresFileBatches.js\";\nimport type {\n AgentRunResponse,\n CreateRunOptionalParams,\n GetRunOptionalParams,\n CancelRunOptionalParams,\n SubmitToolOutputsToRunOptionalParams,\n UpdateRunOptionalParams,\n ListRunQueryOptionalParams,\n CreateAndRunThreadOptionalParams,\n CreateAgentThreadOptionalParams,\n GetAgentThreadOptionalParams,\n UpdateAgentThreadOptionalParams,\n DeleteAgentThreadOptionalParams,\n GetRunStepOptionalParams,\n ListRunStepsOptionalParams,\n CreateMessageOptionalParams,\n ListMessagesOptionalParams,\n UpdateMessageOptionalParams,\n GetVectorStoreOptionalParams,\n ListVectorStoresOptionalParams,\n UpdateVectorStoreOptionalParams,\n DeleteVectorStoreOptionalParams,\n CreateVectorStoreOptionalParams,\n CreateVectorStoreFileOptionalParams,\n ListVectorStoreFilesOptionalParams,\n GetVectorStoreFileOptionalParams,\n DeleteVectorStoreFileOptionalParams,\n CreateVectorStoreFileBatchOptionalParams,\n GetVectorStoreFileBatchOptionalParams,\n ListVectorStoreFileBatchFilesOptionalParams,\n CreateAgentOptionalParams,\n ListAgentsOptionalParams,\n GetAgentOptionalParams,\n UpdateAgentOptionalParams,\n DeleteFileOptionalParams,\n GetFileOptionalParams,\n GetFileContentOptionalParams,\n ListFilesOptionalParams,\n UploadFileOptionalParams,\n CancelVectorStoreFileBatchOptionalParams,\n DeleteAgentOptionalParams,\n ListAgentThreadOptionalParams,\n} from \"./customModels.js\";\nimport type { ThreadMessageOptions, ToolOutput } from \"../customization/models.js\";\nimport type { PollerLike, OperationState } from \"@azure/core-lro\";\n\n/**\n * Agents Interface Contains operations for creating, listing, updating, and deleting agents, threads, runs, messages, and files.\n */\nexport interface AgentsOperations {\n /** Creates a new agent. */\n createAgent: (model: string, options?: CreateAgentOptionalParams) => Promise<AgentOutput>;\n\n /** Gets a list of agents that were previously created. */\n listAgents: (options?: ListAgentsOptionalParams) => Promise<OpenAIPageableListOfAgentOutput>;\n /** Retrieves an existing agent. */\n getAgent: (assistantId: string, options?: GetAgentOptionalParams) => Promise<AgentOutput>;\n /** Modifies an existing agent. */\n updateAgent: (assistantId: string, options: UpdateAgentOptionalParams) => Promise<AgentOutput>;\n /** Deletes an agent. */\n deleteAgent: (\n assistantId: string,\n options?: DeleteAgentOptionalParams,\n ) => Promise<AgentDeletionStatusOutput>;\n\n /** Creates a new thread. Threads contain messages and can be run by agents. */\n createThread: (options?: CreateAgentThreadOptionalParams) => Promise<AgentThreadOutput>;\n /** Gets information about an existing thread. */\n getThread: (\n threadId: string,\n options?: GetAgentThreadOptionalParams,\n ) => Promise<AgentThreadOutput>;\n /** Modifies an existing thread. */\n updateThread: (\n threadId: string,\n options?: UpdateAgentThreadOptionalParams,\n ) => Promise<AgentThreadOutput>;\n /** Deletes an existing thread. */\n deleteThread: (\n threadId: string,\n options?: DeleteAgentThreadOptionalParams,\n ) => Promise<ThreadDeletionStatusOutput>;\n /** Gets a list of threads that were previously created. */\n listThreads: (\n options?: ListAgentThreadOptionalParams,\n ) => Promise<OpenAIPageableListOfAgentThreadOutput>;\n\n /** Creates and starts a new run of the specified thread using the specified agent. */\n createRun: (\n threadId: string,\n assistantId: string,\n options?: CreateRunOptionalParams,\n ) => AgentRunResponse;\n\n /** Gets a list of runs for a specified thread. */\n listRuns: (\n threadId: string,\n options?: ListRunQueryOptionalParams,\n ) => Promise<OpenAIPageableListOfThreadRunOutput>;\n /** Gets an existing run from an existing thread. */\n getRun: (\n threadId: string,\n runId: string,\n options?: GetRunOptionalParams,\n ) => Promise<ThreadRunOutput>;\n /** Modifies an existing thread run. */\n updateRun: (\n threadId: string,\n runId: string,\n options?: UpdateRunOptionalParams,\n ) => Promise<ThreadRunOutput>;\n /** 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'. */\n submitToolOutputsToRun: (\n threadId: string,\n runId: string,\n toolOutputs: Array<ToolOutput>,\n options?: SubmitToolOutputsToRunOptionalParams,\n ) => AgentRunResponse;\n\n /** Cancels a run of an in progress thread. */\n cancelRun: (\n threadId: string,\n runId: string,\n options?: CancelRunOptionalParams,\n ) => Promise<ThreadRunOutput>;\n /** Creates a new thread and immediately starts a run of that thread. */\n createThreadAndRun: (\n assistantId: string,\n options?: CreateAndRunThreadOptionalParams,\n ) => AgentRunResponse;\n\n /** Creates a new message on a specified thread. */\n createMessage: (\n threadId: string,\n messageOptions: ThreadMessageOptions,\n options?: CreateMessageOptionalParams,\n ) => Promise<ThreadMessageOutput>;\n /** Gets a list of messages that exist on a thread. */\n listMessages: (\n threadId: string,\n options?: ListMessagesOptionalParams,\n ) => Promise<OpenAIPageableListOfThreadMessageOutput>;\n /** Modifies an existing message on an existing thread. */\n updateMessage: (\n threadId: string,\n messageId: string,\n options?: UpdateMessageOptionalParams,\n ) => Promise<ThreadMessageOutput>;\n\n /** Gets a list of previously uploaded files. */\n listFiles: (options?: ListFilesOptionalParams) => Promise<FileListResponseOutput>;\n /** Uploads a file for use by other operations. */\n uploadFile: (\n data: ReadableStream | NodeJS.ReadableStream,\n purpose: FilePurpose,\n options?: UploadFileOptionalParams,\n ) => PollerLike<OperationState<OpenAIFileOutput>, OpenAIFileOutput>;\n\n /** Uploads a file for use by other operations. */\n uploadFileAndPoll: (\n data: ReadableStream | NodeJS.ReadableStream,\n purpose: FilePurpose,\n options?: UploadFileOptionalParams,\n ) => PollerLike<OperationState<OpenAIFileOutput>, OpenAIFileOutput>;\n /** Delete a previously uploaded file. */\n deleteFile: (\n fileId: string,\n options?: DeleteFileOptionalParams,\n ) => Promise<FileDeletionStatusOutput>;\n /** Returns information about a specific file. Does not retrieve file content. */\n getFile: (fileId: string, options?: GetFileOptionalParams) => Promise<OpenAIFileOutput>;\n /** Returns the content of a specific file. */\n getFileContent: (\n fileId: string,\n options?: GetFileContentOptionalParams,\n ) => StreamableMethod<string | Uint8Array>;\n\n /** Returns a list of vector stores. */\n listVectorStores: (\n options?: DeleteVectorStoreOptionalParams,\n ) => Promise<OpenAIPageableListOfVectorStoreOutput>;\n /** Creates a vector store. */\n createVectorStore: (\n options?: CreateVectorStoreOptionalParams,\n ) => PollerLike<OperationState<VectorStoreOutput>, VectorStoreOutput>;\n /** Returns the vector store object object matching the specific ID. */\n getVectorStore: (\n vectorStoreId: string,\n options?: DeleteVectorStoreOptionalParams,\n ) => Promise<VectorStoreOutput>;\n /** The ID of the vector store to modify. */\n modifyVectorStore: (\n vectorStoreId: string,\n options?: UpdateVectorStoreOptionalParams,\n ) => Promise<VectorStoreOutput>;\n /** Deletes the vector store object matching the specified ID. */\n deleteVectorStore: (\n vectorStoreId: string,\n options?: DeleteVectorStoreOptionalParams,\n ) => Promise<VectorStoreDeletionStatusOutput>;\n\n /** Create vector store and poll. */\n createVectorStoreAndPoll: (\n options?: CreateVectorStoreOptionalParams,\n ) => PollerLike<OperationState<VectorStoreOutput>, VectorStoreOutput>;\n\n /** Create a vector store file by attching a file to a vector store. */\n createVectorStoreFile: (\n vectorStoreId: string,\n options?: CreateVectorStoreFileOptionalParams,\n ) => PollerLike<OperationState<VectorStoreFileOutput>, VectorStoreFileOutput>;\n /** Retrieves a vector store file. */\n getVectorStoreFile: (\n vectorStoreId: string,\n fileId: string,\n options?: GetVectorStoreFileOptionalParams,\n ) => Promise<VectorStoreFileOutput>;\n /** Returns a list of vector store files. */\n listVectorStoreFiles: (\n vectorStoreId: string,\n options?: ListVectorStoreFilesOptionalParams,\n ) => Promise<OpenAIPageableListOfVectorStoreFileOutput>;\n /**\n * Delete a vector store file. This will remove the file from the vector store but the file itself will not be deleted.\n * To delete the file, use the delete file endpoint.\n */\n deleteVectorStoreFile: (\n vectorStoreId: string,\n fileId: string,\n options?: DeleteVectorStoreFileOptionalParams,\n ) => Promise<VectorStoreFileDeletionStatusOutput>;\n /** Create a vector store file by attaching a file to a vector store and poll. */\n createVectorStoreFileAndPoll: (\n vectorStoreId: string,\n options?: CreateVectorStoreFileOptionalParams,\n ) => PollerLike<OperationState<VectorStoreFileOutput>, VectorStoreFileOutput>;\n\n /** Create a vector store file batch. */\n createVectorStoreFileBatch: (\n vectorStoreId: string,\n options?: CreateVectorStoreFileBatchOptionalParams,\n ) => PollerLike<OperationState<VectorStoreFileBatchOutput>, VectorStoreFileBatchOutput>;\n /** Retrieve a vector store file batch. */\n getVectorStoreFileBatch: (\n vectorStoreId: string,\n batchId: string,\n options?: GetVectorStoreFileBatchOptionalParams,\n ) => Promise<VectorStoreFileBatchOutput>;\n /** Cancel a vector store file batch. This attempts to cancel the processing of files in this batch as soon as possible. */\n cancelVectorStoreFileBatch: (\n vectorStoreId: string,\n batchId: string,\n options?: CancelVectorStoreFileBatchOptionalParams,\n ) => Promise<VectorStoreFileBatchOutput>;\n /** Returns a list of vector store files in a batch. */\n listVectorStoreFileBatchFiles: (\n vectorStoreId: string,\n batchId: string,\n options?: ListVectorStoreFileBatchFilesOptionalParams,\n ) => Promise<OpenAIPageableListOfVectorStoreFileOutput>;\n /** Create a vector store file batch and poll. */\n createVectorStoreFileBatchAndPoll: (\n vectorStoreId: string,\n options?: CreateVectorStoreFileBatchOptionalParams,\n ) => PollerLike<OperationState<VectorStoreFileBatchOutput>, VectorStoreFileBatchOutput>;\n\n /** Gets a single run step from a thread run. */\n getRunStep: (\n threadId: string,\n runId: string,\n stepId: string,\n options?: GetRunStepOptionalParams,\n ) => Promise<RunStepOutput>;\n /** Gets a list of run steps from a thread run. */\n listRunSteps: (\n threadId: string,\n runId: string,\n options?: ListRunQueryOptionalParams,\n ) => Promise<OpenAIPageableListOfRunStepOutput>;\n}\n\nfunction getAgents(context: Client): AgentsOperations {\n return {\n createAgent: (model: string, options?: CreateAgentOptionalParams) =>\n createAgent(context, model, options),\n listAgents: (options?: ListAgentsOptionalParams) => listAgents(context, options),\n getAgent: (assistantId: string, options?: GetAgentOptionalParams) =>\n getAgent(context, assistantId, options),\n updateAgent: (assistantId: string, options: UpdateAgentOptionalParams) =>\n updateAgent(context, assistantId, options),\n deleteAgent: (assistantId: string, options?: DeleteAgentOptionalParams) =>\n deleteAgent(context, assistantId, options),\n\n createThread: (options?: CreateAgentThreadOptionalParams) => createThread(context, options),\n getThread: (threadId: string, options?: GetAgentThreadOptionalParams) =>\n getThread(context, threadId, options),\n updateThread: (threadId: string, options?: UpdateAgentThreadOptionalParams) =>\n updateThread(context, threadId, options),\n deleteThread: (threadId: string, options?: DeleteAgentThreadOptionalParams) =>\n deleteThread(context, threadId, options),\n listThreads: (options?: ListAgentThreadOptionalParams) => listThreads(context, options),\n\n createRun: (threadId: string, assistantId: string, options?: CreateRunOptionalParams) =>\n createRun(context, threadId, assistantId, options ?? {}),\n listRuns: (threadId: string, options?: ListRunQueryOptionalParams) =>\n listRuns(context, threadId, options ?? {}),\n getRun: (threadId: string, runId: string, options?: GetRunOptionalParams) =>\n getRun(context, threadId, runId, options),\n updateRun: (threadId: string, runId: string, options?: UpdateRunOptionalParams) =>\n updateRun(context, threadId, runId, options),\n submitToolOutputsToRun: (\n threadId: string,\n runId: string,\n toolOutputs: Array<ToolOutput>,\n options?: SubmitToolOutputsToRunOptionalParams,\n ) => submitToolOutputsToRun(context, threadId, runId, toolOutputs, options),\n cancelRun: (threadId: string, runId: string, options?: CancelRunOptionalParams) =>\n cancelRun(context, threadId, runId, options),\n createThreadAndRun: (assistantId: string, options?: CreateAndRunThreadOptionalParams) =>\n createThreadAndRun(context, assistantId, options ?? {}),\n\n createMessage: (\n threadId: string,\n messageOptions: ThreadMessageOptions,\n options?: CreateMessageOptionalParams,\n ) => createMessage(context, threadId, messageOptions, options),\n listMessages: (threadId: string, options?: ListMessagesOptionalParams) =>\n listMessages(context, threadId, options),\n updateMessage: (threadId: string, messageId: string, options?: UpdateMessageOptionalParams) =>\n updateMessage(context, threadId, messageId, options),\n\n listFiles: (options?: ListFilesOptionalParams) => listFiles(context, options),\n uploadFile: (\n content: ReadableStream | NodeJS.ReadableStream,\n purpose: FilePurpose,\n options?: UploadFileOptionalParams,\n ) => uploadFile(context, content, purpose, options),\n uploadFileAndPoll: (\n content: ReadableStream | NodeJS.ReadableStream,\n purpose: FilePurpose,\n options?: UploadFileOptionalParams,\n ) => uploadFileAndPoll(context, content, purpose, options),\n deleteFile: (fileId: string, options?: DeleteFileOptionalParams) =>\n deleteFile(context, fileId, options),\n getFile: (fileId: string, options?: GetFileOptionalParams) => getFile(context, fileId, options),\n getFileContent: (fileId: string, options?: GetFileContentOptionalParams) =>\n getFileContent(context, fileId, options),\n\n listVectorStores: (options?: ListVectorStoresOptionalParams) =>\n listVectorStores(context, options),\n createVectorStore: (options?: CreateVectorStoreOptionalParams) =>\n createVectorStore(context, options),\n getVectorStore: (vectorStoreId: string, options?: GetVectorStoreOptionalParams) =>\n getVectorStore(context, vectorStoreId, options),\n modifyVectorStore: (vectorStoreId: string, options?: UpdateVectorStoreOptionalParams) =>\n modifyVectorStore(context, vectorStoreId, options),\n deleteVectorStore: (vectorStoreId: string, options?: DeleteVectorStoreOptionalParams) =>\n deleteVectorStore(context, vectorStoreId, options),\n createVectorStoreAndPoll: (options?: CreateVectorStoreOptionalParams) =>\n createVectorStoreAndPoll(context, options),\n\n createVectorStoreFile: (vectorStoreId: string, options?: CreateVectorStoreFileOptionalParams) =>\n createVectorStoreFile(context, vectorStoreId, options),\n getVectorStoreFile: (\n vectorStoreId: string,\n fileId: string,\n options?: GetVectorStoreFileOptionalParams,\n ) => getVectorStoreFile(context, vectorStoreId, fileId, options),\n listVectorStoreFiles: (vectorStoreId: string, options?: ListVectorStoreFilesOptionalParams) =>\n listVectorStoreFiles(context, vectorStoreId, options),\n deleteVectorStoreFile: (\n vectorStoreId: string,\n fileId: string,\n options?: DeleteVectorStoreFileOptionalParams,\n ) => deleteVectorStoreFile(context, vectorStoreId, fileId, options),\n createVectorStoreFileAndPoll: (\n vectorStoreId: string,\n options?: CreateVectorStoreFileOptionalParams,\n ) => createVectorStoreFileAndPoll(context, vectorStoreId, options),\n\n createVectorStoreFileBatch: (\n vectorStoreId: string,\n options?: CreateVectorStoreFileBatchOptionalParams,\n ) => createVectorStoreFileBatch(context, vectorStoreId, options),\n getVectorStoreFileBatch: (\n vectorStoreId: string,\n batchId: string,\n options?: GetVectorStoreFileBatchOptionalParams,\n ) => getVectorStoreFileBatch(context, vectorStoreId, batchId, options),\n cancelVectorStoreFileBatch: (\n vectorStoreId: string,\n batchId: string,\n options?: CancelVectorStoreFileBatchOptionalParams,\n ) => cancelVectorStoreFileBatch(context, vectorStoreId, batchId, options),\n listVectorStoreFileBatchFiles: (\n vectorStoreId: string,\n batchId: string,\n options?: ListVectorStoreFileBatchFilesOptionalParams,\n ) => listVectorStoreFileBatchFiles(context, vectorStoreId, batchId, options),\n createVectorStoreFileBatchAndPoll: (\n vectorStoreId: string,\n options?: CreateVectorStoreFileBatchOptionalParams,\n ) => createVectorStoreFileBatchAndPoll(context, vectorStoreId, options),\n\n getRunStep: (\n threadId: string,\n runId: string,\n stepId: string,\n options?: GetRunStepOptionalParams,\n ) => getRunStep(context, threadId, runId, stepId, options),\n listRunSteps: (threadId: string, runId: string, options?: ListRunStepsOptionalParams) =>\n listRunSteps(context, threadId, runId, options),\n };\n}\n\nexport function getAgentsOperations(context: Client): AgentsOperations {\n return {\n ...getAgents(context),\n };\n}\n"]}
|
|
@@ -3,8 +3,8 @@ export * from "./streamingModels.js";
|
|
|
3
3
|
export * from "./vectorStoresModels.js";
|
|
4
4
|
export * from "./utils.js";
|
|
5
5
|
export * from "../customization/streamingModels.js";
|
|
6
|
-
export type { OpenAIPageableListOfThreadRunOutput, ThreadRunOutput, AgentThreadOutput, RunStepOutput, OpenAIPageableListOfRunStepOutput, ThreadMessageOutput, ThreadDeletionStatusOutput, OpenAIPageableListOfThreadMessageOutput, OpenAIPageableListOfVectorStoreOutput, VectorStoreOutput, VectorStoreFileOutput, VectorStoreDeletionStatusOutput, VectorStoreFileDeletionStatusOutput, VectorStoreFileBatchOutput, OpenAIPageableListOfVectorStoreFileOutput, AgentDeletionStatusOutput, AgentOutput, OpenAIPageableListOfAgentOutput, FileDeletionStatusOutput, FileListResponseOutput, OpenAIFileOutput, RequiredActionOutput, RequiredToolCallOutput, ToolDefinitionOutputParent, AgentsApiResponseFormatOptionOutput, ToolDefinitionOutput, ToolResourcesOutput, AgentsApiResponseFormatModeOutput, AgentsApiResponseFormatOutput, FilePurposeOutput, FileStateOutput, RequiredActionOutputParent, SubmitToolOutputsActionOutput, RequiredToolCallOutputParent, RequiredFunctionToolCallOutput, RunStepErrorOutput, RunStepStatusOutput, RunStepDetailsOutput, RunStepTypeOutput, RunStepCompletionUsageOutput, MessageAttachmentOutput, MessageContentOutput, MessageIncompleteDetailsOutput, MessageRoleOutput, MessageStatusOutput, IncompleteRunDetailsOutput, RunErrorOutput, RunStatusOutput, AgentsApiToolChoiceOptionOutput, UpdateToolResourcesOptionsOutput, TruncationObjectOutput, RunCompletionUsageOutput, CodeInterpreterToolDefinitionOutput, FileSearchToolDefinitionOutput, FunctionToolDefinitionOutput, BingGroundingToolDefinitionOutput, BingCustomSearchToolDefinitionOutput, SearchConfigurationListOutput, SearchConfigurationOutput, AzureAISearchToolDefinitionOutput, AzureAISearchResourceOutput, CodeInterpreterToolResourceOutput, FileSearchToolResourceOutput, VectorStoreFileCountOutput, VectorStoreFileBatchStatusOutput, VectorStoreChunkingStrategyResponseOutput, VectorStoreConfigurationOutput, AgentsNamedToolChoiceOutput, IndexResourceOutput, ToolConnectionListOutput, VectorStoreDataSourceOutput, FileSearchToolDefinitionDetailsOutput, VectorStoreConfigurationsOutput, FunctionDefinitionOutput, MessageAttachmentToolDefinitionOutput, MessageContentOutputParent, MessageTextContentOutput, MessageImageFileContentOutput, RequiredFunctionToolCallDetailsOutput, RunStepDetailsOutputParent, RunStepMessageCreationDetailsOutput, RunStepToolCallDetailsOutput, RunStepErrorCodeOutput, SubmitToolOutputsDetailsOutput, MicrosoftFabricToolDefinitionOutput, SharepointToolDefinitionOutput, UpdateCodeInterpreterToolResourceOptionsOutput, UpdateFileSearchToolResourceOptionsOutput, VectorStoreChunkingStrategyResponseOutputParent, VectorStoreAutoChunkingStrategyResponseOutput, VectorStoreStaticChunkingStrategyResponseOutput, VectorStoreFileErrorOutput, VectorStoreFileStatusOutput, VectorStoreExpirationPolicyOutput, VectorStoreStatusOutput, AgentsApiToolChoiceOptionModeOutput, FunctionNameOutput, AgentsNamedToolChoiceTypeOutput, MessageImageFileDetailsOutput, MessageIncompleteDetailsReasonOutput, MessageTextDetailsOutput, RunStepMessageCreationReferenceOutput, RunStepToolCallOutput, ToolConnectionOutput, TruncationStrategyOutput, VectorStoreChunkingStrategyResponseTypeOutput, VectorStoreDataSourceAssetTypeOutput, VectorStoreExpirationPolicyAnchorOutput, VectorStoreFileErrorCodeOutput, VectorStoreStaticChunkingStrategyOptionsOutput, FileSearchRankingOptionsOutput, MessageTextAnnotationOutput, RunStepToolCallOutputParent, RunStepCodeInterpreterToolCallOutput, RunStepFileSearchToolCallOutput, RunStepBingGroundingToolCallOutput, RunStepAzureAISearchToolCallOutput, RunStepSharepointToolCallOutput, RunStepMicrosoftFabricToolCallOutput, RunStepFunctionToolCallOutput, MessageTextAnnotationOutputParent, MessageTextFileCitationAnnotationOutput, MessageTextFilePathAnnotationOutput, RunStepCodeInterpreterToolCallOutputOutputParent, RunStepCodeInterpreterToolCallDetailsOutput, RunStepFunctionToolCallDetailsOutput, MessageTextFileCitationDetailsOutput, MessageTextFilePathDetailsOutput, RunStepCodeInterpreterToolCallOutputOutput, RunStepCodeInterpreterLogOutputOutput, RunStepCodeInterpreterImageOutputOutput, RunStepCodeInterpreterImageReferenceOutput, ResponseFormatOutput, ResponseFormatJsonSchemaTypeOutput, IncompleteDetailsReasonOutput, RunStepFileSearchToolCallResultsOutput, ResponseFormatJsonSchemaOutput, RunStepFileSearchToolCallResultOutput, FileSearchToolCallContentOutput, AzureFunctionToolDefinitionOutput, AzureFunctionDefinitionOutput, AzureFunctionBindingOutput, OpenApiToolDefinitionOutput, OpenApiFunctionDefinitionOutput, OpenApiAuthDetailsOutput, OpenApiAuthTypeOutput, OpenApiAuthDetailsOutputParent, OpenApiAnonymousAuthDetailsOutput, OpenApiConnectionAuthDetailsOutput, OpenApiManagedAuthDetailsOutput, AzureFunctionStorageQueueOutput, OpenApiConnectionSecuritySchemeOutput, OpenApiManagedSecuritySchemeOutput, } from "../customization/outputModels.js";
|
|
7
|
-
export { ListMessagesQueryParamProperties, ListFilesQueryParamProperties, } from "../customization/parameters.js";
|
|
8
|
-
export type { AgentRunResponse, CreateRunOptionalParams, GetRunOptionalParams, CancelRunOptionalParams, SubmitToolOutputsToRunOptionalParams, UpdateRunOptionalParams, ListRunQueryOptionalParams, CreateAndRunThreadOptionalParams, CreateAgentThreadOptionalParams, GetAgentThreadOptionalParams, UpdateAgentThreadOptionalParams, DeleteAgentThreadOptionalParams, GetRunStepOptionalParams, ListRunStepsOptionalParams, CreateMessageOptionalParams, ListMessagesOptionalParams, UpdateMessageOptionalParams, GetVectorStoreOptionalParams, ListVectorStoresOptionalParams, UpdateVectorStoreOptionalParams, DeleteVectorStoreOptionalParams, CreateVectorStoreOptionalParams, CreateVectorStoreFileOptionalParams, ListVectorStoreFilesOptionalParams, GetVectorStoreFileOptionalParams, DeleteVectorStoreFileOptionalParams, CreateVectorStoreFileBatchOptionalParams, GetVectorStoreFileBatchOptionalParams, ListVectorStoreFileBatchFilesOptionalParams, CreateAgentOptionalParams, ListAgentsOptionalParams, GetAgentOptionalParams, UpdateAgentOptionalParams, DeleteFileOptionalParams, GetFileOptionalParams, GetFileContentOptionalParams, ListFilesOptionalParams, UploadFileOptionalParams, ListQueryParameters, PollingOptions, PollingOptionsParams, CancelVectorStoreFileBatchOptionalParams, DeleteAgentOptionalParams, } from "./customModels.js";
|
|
9
|
-
export { AzureAISearchToolDefinition, CodeInterpreterToolDefinition, FileSearchToolDefinition, FileSearchToolDefinitionDetails, FunctionDefinition, FunctionToolDefinition, ToolResources, VectorStoreConfigurations, VectorStoreDataSource, ToolDefinition, ThreadMessageOptions, ToolOutput, FilePurpose, ToolDefinitionParent, AgentThreadCreationOptions, CreateAgentOptions, CreateAndRunThreadOptions, CreateRunOptions, UpdateAgentOptions, UpdateAgentThreadOptions, VectorStoreFileStatusFilter, VectorStoreOptions, VectorStoreUpdateOptions, AgentsApiResponseFormatMode, AgentsApiToolChoiceOption, TruncationObject, UpdateToolResourcesOptions, VectorStoreChunkingStrategyRequest, FileSearchRankingOptions, AgentsApiToolChoiceOptionMode, AgentsNamedToolChoice, AgentsApiResponseFormatOption, ConnectionType, ListSortOrder, MessageAttachment, BingGroundingToolDefinition, MicrosoftFabricToolDefinition, SharepointToolDefinition, AzureAISearchResource, CodeInterpreterToolResource, FileSearchToolResource, TruncationStrategy, UpdateCodeInterpreterToolResourceOptions, UpdateFileSearchToolResourceOptions, VectorStoreChunkingStrategyRequestParent, VectorStoreAutoChunkingStrategyRequest, VectorStoreStaticChunkingStrategyRequest, VectorStoreConfiguration, VectorStoreDataSourceAssetType, AgentsApiResponseFormat, FunctionName, AgentsNamedToolChoiceType, IndexResource, ToolConnectionList, MessageAttachmentToolDefinition, MessageRole, VectorStoreChunkingStrategyRequestType, VectorStoreExpirationPolicy, VectorStoreStaticChunkingStrategyOptions, ToolConnection, VectorStoreExpirationPolicyAnchor, ResponseFormat, ResponseFormatJsonSchemaType, OpenApiToolDefinition, AzureFunctionToolDefinition, OpenApiFunctionDefinition, ResponseFormatJsonSchema, AzureFunctionDefinition, AzureFunctionBinding, OpenApiAuthDetails, AzureFunctionStorageQueue, OpenApiAuthType, OpenApiAuthDetailsParent, OpenApiAnonymousAuthDetails, OpenApiConnectionAuthDetails, OpenApiManagedAuthDetails, OpenApiConnectionSecurityScheme, OpenApiManagedSecurityScheme, } from "../customization/models.js";
|
|
6
|
+
export type { OpenAIPageableListOfThreadRunOutput, ThreadRunOutput, AgentThreadOutput, RunStepOutput, OpenAIPageableListOfRunStepOutput, ThreadMessageOutput, ThreadDeletionStatusOutput, OpenAIPageableListOfThreadMessageOutput, OpenAIPageableListOfVectorStoreOutput, VectorStoreOutput, VectorStoreFileOutput, VectorStoreDeletionStatusOutput, VectorStoreFileDeletionStatusOutput, VectorStoreFileBatchOutput, OpenAIPageableListOfVectorStoreFileOutput, AgentDeletionStatusOutput, AgentOutput, OpenAIPageableListOfAgentOutput, FileDeletionStatusOutput, FileListResponseOutput, OpenAIFileOutput, RequiredActionOutput, RequiredToolCallOutput, ToolDefinitionOutputParent, AgentsApiResponseFormatOptionOutput, ToolDefinitionOutput, ToolResourcesOutput, AgentsApiResponseFormatModeOutput, AgentsApiResponseFormatOutput, FilePurposeOutput, FileStateOutput, RequiredActionOutputParent, SubmitToolOutputsActionOutput, RequiredToolCallOutputParent, RequiredFunctionToolCallOutput, RunStepErrorOutput, RunStepStatusOutput, RunStepDetailsOutput, RunStepTypeOutput, RunStepCompletionUsageOutput, MessageAttachmentOutput, MessageContentOutput, MessageIncompleteDetailsOutput, MessageRoleOutput, MessageStatusOutput, IncompleteRunDetailsOutput, RunErrorOutput, RunStatusOutput, AgentsApiToolChoiceOptionOutput, UpdateToolResourcesOptionsOutput, TruncationObjectOutput, RunCompletionUsageOutput, CodeInterpreterToolDefinitionOutput, FileSearchToolDefinitionOutput, FunctionToolDefinitionOutput, BingGroundingToolDefinitionOutput, BingCustomSearchToolDefinitionOutput, SearchConfigurationListOutput, SearchConfigurationOutput, AzureAISearchToolDefinitionOutput, AzureAISearchResourceOutput, CodeInterpreterToolResourceOutput, FileSearchToolResourceOutput, VectorStoreFileCountOutput, VectorStoreFileBatchStatusOutput, VectorStoreChunkingStrategyResponseOutput, VectorStoreConfigurationOutput, AgentsNamedToolChoiceOutput, IndexResourceOutput, ToolConnectionListOutput, VectorStoreDataSourceOutput, FileSearchToolDefinitionDetailsOutput, VectorStoreConfigurationsOutput, FunctionDefinitionOutput, MessageAttachmentToolDefinitionOutput, MessageContentOutputParent, MessageTextContentOutput, MessageImageFileContentOutput, RequiredFunctionToolCallDetailsOutput, RunStepDetailsOutputParent, RunStepMessageCreationDetailsOutput, RunStepToolCallDetailsOutput, RunStepErrorCodeOutput, SubmitToolOutputsDetailsOutput, MicrosoftFabricToolDefinitionOutput, SharepointToolDefinitionOutput, UpdateCodeInterpreterToolResourceOptionsOutput, UpdateFileSearchToolResourceOptionsOutput, VectorStoreChunkingStrategyResponseOutputParent, VectorStoreAutoChunkingStrategyResponseOutput, VectorStoreStaticChunkingStrategyResponseOutput, VectorStoreFileErrorOutput, VectorStoreFileStatusOutput, VectorStoreExpirationPolicyOutput, VectorStoreStatusOutput, AgentsApiToolChoiceOptionModeOutput, FunctionNameOutput, AgentsNamedToolChoiceTypeOutput, MessageImageFileDetailsOutput, MessageIncompleteDetailsReasonOutput, MessageTextDetailsOutput, RunStepMessageCreationReferenceOutput, RunStepToolCallOutput, ToolConnectionOutput, TruncationStrategyOutput, VectorStoreChunkingStrategyResponseTypeOutput, VectorStoreDataSourceAssetTypeOutput, VectorStoreExpirationPolicyAnchorOutput, VectorStoreFileErrorCodeOutput, VectorStoreStaticChunkingStrategyOptionsOutput, FileSearchRankingOptionsOutput, MessageTextAnnotationOutput, RunStepToolCallOutputParent, RunStepCodeInterpreterToolCallOutput, RunStepFileSearchToolCallOutput, RunStepBingGroundingToolCallOutput, RunStepAzureAISearchToolCallOutput, RunStepSharepointToolCallOutput, RunStepMicrosoftFabricToolCallOutput, RunStepFunctionToolCallOutput, MessageTextAnnotationOutputParent, MessageTextFileCitationAnnotationOutput, MessageTextFilePathAnnotationOutput, RunStepCodeInterpreterToolCallOutputOutputParent, RunStepCodeInterpreterToolCallDetailsOutput, RunStepFunctionToolCallDetailsOutput, MessageTextFileCitationDetailsOutput, MessageTextFilePathDetailsOutput, RunStepCodeInterpreterToolCallOutputOutput, RunStepCodeInterpreterLogOutputOutput, RunStepCodeInterpreterImageOutputOutput, RunStepCodeInterpreterImageReferenceOutput, ResponseFormatOutput, ResponseFormatJsonSchemaTypeOutput, IncompleteDetailsReasonOutput, RunStepFileSearchToolCallResultsOutput, ResponseFormatJsonSchemaOutput, RunStepFileSearchToolCallResultOutput, FileSearchToolCallContentOutput, AzureFunctionToolDefinitionOutput, AzureFunctionDefinitionOutput, AzureFunctionBindingOutput, OpenApiToolDefinitionOutput, OpenApiFunctionDefinitionOutput, OpenApiAuthDetailsOutput, OpenApiAuthTypeOutput, OpenApiAuthDetailsOutputParent, OpenApiAnonymousAuthDetailsOutput, OpenApiConnectionAuthDetailsOutput, OpenApiManagedAuthDetailsOutput, AzureFunctionStorageQueueOutput, OpenApiConnectionSecuritySchemeOutput, OpenApiManagedSecuritySchemeOutput, OpenAIPageableListOfAgentThreadOutput, } from "../customization/outputModels.js";
|
|
7
|
+
export { ListMessagesQueryParamProperties, ListFilesQueryParamProperties, ListThreadsQueryParamProperties, } from "../customization/parameters.js";
|
|
8
|
+
export type { AgentRunResponse, CreateRunOptionalParams, GetRunOptionalParams, CancelRunOptionalParams, SubmitToolOutputsToRunOptionalParams, UpdateRunOptionalParams, ListRunQueryOptionalParams, CreateAndRunThreadOptionalParams, CreateAgentThreadOptionalParams, GetAgentThreadOptionalParams, UpdateAgentThreadOptionalParams, DeleteAgentThreadOptionalParams, GetRunStepOptionalParams, ListRunStepsOptionalParams, CreateMessageOptionalParams, ListMessagesOptionalParams, UpdateMessageOptionalParams, GetVectorStoreOptionalParams, ListVectorStoresOptionalParams, UpdateVectorStoreOptionalParams, DeleteVectorStoreOptionalParams, CreateVectorStoreOptionalParams, CreateVectorStoreFileOptionalParams, ListVectorStoreFilesOptionalParams, GetVectorStoreFileOptionalParams, DeleteVectorStoreFileOptionalParams, CreateVectorStoreFileBatchOptionalParams, GetVectorStoreFileBatchOptionalParams, ListVectorStoreFileBatchFilesOptionalParams, CreateAgentOptionalParams, ListAgentsOptionalParams, GetAgentOptionalParams, UpdateAgentOptionalParams, DeleteFileOptionalParams, GetFileOptionalParams, GetFileContentOptionalParams, ListFilesOptionalParams, UploadFileOptionalParams, ListQueryParameters, PollingOptions, PollingOptionsParams, CancelVectorStoreFileBatchOptionalParams, DeleteAgentOptionalParams, ListAgentThreadOptionalParams, } from "./customModels.js";
|
|
9
|
+
export { AzureAISearchToolDefinition, CodeInterpreterToolDefinition, FileSearchToolDefinition, FileSearchToolDefinitionDetails, FunctionDefinition, FunctionToolDefinition, ToolResources, VectorStoreConfigurations, VectorStoreDataSource, ToolDefinition, ThreadMessageOptions, ToolOutput, FilePurpose, ToolDefinitionParent, AgentThreadCreationOptions, CreateAgentOptions, CreateAndRunThreadOptions, CreateRunOptions, UpdateAgentOptions, UpdateAgentThreadOptions, VectorStoreFileStatusFilter, VectorStoreOptions, VectorStoreUpdateOptions, AgentsApiResponseFormatMode, AgentsApiToolChoiceOption, TruncationObject, UpdateToolResourcesOptions, VectorStoreChunkingStrategyRequest, FileSearchRankingOptions, AgentsApiToolChoiceOptionMode, AgentsNamedToolChoice, AgentsApiResponseFormatOption, ConnectionType, ListSortOrder, MessageAttachment, BingGroundingToolDefinition, MicrosoftFabricToolDefinition, SharepointToolDefinition, AzureAISearchResource, CodeInterpreterToolResource, FileSearchToolResource, TruncationStrategy, UpdateCodeInterpreterToolResourceOptions, UpdateFileSearchToolResourceOptions, VectorStoreChunkingStrategyRequestParent, VectorStoreAutoChunkingStrategyRequest, VectorStoreStaticChunkingStrategyRequest, VectorStoreConfiguration, VectorStoreDataSourceAssetType, AgentsApiResponseFormat, FunctionName, AgentsNamedToolChoiceType, IndexResource, ToolConnectionList, MessageAttachmentToolDefinition, MessageRole, VectorStoreChunkingStrategyRequestType, VectorStoreExpirationPolicy, VectorStoreStaticChunkingStrategyOptions, ToolConnection, VectorStoreExpirationPolicyAnchor, ResponseFormat, ResponseFormatJsonSchemaType, OpenApiToolDefinition, AzureFunctionToolDefinition, OpenApiFunctionDefinition, ResponseFormatJsonSchema, AzureFunctionDefinition, AzureFunctionBinding, OpenApiAuthDetails, AzureFunctionStorageQueue, OpenApiAuthType, OpenApiAuthDetailsParent, OpenApiAnonymousAuthDetails, OpenApiConnectionAuthDetails, OpenApiManagedAuthDetails, OpenApiConnectionSecurityScheme, OpenApiManagedSecurityScheme, CreateMessageContent, MessageContentBlockInput, MessageContentBlockInputParent, MessageTextBlockInput, MessageImageFileBlockInput, MessageImageUrlBlockInput, MessageBlockType, MessageImageFileParam, MessageImageUrlParam, ImageDetailLevel, AzureFunctionToolResource, } from "../customization/models.js";
|
|
10
10
|
//# sourceMappingURL=inputOutputs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inputOutputs.d.ts","sourceRoot":"","sources":["../../../src/agents/inputOutputs.ts"],"names":[],"mappings":"AAGA,cAAc,qCAAqC,CAAC;AACpD,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,YAAY,CAAC;AAC3B,cAAc,qCAAqC,CAAC;AACpD,YAAY,EACV,mCAAmC,EACnC,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,iCAAiC,EACjC,mBAAmB,EACnB,0BAA0B,EAC1B,uCAAuC,EACvC,qCAAqC,EACrC,iBAAiB,EACjB,qBAAqB,EACrB,+BAA+B,EAC/B,mCAAmC,EACnC,0BAA0B,EAC1B,yCAAyC,EACzC,yBAAyB,EACzB,WAAW,EACX,+BAA+B,EAC/B,wBAAwB,EACxB,sBAAsB,EACtB,gBAAgB,EAChB,oBAAoB,EACpB,sB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C,EAC7C,oCAAoC,EACpC,uCAAuC,EACvC,8BAA8B,EAC9B,8CAA8C,EAC9C,8BAA8B,EAC9B,2BAA2B,EAC3B,2BAA2B,EAC3B,oCAAoC,EACpC,+BAA+B,EAC/B,kCAAkC,EAClC,kCAAkC,EAClC,+BAA+B,EAC/B,oCAAoC,EACpC,6BAA6B,EAC7B,iCAAiC,EACjC,uCAAuC,EACvC,mCAAmC,EACnC,gDAAgD,EAChD,2CAA2C,EAC3C,oCAAoC,EACpC,oCAAoC,EACpC,gCAAgC,EAChC,0CAA0C,EAC1C,qCAAqC,EACrC,uCAAuC,EACvC,0CAA0C,EAC1C,oBAAoB,EACpB,kCAAkC,EAClC,6BAA6B,EAC7B,sCAAsC,EACtC,8BAA8B,EAC9B,qCAAqC,EACrC,+BAA+B,EAC/B,iCAAiC,EACjC,6BAA6B,EAC7B,0BAA0B,EAC1B,2BAA2B,EAC3B,+BAA+B,EAC/B,wBAAwB,EACxB,qBAAqB,EACrB,8BAA8B,EAC9B,iCAAiC,EACjC,kCAAkC,EAClC,+BAA+B,EAC/B,+BAA+B,EAC/B,qCAAqC,EACrC,kCAAkC,
|
|
1
|
+
{"version":3,"file":"inputOutputs.d.ts","sourceRoot":"","sources":["../../../src/agents/inputOutputs.ts"],"names":[],"mappings":"AAGA,cAAc,qCAAqC,CAAC;AACpD,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,YAAY,CAAC;AAC3B,cAAc,qCAAqC,CAAC;AACpD,YAAY,EACV,mCAAmC,EACnC,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,iCAAiC,EACjC,mBAAmB,EACnB,0BAA0B,EAC1B,uCAAuC,EACvC,qCAAqC,EACrC,iBAAiB,EACjB,qBAAqB,EACrB,+BAA+B,EAC/B,mCAAmC,EACnC,0BAA0B,EAC1B,yCAAyC,EACzC,yBAAyB,EACzB,WAAW,EACX,+BAA+B,EAC/B,wBAAwB,EACxB,sBAAsB,EACtB,gB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B,EACrB,2BAA2B,EAC3B,yBAAyB,EACzB,wBAAwB,EACxB,uBAAuB,EACvB,oBAAoB,EACpB,kBAAkB,EAClB,yBAAyB,EACzB,eAAe,EACf,wBAAwB,EACxB,2BAA2B,EAC3B,4BAA4B,EAC5B,yBAAyB,EACzB,+BAA+B,EAC/B,4BAA4B,EAC5B,oBAAoB,EACpB,wBAAwB,EACxB,8BAA8B,EAC9B,qBAAqB,EACrB,0BAA0B,EAC1B,yBAAyB,EACzB,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,yBAAyB,GAC1B,MAAM,4BAA4B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inputOutputs.js","sourceRoot":"","sources":["../../../src/agents/inputOutputs.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,8EAAoD;AACpD,+DAAqC;AACrC,kEAAwC;AACxC,qDAA2B;AAC3B,8EAAoD","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport * from \"../customization/streamingModels.js\";\nexport * from \"./streamingModels.js\";\nexport * from \"./vectorStoresModels.js\";\nexport * from \"./utils.js\";\nexport * from \"../customization/streamingModels.js\";\nexport type {\n OpenAIPageableListOfThreadRunOutput,\n ThreadRunOutput,\n AgentThreadOutput,\n RunStepOutput,\n OpenAIPageableListOfRunStepOutput,\n ThreadMessageOutput,\n ThreadDeletionStatusOutput,\n OpenAIPageableListOfThreadMessageOutput,\n OpenAIPageableListOfVectorStoreOutput,\n VectorStoreOutput,\n VectorStoreFileOutput,\n VectorStoreDeletionStatusOutput,\n VectorStoreFileDeletionStatusOutput,\n VectorStoreFileBatchOutput,\n OpenAIPageableListOfVectorStoreFileOutput,\n AgentDeletionStatusOutput,\n AgentOutput,\n OpenAIPageableListOfAgentOutput,\n FileDeletionStatusOutput,\n FileListResponseOutput,\n OpenAIFileOutput,\n RequiredActionOutput,\n RequiredToolCallOutput,\n ToolDefinitionOutputParent,\n AgentsApiResponseFormatOptionOutput,\n ToolDefinitionOutput,\n ToolResourcesOutput,\n AgentsApiResponseFormatModeOutput,\n AgentsApiResponseFormatOutput,\n FilePurposeOutput,\n FileStateOutput,\n RequiredActionOutputParent,\n SubmitToolOutputsActionOutput,\n RequiredToolCallOutputParent,\n RequiredFunctionToolCallOutput,\n RunStepErrorOutput,\n RunStepStatusOutput,\n RunStepDetailsOutput,\n RunStepTypeOutput,\n RunStepCompletionUsageOutput,\n MessageAttachmentOutput,\n MessageContentOutput,\n MessageIncompleteDetailsOutput,\n MessageRoleOutput,\n MessageStatusOutput,\n IncompleteRunDetailsOutput,\n RunErrorOutput,\n RunStatusOutput,\n AgentsApiToolChoiceOptionOutput,\n UpdateToolResourcesOptionsOutput,\n TruncationObjectOutput,\n RunCompletionUsageOutput,\n CodeInterpreterToolDefinitionOutput,\n FileSearchToolDefinitionOutput,\n FunctionToolDefinitionOutput,\n BingGroundingToolDefinitionOutput,\n BingCustomSearchToolDefinitionOutput,\n SearchConfigurationListOutput,\n SearchConfigurationOutput,\n AzureAISearchToolDefinitionOutput,\n AzureAISearchResourceOutput,\n CodeInterpreterToolResourceOutput,\n FileSearchToolResourceOutput,\n VectorStoreFileCountOutput,\n VectorStoreFileBatchStatusOutput,\n VectorStoreChunkingStrategyResponseOutput,\n VectorStoreConfigurationOutput,\n AgentsNamedToolChoiceOutput,\n IndexResourceOutput,\n ToolConnectionListOutput,\n VectorStoreDataSourceOutput,\n FileSearchToolDefinitionDetailsOutput,\n VectorStoreConfigurationsOutput,\n FunctionDefinitionOutput,\n MessageAttachmentToolDefinitionOutput,\n MessageContentOutputParent,\n MessageTextContentOutput,\n MessageImageFileContentOutput,\n RequiredFunctionToolCallDetailsOutput,\n RunStepDetailsOutputParent,\n RunStepMessageCreationDetailsOutput,\n RunStepToolCallDetailsOutput,\n RunStepErrorCodeOutput,\n SubmitToolOutputsDetailsOutput,\n MicrosoftFabricToolDefinitionOutput,\n SharepointToolDefinitionOutput,\n UpdateCodeInterpreterToolResourceOptionsOutput,\n UpdateFileSearchToolResourceOptionsOutput,\n VectorStoreChunkingStrategyResponseOutputParent,\n VectorStoreAutoChunkingStrategyResponseOutput,\n VectorStoreStaticChunkingStrategyResponseOutput,\n VectorStoreFileErrorOutput,\n VectorStoreFileStatusOutput,\n VectorStoreExpirationPolicyOutput,\n VectorStoreStatusOutput,\n AgentsApiToolChoiceOptionModeOutput,\n FunctionNameOutput,\n AgentsNamedToolChoiceTypeOutput,\n MessageImageFileDetailsOutput,\n MessageIncompleteDetailsReasonOutput,\n MessageTextDetailsOutput,\n RunStepMessageCreationReferenceOutput,\n RunStepToolCallOutput,\n ToolConnectionOutput,\n TruncationStrategyOutput,\n VectorStoreChunkingStrategyResponseTypeOutput,\n VectorStoreDataSourceAssetTypeOutput,\n VectorStoreExpirationPolicyAnchorOutput,\n VectorStoreFileErrorCodeOutput,\n VectorStoreStaticChunkingStrategyOptionsOutput,\n FileSearchRankingOptionsOutput,\n MessageTextAnnotationOutput,\n RunStepToolCallOutputParent,\n RunStepCodeInterpreterToolCallOutput,\n RunStepFileSearchToolCallOutput,\n RunStepBingGroundingToolCallOutput,\n RunStepAzureAISearchToolCallOutput,\n RunStepSharepointToolCallOutput,\n RunStepMicrosoftFabricToolCallOutput,\n RunStepFunctionToolCallOutput,\n MessageTextAnnotationOutputParent,\n MessageTextFileCitationAnnotationOutput,\n MessageTextFilePathAnnotationOutput,\n RunStepCodeInterpreterToolCallOutputOutputParent,\n RunStepCodeInterpreterToolCallDetailsOutput,\n RunStepFunctionToolCallDetailsOutput,\n MessageTextFileCitationDetailsOutput,\n MessageTextFilePathDetailsOutput,\n RunStepCodeInterpreterToolCallOutputOutput,\n RunStepCodeInterpreterLogOutputOutput,\n RunStepCodeInterpreterImageOutputOutput,\n RunStepCodeInterpreterImageReferenceOutput,\n ResponseFormatOutput,\n ResponseFormatJsonSchemaTypeOutput,\n IncompleteDetailsReasonOutput,\n RunStepFileSearchToolCallResultsOutput,\n ResponseFormatJsonSchemaOutput,\n RunStepFileSearchToolCallResultOutput,\n FileSearchToolCallContentOutput,\n AzureFunctionToolDefinitionOutput,\n AzureFunctionDefinitionOutput,\n AzureFunctionBindingOutput,\n OpenApiToolDefinitionOutput,\n OpenApiFunctionDefinitionOutput,\n OpenApiAuthDetailsOutput,\n OpenApiAuthTypeOutput,\n OpenApiAuthDetailsOutputParent,\n OpenApiAnonymousAuthDetailsOutput,\n OpenApiConnectionAuthDetailsOutput,\n OpenApiManagedAuthDetailsOutput,\n AzureFunctionStorageQueueOutput,\n OpenApiConnectionSecuritySchemeOutput,\n OpenApiManagedSecuritySchemeOutput,\n} from \"../customization/outputModels.js\";\nexport {\n ListMessagesQueryParamProperties,\n ListFilesQueryParamProperties,\n} from \"../customization/parameters.js\";\nexport type {\n AgentRunResponse,\n CreateRunOptionalParams,\n GetRunOptionalParams,\n CancelRunOptionalParams,\n SubmitToolOutputsToRunOptionalParams,\n UpdateRunOptionalParams,\n ListRunQueryOptionalParams,\n CreateAndRunThreadOptionalParams,\n CreateAgentThreadOptionalParams,\n GetAgentThreadOptionalParams,\n UpdateAgentThreadOptionalParams,\n DeleteAgentThreadOptionalParams,\n GetRunStepOptionalParams,\n ListRunStepsOptionalParams,\n CreateMessageOptionalParams,\n ListMessagesOptionalParams,\n UpdateMessageOptionalParams,\n GetVectorStoreOptionalParams,\n ListVectorStoresOptionalParams,\n UpdateVectorStoreOptionalParams,\n DeleteVectorStoreOptionalParams,\n CreateVectorStoreOptionalParams,\n CreateVectorStoreFileOptionalParams,\n ListVectorStoreFilesOptionalParams,\n GetVectorStoreFileOptionalParams,\n DeleteVectorStoreFileOptionalParams,\n CreateVectorStoreFileBatchOptionalParams,\n GetVectorStoreFileBatchOptionalParams,\n ListVectorStoreFileBatchFilesOptionalParams,\n CreateAgentOptionalParams,\n ListAgentsOptionalParams,\n GetAgentOptionalParams,\n UpdateAgentOptionalParams,\n DeleteFileOptionalParams,\n GetFileOptionalParams,\n GetFileContentOptionalParams,\n ListFilesOptionalParams,\n UploadFileOptionalParams,\n ListQueryParameters,\n PollingOptions,\n PollingOptionsParams,\n CancelVectorStoreFileBatchOptionalParams,\n DeleteAgentOptionalParams,\n} from \"./customModels.js\";\n\nexport {\n AzureAISearchToolDefinition,\n CodeInterpreterToolDefinition,\n FileSearchToolDefinition,\n FileSearchToolDefinitionDetails,\n FunctionDefinition,\n FunctionToolDefinition,\n ToolResources,\n VectorStoreConfigurations,\n VectorStoreDataSource,\n ToolDefinition,\n ThreadMessageOptions,\n ToolOutput,\n FilePurpose,\n ToolDefinitionParent,\n AgentThreadCreationOptions,\n CreateAgentOptions,\n CreateAndRunThreadOptions,\n CreateRunOptions,\n UpdateAgentOptions,\n UpdateAgentThreadOptions,\n VectorStoreFileStatusFilter,\n VectorStoreOptions,\n VectorStoreUpdateOptions,\n AgentsApiResponseFormatMode,\n AgentsApiToolChoiceOption,\n TruncationObject,\n UpdateToolResourcesOptions,\n VectorStoreChunkingStrategyRequest,\n FileSearchRankingOptions,\n AgentsApiToolChoiceOptionMode,\n AgentsNamedToolChoice,\n AgentsApiResponseFormatOption,\n ConnectionType,\n ListSortOrder,\n MessageAttachment,\n BingGroundingToolDefinition,\n MicrosoftFabricToolDefinition,\n SharepointToolDefinition,\n AzureAISearchResource,\n CodeInterpreterToolResource,\n FileSearchToolResource,\n TruncationStrategy,\n UpdateCodeInterpreterToolResourceOptions,\n UpdateFileSearchToolResourceOptions,\n VectorStoreChunkingStrategyRequestParent,\n VectorStoreAutoChunkingStrategyRequest,\n VectorStoreStaticChunkingStrategyRequest,\n VectorStoreConfiguration,\n VectorStoreDataSourceAssetType,\n AgentsApiResponseFormat,\n FunctionName,\n AgentsNamedToolChoiceType,\n IndexResource,\n ToolConnectionList,\n MessageAttachmentToolDefinition,\n MessageRole,\n VectorStoreChunkingStrategyRequestType,\n VectorStoreExpirationPolicy,\n VectorStoreStaticChunkingStrategyOptions,\n ToolConnection,\n VectorStoreExpirationPolicyAnchor,\n ResponseFormat,\n ResponseFormatJsonSchemaType,\n OpenApiToolDefinition,\n AzureFunctionToolDefinition,\n OpenApiFunctionDefinition,\n ResponseFormatJsonSchema,\n AzureFunctionDefinition,\n AzureFunctionBinding,\n OpenApiAuthDetails,\n AzureFunctionStorageQueue,\n OpenApiAuthType,\n OpenApiAuthDetailsParent,\n OpenApiAnonymousAuthDetails,\n OpenApiConnectionAuthDetails,\n OpenApiManagedAuthDetails,\n OpenApiConnectionSecurityScheme,\n OpenApiManagedSecurityScheme,\n} from \"../customization/models.js\";\n"]}
|
|
1
|
+
{"version":3,"file":"inputOutputs.js","sourceRoot":"","sources":["../../../src/agents/inputOutputs.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,8EAAoD;AACpD,+DAAqC;AACrC,kEAAwC;AACxC,qDAA2B;AAC3B,8EAAoD","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport * from \"../customization/streamingModels.js\";\nexport * from \"./streamingModels.js\";\nexport * from \"./vectorStoresModels.js\";\nexport * from \"./utils.js\";\nexport * from \"../customization/streamingModels.js\";\nexport type {\n OpenAIPageableListOfThreadRunOutput,\n ThreadRunOutput,\n AgentThreadOutput,\n RunStepOutput,\n OpenAIPageableListOfRunStepOutput,\n ThreadMessageOutput,\n ThreadDeletionStatusOutput,\n OpenAIPageableListOfThreadMessageOutput,\n OpenAIPageableListOfVectorStoreOutput,\n VectorStoreOutput,\n VectorStoreFileOutput,\n VectorStoreDeletionStatusOutput,\n VectorStoreFileDeletionStatusOutput,\n VectorStoreFileBatchOutput,\n OpenAIPageableListOfVectorStoreFileOutput,\n AgentDeletionStatusOutput,\n AgentOutput,\n OpenAIPageableListOfAgentOutput,\n FileDeletionStatusOutput,\n FileListResponseOutput,\n OpenAIFileOutput,\n RequiredActionOutput,\n RequiredToolCallOutput,\n ToolDefinitionOutputParent,\n AgentsApiResponseFormatOptionOutput,\n ToolDefinitionOutput,\n ToolResourcesOutput,\n AgentsApiResponseFormatModeOutput,\n AgentsApiResponseFormatOutput,\n FilePurposeOutput,\n FileStateOutput,\n RequiredActionOutputParent,\n SubmitToolOutputsActionOutput,\n RequiredToolCallOutputParent,\n RequiredFunctionToolCallOutput,\n RunStepErrorOutput,\n RunStepStatusOutput,\n RunStepDetailsOutput,\n RunStepTypeOutput,\n RunStepCompletionUsageOutput,\n MessageAttachmentOutput,\n MessageContentOutput,\n MessageIncompleteDetailsOutput,\n MessageRoleOutput,\n MessageStatusOutput,\n IncompleteRunDetailsOutput,\n RunErrorOutput,\n RunStatusOutput,\n AgentsApiToolChoiceOptionOutput,\n UpdateToolResourcesOptionsOutput,\n TruncationObjectOutput,\n RunCompletionUsageOutput,\n CodeInterpreterToolDefinitionOutput,\n FileSearchToolDefinitionOutput,\n FunctionToolDefinitionOutput,\n BingGroundingToolDefinitionOutput,\n BingCustomSearchToolDefinitionOutput,\n SearchConfigurationListOutput,\n SearchConfigurationOutput,\n AzureAISearchToolDefinitionOutput,\n AzureAISearchResourceOutput,\n CodeInterpreterToolResourceOutput,\n FileSearchToolResourceOutput,\n VectorStoreFileCountOutput,\n VectorStoreFileBatchStatusOutput,\n VectorStoreChunkingStrategyResponseOutput,\n VectorStoreConfigurationOutput,\n AgentsNamedToolChoiceOutput,\n IndexResourceOutput,\n ToolConnectionListOutput,\n VectorStoreDataSourceOutput,\n FileSearchToolDefinitionDetailsOutput,\n VectorStoreConfigurationsOutput,\n FunctionDefinitionOutput,\n MessageAttachmentToolDefinitionOutput,\n MessageContentOutputParent,\n MessageTextContentOutput,\n MessageImageFileContentOutput,\n RequiredFunctionToolCallDetailsOutput,\n RunStepDetailsOutputParent,\n RunStepMessageCreationDetailsOutput,\n RunStepToolCallDetailsOutput,\n RunStepErrorCodeOutput,\n SubmitToolOutputsDetailsOutput,\n MicrosoftFabricToolDefinitionOutput,\n SharepointToolDefinitionOutput,\n UpdateCodeInterpreterToolResourceOptionsOutput,\n UpdateFileSearchToolResourceOptionsOutput,\n VectorStoreChunkingStrategyResponseOutputParent,\n VectorStoreAutoChunkingStrategyResponseOutput,\n VectorStoreStaticChunkingStrategyResponseOutput,\n VectorStoreFileErrorOutput,\n VectorStoreFileStatusOutput,\n VectorStoreExpirationPolicyOutput,\n VectorStoreStatusOutput,\n AgentsApiToolChoiceOptionModeOutput,\n FunctionNameOutput,\n AgentsNamedToolChoiceTypeOutput,\n MessageImageFileDetailsOutput,\n MessageIncompleteDetailsReasonOutput,\n MessageTextDetailsOutput,\n RunStepMessageCreationReferenceOutput,\n RunStepToolCallOutput,\n ToolConnectionOutput,\n TruncationStrategyOutput,\n VectorStoreChunkingStrategyResponseTypeOutput,\n VectorStoreDataSourceAssetTypeOutput,\n VectorStoreExpirationPolicyAnchorOutput,\n VectorStoreFileErrorCodeOutput,\n VectorStoreStaticChunkingStrategyOptionsOutput,\n FileSearchRankingOptionsOutput,\n MessageTextAnnotationOutput,\n RunStepToolCallOutputParent,\n RunStepCodeInterpreterToolCallOutput,\n RunStepFileSearchToolCallOutput,\n RunStepBingGroundingToolCallOutput,\n RunStepAzureAISearchToolCallOutput,\n RunStepSharepointToolCallOutput,\n RunStepMicrosoftFabricToolCallOutput,\n RunStepFunctionToolCallOutput,\n MessageTextAnnotationOutputParent,\n MessageTextFileCitationAnnotationOutput,\n MessageTextFilePathAnnotationOutput,\n RunStepCodeInterpreterToolCallOutputOutputParent,\n RunStepCodeInterpreterToolCallDetailsOutput,\n RunStepFunctionToolCallDetailsOutput,\n MessageTextFileCitationDetailsOutput,\n MessageTextFilePathDetailsOutput,\n RunStepCodeInterpreterToolCallOutputOutput,\n RunStepCodeInterpreterLogOutputOutput,\n RunStepCodeInterpreterImageOutputOutput,\n RunStepCodeInterpreterImageReferenceOutput,\n ResponseFormatOutput,\n ResponseFormatJsonSchemaTypeOutput,\n IncompleteDetailsReasonOutput,\n RunStepFileSearchToolCallResultsOutput,\n ResponseFormatJsonSchemaOutput,\n RunStepFileSearchToolCallResultOutput,\n FileSearchToolCallContentOutput,\n AzureFunctionToolDefinitionOutput,\n AzureFunctionDefinitionOutput,\n AzureFunctionBindingOutput,\n OpenApiToolDefinitionOutput,\n OpenApiFunctionDefinitionOutput,\n OpenApiAuthDetailsOutput,\n OpenApiAuthTypeOutput,\n OpenApiAuthDetailsOutputParent,\n OpenApiAnonymousAuthDetailsOutput,\n OpenApiConnectionAuthDetailsOutput,\n OpenApiManagedAuthDetailsOutput,\n AzureFunctionStorageQueueOutput,\n OpenApiConnectionSecuritySchemeOutput,\n OpenApiManagedSecuritySchemeOutput,\n OpenAIPageableListOfAgentThreadOutput,\n} from \"../customization/outputModels.js\";\nexport {\n ListMessagesQueryParamProperties,\n ListFilesQueryParamProperties,\n ListThreadsQueryParamProperties,\n} from \"../customization/parameters.js\";\nexport type {\n AgentRunResponse,\n CreateRunOptionalParams,\n GetRunOptionalParams,\n CancelRunOptionalParams,\n SubmitToolOutputsToRunOptionalParams,\n UpdateRunOptionalParams,\n ListRunQueryOptionalParams,\n CreateAndRunThreadOptionalParams,\n CreateAgentThreadOptionalParams,\n GetAgentThreadOptionalParams,\n UpdateAgentThreadOptionalParams,\n DeleteAgentThreadOptionalParams,\n GetRunStepOptionalParams,\n ListRunStepsOptionalParams,\n CreateMessageOptionalParams,\n ListMessagesOptionalParams,\n UpdateMessageOptionalParams,\n GetVectorStoreOptionalParams,\n ListVectorStoresOptionalParams,\n UpdateVectorStoreOptionalParams,\n DeleteVectorStoreOptionalParams,\n CreateVectorStoreOptionalParams,\n CreateVectorStoreFileOptionalParams,\n ListVectorStoreFilesOptionalParams,\n GetVectorStoreFileOptionalParams,\n DeleteVectorStoreFileOptionalParams,\n CreateVectorStoreFileBatchOptionalParams,\n GetVectorStoreFileBatchOptionalParams,\n ListVectorStoreFileBatchFilesOptionalParams,\n CreateAgentOptionalParams,\n ListAgentsOptionalParams,\n GetAgentOptionalParams,\n UpdateAgentOptionalParams,\n DeleteFileOptionalParams,\n GetFileOptionalParams,\n GetFileContentOptionalParams,\n ListFilesOptionalParams,\n UploadFileOptionalParams,\n ListQueryParameters,\n PollingOptions,\n PollingOptionsParams,\n CancelVectorStoreFileBatchOptionalParams,\n DeleteAgentOptionalParams,\n ListAgentThreadOptionalParams,\n} from \"./customModels.js\";\n\nexport {\n AzureAISearchToolDefinition,\n CodeInterpreterToolDefinition,\n FileSearchToolDefinition,\n FileSearchToolDefinitionDetails,\n FunctionDefinition,\n FunctionToolDefinition,\n ToolResources,\n VectorStoreConfigurations,\n VectorStoreDataSource,\n ToolDefinition,\n ThreadMessageOptions,\n ToolOutput,\n FilePurpose,\n ToolDefinitionParent,\n AgentThreadCreationOptions,\n CreateAgentOptions,\n CreateAndRunThreadOptions,\n CreateRunOptions,\n UpdateAgentOptions,\n UpdateAgentThreadOptions,\n VectorStoreFileStatusFilter,\n VectorStoreOptions,\n VectorStoreUpdateOptions,\n AgentsApiResponseFormatMode,\n AgentsApiToolChoiceOption,\n TruncationObject,\n UpdateToolResourcesOptions,\n VectorStoreChunkingStrategyRequest,\n FileSearchRankingOptions,\n AgentsApiToolChoiceOptionMode,\n AgentsNamedToolChoice,\n AgentsApiResponseFormatOption,\n ConnectionType,\n ListSortOrder,\n MessageAttachment,\n BingGroundingToolDefinition,\n MicrosoftFabricToolDefinition,\n SharepointToolDefinition,\n AzureAISearchResource,\n CodeInterpreterToolResource,\n FileSearchToolResource,\n TruncationStrategy,\n UpdateCodeInterpreterToolResourceOptions,\n UpdateFileSearchToolResourceOptions,\n VectorStoreChunkingStrategyRequestParent,\n VectorStoreAutoChunkingStrategyRequest,\n VectorStoreStaticChunkingStrategyRequest,\n VectorStoreConfiguration,\n VectorStoreDataSourceAssetType,\n AgentsApiResponseFormat,\n FunctionName,\n AgentsNamedToolChoiceType,\n IndexResource,\n ToolConnectionList,\n MessageAttachmentToolDefinition,\n MessageRole,\n VectorStoreChunkingStrategyRequestType,\n VectorStoreExpirationPolicy,\n VectorStoreStaticChunkingStrategyOptions,\n ToolConnection,\n VectorStoreExpirationPolicyAnchor,\n ResponseFormat,\n ResponseFormatJsonSchemaType,\n OpenApiToolDefinition,\n AzureFunctionToolDefinition,\n OpenApiFunctionDefinition,\n ResponseFormatJsonSchema,\n AzureFunctionDefinition,\n AzureFunctionBinding,\n OpenApiAuthDetails,\n AzureFunctionStorageQueue,\n OpenApiAuthType,\n OpenApiAuthDetailsParent,\n OpenApiAnonymousAuthDetails,\n OpenApiConnectionAuthDetails,\n OpenApiManagedAuthDetails,\n OpenApiConnectionSecurityScheme,\n OpenApiManagedSecurityScheme,\n CreateMessageContent,\n MessageContentBlockInput,\n MessageContentBlockInputParent,\n MessageTextBlockInput,\n MessageImageFileBlockInput,\n MessageImageUrlBlockInput,\n MessageBlockType,\n MessageImageFileParam,\n MessageImageUrlParam,\n ImageDetailLevel,\n AzureFunctionToolResource,\n} from \"../customization/models.js\";\n"]}
|
|
@@ -32,7 +32,7 @@ async function createMessage(context, threadId, messageOptions, options = {}) {
|
|
|
32
32
|
}
|
|
33
33
|
/** Gets a list of messages that exist on a thread. */
|
|
34
34
|
async function listMessages(context, threadId, options = {}) {
|
|
35
|
-
const listOptions = Object.assign(Object.assign({}, (0, core_client_1.operationOptionsToRequestParameters)(options)), { queryParameters: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (options.runId && { run_id: options.runId })), (options.limit && {
|
|
35
|
+
const listOptions = Object.assign(Object.assign({}, (0, core_client_1.operationOptionsToRequestParameters)(options)), { queryParameters: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (options.runId && { run_id: options.runId })), (options.limit && { limit: options.limit })), (options.order && { order: options.order })), (options.after && { after: options.after })), (options.before && { before: options.before })) });
|
|
36
36
|
validateThreadId(threadId);
|
|
37
37
|
validateListMessagesParameters(listOptions);
|
|
38
38
|
const output = await tracing_js_1.TracingUtility.withSpan("ListMessages", listOptions, async (updateOptions) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/ag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OAAgC;;IACtE,IACE,CAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe,0CAAE,KAAK;QAC/B,CAAC,OAAO,CAAC,eAAe,CAAC,KAAK,GAAG,CAAC,IAAI,OAAO,CAAC,eAAe,CAAC,KAAK,GAAG,GAAG,CAAC,EAC1E,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;IACrD,CAAC;IACD,IAAI,CAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe,0CAAE,KAAK,KAAI,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC;QAChG,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;IAC1D,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { Client } from \"@azure-rest/core-client\";\nimport { operationOptionsToRequestParameters } from \"@azure-rest/core-client\";\nimport type {\n OpenAIPageableListOfThreadMessageOutput,\n ThreadMessageOutput,\n} from \"../customization/outputModels.js\";\nimport type {\n CreateMessageParameters,\n ListMessagesParameters,\n} from \"../generated/src/parameters.js\";\nimport { validateMetadata, validateVectorStoreDataType } from \"./inputValidations.js\";\nimport { TracingUtility } from \"../tracing.js\";\nimport {\n traceEndCreateMessage,\n traceEndListMessages,\n traceStartCreateMessage,\n traceStartListMessages,\n} from \"./messagesTrace.js\";\nimport { traceStartAgentGeneric } from \"./traceUtility.js\";\nimport type { ThreadMessageOptions } from \"../customization/models.js\";\nimport type {\n CreateMessageOptionalParams,\n ListMessagesOptionalParams,\n UpdateMessageOptionalParams,\n} from \"./customModels.js\";\nimport type * as GeneratedParameters from \"../generated/src/parameters.js\";\nimport * as ConvertFromWire from \"../customization/convertOutputModelsFromWire.js\";\nimport { createOpenAIError } from \"./openAIError.js\";\n\nconst expectedStatuses = [\"200\"];\n\n/** Creates a new message on a specified thread. */\nexport async function createMessage(\n context: Client,\n threadId: string,\n messageOptions: ThreadMessageOptions,\n options: CreateMessageOptionalParams = {},\n): Promise<ThreadMessageOutput> {\n const createOptions: GeneratedParameters.CreateMessageParameters = {\n ...operationOptionsToRequestParameters(options),\n body: {\n ...messageOptions,\n },\n };\n\n validateThreadId(threadId);\n validateCreateMessageParameters(createOptions);\n const response = await TracingUtility.withSpan(\n \"CreateMessage\",\n createOptions,\n async (updateOptions) => {\n const result = await context\n .path(\"/threads/{threadId}/messages\", threadId)\n .post(updateOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return result.body;\n },\n (span, updatedOptions) => traceStartCreateMessage(span, threadId, updatedOptions),\n traceEndCreateMessage,\n );\n return ConvertFromWire.convertThreadMessageOutput(response);\n}\n\n/** Gets a list of messages that exist on a thread. */\nexport async function listMessages(\n context: Client,\n threadId: string,\n options: ListMessagesOptionalParams = {},\n): Promise<OpenAIPageableListOfThreadMessageOutput> {\n const listOptions: GeneratedParameters.ListMessagesParameters = {\n ...operationOptionsToRequestParameters(options),\n queryParameters: {\n ...(options.runId && { run_id: options.runId }),\n ...(options.limit && { run_id: options.limit }),\n ...(options.order && { run_id: options.order }),\n ...(options.after && { run_id: options.after }),\n ...(options.before && { run_id: options.before }),\n },\n };\n\n validateThreadId(threadId);\n validateListMessagesParameters(listOptions);\n const output = await TracingUtility.withSpan(\n \"ListMessages\",\n listOptions,\n async (updateOptions) => {\n const result = await context\n .path(\"/threads/{threadId}/messages\", threadId)\n .get(updateOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return result.body;\n },\n (span, updatedOptions) => traceStartListMessages(span, threadId, updatedOptions),\n traceEndListMessages,\n );\n\n return ConvertFromWire.convertOpenAIPageableListOfThreadMessageOutput(output);\n}\n\n/** Modifies an existing message on an existing thread. */\nexport async function updateMessage(\n context: Client,\n threadId: string,\n messageId: string,\n options: UpdateMessageOptionalParams = {},\n): Promise<ThreadMessageOutput> {\n const updateMessageOptions: GeneratedParameters.UpdateMessageParameters = {\n ...operationOptionsToRequestParameters(options),\n body: {\n ...(options.metadata ? { metadata: options.metadata } : {}),\n },\n };\n validateThreadId(threadId);\n validateMessageId(messageId);\n const response = await TracingUtility.withSpan(\n \"UpdateMessage\",\n updateMessageOptions,\n async (updateOptions) => {\n const result = await context\n .path(\"/threads/{threadId}/messages/{messageId}\", threadId, messageId)\n .post(updateOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return result.body;\n },\n (span, updatedOptions) =>\n traceStartAgentGeneric(span, {\n ...updatedOptions,\n tracingAttributeOptions: { threadId: threadId, messageId: messageId },\n }),\n );\n\n return ConvertFromWire.convertThreadMessageOutput(response);\n}\n\nfunction validateThreadId(threadId: string): void {\n if (!threadId) {\n throw new Error(\"Thread ID is required\");\n }\n}\n\nfunction validateMessageId(messageId: string): void {\n if (!messageId) {\n throw new Error(\"Message ID is required\");\n }\n}\n\nfunction validateCreateMessageParameters(options: CreateMessageParameters): void {\n if (options.body.role && ![\"user\", \"assistant\"].includes(options.body.role)) {\n throw new Error(\"Role must be either 'user' or 'assistant'\");\n }\n if (options.body.metadata) {\n validateMetadata(options.body.metadata);\n }\n if (options.body.attachments) {\n if (\n options.body.attachments.some((value) => {\n value.tools.some((tool) => ![\"code_interpreter\", \"file_search\"].includes(tool.type));\n })\n ) {\n throw new Error(\"Tool type must be either 'code_interpreter' or 'file_search'\");\n }\n if (options.body.attachments) {\n options.body.attachments.forEach((value) => {\n if (value.data_source) {\n validateVectorStoreDataType([value.data_source]);\n }\n });\n }\n }\n}\n\nfunction validateListMessagesParameters(options?: ListMessagesParameters): void {\n if (\n options?.queryParameters?.limit &&\n (options.queryParameters.limit < 1 || options.queryParameters.limit > 100)\n ) {\n throw new Error(\"Limit must be between 1 and 100\");\n }\n if (options?.queryParameters?.order && ![\"asc\", \"desc\"].includes(options.queryParameters.order)) {\n throw new Error(\"Order must be either 'asc' or 'desc'\");\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/agents/messages.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAkClC,sCA+BC;AAGD,oCAmCC;AAGD,sCAkCC;;AAzID,yDAA8E;AAS9E,+DAAsF;AACtF,8CAA+C;AAC/C,yDAK4B;AAC5B,uDAA2D;AAQ3D,yGAAmF;AACnF,qDAAqD;AAErD,MAAM,gBAAgB,GAAG,CAAC,KAAK,CAAC,CAAC;AAEjC,mDAAmD;AAC5C,KAAK,UAAU,aAAa,CACjC,OAAe,EACf,QAAgB,EAChB,cAAoC,EACpC,UAAuC,EAAE;IAEzC,MAAM,aAAa,mCACd,IAAA,iDAAmC,EAAC,OAAO,CAAC,KAC/C,IAAI,oBACC,cAAc,IAEpB,CAAC;IAEF,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC3B,+BAA+B,CAAC,aAAa,CAAC,CAAC;IAC/C,MAAM,QAAQ,GAAG,MAAM,2BAAc,CAAC,QAAQ,CAC5C,eAAe,EACf,aAAa,EACb,KAAK,EAAE,aAAa,EAAE,EAAE;QACtB,MAAM,MAAM,GAAG,MAAM,OAAO;aACzB,IAAI,CAAC,8BAA8B,EAAE,QAAQ,CAAC;aAC9C,IAAI,CAAC,aAAa,CAAC,CAAC;QACvB,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;YAC9C,MAAM,IAAA,kCAAiB,EAAC,MAAM,CAAC,CAAC;QAClC,CAAC;QACD,OAAO,MAAM,CAAC,IAAI,CAAC;IACrB,CAAC,EACD,CAAC,IAAI,EAAE,cAAc,EAAE,EAAE,CAAC,IAAA,0CAAuB,EAAC,IAAI,EAAE,QAAQ,EAAE,cAAc,CAAC,EACjF,wCAAqB,CACtB,CAAC;IACF,OAAO,eAAe,CAAC,0BAA0B,CAAC,QAAQ,CAAC,CAAC;AA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,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;AACH,CAAC;AAED,SAAS,8BAA8B,CAAC,OAAgC;;IACtE,IACE,CAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe,0CAAE,KAAK;QAC/B,CAAC,OAAO,CAAC,eAAe,CAAC,KAAK,GAAG,CAAC,IAAI,OAAO,CAAC,eAAe,CAAC,KAAK,GAAG,GAAG,CAAC,EAC1E,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;IACrD,CAAC;IACD,IAAI,CAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe,0CAAE,KAAK,KAAI,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC;QAChG,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;IAC1D,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { Client } from \"@azure-rest/core-client\";\nimport { operationOptionsToRequestParameters } from \"@azure-rest/core-client\";\nimport type {\n OpenAIPageableListOfThreadMessageOutput,\n ThreadMessageOutput,\n} from \"../customization/outputModels.js\";\nimport type {\n CreateMessageParameters,\n ListMessagesParameters,\n} from \"../generated/src/parameters.js\";\nimport { validateMetadata, validateVectorStoreDataType } from \"./inputValidations.js\";\nimport { TracingUtility } from \"../tracing.js\";\nimport {\n traceEndCreateMessage,\n traceEndListMessages,\n traceStartCreateMessage,\n traceStartListMessages,\n} from \"./messagesTrace.js\";\nimport { traceStartAgentGeneric } from \"./traceUtility.js\";\nimport type { ThreadMessageOptions } from \"../customization/models.js\";\nimport type {\n CreateMessageOptionalParams,\n ListMessagesOptionalParams,\n UpdateMessageOptionalParams,\n} from \"./customModels.js\";\nimport type * as GeneratedParameters from \"../generated/src/parameters.js\";\nimport * as ConvertFromWire from \"../customization/convertOutputModelsFromWire.js\";\nimport { createOpenAIError } from \"./openAIError.js\";\n\nconst expectedStatuses = [\"200\"];\n\n/** Creates a new message on a specified thread. */\nexport async function createMessage(\n context: Client,\n threadId: string,\n messageOptions: ThreadMessageOptions,\n options: CreateMessageOptionalParams = {},\n): Promise<ThreadMessageOutput> {\n const createOptions: GeneratedParameters.CreateMessageParameters = {\n ...operationOptionsToRequestParameters(options),\n body: {\n ...messageOptions,\n },\n };\n\n validateThreadId(threadId);\n validateCreateMessageParameters(createOptions);\n const response = await TracingUtility.withSpan(\n \"CreateMessage\",\n createOptions,\n async (updateOptions) => {\n const result = await context\n .path(\"/threads/{threadId}/messages\", threadId)\n .post(updateOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return result.body;\n },\n (span, updatedOptions) => traceStartCreateMessage(span, threadId, updatedOptions),\n traceEndCreateMessage,\n );\n return ConvertFromWire.convertThreadMessageOutput(response);\n}\n\n/** Gets a list of messages that exist on a thread. */\nexport async function listMessages(\n context: Client,\n threadId: string,\n options: ListMessagesOptionalParams = {},\n): Promise<OpenAIPageableListOfThreadMessageOutput> {\n const listOptions: GeneratedParameters.ListMessagesParameters = {\n ...operationOptionsToRequestParameters(options),\n queryParameters: {\n ...(options.runId && { run_id: options.runId }),\n ...(options.limit && { limit: options.limit }),\n ...(options.order && { order: options.order }),\n ...(options.after && { after: options.after }),\n ...(options.before && { before: options.before }),\n },\n };\n\n validateThreadId(threadId);\n validateListMessagesParameters(listOptions);\n const output = await TracingUtility.withSpan(\n \"ListMessages\",\n listOptions,\n async (updateOptions) => {\n const result = await context\n .path(\"/threads/{threadId}/messages\", threadId)\n .get(updateOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return result.body;\n },\n (span, updatedOptions) => traceStartListMessages(span, threadId, updatedOptions),\n traceEndListMessages,\n );\n\n return ConvertFromWire.convertOpenAIPageableListOfThreadMessageOutput(output);\n}\n\n/** Modifies an existing message on an existing thread. */\nexport async function updateMessage(\n context: Client,\n threadId: string,\n messageId: string,\n options: UpdateMessageOptionalParams = {},\n): Promise<ThreadMessageOutput> {\n const updateMessageOptions: GeneratedParameters.UpdateMessageParameters = {\n ...operationOptionsToRequestParameters(options),\n body: {\n ...(options.metadata ? { metadata: options.metadata } : {}),\n },\n };\n validateThreadId(threadId);\n validateMessageId(messageId);\n const response = await TracingUtility.withSpan(\n \"UpdateMessage\",\n updateMessageOptions,\n async (updateOptions) => {\n const result = await context\n .path(\"/threads/{threadId}/messages/{messageId}\", threadId, messageId)\n .post(updateOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return result.body;\n },\n (span, updatedOptions) =>\n traceStartAgentGeneric(span, {\n ...updatedOptions,\n tracingAttributeOptions: { threadId: threadId, messageId: messageId },\n }),\n );\n\n return ConvertFromWire.convertThreadMessageOutput(response);\n}\n\nfunction validateThreadId(threadId: string): void {\n if (!threadId) {\n throw new Error(\"Thread ID is required\");\n }\n}\n\nfunction validateMessageId(messageId: string): void {\n if (!messageId) {\n throw new Error(\"Message ID is required\");\n }\n}\n\nfunction validateCreateMessageParameters(options: CreateMessageParameters): void {\n if (options.body.role && ![\"user\", \"assistant\"].includes(options.body.role)) {\n throw new Error(\"Role must be either 'user' or 'assistant'\");\n }\n if (options.body.metadata) {\n validateMetadata(options.body.metadata);\n }\n if (options.body.attachments) {\n if (\n options.body.attachments.some((value) => {\n value.tools.some((tool) => ![\"code_interpreter\", \"file_search\"].includes(tool.type));\n })\n ) {\n throw new Error(\"Tool type must be either 'code_interpreter' or 'file_search'\");\n }\n if (options.body.attachments) {\n options.body.attachments.forEach((value) => {\n if (value.data_source) {\n validateVectorStoreDataType([value.data_source]);\n }\n });\n }\n }\n}\n\nfunction validateListMessagesParameters(options?: ListMessagesParameters): void {\n if (\n options?.queryParameters?.limit &&\n (options.queryParameters.limit < 1 || options.queryParameters.limit > 100)\n ) {\n throw new Error(\"Limit must be between 1 and 100\");\n }\n if (options?.queryParameters?.order && ![\"asc\", \"desc\"].includes(options.queryParameters.order)) {\n throw new Error(\"Order must be either 'asc' or 'desc'\");\n }\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Client } from "@azure-rest/core-client";
|
|
2
|
-
import type { AgentThreadOutput, ThreadDeletionStatusOutput } from "../customization/outputModels.js";
|
|
3
|
-
import type { CreateAgentThreadOptionalParams, DeleteAgentThreadOptionalParams, GetAgentThreadOptionalParams, UpdateAgentThreadOptionalParams } from "./customModels.js";
|
|
2
|
+
import type { AgentThreadOutput, OpenAIPageableListOfAgentThreadOutput, ThreadDeletionStatusOutput } from "../customization/outputModels.js";
|
|
3
|
+
import type { CreateAgentThreadOptionalParams, DeleteAgentThreadOptionalParams, GetAgentThreadOptionalParams, ListAgentThreadOptionalParams, UpdateAgentThreadOptionalParams } from "./customModels.js";
|
|
4
4
|
/** Creates a new thread. Threads contain messages and can be run by agents. */
|
|
5
5
|
export declare function createThread(context: Client, options?: CreateAgentThreadOptionalParams): Promise<AgentThreadOutput>;
|
|
6
6
|
/** Gets information about an existing thread. */
|
|
@@ -9,4 +9,6 @@ export declare function getThread(context: Client, threadId: string, options?: G
|
|
|
9
9
|
export declare function updateThread(context: Client, threadId: string, options?: UpdateAgentThreadOptionalParams): Promise<AgentThreadOutput>;
|
|
10
10
|
/** Deletes an existing thread. */
|
|
11
11
|
export declare function deleteThread(context: Client, threadId: string, options?: DeleteAgentThreadOptionalParams): Promise<ThreadDeletionStatusOutput>;
|
|
12
|
+
/** Gets a list of threads that were previously created. */
|
|
13
|
+
export declare function listThreads(context: Client, options?: ListAgentThreadOptionalParams): Promise<OpenAIPageableListOfAgentThreadOutput>;
|
|
12
14
|
//# sourceMappingURL=threads.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"threads.d.ts","sourceRoot":"","sources":["../../../src/agents/threads.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,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C5C,OAAO,CAAC,iBAAiB,CAAC,CAwB5B;AAED,iDAAiD;AACjD,wBAAsB,SAAS,CAC7B,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,4BAAiC,GACzC,OAAO,CAAC,iBAAiB,CAAC,CAwB5B;AAED,mCAAmC;AACnC,wBAAsB,YAAY,CAChC,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,+BAAoC,GAC5C,OAAO,CAAC,iBAAiB,CAAC,CA2B5B;AAED,kCAAkC;AAClC,wBAAsB,YAAY,CAChC,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,+BAAoC,GAC5C,OAAO,CAAC,0BAA0B,CAAC,CAwBrC;AAED,2DAA2D;AAC3D,wBAAsB,WAAW,CAC/B,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,6BAAkC,GAC1C,OAAO,CAAC,qCAAqC,CAAC,CA8BhD"}
|
|
@@ -6,6 +6,7 @@ exports.createThread = createThread;
|
|
|
6
6
|
exports.getThread = getThread;
|
|
7
7
|
exports.updateThread = updateThread;
|
|
8
8
|
exports.deleteThread = deleteThread;
|
|
9
|
+
exports.listThreads = listThreads;
|
|
9
10
|
const tslib_1 = require("tslib");
|
|
10
11
|
const core_client_1 = require("@azure-rest/core-client");
|
|
11
12
|
const ConverterToWire = tslib_1.__importStar(require("../customization/convertModelsToWrite.js"));
|
|
@@ -69,6 +70,19 @@ async function deleteThread(context, threadId, options = {}) {
|
|
|
69
70
|
}, (span, updatedOptions) => (0, traceUtility_js_1.traceStartAgentGeneric)(span, Object.assign(Object.assign({}, updatedOptions), { tracingAttributeOptions: { threadId: threadId } })));
|
|
70
71
|
return (0, convertOutputModelsFromWire_js_1.convertThreadDeletionStatusOutput)(response);
|
|
71
72
|
}
|
|
73
|
+
/** Gets a list of threads that were previously created. */
|
|
74
|
+
async function listThreads(context, options = {}) {
|
|
75
|
+
const listThreadsOptions = Object.assign(Object.assign({}, (0, core_client_1.operationOptionsToRequestParameters)(options)), { queryParameters: Object.assign(Object.assign(Object.assign(Object.assign({}, (options.limit && { limit: options.limit })), (options.order && { order: options.order })), (options.after && { after: options.after })), (options.before && { before: options.before })) });
|
|
76
|
+
validateListThreadsParameters(listThreadsOptions);
|
|
77
|
+
const output = await tracing_js_1.TracingUtility.withSpan("ListThreads", listThreadsOptions, async (updatedOptions) => {
|
|
78
|
+
const result = await context.path("/threads").get(updatedOptions);
|
|
79
|
+
if (!expectedStatuses.includes(result.status)) {
|
|
80
|
+
throw (0, openAIError_js_1.createOpenAIError)(result);
|
|
81
|
+
}
|
|
82
|
+
return result.body;
|
|
83
|
+
}, (span, updatedOptions) => (0, traceUtility_js_1.traceStartAgentGeneric)(span, Object.assign(Object.assign({}, updatedOptions), { tracingAttributeOptions: {} })));
|
|
84
|
+
return ConverterFromWire.convertOpenAIPageableListOfAgentThreadOutput(output);
|
|
85
|
+
}
|
|
72
86
|
function validateCreateThreadParameters(options) {
|
|
73
87
|
if (options === null || options === void 0 ? void 0 : options.body.messages) {
|
|
74
88
|
options.body.messages.forEach((message) => (0, inputValidations_js_1.validateMessages)(message.role));
|
|
@@ -89,4 +103,14 @@ function validateUpdateThreadParameters(threadId, options) {
|
|
|
89
103
|
(0, inputValidations_js_1.validateMetadata)(options.body.metadata);
|
|
90
104
|
}
|
|
91
105
|
}
|
|
106
|
+
function validateListThreadsParameters(options) {
|
|
107
|
+
var _a, _b;
|
|
108
|
+
if (((_a = options === null || options === void 0 ? void 0 : options.queryParameters) === null || _a === void 0 ? void 0 : _a.limit) &&
|
|
109
|
+
(options.queryParameters.limit < 1 || options.queryParameters.limit > 100)) {
|
|
110
|
+
throw new Error("Limit must be between 1 and 100");
|
|
111
|
+
}
|
|
112
|
+
if (((_b = options === null || options === void 0 ? void 0 : options.queryParameters) === null || _b === void 0 ? void 0 : _b.order) && !["asc", "desc"].includes(options.queryParameters.order)) {
|
|
113
|
+
throw new Error("Order must be either 'asc' or 'desc'");
|
|
114
|
+
}
|
|
115
|
+
}
|
|
92
116
|
//# sourceMappingURL=threads.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"threads.js","sourceRoot":"","sources":["../../../src/agents/threads.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAgClC,oCA2BC;AAGD,8BA4BC;AAGD,oCA+BC;AAGD,oCA4BC;;AAxJD,yDAA8E;AAE9E,kGAA4E;AAC5E,2GAAqF;AAKrF,8CAA+C;AAC/C,uDAAiF;AACjF,+DAK+B;AAC/B,uDAA2D;AAO3D,oGAAoG;AACpG,qDAAqD;AAErD,MAAM,gBAAgB,GAAG,CAAC,KAAK,CAAC,CAAC;AAEjC,+EAA+E;AACxE,KAAK,UAAU,YAAY,CAChC,OAAe,EACf,UAA2C,EAAE;IAE7C,MAAM,mBAAmB,mCACpB,IAAA,iDAAmC,EAAC,OAAO,CAAC,KAC/C,IAAI,oBACC,eAAe,CAAC,iCAAiC,CAAC,OAAO,CAAC,IAEhE,CAAC;IAEF,8BAA8B,CAAC,mBAAmB,CAAC,CAAC;IACpD,MAAM,QAAQ,GAAG,MAAM,2BAAc,CAAC,QAAQ,CAC5C,cAAc,EACd,mBAAmB,EACnB,KAAK,EAAE,cAAc,EAAE,EAAE;QACvB,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QACnE,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;YAC9C,MAAM,IAAA,kCAAiB,EAAC,MAAM,CAAC,CAAC;QAClC,CAAC;QACD,OAAO,MAAM,CAAC,IAAI,CAAC;IACrB,CAAC,EACD,wCAAsB,EACtB,sCAAoB,CACrB,CAAC;IAEF,OAAO,iBAAiB,CAAC,wBAAwB,CAAC,QAAQ,CAAC,CAAC;AAC9D,CAAC;AA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n// Licensed under the MIT License.\n\nimport type { Client } from \"@azure-rest/core-client\";\nimport { operationOptionsToRequestParameters } from \"@azure-rest/core-client\";\nimport type * as GeneratedParameters from \"../generated/src/parameters.js\";\nimport * as ConverterToWire from \"../customization/convertModelsToWrite.js\";\nimport * as ConverterFromWire from \"../customization/convertOutputModelsFromWire.js\";\nimport type {\n AgentThreadOutput,\n ThreadDeletionStatusOutput,\n} from \"../customization/outputModels.js\";\nimport { TracingUtility } from \"../tracing.js\";\nimport { traceEndCreateThread, traceStartCreateThread } from \"./threadsTrace.js\";\nimport {\n validateMessages,\n validateMetadata,\n validateThreadId,\n validateToolResources,\n} from \"./inputValidations.js\";\nimport { traceStartAgentGeneric } from \"./traceUtility.js\";\nimport type {\n CreateAgentThreadOptionalParams,\n DeleteAgentThreadOptionalParams,\n GetAgentThreadOptionalParams,\n UpdateAgentThreadOptionalParams,\n} from \"./customModels.js\";\nimport { convertThreadDeletionStatusOutput } from \"../customization/convertOutputModelsFromWire.js\";\nimport { createOpenAIError } from \"./openAIError.js\";\n\nconst expectedStatuses = [\"200\"];\n\n/** Creates a new thread. Threads contain messages and can be run by agents. */\nexport async function createThread(\n context: Client,\n options: CreateAgentThreadOptionalParams = {},\n): Promise<AgentThreadOutput> {\n const createThreadOptions: GeneratedParameters.CreateThreadParameters = {\n ...operationOptionsToRequestParameters(options),\n body: {\n ...ConverterToWire.convertAgentThreadCreationOptions(options),\n },\n };\n\n validateCreateThreadParameters(createThreadOptions);\n const response = await TracingUtility.withSpan(\n \"CreateThread\",\n createThreadOptions,\n async (updatedOptions) => {\n const result = await context.path(\"/threads\").post(updatedOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return result.body;\n },\n traceStartCreateThread,\n traceEndCreateThread,\n );\n\n return ConverterFromWire.convertAgentThreadOutput(response);\n}\n\n/** Gets information about an existing thread. */\nexport async function getThread(\n context: Client,\n threadId: string,\n options: GetAgentThreadOptionalParams = {},\n): Promise<AgentThreadOutput> {\n const getThreadOptions: GeneratedParameters.GetThreadParameters = {\n ...operationOptionsToRequestParameters(options),\n };\n\n validateThreadId(threadId);\n const response = await TracingUtility.withSpan(\n \"GetThread\",\n getThreadOptions,\n async (updatedOptions) => {\n const result = await context.path(\"/threads/{threadId}\", threadId).get(updatedOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return result.body;\n },\n (span, updatedOptions) =>\n traceStartAgentGeneric(span, {\n ...updatedOptions,\n tracingAttributeOptions: { threadId: threadId },\n }),\n );\n\n return ConverterFromWire.convertAgentThreadOutput(response);\n}\n\n/** Modifies an existing thread. */\nexport async function updateThread(\n context: Client,\n threadId: string,\n options: UpdateAgentThreadOptionalParams = {},\n): Promise<AgentThreadOutput> {\n const updateThreadOptions: GeneratedParameters.UpdateThreadParameters = {\n ...operationOptionsToRequestParameters(options),\n body: {\n ...ConverterToWire.convertAgentThreadUpdateOptions(options),\n },\n };\n\n validateUpdateThreadParameters(threadId, updateThreadOptions);\n const response = await TracingUtility.withSpan(\n \"UpdateThread\",\n updateThreadOptions,\n async (updatedOptions) => {\n const result = await context.path(\"/threads/{threadId}\", threadId).post(updatedOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return result.body;\n },\n (span, updatedOptions) =>\n traceStartAgentGeneric(span, {\n ...updatedOptions,\n tracingAttributeOptions: { threadId: threadId },\n }),\n );\n\n return ConverterFromWire.convertAgentThreadOutput(response);\n}\n\n/** Deletes an existing thread. */\nexport async function deleteThread(\n context: Client,\n threadId: string,\n options: DeleteAgentThreadOptionalParams = {},\n): Promise<ThreadDeletionStatusOutput> {\n const deleteThreadOptions: GeneratedParameters.DeleteAgentParameters = {\n ...operationOptionsToRequestParameters(options),\n };\n\n validateThreadId(threadId);\n const response = await TracingUtility.withSpan(\n \"DeleteThread\",\n deleteThreadOptions,\n async (updatedOptions) => {\n const result = await context.path(\"/threads/{threadId}\", threadId).delete(updatedOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return result.body;\n },\n (span, updatedOptions) =>\n traceStartAgentGeneric(span, {\n ...updatedOptions,\n tracingAttributeOptions: { threadId: threadId },\n }),\n );\n\n return convertThreadDeletionStatusOutput(response);\n}\n\nfunction validateCreateThreadParameters(\n options?: GeneratedParameters.CreateThreadParameters,\n): void {\n if (options?.body.messages) {\n options.body.messages.forEach((message) => validateMessages(message.role));\n }\n if (options?.body.tool_resources) {\n validateToolResources(options.body.tool_resources);\n }\n if (options?.body.metadata) {\n validateMetadata(options.body.metadata);\n }\n}\n\nfunction validateUpdateThreadParameters(\n threadId: string,\n options?: GeneratedParameters.UpdateThreadParameters,\n): void {\n validateThreadId(threadId);\n if (options?.body.tool_resources) {\n validateToolResources(options.body.tool_resources);\n }\n if (options?.body.metadata) {\n validateMetadata(options.body.metadata);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"threads.js","sourceRoot":"","sources":["../../../src/agents/threads.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAkClC,oCA2BC;AAGD,8BA4BC;AAGD,oCA+BC;AAGD,oCA4BC;AAGD,kCAiCC;;AA9LD,yDAA8E;AAE9E,kGAA4E;AAC5E,2GAAqF;AAMrF,8CAA+C;AAC/C,uDAAiF;AACjF,+DAK+B;AAC/B,uDAA2D;AAQ3D,oGAAoG;AACpG,qDAAqD;AAErD,MAAM,gBAAgB,GAAG,CAAC,KAAK,CAAC,CAAC;AAEjC,+EAA+E;AACxE,KAAK,UAAU,YAAY,CAChC,OAAe,EACf,UAA2C,EAAE;IAE7C,MAAM,mBAAmB,mCACpB,IAAA,iDAAmC,EAAC,OAAO,CAAC,KAC/C,IAAI,oBACC,eAAe,CAAC,iCAAiC,CAAC,OAAO,CAAC,IAEhE,CAAC;IAEF,8BAA8B,CAAC,mBAAmB,CAAC,CAAC;IACpD,MAAM,QAAQ,GAAG,MAAM,2BAAc,CAAC,QAAQ,CAC5C,cAAc,EACd,mBAA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C3B,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CAAC,cAAc,EAAE,CAAC;QACjC,IAAA,2CAAqB,EAAC,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IACrD,CAAC;IACD,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CAAC,QAAQ,EAAE,CAAC;QAC3B,IAAA,sCAAgB,EAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC1C,CAAC;AACH,CAAC;AAED,SAAS,6BAA6B,CAAC,OAAmD;;IACxF,IACE,CAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe,0CAAE,KAAK;QAC/B,CAAC,OAAO,CAAC,eAAe,CAAC,KAAK,GAAG,CAAC,IAAI,OAAO,CAAC,eAAe,CAAC,KAAK,GAAG,GAAG,CAAC,EAC1E,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;IACrD,CAAC;IACD,IAAI,CAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe,0CAAE,KAAK,KAAI,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC;QAChG,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;IAC1D,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { Client } from \"@azure-rest/core-client\";\nimport { operationOptionsToRequestParameters } from \"@azure-rest/core-client\";\nimport type * as GeneratedParameters from \"../generated/src/parameters.js\";\nimport * as ConverterToWire from \"../customization/convertModelsToWrite.js\";\nimport * as ConverterFromWire from \"../customization/convertOutputModelsFromWire.js\";\nimport type {\n AgentThreadOutput,\n OpenAIPageableListOfAgentThreadOutput,\n ThreadDeletionStatusOutput,\n} from \"../customization/outputModels.js\";\nimport { TracingUtility } from \"../tracing.js\";\nimport { traceEndCreateThread, traceStartCreateThread } from \"./threadsTrace.js\";\nimport {\n validateMessages,\n validateMetadata,\n validateThreadId,\n validateToolResources,\n} from \"./inputValidations.js\";\nimport { traceStartAgentGeneric } from \"./traceUtility.js\";\nimport type {\n CreateAgentThreadOptionalParams,\n DeleteAgentThreadOptionalParams,\n GetAgentThreadOptionalParams,\n ListAgentThreadOptionalParams,\n UpdateAgentThreadOptionalParams,\n} from \"./customModels.js\";\nimport { convertThreadDeletionStatusOutput } from \"../customization/convertOutputModelsFromWire.js\";\nimport { createOpenAIError } from \"./openAIError.js\";\n\nconst expectedStatuses = [\"200\"];\n\n/** Creates a new thread. Threads contain messages and can be run by agents. */\nexport async function createThread(\n context: Client,\n options: CreateAgentThreadOptionalParams = {},\n): Promise<AgentThreadOutput> {\n const createThreadOptions: GeneratedParameters.CreateThreadParameters = {\n ...operationOptionsToRequestParameters(options),\n body: {\n ...ConverterToWire.convertAgentThreadCreationOptions(options),\n },\n };\n\n validateCreateThreadParameters(createThreadOptions);\n const response = await TracingUtility.withSpan(\n \"CreateThread\",\n createThreadOptions,\n async (updatedOptions) => {\n const result = await context.path(\"/threads\").post(updatedOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return result.body;\n },\n traceStartCreateThread,\n traceEndCreateThread,\n );\n\n return ConverterFromWire.convertAgentThreadOutput(response);\n}\n\n/** Gets information about an existing thread. */\nexport async function getThread(\n context: Client,\n threadId: string,\n options: GetAgentThreadOptionalParams = {},\n): Promise<AgentThreadOutput> {\n const getThreadOptions: GeneratedParameters.GetThreadParameters = {\n ...operationOptionsToRequestParameters(options),\n };\n\n validateThreadId(threadId);\n const response = await TracingUtility.withSpan(\n \"GetThread\",\n getThreadOptions,\n async (updatedOptions) => {\n const result = await context.path(\"/threads/{threadId}\", threadId).get(updatedOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return result.body;\n },\n (span, updatedOptions) =>\n traceStartAgentGeneric(span, {\n ...updatedOptions,\n tracingAttributeOptions: { threadId: threadId },\n }),\n );\n\n return ConverterFromWire.convertAgentThreadOutput(response);\n}\n\n/** Modifies an existing thread. */\nexport async function updateThread(\n context: Client,\n threadId: string,\n options: UpdateAgentThreadOptionalParams = {},\n): Promise<AgentThreadOutput> {\n const updateThreadOptions: GeneratedParameters.UpdateThreadParameters = {\n ...operationOptionsToRequestParameters(options),\n body: {\n ...ConverterToWire.convertAgentThreadUpdateOptions(options),\n },\n };\n\n validateUpdateThreadParameters(threadId, updateThreadOptions);\n const response = await TracingUtility.withSpan(\n \"UpdateThread\",\n updateThreadOptions,\n async (updatedOptions) => {\n const result = await context.path(\"/threads/{threadId}\", threadId).post(updatedOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return result.body;\n },\n (span, updatedOptions) =>\n traceStartAgentGeneric(span, {\n ...updatedOptions,\n tracingAttributeOptions: { threadId: threadId },\n }),\n );\n\n return ConverterFromWire.convertAgentThreadOutput(response);\n}\n\n/** Deletes an existing thread. */\nexport async function deleteThread(\n context: Client,\n threadId: string,\n options: DeleteAgentThreadOptionalParams = {},\n): Promise<ThreadDeletionStatusOutput> {\n const deleteThreadOptions: GeneratedParameters.DeleteAgentParameters = {\n ...operationOptionsToRequestParameters(options),\n };\n\n validateThreadId(threadId);\n const response = await TracingUtility.withSpan(\n \"DeleteThread\",\n deleteThreadOptions,\n async (updatedOptions) => {\n const result = await context.path(\"/threads/{threadId}\", threadId).delete(updatedOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return result.body;\n },\n (span, updatedOptions) =>\n traceStartAgentGeneric(span, {\n ...updatedOptions,\n tracingAttributeOptions: { threadId: threadId },\n }),\n );\n\n return convertThreadDeletionStatusOutput(response);\n}\n\n/** Gets a list of threads that were previously created. */\nexport async function listThreads(\n context: Client,\n options: ListAgentThreadOptionalParams = {},\n): Promise<OpenAIPageableListOfAgentThreadOutput> {\n const listThreadsOptions: GeneratedParameters.ListThreadsParameters = {\n ...operationOptionsToRequestParameters(options),\n queryParameters: {\n ...(options.limit && { limit: options.limit }),\n ...(options.order && { order: options.order }),\n ...(options.after && { after: options.after }),\n ...(options.before && { before: options.before }),\n },\n };\n\n validateListThreadsParameters(listThreadsOptions);\n const output = await TracingUtility.withSpan(\n \"ListThreads\",\n listThreadsOptions,\n async (updatedOptions) => {\n const result = await context.path(\"/threads\").get(updatedOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return result.body;\n },\n (span, updatedOptions) =>\n traceStartAgentGeneric(span, {\n ...updatedOptions,\n tracingAttributeOptions: {},\n }),\n );\n\n return ConverterFromWire.convertOpenAIPageableListOfAgentThreadOutput(output);\n}\n\nfunction validateCreateThreadParameters(\n options?: GeneratedParameters.CreateThreadParameters,\n): void {\n if (options?.body.messages) {\n options.body.messages.forEach((message) => validateMessages(message.role));\n }\n if (options?.body.tool_resources) {\n validateToolResources(options.body.tool_resources);\n }\n if (options?.body.metadata) {\n validateMetadata(options.body.metadata);\n }\n}\n\nfunction validateUpdateThreadParameters(\n threadId: string,\n options?: GeneratedParameters.UpdateThreadParameters,\n): void {\n validateThreadId(threadId);\n if (options?.body.tool_resources) {\n validateToolResources(options.body.tool_resources);\n }\n if (options?.body.metadata) {\n validateMetadata(options.body.metadata);\n }\n}\n\nfunction validateListThreadsParameters(options?: GeneratedParameters.ListThreadsParameters): void {\n if (\n options?.queryParameters?.limit &&\n (options.queryParameters.limit < 1 || options.queryParameters.limit > 100)\n ) {\n throw new Error(\"Limit must be between 1 and 100\");\n }\n if (options?.queryParameters?.order && ![\"asc\", \"desc\"].includes(options.queryParameters.order)) {\n throw new Error(\"Order must be either 'asc' or 'desc'\");\n }\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AzureAISearchToolDefinition, AzureFunctionToolDefinition, CodeInterpreterToolDefinition, FileSearchToolDefinition, FileSearchToolDefinitionDetails, FunctionDefinition, FunctionToolDefinition, SearchConfigurationOutput,
|
|
1
|
+
import type { AzureAISearchToolDefinition, AzureFunctionToolDefinition, CodeInterpreterToolDefinition, FileSearchToolDefinition, FileSearchToolDefinitionDetails, FunctionDefinition, FunctionToolDefinition, SearchConfigurationOutput, OpenApiToolDefinition, RequiredActionOutput, RequiredToolCallOutput, ToolDefinition, ToolDefinitionOutputParent, ToolResources, VectorStoreConfigurations, VectorStoreDataSource, AzureFunctionStorageQueue, AzureFunctionDefinition, OpenApiFunctionDefinition } from "./inputOutputs.js";
|
|
2
2
|
import type { CreateAzureAISearchToolOptions } from "../customization/models.js";
|
|
3
3
|
/**
|
|
4
4
|
* Determines if the given output is of the specified type.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/agents/utils.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,2BAA2B,EAC3B,2BAA2B,EAC3B,6BAA6B,EAC7B,wBAAwB,EACxB,+BAA+B,EAC/B,kBAAkB,EAClB,sBAAsB,EACtB,yBAAyB,EACzB,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/agents/utils.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,2BAA2B,EAC3B,2BAA2B,EAC3B,6BAA6B,EAC7B,wBAAwB,EACxB,+BAA+B,EAC/B,kBAAkB,EAClB,sBAAsB,EACtB,yBAAyB,EACzB,qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB,EACtB,cAAc,EACd,0BAA0B,EAC1B,aAAa,EACb,yBAAyB,EACzB,qBAAqB,EACrB,yBAAyB,EACzB,uBAAuB,EACvB,yBAAyB,EAC1B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,4BAA4B,CAAC;AAEjF;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS;IAAE,IAAI,EAAE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1C,MAAM,IAAI,GAAG,WAAW,CAAC,uBAAuB,CAC9C,IAAI,EACJ,WAAW,EACX,UAAU,EACV,UAAU,EACV,WAAW,EACX,iBAAiB,CAClB,CAAC;QACF,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC3C,IAAI,CAAC,aAAa,mCAAQ,IAAI,CAAC,aAAa,GAAK,IAAI,CAAC,SAAS,CAAE,CAAC;QAClE,OAAO,IAAI,CAAC;IACd,CAAC;IACD;;;;;OAKG;IACH,aAAa,CAAC,YAAoB;QAChC,MAAM,IAAI,GAAG,WAAW,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC;QACxD,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC3C,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAzID,0BAyIC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n AzureAISearchToolDefinition,\n AzureFunctionToolDefinition,\n CodeInterpreterToolDefinition,\n FileSearchToolDefinition,\n FileSearchToolDefinitionDetails,\n FunctionDefinition,\n FunctionToolDefinition,\n SearchConfigurationOutput,\n OpenApiFunctionDefinition,\n OpenApiToolDefinition,\n RequiredActionOutput,\n RequiredToolCallOutput,\n ToolDefinition,\n ToolDefinitionOutputParent,\n ToolResources,\n VectorStoreConfigurations,\n VectorStoreDataSource,\n AzureFunctionStorageQueue,\n AzureFunctionDefinition,\n} from \"./inputOutputs.js\";\nimport type { CreateAzureAISearchToolOptions } from \"../customization/models.js\";\n\n/**\n * Determines if the given output is of the specified type.\n *\n * @typeParam T - The type to check against, which extends one of the possible output parent types.\n * @param output - The action to check, which can be of type `RequiredActionOutput`, `RequiredToolCallOutput`, or `ToolDefinitionOutputParent`.\n * @param type - The type to check the action against.\n * @returns A boolean indicating whether the action is of the specified type.\n */\nexport function isOutputOfType<T extends { type: string }>(\n output: RequiredActionOutput | RequiredToolCallOutput | ToolDefinitionOutputParent,\n type: string,\n): output is T {\n return output.type === type;\n}\n\n/** Types of connection tools used to configure an agent */\nexport enum connectionToolType {\n /** Bing grounding search tool */\n BingGrounding = \"bing_grounding\",\n /** Microsoft Fabric tool */\n MicrosoftFabric = \"fabric_dataagent\",\n /** Sharepoint tool */\n SharepointGrounding = \"sharepoint_grounding\",\n /** Azure Function tool */\n AzureFunction = \"azure_function\",\n /** Bing custom search tool */\n BingCustomSearch = \"bing_custom_search\",\n}\n\nconst toolMap = {\n bing_grounding: \"bingGrounding\",\n fabric_dataagent: \"fabric_dataagent\",\n sharepoint_grounding: \"sharepointGrounding\",\n azure_function: \"azureFunction\",\n bing_custom_search: \"bingCustomSearch\",\n};\n\n/**\n * Utility class for creating various tools.\n */\nexport class ToolUtility {\n /**\n * Creates a connection tool\n *\n * @param toolType - The type of the connection tool.\n * @param connectionIds - A list of the IDs of the connections to use.\n * @returns An object containing the definition for the connection tool\n */\n static createConnectionTool(\n toolType: connectionToolType,\n connectionIds: string[],\n ): { definition: ToolDefinition } {\n return {\n definition: {\n type: toolType,\n [toolMap[toolType]]: {\n connections: connectionIds.map((connectionId) => ({ connectionId: connectionId })),\n },\n },\n };\n }\n\n /**\n * Creates a bing custom search tool\n *\n * @param searchConfigurations - The ID of bing search connection and instanceName.\n *\n * @returns An object containing the definition and resources for the bing custom search tool\n */\n\n static createBingCustomSearchTool(searchConfigurations: SearchConfigurationOutput[]): {\n definition: ToolDefinition;\n } {\n return {\n definition: {\n type: \"bing_custom_search\",\n bingCustomSearch: {\n searchConfigurations: searchConfigurations.map((searchConfiguration) => ({\n connectionId: searchConfiguration.connectionId,\n instanceName: searchConfiguration.instanceName,\n })),\n },\n },\n };\n }\n\n /**\n * Creates a file search tool\n *\n * @param vectorStoreIds - The ID of the vector store attached to this agent. There can be a maximum of 1 vector store attached to the agent.\n * @param vectorStores - 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.\n * @param definitionDetails - The input definition information for a file search tool as used to configure an agent.\n *\n * @returns An object containing the definition and resources for the file search tool\n */\n static createFileSearchTool(\n vectorStoreIds?: string[],\n vectorStores?: Array<VectorStoreConfigurations>,\n definitionDetails?: FileSearchToolDefinitionDetails,\n ): { definition: FileSearchToolDefinition; resources: ToolResources } {\n return {\n definition: { type: \"file_search\", fileSearch: definitionDetails },\n resources: { fileSearch: { vectorStoreIds: vectorStoreIds, vectorStores: vectorStores } },\n };\n }\n\n /**\n * Creates a code interpreter tool\n *\n * @param fileIds - A list of file IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool.\n * @param dataSources - The data sources to be used. This option is mutually exclusive with fileIds.\n *\n * @returns An object containing the definition and resources for the code interpreter tool.\n */\n static createCodeInterpreterTool(\n fileIds?: string[],\n dataSources?: Array<VectorStoreDataSource>,\n ): { definition: CodeInterpreterToolDefinition; resources: ToolResources } {\n if (fileIds && dataSources) {\n throw new Error(\"Cannot specify both fileIds and dataSources\");\n }\n\n return {\n definition: { type: \"code_interpreter\" },\n resources: { codeInterpreter: { fileIds: fileIds, dataSources: dataSources } },\n };\n }\n\n /**\n * Creates an Azure Function tool\n * @param name - The name of the Azure Function.\n * @param description - The description of the Azure Function.\n * @param parameters - The parameters of the Azure Function.\n * @param inputQueue - The input queue configuration.\n * @param outputQueue - The output queue configuration.\n * @returns An object containing the definition and resources for the Azure Function tool.\n */\n static createAzureFunctionTool(\n name: string,\n description: string,\n parameters: unknown,\n inputQueue: AzureFunctionStorageQueue,\n outputQueue: AzureFunctionStorageQueue,\n definitionDetails: AzureFunctionDefinition,\n ): { definition: AzureFunctionToolDefinition; resources: ToolResources } {\n return {\n definition: { type: \"azure_function\", azureFunction: definitionDetails },\n resources: {\n azureFunction: {\n name: name,\n description: description,\n parameters: parameters,\n inputQueue: inputQueue,\n outputQueue: outputQueue,\n },\n },\n };\n }\n /**\n * Creates an Azure AI search tool\n *\n * @param indexConnectionId - The connection ID of the Azure AI search index.\n * @param indexName - The name of the Azure AI search index.\n *\n * @returns An object containing the definition and resources for the Azure AI search tool.\n */\n static createAzureAISearchTool(\n indexConnectionId: string,\n indexName: string,\n options?: CreateAzureAISearchToolOptions,\n ): { definition: AzureAISearchToolDefinition; resources: ToolResources } {\n return {\n definition: { type: \"azure_ai_search\" },\n resources: {\n azureAISearch: {\n indexes: [\n {\n indexConnectionId: indexConnectionId,\n indexName: indexName,\n queryType: options?.queryType,\n topK: options?.topK,\n filter: options?.filter,\n },\n ],\n },\n },\n };\n }\n\n /**\n * Creates a Microsoft Fabric tool\n *\n * @param connectionIds - A list of the IDs of the Fabric connections to use.\n * @returns An object containing the definition for the Microsoft Fabric tool\n */\n static createFabricTool(connectionId: string): { definition: ToolDefinition } {\n return {\n definition: {\n type: \"fabric_dataagent\",\n fabricDataAgent: {\n connections: [{ connectionId: connectionId }],\n },\n },\n };\n }\n\n /**\n * Creates a function tool\n *\n * @param functionDefinition - The function definition to use.\n *\n * @returns An object containing the definition for the function tool.\n */\n static createFunctionTool(functionDefinition: FunctionDefinition): {\n definition: FunctionToolDefinition;\n } {\n return {\n definition: {\n type: \"function\",\n function: functionDefinition,\n },\n };\n }\n\n /**\n * Creates an OpenApi tool\n *\n * @param openApiFunctionDefinition - The OpenApi function definition to use.\n *\n * @returns An object containing the definition for the OpenApi tool.\n */\n static createOpenApiTool(openApiFunctionDefinition: OpenApiFunctionDefinition): {\n definition: OpenApiToolDefinition;\n } {\n return {\n definition: {\n type: \"openapi\",\n openapi: openApiFunctionDefinition,\n },\n };\n }\n}\n\n/**\n * Represents a set of tools with their definitions and resources.\n */\nexport class ToolSet {\n /** A list of tool definitions that have been added to the tool set. */\n toolDefinitions: ToolDefinition[] = [];\n\n /** A collection of resources associated with the tools in the tool set. */\n toolResources: ToolResources = {};\n\n /**\n * Adds a connection tool to the tool set.\n *\n * @param toolType - The type of the connection tool.\n * @param connectionIds - A list of the IDs of the connections to use.\n *\n * @returns An object containing the definition for the connection tool\n */\n addConnectionTool(\n toolType: connectionToolType,\n connectionIds: string[],\n ): { definition: ToolDefinition } {\n const tool = ToolUtility.createConnectionTool(toolType, connectionIds);\n this.toolDefinitions.push(tool.definition);\n return tool;\n }\n\n /**\n * Adds a file search tool to the tool set.\n *\n * @param vectorStoreIds - The ID of the vector store attached to this agent. There can be a maximum of 1 vector store attached to the agent.\n * @param vectorStores - 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.\n * @param definitionDetails - The input definition information for a file search tool as used to configure an agent.\n *\n * @returns An object containing the definition and resources for the file search tool\n */\n addFileSearchTool(\n vectorStoreIds?: string[],\n vectorStores?: Array<VectorStoreConfigurations>,\n definitionDetails?: FileSearchToolDefinitionDetails,\n ): { definition: FileSearchToolDefinition; resources: ToolResources } {\n const tool = ToolUtility.createFileSearchTool(vectorStoreIds, vectorStores, definitionDetails);\n this.toolDefinitions.push(tool.definition);\n this.toolResources = { ...this.toolResources, ...tool.resources };\n return tool;\n }\n\n /**\n * Adds a code interpreter tool to the tool set.\n *\n * @param fileIds - A list of file IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool.\n * @param dataSources - The data sources to be used. This option is mutually exclusive with fileIds.\n *\n * @returns An object containing the definition and resources for the code interpreter tool\n */\n addCodeInterpreterTool(\n fileIds?: string[],\n dataSources?: Array<VectorStoreDataSource>,\n ): { definition: CodeInterpreterToolDefinition; resources: ToolResources } {\n const tool = ToolUtility.createCodeInterpreterTool(fileIds, dataSources);\n this.toolDefinitions.push(tool.definition);\n this.toolResources = { ...this.toolResources, ...tool.resources };\n return tool;\n }\n\n /**\n * Adds an Azure AI search tool to the tool set.\n *\n * @param indexConnectionId - The connection ID of the Azure AI search index.\n * @param indexName - The name of the Azure AI search index.\n *\n * @returns An object containing the definition and resources for the Azure AI search tool\n */\n addAzureAISearchTool(\n indexConnectionId: string,\n indexName: string,\n ): { definition: AzureAISearchToolDefinition; resources: ToolResources } {\n const tool = ToolUtility.createAzureAISearchTool(indexConnectionId, indexName);\n this.toolDefinitions.push(tool.definition);\n this.toolResources = { ...this.toolResources, ...tool.resources };\n return tool;\n }\n\n /**\n * Adds an OpenApi tool to the tool set.\n *\n * @param openApiFunctionDefinition - The OpenApi function definition to use.\n *\n * @returns An object containing the definition for the OpenApi tool\n */\n addOpenApiTool(openApiFunctionDefinition: OpenApiFunctionDefinition): {\n definition: OpenApiToolDefinition;\n } {\n const tool = ToolUtility.createOpenApiTool(openApiFunctionDefinition);\n this.toolDefinitions.push(tool.definition);\n return tool;\n }\n\n /**\n * Adds an Azure Function tool to the tool set.\n *\n * @param name - The name of the Azure Function.\n * @param description - The description of the Azure Function.\n * @param parameters - The parameters of the Azure Function.\n * @param inputQueue - The input queue configuration.\n * @param outputQueue - The output queue configuration.\n *\n * @returns An object containing the definition and resources for the Azure Function tool.\n */\n addAzureFunctionTool(\n name: string,\n description: string,\n parameters: unknown,\n inputQueue: AzureFunctionStorageQueue,\n outputQueue: AzureFunctionStorageQueue,\n definitionDetails: AzureFunctionDefinition,\n ): { definition: AzureFunctionToolDefinition; resources: ToolResources } {\n const tool = ToolUtility.createAzureFunctionTool(\n name,\n description,\n parameters,\n inputQueue,\n outputQueue,\n definitionDetails,\n );\n this.toolDefinitions.push(tool.definition);\n this.toolResources = { ...this.toolResources, ...tool.resources };\n return tool;\n }\n /**\n * Adds a Microsoft Fabric tool to the tool set.\n *\n * @param connectionId - The ID of the Fabric connection to use.\n * @returns An object containing the definition for the Microsoft Fabric tool\n */\n addFabricTool(connectionId: string): { definition: ToolDefinition } {\n const tool = ToolUtility.createFabricTool(connectionId);\n this.toolDefinitions.push(tool.definition);\n return tool;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/agents/utils.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAiClC,wCAKC;AAbD;;;;;;;GAOG;AACH,SAAgB,cAAc,CAC5B,MAAkF,EAClF,IAAY;IAEZ,OAAO,MAAM,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AAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC3C,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;;;;;OAUG;IACH,oBAAoB,CAClB,IAAY,EACZ,WAAmB,EACnB,UAAmB,EACnB,UAAqC,EACrC,WAAsC,EACtC,iBAA0C;QAE1C,MAAM,IAAI,GAAG,WAAW,CAAC,uBAAuB,CAC9C,IAAI,EACJ,WAAW,EACX,UAAU,EACV,UAAU,EACV,WAAW,EACX,iBAAiB,CAClB,CAAC;QACF,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC3C,IAAI,CAAC,aAAa,mCAAQ,IAAI,CAAC,aAAa,GAAK,IAAI,CAAC,SAAS,CAAE,CAAC;QAClE,OAAO,IAAI,CAAC;IACd,CAAC;IACD;;;;;OAKG;IACH,aAAa,CAAC,YAAoB;QAChC,MAAM,IAAI,GAAG,WAAW,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC;QACxD,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC3C,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAzID,0BAyIC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n AzureAISearchToolDefinition,\n AzureFunctionToolDefinition,\n CodeInterpreterToolDefinition,\n FileSearchToolDefinition,\n FileSearchToolDefinitionDetails,\n FunctionDefinition,\n FunctionToolDefinition,\n SearchConfigurationOutput,\n OpenApiToolDefinition,\n RequiredActionOutput,\n RequiredToolCallOutput,\n ToolDefinition,\n ToolDefinitionOutputParent,\n ToolResources,\n VectorStoreConfigurations,\n VectorStoreDataSource,\n AzureFunctionStorageQueue,\n AzureFunctionDefinition,\n OpenApiFunctionDefinition,\n} from \"./inputOutputs.js\";\nimport type { CreateAzureAISearchToolOptions } from \"../customization/models.js\";\n\n/**\n * Determines if the given output is of the specified type.\n *\n * @typeParam T - The type to check against, which extends one of the possible output parent types.\n * @param output - The action to check, which can be of type `RequiredActionOutput`, `RequiredToolCallOutput`, or `ToolDefinitionOutputParent`.\n * @param type - The type to check the action against.\n * @returns A boolean indicating whether the action is of the specified type.\n */\nexport function isOutputOfType<T extends { type: string }>(\n output: RequiredActionOutput | RequiredToolCallOutput | ToolDefinitionOutputParent,\n type: string,\n): output is T {\n return output.type === type;\n}\n\n/** Types of connection tools used to configure an agent */\nexport enum connectionToolType {\n /** Bing grounding search tool */\n BingGrounding = \"bing_grounding\",\n /** Microsoft Fabric tool */\n MicrosoftFabric = \"fabric_dataagent\",\n /** Sharepoint tool */\n SharepointGrounding = \"sharepoint_grounding\",\n /** Azure Function tool */\n AzureFunction = \"azure_function\",\n /** Bing custom search tool */\n BingCustomSearch = \"bing_custom_search\",\n}\n\nconst toolMap = {\n bing_grounding: \"bingGrounding\",\n fabric_dataagent: \"fabric_dataagent\",\n sharepoint_grounding: \"sharepointGrounding\",\n azure_function: \"azureFunction\",\n bing_custom_search: \"bingCustomSearch\",\n};\n\n/**\n * Utility class for creating various tools.\n */\nexport class ToolUtility {\n /**\n * Creates a connection tool\n *\n * @param toolType - The type of the connection tool.\n * @param connectionIds - A list of the IDs of the connections to use.\n * @returns An object containing the definition for the connection tool\n */\n static createConnectionTool(\n toolType: connectionToolType,\n connectionIds: string[],\n ): { definition: ToolDefinition } {\n return {\n definition: {\n type: toolType,\n [toolMap[toolType]]: {\n connections: connectionIds.map((connectionId) => ({ connectionId: connectionId })),\n },\n },\n };\n }\n\n /**\n * Creates a bing custom search tool\n *\n * @param searchConfigurations - The ID of bing search connection and instanceName.\n *\n * @returns An object containing the definition and resources for the bing custom search tool\n */\n\n static createBingCustomSearchTool(searchConfigurations: SearchConfigurationOutput[]): {\n definition: ToolDefinition;\n } {\n return {\n definition: {\n type: \"bing_custom_search\",\n bingCustomSearch: {\n searchConfigurations: searchConfigurations.map((searchConfiguration) => ({\n connectionId: searchConfiguration.connectionId,\n instanceName: searchConfiguration.instanceName,\n })),\n },\n },\n };\n }\n\n /**\n * Creates a file search tool\n *\n * @param vectorStoreIds - The ID of the vector store attached to this agent. There can be a maximum of 1 vector store attached to the agent.\n * @param vectorStores - 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.\n * @param definitionDetails - The input definition information for a file search tool as used to configure an agent.\n *\n * @returns An object containing the definition and resources for the file search tool\n */\n static createFileSearchTool(\n vectorStoreIds?: string[],\n vectorStores?: Array<VectorStoreConfigurations>,\n definitionDetails?: FileSearchToolDefinitionDetails,\n ): { definition: FileSearchToolDefinition; resources: ToolResources } {\n return {\n definition: { type: \"file_search\", fileSearch: definitionDetails },\n resources: { fileSearch: { vectorStoreIds: vectorStoreIds, vectorStores: vectorStores } },\n };\n }\n\n /**\n * Creates a code interpreter tool\n *\n * @param fileIds - A list of file IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool.\n * @param dataSources - The data sources to be used. This option is mutually exclusive with fileIds.\n *\n * @returns An object containing the definition and resources for the code interpreter tool.\n */\n static createCodeInterpreterTool(\n fileIds?: string[],\n dataSources?: Array<VectorStoreDataSource>,\n ): { definition: CodeInterpreterToolDefinition; resources: ToolResources } {\n if (fileIds && dataSources) {\n throw new Error(\"Cannot specify both fileIds and dataSources\");\n }\n\n return {\n definition: { type: \"code_interpreter\" },\n resources: { codeInterpreter: { fileIds: fileIds, dataSources: dataSources } },\n };\n }\n\n /**\n * Creates an Azure Function tool\n * @param name - The name of the Azure Function.\n * @param description - The description of the Azure Function.\n * @param parameters - The parameters of the Azure Function.\n * @param inputQueue - The input queue configuration.\n * @param outputQueue - The output queue configuration.\n * @returns An object containing the definition and resources for the Azure Function tool.\n */\n static createAzureFunctionTool(\n name: string,\n description: string,\n parameters: unknown,\n inputQueue: AzureFunctionStorageQueue,\n outputQueue: AzureFunctionStorageQueue,\n definitionDetails: AzureFunctionDefinition,\n ): { definition: AzureFunctionToolDefinition; resources: ToolResources } {\n return {\n definition: { type: \"azure_function\", azureFunction: definitionDetails },\n resources: {\n azureFunction: {\n name: name,\n description: description,\n parameters: parameters,\n inputQueue: inputQueue,\n outputQueue: outputQueue,\n },\n },\n };\n }\n /**\n * Creates an Azure AI search tool\n *\n * @param indexConnectionId - The connection ID of the Azure AI search index.\n * @param indexName - The name of the Azure AI search index.\n *\n * @returns An object containing the definition and resources for the Azure AI search tool.\n */\n static createAzureAISearchTool(\n indexConnectionId: string,\n indexName: string,\n options?: CreateAzureAISearchToolOptions,\n ): { definition: AzureAISearchToolDefinition; resources: ToolResources } {\n return {\n definition: { type: \"azure_ai_search\" },\n resources: {\n azureAISearch: {\n indexes: [\n {\n indexConnectionId: indexConnectionId,\n indexName: indexName,\n queryType: options?.queryType,\n topK: options?.topK,\n filter: options?.filter,\n },\n ],\n },\n },\n };\n }\n\n /**\n * Creates a Microsoft Fabric tool\n *\n * @param connectionIds - A list of the IDs of the Fabric connections to use.\n * @returns An object containing the definition for the Microsoft Fabric tool\n */\n static createFabricTool(connectionId: string): { definition: ToolDefinition } {\n return {\n definition: {\n type: \"fabric_dataagent\",\n fabricDataAgent: {\n connections: [{ connectionId: connectionId }],\n },\n },\n };\n }\n\n /**\n * Creates a function tool\n *\n * @param functionDefinition - The function definition to use.\n *\n * @returns An object containing the definition for the function tool.\n */\n static createFunctionTool(functionDefinition: FunctionDefinition): {\n definition: FunctionToolDefinition;\n } {\n return {\n definition: {\n type: \"function\",\n function: functionDefinition,\n },\n };\n }\n\n /**\n * Creates an OpenApi tool\n *\n * @param openApiFunctionDefinition - The OpenApi function definition to use.\n *\n * @returns An object containing the definition for the OpenApi tool.\n */\n static createOpenApiTool(openApiFunctionDefinition: OpenApiFunctionDefinition): {\n definition: OpenApiToolDefinition;\n } {\n return {\n definition: {\n type: \"openapi\",\n openapi: openApiFunctionDefinition,\n },\n };\n }\n}\n/**\n * Represents a set of tools with their definitions and resources.\n */\nexport class ToolSet {\n /** A list of tool definitions that have been added to the tool set. */\n toolDefinitions: ToolDefinition[] = [];\n\n /** A collection of resources associated with the tools in the tool set. */\n toolResources: ToolResources = {};\n\n /**\n * Adds a connection tool to the tool set.\n *\n * @param toolType - The type of the connection tool.\n * @param connectionIds - A list of the IDs of the connections to use.\n *\n * @returns An object containing the definition for the connection tool\n */\n addConnectionTool(\n toolType: connectionToolType,\n connectionIds: string[],\n ): { definition: ToolDefinition } {\n const tool = ToolUtility.createConnectionTool(toolType, connectionIds);\n this.toolDefinitions.push(tool.definition);\n return tool;\n }\n\n /**\n * Adds a file search tool to the tool set.\n *\n * @param vectorStoreIds - The ID of the vector store attached to this agent. There can be a maximum of 1 vector store attached to the agent.\n * @param vectorStores - 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.\n * @param definitionDetails - The input definition information for a file search tool as used to configure an agent.\n *\n * @returns An object containing the definition and resources for the file search tool\n */\n addFileSearchTool(\n vectorStoreIds?: string[],\n vectorStores?: Array<VectorStoreConfigurations>,\n definitionDetails?: FileSearchToolDefinitionDetails,\n ): { definition: FileSearchToolDefinition; resources: ToolResources } {\n const tool = ToolUtility.createFileSearchTool(vectorStoreIds, vectorStores, definitionDetails);\n this.toolDefinitions.push(tool.definition);\n this.toolResources = { ...this.toolResources, ...tool.resources };\n return tool;\n }\n\n /**\n * Adds a code interpreter tool to the tool set.\n *\n * @param fileIds - A list of file IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool.\n * @param dataSources - The data sources to be used. This option is mutually exclusive with fileIds.\n *\n * @returns An object containing the definition and resources for the code interpreter tool\n */\n addCodeInterpreterTool(\n fileIds?: string[],\n dataSources?: Array<VectorStoreDataSource>,\n ): { definition: CodeInterpreterToolDefinition; resources: ToolResources } {\n const tool = ToolUtility.createCodeInterpreterTool(fileIds, dataSources);\n this.toolDefinitions.push(tool.definition);\n this.toolResources = { ...this.toolResources, ...tool.resources };\n return tool;\n }\n\n /**\n * Adds an Azure AI search tool to the tool set.\n *\n * @param indexConnectionId - The connection ID of the Azure AI search index.\n * @param indexName - The name of the Azure AI search index.\n *\n * @returns An object containing the definition and resources for the Azure AI search tool\n */\n addAzureAISearchTool(\n indexConnectionId: string,\n indexName: string,\n ): { definition: AzureAISearchToolDefinition; resources: ToolResources } {\n const tool = ToolUtility.createAzureAISearchTool(indexConnectionId, indexName);\n this.toolDefinitions.push(tool.definition);\n this.toolResources = { ...this.toolResources, ...tool.resources };\n return tool;\n }\n\n /**\n * Adds an OpenApi tool to the tool set.\n *\n * @param openApiFunctionDefinition - The OpenApi function definition to use.\n *\n * @returns An object containing the definition for the OpenApi tool\n */\n addOpenApiTool(openApiFunctionDefinition: OpenApiFunctionDefinition): {\n definition: OpenApiToolDefinition;\n } {\n const tool = ToolUtility.createOpenApiTool(openApiFunctionDefinition);\n this.toolDefinitions.push(tool.definition);\n return tool;\n }\n\n /**\n * Adds an Azure Function tool to the tool set.\n *\n * @param name - The name of the Azure Function.\n * @param description - The description of the Azure Function.\n * @param parameters - The parameters of the Azure Function.\n * @param inputQueue - The input queue configuration.\n * @param outputQueue - The output queue configuration.\n *\n * @returns An object containing the definition and resources for the Azure Function tool.\n */\n addAzureFunctionTool(\n name: string,\n description: string,\n parameters: unknown,\n inputQueue: AzureFunctionStorageQueue,\n outputQueue: AzureFunctionStorageQueue,\n definitionDetails: AzureFunctionDefinition,\n ): { definition: AzureFunctionToolDefinition; resources: ToolResources } {\n const tool = ToolUtility.createAzureFunctionTool(\n name,\n description,\n parameters,\n inputQueue,\n outputQueue,\n definitionDetails,\n );\n this.toolDefinitions.push(tool.definition);\n this.toolResources = { ...this.toolResources, ...tool.resources };\n return tool;\n }\n /**\n * Adds a Microsoft Fabric tool to the tool set.\n *\n * @param connectionId - The ID of the Fabric connection to use.\n * @returns An object containing the definition for the Microsoft Fabric tool\n */\n addFabricTool(connectionId: string): { definition: ToolDefinition } {\n const tool = ToolUtility.createFabricTool(connectionId);\n this.toolDefinitions.push(tool.definition);\n return tool;\n }\n}\n"]}
|
|
@@ -13,6 +13,7 @@ export declare function convertOpenAIPageableListOfThreadRunOutput(input: Genera
|
|
|
13
13
|
export declare function convertRunStepOutput(input: GeneratedModels.RunStepOutput): PublicModels.RunStepOutput;
|
|
14
14
|
export declare function convertOpenAIPageableListOfRunStepOutput(input: GeneratedModels.OpenAIPageableListOfRunStepOutput): PublicModels.OpenAIPageableListOfRunStepOutput;
|
|
15
15
|
export declare function convertOpenAIPageableListOfThreadMessageOutput(input: GeneratedModels.OpenAIPageableListOfThreadMessageOutput): PublicModels.OpenAIPageableListOfThreadMessageOutput;
|
|
16
|
+
export declare function convertOpenAIPageableListOfAgentThreadOutput(input: GeneratedModels.OpenAIPageableListOfAgentThreadOutput): PublicModels.OpenAIPageableListOfAgentThreadOutput;
|
|
16
17
|
export declare function convertOpenAIPageableListOfVectorStoreOutput(input: GeneratedModels.OpenAIPageableListOfVectorStoreOutput): PublicModels.OpenAIPageableListOfVectorStoreOutput;
|
|
17
18
|
export declare function convertVectorStoreOutput(input: GeneratedModels.VectorStoreOutput): PublicModels.VectorStoreOutput;
|
|
18
19
|
export declare function convertVectorStoreDeletionStatusOutput(input: GeneratedModels.VectorStoreDeletionStatusOutput): PublicModels.VectorStoreDeletionStatusOutput;
|