@azure/ai-projects 1.0.0-beta.3 → 1.0.0-beta.4
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 +26 -3
- package/dist/browser/agents/assistants.js +2 -2
- package/dist/browser/agents/assistants.js.map +1 -1
- package/dist/browser/agents/inputValidations.js +2 -2
- package/dist/browser/agents/inputValidations.js.map +1 -1
- package/dist/browser/agents/utils.d.ts +19 -1
- package/dist/browser/agents/utils.d.ts.map +1 -1
- package/dist/browser/agents/utils.js +29 -2
- package/dist/browser/agents/utils.js.map +1 -1
- package/dist/browser/constants.d.ts +1 -1
- package/dist/browser/constants.js +1 -1
- package/dist/browser/constants.js.map +1 -1
- package/dist/browser/customization/convertModelsToWrite.d.ts.map +1 -1
- package/dist/browser/customization/convertModelsToWrite.js +2 -2
- package/dist/browser/customization/convertModelsToWrite.js.map +1 -1
- package/dist/browser/customization/convertOutputModelsFromWire.d.ts.map +1 -1
- package/dist/browser/customization/convertOutputModelsFromWire.js +5 -5
- package/dist/browser/customization/convertOutputModelsFromWire.js.map +1 -1
- package/dist/browser/customization/models.d.ts +5 -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 +8 -8
- package/dist/browser/customization/outputModels.d.ts.map +1 -1
- package/dist/browser/customization/outputModels.js.map +1 -1
- package/dist/browser/generated/src/clientDefinitions.d.ts +3 -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 +1 -1
- package/dist/browser/generated/src/isUnexpected.d.ts.map +1 -1
- package/dist/browser/generated/src/isUnexpected.js.map +1 -1
- package/dist/browser/generated/src/models.d.ts +65 -12
- 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 +98 -19
- 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/paginateHelper.d.ts +1 -1
- package/dist/browser/generated/src/paginateHelper.d.ts.map +1 -1
- package/dist/browser/generated/src/paginateHelper.js +1 -1
- package/dist/browser/generated/src/paginateHelper.js.map +1 -1
- package/dist/browser/generated/src/parameters.d.ts +67 -10
- 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.d.ts +3 -3
- package/dist/browser/generated/src/projectsClient.d.ts.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 +5 -4
- 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/assistants.js +2 -2
- package/dist/commonjs/agents/assistants.js.map +1 -1
- package/dist/commonjs/agents/inputValidations.js +2 -2
- package/dist/commonjs/agents/inputValidations.js.map +1 -1
- package/dist/commonjs/agents/utils.d.ts +19 -1
- package/dist/commonjs/agents/utils.d.ts.map +1 -1
- package/dist/commonjs/agents/utils.js +29 -2
- package/dist/commonjs/agents/utils.js.map +1 -1
- package/dist/commonjs/constants.d.ts +1 -1
- package/dist/commonjs/constants.js +1 -1
- package/dist/commonjs/constants.js.map +1 -1
- package/dist/commonjs/customization/convertModelsToWrite.d.ts.map +1 -1
- package/dist/commonjs/customization/convertModelsToWrite.js +2 -2
- package/dist/commonjs/customization/convertModelsToWrite.js.map +1 -1
- package/dist/commonjs/customization/convertOutputModelsFromWire.d.ts.map +1 -1
- package/dist/commonjs/customization/convertOutputModelsFromWire.js +5 -5
- package/dist/commonjs/customization/convertOutputModelsFromWire.js.map +1 -1
- package/dist/commonjs/customization/models.d.ts +5 -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 +8 -8
- package/dist/commonjs/customization/outputModels.d.ts.map +1 -1
- package/dist/commonjs/customization/outputModels.js.map +1 -1
- package/dist/commonjs/generated/src/clientDefinitions.d.ts +3 -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 +1 -1
- package/dist/commonjs/generated/src/isUnexpected.d.ts.map +1 -1
- package/dist/commonjs/generated/src/isUnexpected.js.map +1 -1
- package/dist/commonjs/generated/src/models.d.ts +65 -12
- 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 +98 -19
- 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/paginateHelper.d.ts +1 -1
- package/dist/commonjs/generated/src/paginateHelper.d.ts.map +1 -1
- package/dist/commonjs/generated/src/paginateHelper.js.map +1 -1
- package/dist/commonjs/generated/src/parameters.d.ts +67 -10
- 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.d.ts +3 -3
- package/dist/commonjs/generated/src/projectsClient.d.ts.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 +5 -4
- package/dist/commonjs/generated/src/responses.d.ts.map +1 -1
- package/dist/commonjs/generated/src/responses.js.map +1 -1
- package/dist/commonjs/tsdoc-metadata.json +1 -1
- package/dist/esm/agents/assistants.js +2 -2
- package/dist/esm/agents/assistants.js.map +1 -1
- package/dist/esm/agents/inputValidations.js +2 -2
- package/dist/esm/agents/inputValidations.js.map +1 -1
- package/dist/esm/agents/utils.d.ts +19 -1
- package/dist/esm/agents/utils.d.ts.map +1 -1
- package/dist/esm/agents/utils.js +29 -2
- package/dist/esm/agents/utils.js.map +1 -1
- package/dist/esm/constants.d.ts +1 -1
- package/dist/esm/constants.js +1 -1
- package/dist/esm/constants.js.map +1 -1
- package/dist/esm/customization/convertModelsToWrite.d.ts.map +1 -1
- package/dist/esm/customization/convertModelsToWrite.js +2 -2
- package/dist/esm/customization/convertModelsToWrite.js.map +1 -1
- package/dist/esm/customization/convertOutputModelsFromWire.d.ts.map +1 -1
- package/dist/esm/customization/convertOutputModelsFromWire.js +5 -5
- package/dist/esm/customization/convertOutputModelsFromWire.js.map +1 -1
- package/dist/esm/customization/models.d.ts +5 -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 +8 -8
- package/dist/esm/customization/outputModels.d.ts.map +1 -1
- package/dist/esm/customization/outputModels.js.map +1 -1
- package/dist/esm/generated/src/clientDefinitions.d.ts +3 -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 +1 -1
- package/dist/esm/generated/src/isUnexpected.d.ts.map +1 -1
- package/dist/esm/generated/src/isUnexpected.js.map +1 -1
- package/dist/esm/generated/src/models.d.ts +65 -12
- 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 +98 -19
- 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/paginateHelper.d.ts +1 -1
- package/dist/esm/generated/src/paginateHelper.d.ts.map +1 -1
- package/dist/esm/generated/src/paginateHelper.js +1 -1
- package/dist/esm/generated/src/paginateHelper.js.map +1 -1
- package/dist/esm/generated/src/parameters.d.ts +67 -10
- 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.d.ts +3 -3
- package/dist/esm/generated/src/projectsClient.d.ts.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 +5 -4
- 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/assistants.js +2 -2
- package/dist/react-native/agents/assistants.js.map +1 -1
- package/dist/react-native/agents/inputValidations.js +2 -2
- package/dist/react-native/agents/inputValidations.js.map +1 -1
- package/dist/react-native/agents/utils.d.ts +19 -1
- package/dist/react-native/agents/utils.d.ts.map +1 -1
- package/dist/react-native/agents/utils.js +29 -2
- package/dist/react-native/agents/utils.js.map +1 -1
- package/dist/react-native/constants.d.ts +1 -1
- package/dist/react-native/constants.js +1 -1
- package/dist/react-native/constants.js.map +1 -1
- package/dist/react-native/customization/convertModelsToWrite.d.ts.map +1 -1
- package/dist/react-native/customization/convertModelsToWrite.js +2 -2
- package/dist/react-native/customization/convertModelsToWrite.js.map +1 -1
- package/dist/react-native/customization/convertOutputModelsFromWire.d.ts.map +1 -1
- package/dist/react-native/customization/convertOutputModelsFromWire.js +5 -5
- package/dist/react-native/customization/convertOutputModelsFromWire.js.map +1 -1
- package/dist/react-native/customization/models.d.ts +5 -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 +8 -8
- 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/generated/src/clientDefinitions.d.ts +3 -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 +1 -1
- package/dist/react-native/generated/src/isUnexpected.d.ts.map +1 -1
- package/dist/react-native/generated/src/isUnexpected.js.map +1 -1
- package/dist/react-native/generated/src/models.d.ts +65 -12
- 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 +98 -19
- 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/paginateHelper.d.ts +1 -1
- package/dist/react-native/generated/src/paginateHelper.d.ts.map +1 -1
- package/dist/react-native/generated/src/paginateHelper.js +1 -1
- package/dist/react-native/generated/src/paginateHelper.js.map +1 -1
- package/dist/react-native/generated/src/parameters.d.ts +67 -10
- 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.d.ts +3 -3
- package/dist/react-native/generated/src/projectsClient.d.ts.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 +5 -4
- 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 +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inputValidations.js","sourceRoot":"","sources":["../../../src/agents/inputValidations.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAQlC,MAAM,UAAU,2BAA2B,CAAC,YAAqC;IAC/E,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;QACnF,MAAM,IAAI,KAAK,CAAC,+DAA+D,CAAC,CAAC;IACnF,CAAC;AACH,CAAC;AAED,MAAM,UAAU,gBA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CAAC,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,QAAQ,CAAC,KAA2B,CAAC,EAAE,CAAC;QAC7E,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;IACnE,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n ToolDefinition,\n UpdateToolResourcesOptions,\n VectorStoreDataSource,\n} from \"../generated/src/models.js\";\n\nexport function validateVectorStoreDataType(data_sources: VectorStoreDataSource[]): void {\n if (!data_sources.some((value) => ![\"uri_asset\", \"id_asset\"].includes(value.type))) {\n throw new Error(\"Vector store data type must be one of 'uri_asset', 'id_asset'\");\n }\n}\n\nexport function validateThreadId(threadId: string): void {\n if (!threadId) {\n throw new Error(\"Thread ID is required\");\n }\n}\n\nexport function validateRunId(runId: string): void {\n if (!runId) {\n throw new Error(\"Run ID is required\");\n }\n}\n\nexport function validateLimit(limit: number): void {\n if (limit < 1 || limit > 100) {\n throw new Error(\"Limit must be between 1 and 100\");\n }\n}\n\nexport function validateOrder(order: string): void {\n if (![\"asc\", \"desc\"].includes(order)) {\n throw new Error(\"Order must be 'asc' or 'desc'\");\n }\n}\n\nenum Tools {\n CodeInterpreter = \"code_interpreter\",\n FileSearch = \"file_search\",\n Function = \"function\",\n BingGrounding = \"bing_grounding\",\n MicrosoftFabric = \"
|
|
1
|
+
{"version":3,"file":"inputValidations.js","sourceRoot":"","sources":["../../../src/agents/inputValidations.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAQlC,MAAM,UAAU,2BAA2B,CAAC,YAAqC;IAC/E,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;QACnF,MAAM,IAAI,KAAK,CAAC,+DAA+D,CAAC,CAAC;I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AM,UAAU,0BAA0B,CAAC,KAAa;IACtD,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,QAAQ,CAAC,KAA2B,CAAC,EAAE,CAAC;QAC7E,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;IACnE,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n ToolDefinition,\n UpdateToolResourcesOptions,\n VectorStoreDataSource,\n} from \"../generated/src/models.js\";\n\nexport function validateVectorStoreDataType(data_sources: VectorStoreDataSource[]): void {\n if (!data_sources.some((value) => ![\"uri_asset\", \"id_asset\"].includes(value.type))) {\n throw new Error(\"Vector store data type must be one of 'uri_asset', 'id_asset'\");\n }\n}\n\nexport function validateThreadId(threadId: string): void {\n if (!threadId) {\n throw new Error(\"Thread ID is required\");\n }\n}\n\nexport function validateRunId(runId: string): void {\n if (!runId) {\n throw new Error(\"Run ID is required\");\n }\n}\n\nexport function validateLimit(limit: number): void {\n if (limit < 1 || limit > 100) {\n throw new Error(\"Limit must be between 1 and 100\");\n }\n}\n\nexport function validateOrder(order: string): void {\n if (![\"asc\", \"desc\"].includes(order)) {\n throw new Error(\"Order must be 'asc' or 'desc'\");\n }\n}\n\nenum Tools {\n CodeInterpreter = \"code_interpreter\",\n FileSearch = \"file_search\",\n Function = \"function\",\n BingGrounding = \"bing_grounding\",\n MicrosoftFabric = \"fabric_dataagent\",\n SharepointGrounding = \"sharepoint_grounding\",\n AzureAISearch = \"azure_ai_search\",\n AzureFunction = \"azure_function\",\n}\n\nexport function validateTools(value: Array<ToolDefinition>): void {\n if (value.some((tool) => !Object.values(Tools).includes(tool as unknown as Tools))) {\n throw new Error(\n \"Tool type must be one of 'code_interpreter', 'file_search', 'function', 'bing_grounding', 'fabric_dataagent', 'sharepoint_grounding', 'azure_ai_search', 'azure_function'\",\n );\n }\n}\n\nexport function validateMetadata(metadata: Record<string, string>): void {\n if (Object.keys(metadata).length > 16) {\n throw new Error(\"Only 16 key/value pairs are allowed\");\n }\n if (Object.keys(metadata).some((value) => value.length > 64)) {\n throw new Error(\"Keys must be less than 64 characters\");\n }\n if (Object.values(metadata).some((value) => value.length > 512)) {\n throw new Error(\"Values must be less than 512 characters\");\n }\n}\n\nexport function validateToolResources(toolResource: UpdateToolResourcesOptions): void {\n if (toolResource.code_interpreter) {\n if (\n toolResource.code_interpreter.file_ids &&\n toolResource.code_interpreter.file_ids.length > 20\n ) {\n throw new Error(\"A maximum of 20 file IDs are allowed\");\n }\n }\n if (toolResource.file_search) {\n if (\n toolResource.file_search.vector_store_ids &&\n toolResource.file_search.vector_store_ids.length > 1\n ) {\n throw new Error(\"Only one vector store ID is allowed\");\n }\n }\n if (toolResource.azure_ai_search) {\n if (toolResource.azure_ai_search.indexes && toolResource.azure_ai_search.indexes.length > 1) {\n throw new Error(\"Only one index is allowed\");\n }\n }\n}\n\nexport function validateVectorStoreId(vectorStoreId: string): void {\n if (!vectorStoreId) {\n throw new Error(\"Vector store ID is required\");\n }\n}\n\nexport function validateFileId(fileId: string): void {\n if (!fileId) {\n throw new Error(\"File ID is required\");\n }\n}\n\nenum FileBatchStatus {\n InProgress = \"in_progress\",\n Completed = \"completed\",\n Failed = \"failed\",\n Cancelled = \"cancelled\",\n}\n\nexport function validateFileStatusFilter(filter: string): void {\n if (!Object.values(FileBatchStatus).includes(filter as FileBatchStatus)) {\n throw new Error(\n \"File status filter must be one of 'in_progress', 'completed', 'failed', 'cancelled'\",\n );\n }\n}\n\nenum Messages {\n User = \"user\",\n Assistants = \"assistant\",\n}\n\nexport function validateMessages(value: string): void {\n if (!Object.values(Messages).includes(value as Messages)) {\n throw new Error(\"Role must be either 'user' or 'assistant'\");\n }\n}\n\nenum TruncationStrategy {\n Auto = \"auto\",\n LastMessages = \"last_messages\",\n}\n\nexport function validateTruncationStrategy(value: string): void {\n if (!Object.values(TruncationStrategy).includes(value as TruncationStrategy)) {\n throw new Error(\"Role must be either 'auto' or 'last_messages'\");\n }\n}\n"]}
|
|
@@ -15,7 +15,7 @@ export declare enum connectionToolType {
|
|
|
15
15
|
/** Bing grounding search tool */
|
|
16
16
|
BingGrounding = "bing_grounding",
|
|
17
17
|
/** Microsoft Fabric tool */
|
|
18
|
-
MicrosoftFabric = "
|
|
18
|
+
MicrosoftFabric = "fabric_dataagent",
|
|
19
19
|
/** Sharepoint tool */
|
|
20
20
|
SharepointGrounding = "sharepoint_grounding",
|
|
21
21
|
/** Azure Function tool */
|
|
@@ -85,6 +85,15 @@ export declare class ToolUtility {
|
|
|
85
85
|
definition: AzureAISearchToolDefinition;
|
|
86
86
|
resources: ToolResources;
|
|
87
87
|
};
|
|
88
|
+
/**
|
|
89
|
+
* Creates a Microsoft Fabric tool
|
|
90
|
+
*
|
|
91
|
+
* @param connectionIds - A list of the IDs of the Fabric connections to use.
|
|
92
|
+
* @returns An object containing the definition for the Microsoft Fabric tool
|
|
93
|
+
*/
|
|
94
|
+
static createFabricTool(connectionId: string): {
|
|
95
|
+
definition: ToolDefinition;
|
|
96
|
+
};
|
|
88
97
|
/**
|
|
89
98
|
* Creates a function tool
|
|
90
99
|
*
|
|
@@ -187,5 +196,14 @@ export declare class ToolSet {
|
|
|
187
196
|
definition: AzureFunctionToolDefinition;
|
|
188
197
|
resources: ToolResources;
|
|
189
198
|
};
|
|
199
|
+
/**
|
|
200
|
+
* Adds a Microsoft Fabric tool to the tool set.
|
|
201
|
+
*
|
|
202
|
+
* @param connectionId - The ID of the Fabric connection to use.
|
|
203
|
+
* @returns An object containing the definition for the Microsoft Fabric tool
|
|
204
|
+
*/
|
|
205
|
+
addFabricTool(connectionId: string): {
|
|
206
|
+
definition: ToolDefinition;
|
|
207
|
+
};
|
|
190
208
|
}
|
|
191
209
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/agents/utils.ts"],"names":[],"mappings":"AAGA,OA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EACzB,SAAS,EAAE,MAAM,GAChB;QAAE,UAAU,EAAE,2BAA2B,CAAC;QAAC,SAAS,EAAE,aAAa,CAAA;KAAE;IAOxE;;;;;;OAMG;IACH,cAAc,CAAC,yBAAyB,EAAE,yBAAyB,GAAG;QACpE,UAAU,EAAE,qBAAqB,CAAC;KACnC;IAMD;;;;;;;;;;OAUG;IACH,oBAAoB,CAClB,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,OAAO,EACnB,UAAU,EAAE,yBAAyB,EACrC,WAAW,EAAE,yBAAyB,EACtC,iBAAiB,EAAE,uBAAuB,GACzC;QAAE,UAAU,EAAE,2BAA2B,CAAC;QAAC,SAAS,EAAE,aAAa,CAAA;KAAE;IAaxE;;;;;OAKG;IACH,aAAa,CAAC,YAAY,EAAE,MAAM,GAAG;QAAE,UAAU,EAAE,cAAc,CAAA;KAAE;CAKpE"}
|
|
@@ -17,7 +17,7 @@ export var connectionToolType;
|
|
|
17
17
|
/** Bing grounding search tool */
|
|
18
18
|
connectionToolType["BingGrounding"] = "bing_grounding";
|
|
19
19
|
/** Microsoft Fabric tool */
|
|
20
|
-
connectionToolType["MicrosoftFabric"] = "
|
|
20
|
+
connectionToolType["MicrosoftFabric"] = "fabric_dataagent";
|
|
21
21
|
/** Sharepoint tool */
|
|
22
22
|
connectionToolType["SharepointGrounding"] = "sharepoint_grounding";
|
|
23
23
|
/** Azure Function tool */
|
|
@@ -25,7 +25,7 @@ export var connectionToolType;
|
|
|
25
25
|
})(connectionToolType || (connectionToolType = {}));
|
|
26
26
|
const toolMap = {
|
|
27
27
|
bing_grounding: "bingGrounding",
|
|
28
|
-
|
|
28
|
+
fabric_dataagent: "fabric_dataagent",
|
|
29
29
|
sharepoint_grounding: "sharepointGrounding",
|
|
30
30
|
azure_function: "azureFunction",
|
|
31
31
|
};
|
|
@@ -123,6 +123,22 @@ export class ToolUtility {
|
|
|
123
123
|
},
|
|
124
124
|
};
|
|
125
125
|
}
|
|
126
|
+
/**
|
|
127
|
+
* Creates a Microsoft Fabric tool
|
|
128
|
+
*
|
|
129
|
+
* @param connectionIds - A list of the IDs of the Fabric connections to use.
|
|
130
|
+
* @returns An object containing the definition for the Microsoft Fabric tool
|
|
131
|
+
*/
|
|
132
|
+
static createFabricTool(connectionId) {
|
|
133
|
+
return {
|
|
134
|
+
definition: {
|
|
135
|
+
type: "fabric_dataagent",
|
|
136
|
+
fabricDataAgent: {
|
|
137
|
+
connections: [{ connectionId: connectionId }],
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
};
|
|
141
|
+
}
|
|
126
142
|
/**
|
|
127
143
|
* Creates a function tool
|
|
128
144
|
*
|
|
@@ -249,5 +265,16 @@ export class ToolSet {
|
|
|
249
265
|
this.toolResources = Object.assign(Object.assign({}, this.toolResources), tool.resources);
|
|
250
266
|
return tool;
|
|
251
267
|
}
|
|
268
|
+
/**
|
|
269
|
+
* Adds a Microsoft Fabric tool to the tool set.
|
|
270
|
+
*
|
|
271
|
+
* @param connectionId - The ID of the Fabric connection to use.
|
|
272
|
+
* @returns An object containing the definition for the Microsoft Fabric tool
|
|
273
|
+
*/
|
|
274
|
+
addFabricTool(connectionId) {
|
|
275
|
+
const tool = ToolUtility.createFabricTool(connectionId);
|
|
276
|
+
this.toolDefinitions.push(tool.definition);
|
|
277
|
+
return tool;
|
|
278
|
+
}
|
|
252
279
|
}
|
|
253
280
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/agents/utils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAuBlC;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAC5B,MAAkF,EAClF,IAAY;IAEZ,OAAO,MAAM,CAAC,IAAI,KAAK,IAAI,CAAC;AAC9B,CAAC;AAED,2DAA2D;AAC3D,MAAM,CAAN,IAAY,kBASX;AATD,WAAY,kBAAkB;IA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AAC,UAAU,CAAC,CAAC;QAC3C,IAAI,CAAC,aAAa,mCAAQ,IAAI,CAAC,aAAa,GAAK,IAAI,CAAC,SAAS,CAAE,CAAC;QAClE,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;OAMG;IACH,cAAc,CAAC,yBAAoD;QAGjE,MAAM,IAAI,GAAG,WAAW,CAAC,iBAAiB,CAAC,yBAAyB,CAAC,CAAC;QACtE,IAAI,CAAC,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;CACF","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 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\";\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 = \"microsoft_fabric\",\n /** Sharepoint tool */\n SharepointGrounding = \"sharepoint_grounding\",\n /** Azure Function tool */\n AzureFunction = \"azure_function\",\n}\n\nconst toolMap = {\n bing_grounding: \"bingGrounding\",\n microsoft_fabric: \"microsoftFabric\",\n sharepoint_grounding: \"sharepointGrounding\",\n azure_function: \"azureFunction\",\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 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 ): { definition: AzureAISearchToolDefinition; resources: ToolResources } {\n return {\n definition: { type: \"azure_ai_search\" },\n resources: {\n azureAISearch: {\n indexes: [{ indexConnectionId: indexConnectionId, indexName: indexName }],\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"]}
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/agents/utils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAuBlC;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAC5B,MAAkF,EAClF,IAAY;IAEZ,OAAO,MAAM,CAAC,IAAI,KAAK,IAAI,CAAC;AAC9B,CAAC;AAED,2DAA2D;AAC3D,MAAM,CAAN,IAAY,kBASX;AATD,WAAY,kBAAkB;IAC5B,iCAAiC;IACjC,sDAAgC,CAAA;IAChC,4BAA4B;IAC5B,0DAAoC,CAAA;IACpC,sBAAsB;IACtB,kEAA4C,CAAA;IAC5C,0BAA0B;IAC1B,sDAAgC,CAAA;AAClC,CAAC,EATW,kBAAkB,KAAlB,kBAAkB,QAS7B;AAED,MAAM,OAAO,GAAG;IACd,cAAc,EAAE,eAAe;IAC/B,gBAAgB,EAAE,kBAAkB;IACpC,oBAAoB,EAAE,qBAAqB;IAC3C,cAAc,EAAE,eAAe;CAChC,CAAC;AAEF;;GAEG;AACH,MAAM,OAAO,WAAW;IACtB;;;;;;OAMG;IACH,MAAM,CAAC,oBAAoB,CACzB,QAA4B,EAC5B,aAAuB;QAEvB,OAAO;YACL,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,EAAE;oBACnB,WAAW,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC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C;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","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 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\";\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}\n\nconst toolMap = {\n bing_grounding: \"bingGrounding\",\n fabric_dataagent: \"fabric_dataagent\",\n sharepoint_grounding: \"sharepointGrounding\",\n azure_function: \"azureFunction\",\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 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 ): { definition: AzureAISearchToolDefinition; resources: ToolResources } {\n return {\n definition: { type: \"azure_ai_search\" },\n resources: {\n azureAISearch: {\n indexes: [{ indexConnectionId: indexConnectionId, indexName: indexName }],\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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,cAAc,CAAC;AAE1C;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,oBAAoB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Current version of the `@azure/ai-projects` package.\n */\nexport const SDK_VERSION = `1.0.0-beta.
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,cAAc,CAAC;AAE1C;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,oBAAoB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Current version of the `@azure/ai-projects` package.\n */\nexport const SDK_VERSION = `1.0.0-beta.4`;\n\n/**\n * The package name of the `@azure/ai-projects` package.\n */\nexport const PACKAGE_NAME = \"@azure/ai-projects\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convertModelsToWrite.d.ts","sourceRoot":"","sources":["../../../src/customization/convertModelsToWrite.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,YAAY,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,KAAK,eAAe,MAAM,4BAA4B,CAAC;AAGnE,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,YAAY,CAAC,kBAAkB,GACtC,eAAe,CAAC,kBAAkB,CAapC;AAsKD,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,YAAY,CAAC,qBAAqB,GACzC,eAAe,CAAC,qBAAqB,CAKvC;
|
|
1
|
+
{"version":3,"file":"convertModelsToWrite.d.ts","sourceRoot":"","sources":["../../../src/customization/convertModelsToWrite.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,YAAY,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,KAAK,eAAe,MAAM,4BAA4B,CAAC;AAGnE,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,YAAY,CAAC,kBAAkB,GACtC,eAAe,CAAC,kBAAkB,CAapC;AAsKD,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,YAAY,CAAC,qBAAqB,GACzC,eAAe,CAAC,qBAAqB,CAKvC;AA8ED,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,YAAY,CAAC,kBAAkB,GACtC,eAAe,CAAC,kBAAkB,CAapC;AAED,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,YAAY,CAAC,0BAA0B,GAC9C,eAAe,CAAC,0BAA0B,CAM5C;AAED,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,YAAY,CAAC,wBAAwB,GAC5C,eAAe,CAAC,wBAAwB,CAK1C;AAyBD,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,YAAY,CAAC,gBAAgB,GACpC,eAAe,CAAC,gBAAgB,CA0BlC;AA2CD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,YAAY,CAAC,UAAU,GAAG,eAAe,CAAC,UAAU,CAK7F;AAED,wBAAgB,gCAAgC,CAC9C,MAAM,EAAE,YAAY,CAAC,yBAAyB,GAC7C,eAAe,CAAC,yBAAyB,CAwB3C;AAWD,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,YAAY,CAAC,kBAAkB,GACtC,eAAe,CAAC,kBAAkB,CAepC;AAED,wBAAgB,yCAAyC,CACvD,MAAM,EAAE,YAAY,CAAC,kCAAkC,GACtD,eAAe,CAAC,kCAAkC,CAWpD;AAoBD,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,YAAY,CAAC,wBAAwB,GAC5C,eAAe,CAAC,wBAAwB,CAQ1C"}
|
|
@@ -33,7 +33,7 @@ function convertToolDefinition(source) {
|
|
|
33
33
|
return convertFunctionToolDefinition(source);
|
|
34
34
|
case "bing_grounding":
|
|
35
35
|
return convertBingGroundingToolDefinition(source);
|
|
36
|
-
case "
|
|
36
|
+
case "fabric_dataagent":
|
|
37
37
|
return convertMicrosoftFabricToolDefinition(source);
|
|
38
38
|
case "sharepoint_grounding":
|
|
39
39
|
return convertSharepointToolDefinition(source);
|
|
@@ -72,7 +72,7 @@ function convertBingGroundingToolDefinition(source) {
|
|
|
72
72
|
function convertMicrosoftFabricToolDefinition(source) {
|
|
73
73
|
return {
|
|
74
74
|
type: source.type,
|
|
75
|
-
|
|
75
|
+
fabric_dataagent: convertToolConnectionList(source.fabricDataAgent),
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
78
|
function convertSharepointToolDefinition(source) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convertModelsToWrite.js","sourceRoot":"","sources":["../../../src/customization/convertModelsToWrite.ts"],"names":[],"mappings":"A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tE;AACJ,CAAC;AAED,SAAS,+CAA+C,CACtD,MAA6D;IAE7D,OAAO;QACL,qBAAqB,EAAE,MAAM,CAAC,kBAAkB;QAChD,oBAAoB,EAAE,MAAM,CAAC,kBAAkB;KAChD,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,+BAA+B,CAC7C,MAA6C;IAE7C,qDACK,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,GACtC,CAAC,MAAM,CAAC,YAAY,IAAI;QACzB,aAAa,EAAE,kCAAkC,CAAC,MAAM,CAAC,YAAY,CAAC;KACvE,CAAC,GACC,CAAC,MAAM,CAAC,QAAQ,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC,EACrD;AACJ,CAAC;AAED,SAAS,yBAAyB,CAChC,MAAuC;IAEvC,qCACE,IAAI,EAAE,MAAM,CAAC,IAAI,IACd,CAAC,MAAM,CAAC,WAAW,IAAI,EAAE,WAAW,EAAE,MAAM,CAAC,WAAW,EAAE,CAAC,KAC9D,UAAU,EAAE,MAAM,CAAC,UAAU,IAC7B;AACJ,CAAC;AAED,SAAS,yBAAyB,CAChC,MAAuC;IAEvC,yBACK,CAAC,MAAM,CAAC,WAAW,IAAI,EAAE,WAAW,EAAE,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,qBAAqB,CAAC,EAAE,CAAC,EACzF;AACJ,CAAC;AAED,SAAS,qBAAqB,CAC5B,MAAmC;IAEnC,OAAO;QACL,aAAa,EAAE,MAAM,CAAC,YAAY;KACnC,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type * as PublicModels from \"./models.js\";\nimport type * as GeneratedModels from \"../generated/src/models.js\";\n\n// Conversion functions\nexport function convertCreateAgentOptions(\n source: PublicModels.CreateAgentOptions,\n): GeneratedModels.CreateAgentOptions {\n return {\n model: source.model,\n ...(source.name && { name: source.name }),\n ...(source.description && { description: source.description }),\n ...(source.instructions && { instructions: source.instructions }),\n ...(source.tools && { tools: source.tools.map(convertToolDefinition) }),\n ...(source.toolResources && { tool_resources: convertToolResources(source.toolResources) }),\n ...(source.temperature !== undefined && { temperature: source.temperature }),\n ...(source.topP !== undefined && { top_p: source.topP }),\n ...(source.responseFormat && { response_format: source.responseFormat }),\n ...(source.metadata && { metadata: source.metadata }),\n };\n}\n\nfunction convertToolResources(source: PublicModels.ToolResources): GeneratedModels.ToolResources {\n return {\n ...(source.codeInterpreter && {\n code_interpreter: convertCodeInterpreterToolResource(source.codeInterpreter),\n }),\n ...(source.fileSearch && { file_search: convertFileSearchToolResource(source.fileSearch) }),\n ...(source.azureAISearch && {\n azure_ai_search: convertAzureAISearchResource(source.azureAISearch),\n }),\n ...(source.azureFunction && {\n name: source.azureFunction.name,\n }),\n };\n}\n\nfunction convertMessageAttachmentToolDefinition(\n source: PublicModels.MessageAttachmentToolDefinition,\n): GeneratedModels.MessageAttachmentToolDefinition {\n switch (source.type) {\n case \"code_interpreter\":\n return convertCodeInterpreterToolDefinition(\n source as PublicModels.CodeInterpreterToolDefinition,\n );\n case \"file_search\":\n return convertFileSearchToolDefinition(source as PublicModels.FileSearchToolDefinition);\n default:\n throw new Error(`Unknown tool type: ${source}`);\n }\n}\n\nfunction convertToolDefinition(\n source: PublicModels.ToolDefinition,\n): GeneratedModels.ToolDefinition {\n switch (source.type) {\n case \"code_interpreter\":\n return convertCodeInterpreterToolDefinition(\n source as PublicModels.CodeInterpreterToolDefinition,\n );\n case \"file_search\":\n return convertFileSearchToolDefinition(source as PublicModels.FileSearchToolDefinition);\n case \"function\":\n return convertFunctionToolDefinition(source as PublicModels.FunctionToolDefinition);\n case \"bing_grounding\":\n return convertBingGroundingToolDefinition(source as PublicModels.BingGroundingToolDefinition);\n case \"microsoft_fabric\":\n return convertMicrosoftFabricToolDefinition(\n source as PublicModels.MicrosoftFabricToolDefinition,\n );\n case \"sharepoint_grounding\":\n return convertSharepointToolDefinition(source as PublicModels.SharepointToolDefinition);\n case \"azure_ai_search\":\n return convertAzureAISearchToolDefinition(source as PublicModels.AzureAISearchToolDefinition);\n case \"openapi\":\n return convertOpenApiToolDefinition(source as PublicModels.OpenApiToolDefinition);\n case \"azure_function\":\n return convertAzureFunctionToolDefinition(source as PublicModels.AzureFunctionToolDefinition);\n default:\n throw new Error(`Unknown tool type: ${source.type}`);\n }\n}\n\nfunction convertCodeInterpreterToolDefinition(\n source: PublicModels.CodeInterpreterToolDefinition,\n): GeneratedModels.CodeInterpreterToolDefinition {\n return {\n type: source.type,\n };\n}\n\nfunction convertFileSearchToolDefinition(\n source: PublicModels.FileSearchToolDefinition,\n): GeneratedModels.FileSearchToolDefinition {\n return {\n type: source.type,\n ...(source.fileSearch && {\n file_search: convertFileSearchToolDefinitionDetails(source.fileSearch),\n }),\n };\n}\n\nfunction convertFunctionToolDefinition(\n source: PublicModels.FunctionToolDefinition,\n): GeneratedModels.FunctionToolDefinition {\n return {\n type: source.type,\n function: convertFunctionDefinition(source.function),\n };\n}\n\nfunction convertBingGroundingToolDefinition(\n source: PublicModels.BingGroundingToolDefinition,\n): GeneratedModels.BingGroundingToolDefinition {\n return {\n type: source.type,\n bing_grounding: convertToolConnectionList(source.bingGrounding),\n };\n}\n\nfunction convertMicrosoftFabricToolDefinition(\n source: PublicModels.MicrosoftFabricToolDefinition,\n): GeneratedModels.MicrosoftFabricToolDefinition {\n return {\n type: source.type,\n fabric_aiskill: convertToolConnectionList(source.fabricAISkill),\n };\n}\n\nfunction convertSharepointToolDefinition(\n source: PublicModels.SharepointToolDefinition,\n): GeneratedModels.SharepointToolDefinition {\n return {\n type: source.type,\n sharepoint_grounding: convertToolConnectionList(source.sharepointGrounding),\n };\n}\n\nfunction convertAzureAISearchToolDefinition(\n source: PublicModels.AzureAISearchToolDefinition,\n): GeneratedModels.AzureAISearchToolDefinition {\n return {\n type: source.type,\n };\n}\n\nfunction convertOpenApiToolDefinition(\n source: PublicModels.OpenApiToolDefinition,\n): GeneratedModels.OpenApiToolDefinition {\n return {\n type: source.type,\n openapi: source.openapi,\n };\n}\n\nfunction convertFileSearchToolDefinitionDetails(\n source: PublicModels.FileSearchToolDefinitionDetails,\n): GeneratedModels.FileSearchToolDefinitionDetails {\n return {\n ...(source.maxNumResults && { max_num_results: source.maxNumResults }),\n ...(source.rankingOptions && {\n ranking_options: convertFileSearchRankingOptions(source.rankingOptions),\n }),\n };\n}\n\nfunction convertFileSearchRankingOptions(\n source: PublicModels.FileSearchRankingOptions,\n): GeneratedModels.FileSearchRankingOptions {\n return {\n ranker: source.ranker,\n score_threshold: source.scoreThreshold,\n };\n}\n\nfunction convertCodeInterpreterToolResource(\n source: PublicModels.CodeInterpreterToolResource,\n): GeneratedModels.CodeInterpreterToolResource {\n return {\n file_ids: source.fileIds,\n ...(source.dataSources && {\n data_sources: source.dataSources.map(convertVectorStoreDataSource),\n }),\n };\n}\n\nexport function convertVectorStoreDataSource(\n source: PublicModels.VectorStoreDataSource,\n): GeneratedModels.VectorStoreDataSource {\n return {\n uri: source.uri,\n type: source.type,\n };\n}\n\nfunction convertFileSearchToolResource(\n source: PublicModels.FileSearchToolResource,\n): GeneratedModels.FileSearchToolResource {\n return {\n ...(source.vectorStoreIds && { vector_store_ids: source.vectorStoreIds }),\n ...(source.vectorStores && {\n vector_stores: source.vectorStores.map(convertVectorStoreConfigurations),\n }),\n };\n}\n\nfunction convertAzureFunctionToolDefinition(\n source: PublicModels.AzureFunctionToolDefinition,\n): GeneratedModels.AzureFunctionToolDefinition {\n return {\n type: source.type,\n azure_function: convertAzureFunctionDefinition(source.azureFunction),\n };\n}\n\nfunction convertAzureFunctionDefinition(\n source: PublicModels.AzureFunctionDefinition,\n): GeneratedModels.AzureFunctionDefinition {\n return {\n function: source.function,\n input_binding: {\n type: source.inputBinding.type,\n storage_queue: {\n queue_service_endpoint: source.inputBinding.storageQueue.queueServiceEndpoint,\n queue_name: source.inputBinding.storageQueue.queueName,\n },\n },\n output_binding: {\n type: source.outputBinding.type,\n storage_queue: {\n queue_service_endpoint: source.outputBinding.storageQueue.queueServiceEndpoint,\n queue_name: source.outputBinding.storageQueue.queueName,\n },\n },\n };\n}\n\nfunction convertVectorStoreConfigurations(\n source: PublicModels.VectorStoreConfigurations,\n): GeneratedModels.VectorStoreConfigurations {\n return {\n name: source.name,\n configuration: convertVectorStoreConfiguration(source.configuration),\n };\n}\n\nfunction convertVectorStoreConfiguration(\n source: PublicModels.VectorStoreConfiguration,\n): GeneratedModels.VectorStoreConfiguration {\n return {\n data_sources: source.dataSources.map(convertVectorStoreDataSource),\n };\n}\n\nfunction convertAzureAISearchResource(\n source: PublicModels.AzureAISearchResource,\n): GeneratedModels.AzureAISearchResource {\n return {\n ...(source.indexes && { indexes: source.indexes.map(convertIndexResource) }),\n };\n}\n\nfunction convertIndexResource(source: PublicModels.IndexResource): GeneratedModels.IndexResource {\n return {\n index_connection_id: source.indexConnectionId,\n index_name: source.indexName,\n };\n}\n\nexport function convertUpdateAgentOptions(\n source: PublicModels.UpdateAgentOptions,\n): GeneratedModels.UpdateAgentOptions {\n return {\n ...(source.model && { model: source.model }),\n ...(source.name && { name: source.name }),\n ...(source.description && { description: source.description }),\n ...(source.instructions && { instructions: source.instructions }),\n ...(source.tools && { tools: source.tools.map(convertToolDefinition) }),\n ...(source.toolResources && { tool_resources: convertToolResources(source.toolResources) }),\n ...(source.temperature !== undefined && { temperature: source.temperature }),\n ...(source.topP !== undefined && { top_p: source.topP }),\n ...(source.responseFormat && { response_format: source.responseFormat }),\n ...(source.metadata && { metadata: source.metadata }),\n };\n}\n\nexport function convertAgentThreadCreationOptions(\n source: PublicModels.AgentThreadCreationOptions,\n): GeneratedModels.AgentThreadCreationOptions {\n return {\n ...(source.messages && { messages: source.messages.map(convertThreadMessageOptions) }),\n ...(source.toolResources && { tool_resources: convertToolResources(source.toolResources) }),\n ...(source.metadata && { metadata: source.metadata }),\n };\n}\n\nexport function convertAgentThreadUpdateOptions(\n source: PublicModels.UpdateAgentThreadOptions,\n): GeneratedModels.UpdateAgentThreadOptions {\n return {\n ...(source.toolResources && { tool_resources: convertToolResources(source.toolResources) }),\n ...(source.metadata && { metadata: source.metadata }),\n };\n}\n\nfunction convertThreadMessageOptions(\n source: PublicModels.ThreadMessageOptions,\n): GeneratedModels.ThreadMessageOptions {\n return {\n role: source.role,\n content: source.content,\n ...(source.attachments && { attachments: source.attachments.map(convertMessageAttachment) }),\n ...(source.metadata && { metadata: source.metadata }),\n };\n}\n\nfunction convertMessageAttachment(\n source: PublicModels.MessageAttachment,\n): GeneratedModels.MessageAttachment {\n return {\n file_id: source.fileId,\n ...(source.dataSource && {\n data_source: convertVectorStoreDataSource(source.dataSource),\n }),\n ...(source.tools && { tools: source.tools.map(convertMessageAttachmentToolDefinition) }),\n };\n}\n\nexport function convertCreateRunOptions(\n source: PublicModels.CreateRunOptions,\n): GeneratedModels.CreateRunOptions {\n return {\n assistant_id: source.assistantId,\n ...(source.model && { model: source.model }),\n ...(source.instructions && { instructions: source.instructions }),\n ...(source.additionalInstructions && {\n additional_instructions: source.additionalInstructions,\n }),\n ...(source.additionalMessages && {\n additional_messages: source.additionalMessages.map(convertThreadMessageOptions),\n }),\n ...(source.tools && { tools: source.tools.map(convertToolDefinition) }),\n ...(source.stream !== undefined && { stream: source.stream }),\n ...(source.temperature !== undefined && { temperature: source.temperature }),\n ...(source.topP !== undefined && { top_p: source.topP }),\n ...(source.maxPromptTokens !== undefined && { max_prompt_tokens: source.maxPromptTokens }),\n ...(source.maxCompletionTokens !== undefined && {\n max_completion_tokens: source.maxCompletionTokens,\n }),\n ...(source.truncationStrategy && {\n truncation_strategy: convertTruncationObject(source.truncationStrategy),\n }),\n ...(source.toolChoice && { tool_choice: source.toolChoice }),\n ...(source.responseFormat && { response_format: source.responseFormat }),\n ...(source.metadata && { metadata: source.metadata }),\n };\n}\n\nfunction convertTruncationObject(\n source: PublicModels.TruncationObject,\n): GeneratedModels.TruncationObject {\n return {\n type: source.type,\n ...(source.lastMessages !== undefined && { last_messages: source.lastMessages }),\n };\n}\n\nfunction convertUpdateToolResourcesOptions(\n source: PublicModels.UpdateToolResourcesOptions,\n): GeneratedModels.UpdateToolResourcesOptions {\n return {\n ...(source.codeInterpreter && {\n code_interpreter: convertUpdateCodeInterpreterToolResourceOptions(source.codeInterpreter),\n }),\n ...(source.fileSearch && {\n file_search: convertUpdateFileSearchToolResourceOptions(source.fileSearch),\n }),\n ...(source.azureAISearch && {\n azure_ai_search: convertAzureAISearchResource(source.azureAISearch),\n }),\n };\n}\n\nfunction convertUpdateCodeInterpreterToolResourceOptions(\n source: PublicModels.UpdateCodeInterpreterToolResourceOptions,\n): GeneratedModels.UpdateCodeInterpreterToolResourceOptions {\n return {\n ...(source.fileIds && { file_ids: source.fileIds }),\n };\n}\n\nfunction convertUpdateFileSearchToolResourceOptions(\n source: PublicModels.UpdateFileSearchToolResourceOptions,\n): GeneratedModels.UpdateFileSearchToolResourceOptions {\n return {\n ...(source.vectorStoreIds && { vector_store_ids: source.vectorStoreIds }),\n };\n}\n\nexport function convertToolOutput(source: PublicModels.ToolOutput): GeneratedModels.ToolOutput {\n return {\n ...(source.toolCallId !== undefined && { tool_call_id: source.toolCallId }),\n ...(source.output !== undefined && { output: source.output }),\n };\n}\n\nexport function convertCreateAndRunThreadOptions(\n source: PublicModels.CreateAndRunThreadOptions,\n): GeneratedModels.CreateAndRunThreadOptions {\n return {\n assistant_id: source.assistantId,\n ...(source.thread && { thread: convertAgentThreadCreationOptions(source.thread) }),\n ...(source.model && { model: source.model }),\n ...(source.instructions && { instructions: source.instructions }),\n ...(source.tools && { tools: source.tools.map(convertToolDefinition) }),\n ...(source.toolResources && {\n tool_resources: convertUpdateToolResourcesOptions(source.toolResources),\n }),\n ...(source.stream !== undefined && { stream: source.stream }),\n ...(source.temperature !== undefined && { temperature: source.temperature }),\n ...(source.topP !== undefined && { top_p: source.topP }),\n ...(source.maxPromptTokens !== undefined && { max_prompt_tokens: source.maxPromptTokens }),\n ...(source.maxCompletionTokens !== undefined && {\n max_completion_tokens: source.maxCompletionTokens,\n }),\n ...(source.truncationStrategy && {\n truncation_strategy: convertTruncationObject(source.truncationStrategy),\n }),\n ...(source.toolChoice && { tool_choice: source.toolChoice }),\n ...(source.responseFormat && { response_format: source.responseFormat }),\n ...(source.metadata && { metadata: source.metadata }),\n };\n}\n\nfunction convertVectorStoreExpirationPolicy(\n source: PublicModels.VectorStoreExpirationPolicy,\n): GeneratedModels.VectorStoreExpirationPolicy {\n return {\n anchor: source.anchor,\n days: source.days,\n };\n}\n\nexport function convertVectorStoreOptions(\n source: PublicModels.VectorStoreOptions,\n): GeneratedModels.VectorStoreOptions {\n return {\n ...(source.fileIds && { file_ids: source.fileIds }),\n ...(source.name && { name: source.name }),\n ...(source.configuration && {\n configuration: convertVectorStoreConfiguration(source.configuration),\n }),\n ...(source.expiresAfter && {\n expires_after: convertVectorStoreExpirationPolicy(source.expiresAfter),\n }),\n ...(source.chunkingStrategy && {\n chunking_strategy: convertVectorStoreChunkingStrategyRequest(source.chunkingStrategy),\n }),\n ...(source.metadata && { metadata: source.metadata }),\n };\n}\n\nexport function convertVectorStoreChunkingStrategyRequest(\n source: PublicModels.VectorStoreChunkingStrategyRequest,\n): GeneratedModels.VectorStoreChunkingStrategyRequest {\n switch (source.type) {\n case \"auto\":\n return source as GeneratedModels.VectorStoreAutoChunkingStrategyRequest;\n case \"static\":\n return convertVectorStoreStaticChunkingStrategyRequest(\n source as PublicModels.VectorStoreStaticChunkingStrategyRequest,\n );\n default:\n throw new Error(`Unknown chunking strategy type: ${source.type}`);\n }\n}\n\nfunction convertVectorStoreStaticChunkingStrategyRequest(\n source: PublicModels.VectorStoreStaticChunkingStrategyRequest,\n): GeneratedModels.VectorStoreStaticChunkingStrategyRequest {\n return {\n ...source,\n static: convertVectorStoreStaticChunkingStrategyOptions(source.static),\n };\n}\n\nfunction convertVectorStoreStaticChunkingStrategyOptions(\n source: PublicModels.VectorStoreStaticChunkingStrategyOptions,\n): GeneratedModels.VectorStoreStaticChunkingStrategyOptions {\n return {\n max_chunk_size_tokens: source.maxChunkSizeTokens,\n chunk_overlap_tokens: source.chunkOverlapTokens,\n };\n}\n\nexport function convertVectorStoreUpdateOptions(\n source: PublicModels.VectorStoreUpdateOptions,\n): GeneratedModels.VectorStoreUpdateOptions {\n return {\n ...(source.name && { name: source.name }),\n ...(source.expiresAfter && {\n expires_after: convertVectorStoreExpirationPolicy(source.expiresAfter),\n }),\n ...(source.metadata && { metadata: source.metadata }),\n };\n}\n\nfunction convertFunctionDefinition(\n source: PublicModels.FunctionDefinition,\n): GeneratedModels.FunctionDefinition {\n return {\n name: source.name,\n ...(source.description && { description: source.description }),\n parameters: source.parameters,\n };\n}\n\nfunction convertToolConnectionList(\n source: PublicModels.ToolConnectionList,\n): GeneratedModels.ToolConnectionList {\n return {\n ...(source.connections && { connections: source.connections.map(convertToolConnection) }),\n };\n}\n\nfunction convertToolConnection(\n source: PublicModels.ToolConnection,\n): GeneratedModels.ToolConnection {\n return {\n connection_id: source.connectionId,\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"convertModelsToWrite.js","sourceRoot":"","sources":["../../../src/customization/convertModelsToWrite.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAKlC,uBAAuB;AACvB,MAAM,UAAU,yBAAyB,CACvC,MAAuC;IAEvC,uIACE,KAAK,EAAE,MAAM,CAAC,KAAK,IAChB,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,GACtC,CAAC,MAAM,CAAC,WAAW,IAAI,EAAE,WAAW,EAAE,MAAM,CAAC,WAAW,EAAE,CAAC,GAC3D,CAAC,MAAM,CAAC,YAAY,IAAI,EAAE,YAAY,EAAE,MAAM,CAAC,YAAY,EAAE,CAAC,GAC9D,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,GAAG,CAA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C,QAAQ,EAAE,CAAC,EACrD;AACJ,CAAC;AAED,SAAS,yBAAyB,CAChC,MAAuC;IAEvC,qCACE,IAAI,EAAE,MAAM,CAAC,IAAI,IACd,CAAC,MAAM,CAAC,WAAW,IAAI,EAAE,WAAW,EAAE,MAAM,CAAC,WAAW,EAAE,CAAC,KAC9D,UAAU,EAAE,MAAM,CAAC,UAAU,IAC7B;AACJ,CAAC;AAED,SAAS,yBAAyB,CAChC,MAAuC;IAEvC,yBACK,CAAC,MAAM,CAAC,WAAW,IAAI,EAAE,WAAW,EAAE,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,qBAAqB,CAAC,EAAE,CAAC,EACzF;AACJ,CAAC;AAED,SAAS,qBAAqB,CAC5B,MAAmC;IAEnC,OAAO;QACL,aAAa,EAAE,MAAM,CAAC,YAAY;KACnC,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type * as PublicModels from \"./models.js\";\nimport type * as GeneratedModels from \"../generated/src/models.js\";\n\n// Conversion functions\nexport function convertCreateAgentOptions(\n source: PublicModels.CreateAgentOptions,\n): GeneratedModels.CreateAgentOptions {\n return {\n model: source.model,\n ...(source.name && { name: source.name }),\n ...(source.description && { description: source.description }),\n ...(source.instructions && { instructions: source.instructions }),\n ...(source.tools && { tools: source.tools.map(convertToolDefinition) }),\n ...(source.toolResources && { tool_resources: convertToolResources(source.toolResources) }),\n ...(source.temperature !== undefined && { temperature: source.temperature }),\n ...(source.topP !== undefined && { top_p: source.topP }),\n ...(source.responseFormat && { response_format: source.responseFormat }),\n ...(source.metadata && { metadata: source.metadata }),\n };\n}\n\nfunction convertToolResources(source: PublicModels.ToolResources): GeneratedModels.ToolResources {\n return {\n ...(source.codeInterpreter && {\n code_interpreter: convertCodeInterpreterToolResource(source.codeInterpreter),\n }),\n ...(source.fileSearch && { file_search: convertFileSearchToolResource(source.fileSearch) }),\n ...(source.azureAISearch && {\n azure_ai_search: convertAzureAISearchResource(source.azureAISearch),\n }),\n ...(source.azureFunction && {\n name: source.azureFunction.name,\n }),\n };\n}\n\nfunction convertMessageAttachmentToolDefinition(\n source: PublicModels.MessageAttachmentToolDefinition,\n): GeneratedModels.MessageAttachmentToolDefinition {\n switch (source.type) {\n case \"code_interpreter\":\n return convertCodeInterpreterToolDefinition(\n source as PublicModels.CodeInterpreterToolDefinition,\n );\n case \"file_search\":\n return convertFileSearchToolDefinition(source as PublicModels.FileSearchToolDefinition);\n default:\n throw new Error(`Unknown tool type: ${source}`);\n }\n}\n\nfunction convertToolDefinition(\n source: PublicModels.ToolDefinition,\n): GeneratedModels.ToolDefinition {\n switch (source.type) {\n case \"code_interpreter\":\n return convertCodeInterpreterToolDefinition(\n source as PublicModels.CodeInterpreterToolDefinition,\n );\n case \"file_search\":\n return convertFileSearchToolDefinition(source as PublicModels.FileSearchToolDefinition);\n case \"function\":\n return convertFunctionToolDefinition(source as PublicModels.FunctionToolDefinition);\n case \"bing_grounding\":\n return convertBingGroundingToolDefinition(source as PublicModels.BingGroundingToolDefinition);\n case \"fabric_dataagent\":\n return convertMicrosoftFabricToolDefinition(\n source as PublicModels.MicrosoftFabricToolDefinition,\n );\n case \"sharepoint_grounding\":\n return convertSharepointToolDefinition(source as PublicModels.SharepointToolDefinition);\n case \"azure_ai_search\":\n return convertAzureAISearchToolDefinition(source as PublicModels.AzureAISearchToolDefinition);\n case \"openapi\":\n return convertOpenApiToolDefinition(source as PublicModels.OpenApiToolDefinition);\n case \"azure_function\":\n return convertAzureFunctionToolDefinition(source as PublicModels.AzureFunctionToolDefinition);\n default:\n throw new Error(`Unknown tool type: ${source.type}`);\n }\n}\n\nfunction convertCodeInterpreterToolDefinition(\n source: PublicModels.CodeInterpreterToolDefinition,\n): GeneratedModels.CodeInterpreterToolDefinition {\n return {\n type: source.type,\n };\n}\n\nfunction convertFileSearchToolDefinition(\n source: PublicModels.FileSearchToolDefinition,\n): GeneratedModels.FileSearchToolDefinition {\n return {\n type: source.type,\n ...(source.fileSearch && {\n file_search: convertFileSearchToolDefinitionDetails(source.fileSearch),\n }),\n };\n}\n\nfunction convertFunctionToolDefinition(\n source: PublicModels.FunctionToolDefinition,\n): GeneratedModels.FunctionToolDefinition {\n return {\n type: source.type,\n function: convertFunctionDefinition(source.function),\n };\n}\n\nfunction convertBingGroundingToolDefinition(\n source: PublicModels.BingGroundingToolDefinition,\n): GeneratedModels.BingGroundingToolDefinition {\n return {\n type: source.type,\n bing_grounding: convertToolConnectionList(source.bingGrounding),\n };\n}\n\nfunction convertMicrosoftFabricToolDefinition(\n source: PublicModels.MicrosoftFabricToolDefinition,\n): GeneratedModels.MicrosoftFabricToolDefinition {\n return {\n type: source.type,\n fabric_dataagent: convertToolConnectionList(source.fabricDataAgent),\n };\n}\n\nfunction convertSharepointToolDefinition(\n source: PublicModels.SharepointToolDefinition,\n): GeneratedModels.SharepointToolDefinition {\n return {\n type: source.type,\n sharepoint_grounding: convertToolConnectionList(source.sharepointGrounding),\n };\n}\n\nfunction convertAzureAISearchToolDefinition(\n source: PublicModels.AzureAISearchToolDefinition,\n): GeneratedModels.AzureAISearchToolDefinition {\n return {\n type: source.type,\n };\n}\n\nfunction convertOpenApiToolDefinition(\n source: PublicModels.OpenApiToolDefinition,\n): GeneratedModels.OpenApiToolDefinition {\n return {\n type: source.type,\n openapi: source.openapi,\n };\n}\n\nfunction convertFileSearchToolDefinitionDetails(\n source: PublicModels.FileSearchToolDefinitionDetails,\n): GeneratedModels.FileSearchToolDefinitionDetails {\n return {\n ...(source.maxNumResults && { max_num_results: source.maxNumResults }),\n ...(source.rankingOptions && {\n ranking_options: convertFileSearchRankingOptions(source.rankingOptions),\n }),\n };\n}\n\nfunction convertFileSearchRankingOptions(\n source: PublicModels.FileSearchRankingOptions,\n): GeneratedModels.FileSearchRankingOptions {\n return {\n ranker: source.ranker,\n score_threshold: source.scoreThreshold,\n };\n}\n\nfunction convertCodeInterpreterToolResource(\n source: PublicModels.CodeInterpreterToolResource,\n): GeneratedModels.CodeInterpreterToolResource {\n return {\n file_ids: source.fileIds,\n ...(source.dataSources && {\n data_sources: source.dataSources.map(convertVectorStoreDataSource),\n }),\n };\n}\n\nexport function convertVectorStoreDataSource(\n source: PublicModels.VectorStoreDataSource,\n): GeneratedModels.VectorStoreDataSource {\n return {\n uri: source.uri,\n type: source.type,\n };\n}\n\nfunction convertFileSearchToolResource(\n source: PublicModels.FileSearchToolResource,\n): GeneratedModels.FileSearchToolResource {\n return {\n ...(source.vectorStoreIds && { vector_store_ids: source.vectorStoreIds }),\n ...(source.vectorStores && {\n vector_stores: source.vectorStores.map(convertVectorStoreConfigurations),\n }),\n };\n}\n\nfunction convertAzureFunctionToolDefinition(\n source: PublicModels.AzureFunctionToolDefinition,\n): GeneratedModels.AzureFunctionToolDefinition {\n return {\n type: source.type,\n azure_function: convertAzureFunctionDefinition(source.azureFunction),\n };\n}\n\nfunction convertAzureFunctionDefinition(\n source: PublicModels.AzureFunctionDefinition,\n): GeneratedModels.AzureFunctionDefinition {\n return {\n function: source.function,\n input_binding: {\n type: source.inputBinding.type,\n storage_queue: {\n queue_service_endpoint: source.inputBinding.storageQueue.queueServiceEndpoint,\n queue_name: source.inputBinding.storageQueue.queueName,\n },\n },\n output_binding: {\n type: source.outputBinding.type,\n storage_queue: {\n queue_service_endpoint: source.outputBinding.storageQueue.queueServiceEndpoint,\n queue_name: source.outputBinding.storageQueue.queueName,\n },\n },\n };\n}\n\nfunction convertVectorStoreConfigurations(\n source: PublicModels.VectorStoreConfigurations,\n): GeneratedModels.VectorStoreConfigurations {\n return {\n name: source.name,\n configuration: convertVectorStoreConfiguration(source.configuration),\n };\n}\n\nfunction convertVectorStoreConfiguration(\n source: PublicModels.VectorStoreConfiguration,\n): GeneratedModels.VectorStoreConfiguration {\n return {\n data_sources: source.dataSources.map(convertVectorStoreDataSource),\n };\n}\n\nfunction convertAzureAISearchResource(\n source: PublicModels.AzureAISearchResource,\n): GeneratedModels.AzureAISearchResource {\n return {\n ...(source.indexes && { indexes: source.indexes.map(convertIndexResource) }),\n };\n}\n\nfunction convertIndexResource(\n source: PublicModels.IndexResource,\n): GeneratedModels.AISearchIndexResource {\n return {\n index_connection_id: source.indexConnectionId,\n index_name: source.indexName,\n };\n}\n\nexport function convertUpdateAgentOptions(\n source: PublicModels.UpdateAgentOptions,\n): GeneratedModels.UpdateAgentOptions {\n return {\n ...(source.model && { model: source.model }),\n ...(source.name && { name: source.name }),\n ...(source.description && { description: source.description }),\n ...(source.instructions && { instructions: source.instructions }),\n ...(source.tools && { tools: source.tools.map(convertToolDefinition) }),\n ...(source.toolResources && { tool_resources: convertToolResources(source.toolResources) }),\n ...(source.temperature !== undefined && { temperature: source.temperature }),\n ...(source.topP !== undefined && { top_p: source.topP }),\n ...(source.responseFormat && { response_format: source.responseFormat }),\n ...(source.metadata && { metadata: source.metadata }),\n };\n}\n\nexport function convertAgentThreadCreationOptions(\n source: PublicModels.AgentThreadCreationOptions,\n): GeneratedModels.AgentThreadCreationOptions {\n return {\n ...(source.messages && { messages: source.messages.map(convertThreadMessageOptions) }),\n ...(source.toolResources && { tool_resources: convertToolResources(source.toolResources) }),\n ...(source.metadata && { metadata: source.metadata }),\n };\n}\n\nexport function convertAgentThreadUpdateOptions(\n source: PublicModels.UpdateAgentThreadOptions,\n): GeneratedModels.UpdateAgentThreadOptions {\n return {\n ...(source.toolResources && { tool_resources: convertToolResources(source.toolResources) }),\n ...(source.metadata && { metadata: source.metadata }),\n };\n}\n\nfunction convertThreadMessageOptions(\n source: PublicModels.ThreadMessageOptions,\n): GeneratedModels.ThreadMessageOptions {\n return {\n role: source.role,\n content: source.content,\n ...(source.attachments && { attachments: source.attachments.map(convertMessageAttachment) }),\n ...(source.metadata && { metadata: source.metadata }),\n };\n}\n\nfunction convertMessageAttachment(\n source: PublicModels.MessageAttachment,\n): GeneratedModels.MessageAttachment {\n return {\n file_id: source.fileId,\n ...(source.dataSource && {\n data_source: convertVectorStoreDataSource(source.dataSource),\n }),\n ...(source.tools && { tools: source.tools.map(convertMessageAttachmentToolDefinition) }),\n };\n}\n\nexport function convertCreateRunOptions(\n source: PublicModels.CreateRunOptions,\n): GeneratedModels.CreateRunOptions {\n return {\n assistant_id: source.assistantId,\n ...(source.model && { model: source.model }),\n ...(source.instructions && { instructions: source.instructions }),\n ...(source.additionalInstructions && {\n additional_instructions: source.additionalInstructions,\n }),\n ...(source.additionalMessages && {\n additional_messages: source.additionalMessages.map(convertThreadMessageOptions),\n }),\n ...(source.tools && { tools: source.tools.map(convertToolDefinition) }),\n ...(source.stream !== undefined && { stream: source.stream }),\n ...(source.temperature !== undefined && { temperature: source.temperature }),\n ...(source.topP !== undefined && { top_p: source.topP }),\n ...(source.maxPromptTokens !== undefined && { max_prompt_tokens: source.maxPromptTokens }),\n ...(source.maxCompletionTokens !== undefined && {\n max_completion_tokens: source.maxCompletionTokens,\n }),\n ...(source.truncationStrategy && {\n truncation_strategy: convertTruncationObject(source.truncationStrategy),\n }),\n ...(source.toolChoice && { tool_choice: source.toolChoice }),\n ...(source.responseFormat && { response_format: source.responseFormat }),\n ...(source.metadata && { metadata: source.metadata }),\n };\n}\n\nfunction convertTruncationObject(\n source: PublicModels.TruncationObject,\n): GeneratedModels.TruncationObject {\n return {\n type: source.type,\n ...(source.lastMessages !== undefined && { last_messages: source.lastMessages }),\n };\n}\n\nfunction convertUpdateToolResourcesOptions(\n source: PublicModels.UpdateToolResourcesOptions,\n): GeneratedModels.UpdateToolResourcesOptions {\n return {\n ...(source.codeInterpreter && {\n code_interpreter: convertUpdateCodeInterpreterToolResourceOptions(source.codeInterpreter),\n }),\n ...(source.fileSearch && {\n file_search: convertUpdateFileSearchToolResourceOptions(source.fileSearch),\n }),\n ...(source.azureAISearch && {\n azure_ai_search: convertAzureAISearchResource(source.azureAISearch),\n }),\n };\n}\n\nfunction convertUpdateCodeInterpreterToolResourceOptions(\n source: PublicModels.UpdateCodeInterpreterToolResourceOptions,\n): GeneratedModels.UpdateCodeInterpreterToolResourceOptions {\n return {\n ...(source.fileIds && { file_ids: source.fileIds }),\n };\n}\n\nfunction convertUpdateFileSearchToolResourceOptions(\n source: PublicModels.UpdateFileSearchToolResourceOptions,\n): GeneratedModels.UpdateFileSearchToolResourceOptions {\n return {\n ...(source.vectorStoreIds && { vector_store_ids: source.vectorStoreIds }),\n };\n}\n\nexport function convertToolOutput(source: PublicModels.ToolOutput): GeneratedModels.ToolOutput {\n return {\n ...(source.toolCallId !== undefined && { tool_call_id: source.toolCallId }),\n ...(source.output !== undefined && { output: source.output }),\n };\n}\n\nexport function convertCreateAndRunThreadOptions(\n source: PublicModels.CreateAndRunThreadOptions,\n): GeneratedModels.CreateAndRunThreadOptions {\n return {\n assistant_id: source.assistantId,\n ...(source.thread && { thread: convertAgentThreadCreationOptions(source.thread) }),\n ...(source.model && { model: source.model }),\n ...(source.instructions && { instructions: source.instructions }),\n ...(source.tools && { tools: source.tools.map(convertToolDefinition) }),\n ...(source.toolResources && {\n tool_resources: convertUpdateToolResourcesOptions(source.toolResources),\n }),\n ...(source.stream !== undefined && { stream: source.stream }),\n ...(source.temperature !== undefined && { temperature: source.temperature }),\n ...(source.topP !== undefined && { top_p: source.topP }),\n ...(source.maxPromptTokens !== undefined && { max_prompt_tokens: source.maxPromptTokens }),\n ...(source.maxCompletionTokens !== undefined && {\n max_completion_tokens: source.maxCompletionTokens,\n }),\n ...(source.truncationStrategy && {\n truncation_strategy: convertTruncationObject(source.truncationStrategy),\n }),\n ...(source.toolChoice && { tool_choice: source.toolChoice }),\n ...(source.responseFormat && { response_format: source.responseFormat }),\n ...(source.metadata && { metadata: source.metadata }),\n };\n}\n\nfunction convertVectorStoreExpirationPolicy(\n source: PublicModels.VectorStoreExpirationPolicy,\n): GeneratedModels.VectorStoreExpirationPolicy {\n return {\n anchor: source.anchor,\n days: source.days,\n };\n}\n\nexport function convertVectorStoreOptions(\n source: PublicModels.VectorStoreOptions,\n): GeneratedModels.VectorStoreOptions {\n return {\n ...(source.fileIds && { file_ids: source.fileIds }),\n ...(source.name && { name: source.name }),\n ...(source.configuration && {\n configuration: convertVectorStoreConfiguration(source.configuration),\n }),\n ...(source.expiresAfter && {\n expires_after: convertVectorStoreExpirationPolicy(source.expiresAfter),\n }),\n ...(source.chunkingStrategy && {\n chunking_strategy: convertVectorStoreChunkingStrategyRequest(source.chunkingStrategy),\n }),\n ...(source.metadata && { metadata: source.metadata }),\n };\n}\n\nexport function convertVectorStoreChunkingStrategyRequest(\n source: PublicModels.VectorStoreChunkingStrategyRequest,\n): GeneratedModels.VectorStoreChunkingStrategyRequest {\n switch (source.type) {\n case \"auto\":\n return source as GeneratedModels.VectorStoreAutoChunkingStrategyRequest;\n case \"static\":\n return convertVectorStoreStaticChunkingStrategyRequest(\n source as PublicModels.VectorStoreStaticChunkingStrategyRequest,\n );\n default:\n throw new Error(`Unknown chunking strategy type: ${source.type}`);\n }\n}\n\nfunction convertVectorStoreStaticChunkingStrategyRequest(\n source: PublicModels.VectorStoreStaticChunkingStrategyRequest,\n): GeneratedModels.VectorStoreStaticChunkingStrategyRequest {\n return {\n ...source,\n static: convertVectorStoreStaticChunkingStrategyOptions(source.static),\n };\n}\n\nfunction convertVectorStoreStaticChunkingStrategyOptions(\n source: PublicModels.VectorStoreStaticChunkingStrategyOptions,\n): GeneratedModels.VectorStoreStaticChunkingStrategyOptions {\n return {\n max_chunk_size_tokens: source.maxChunkSizeTokens,\n chunk_overlap_tokens: source.chunkOverlapTokens,\n };\n}\n\nexport function convertVectorStoreUpdateOptions(\n source: PublicModels.VectorStoreUpdateOptions,\n): GeneratedModels.VectorStoreUpdateOptions {\n return {\n ...(source.name && { name: source.name }),\n ...(source.expiresAfter && {\n expires_after: convertVectorStoreExpirationPolicy(source.expiresAfter),\n }),\n ...(source.metadata && { metadata: source.metadata }),\n };\n}\n\nfunction convertFunctionDefinition(\n source: PublicModels.FunctionDefinition,\n): GeneratedModels.FunctionDefinition {\n return {\n name: source.name,\n ...(source.description && { description: source.description }),\n parameters: source.parameters,\n };\n}\n\nfunction convertToolConnectionList(\n source: PublicModels.ToolConnectionList,\n): GeneratedModels.ToolConnectionList {\n return {\n ...(source.connections && { connections: source.connections.map(convertToolConnection) }),\n };\n}\n\nfunction convertToolConnection(\n source: PublicModels.ToolConnection,\n): GeneratedModels.ToolConnection {\n return {\n connection_id: source.connectionId,\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convertOutputModelsFromWire.d.ts","sourceRoot":"","sources":["../../../src/customization/convertOutputModelsFromWire.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,eAAe,MAAM,kCAAkC,CAAC;AACzE,OAAO,KAAK,KAAK,YAAY,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,KAAK,mBAAmB,MAAM,0BAA0B,CAAC;AACrE,OAAO,KAAK,KAAK,qBAAqB,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"convertOutputModelsFromWire.d.ts","sourceRoot":"","sources":["../../../src/customization/convertOutputModelsFromWire.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,eAAe,MAAM,kCAAkC,CAAC;AACzE,OAAO,KAAK,KAAK,YAAY,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,KAAK,mBAAmB,MAAM,0BAA0B,CAAC;AACrE,OAAO,KAAK,KAAK,qBAAqB,MAAM,sBAAsB,CAAC;AA8MnE,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,eAAe,CAAC,WAAW,GAAG,YAAY,CAAC,WAAW,CAkB/F;AA6DD,wBAAgB,sCAAsC,CACpD,KAAK,EAAE,eAAe,CAAC,+BAA+B,GACrD,YAAY,CAAC,+BAA+B,CAQ9C;AAED,wBAAgB,gCAAgC,CAC9C,KAAK,EAAE,eAAe,CAAC,yBAAyB,GAC/C,YAAY,CAAC,yBAAyB,CAExC;AA6BD,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,eAAe,CAAC,iBAAiB,GACvC,YAAY,CAAC,iBAAi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AAqB,CAapC;AAkCD,wBAAgB,0CAA0C,CACxD,KAAK,EAAE,eAAe,CAAC,mCAAmC,GACzD,YAAY,CAAC,mCAAmC,CAMlD;AAED,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,eAAe,CAAC,gBAAgB,GACtC,YAAY,CAAC,gBAAgB,CAW/B;AAED,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,eAAe,CAAC,sBAAsB,GAC5C,YAAY,CAAC,sBAAsB,CAKrC;AAWD,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE,mBAAmB,CAAC,iBAAiB,GAC3C,qBAAqB,CAAC,iBAAiB,CAMzC;AAwHD,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,mBAAmB,CAAC,iBAAiB,GAC3C,qBAAqB,CAAC,iBAAiB,CAMzC"}
|
|
@@ -65,8 +65,8 @@ function convertToolConnectionOutput(input) {
|
|
|
65
65
|
}
|
|
66
66
|
function convertMicrosoftFabricToolDefinitionOutput(input) {
|
|
67
67
|
return {
|
|
68
|
-
type: "
|
|
69
|
-
|
|
68
|
+
type: "fabric_dataagent",
|
|
69
|
+
fabricDataAgent: input.fabric_dataagent && convertToolConnectionListOutput(input.fabric_dataagent),
|
|
70
70
|
};
|
|
71
71
|
}
|
|
72
72
|
function convertSharepointToolDefinitionOutput(input) {
|
|
@@ -157,7 +157,7 @@ function convertToolDefinitionOutput(tool) {
|
|
|
157
157
|
return convertFunctionToolDefinitionOutput(tool);
|
|
158
158
|
case "bing_grounding":
|
|
159
159
|
return convertBingGroundingToolDefinitionOutput(tool);
|
|
160
|
-
case "
|
|
160
|
+
case "fabric_dataagent":
|
|
161
161
|
return convertMicrosoftFabricToolDefinitionOutput(tool);
|
|
162
162
|
case "sharepoint_grounding":
|
|
163
163
|
return convertSharepointToolDefinitionOutput(tool);
|
|
@@ -437,7 +437,7 @@ function convertRunStepToolCallOutput(input) {
|
|
|
437
437
|
return convertRunStepAzureAISearchToolCallOutput(input);
|
|
438
438
|
case "sharepoint_grounding":
|
|
439
439
|
return convertRunStepSharepointToolCallOutput(input);
|
|
440
|
-
case "
|
|
440
|
+
case "fabric_dataagent":
|
|
441
441
|
return convertRunStepMicrosoftFabricToolCallOutput(input);
|
|
442
442
|
case "function":
|
|
443
443
|
return convertRunStepFunctionToolCallOutput(input);
|
|
@@ -501,7 +501,7 @@ function convertRunStepMicrosoftFabricToolCallOutput(input) {
|
|
|
501
501
|
return {
|
|
502
502
|
type: input.type,
|
|
503
503
|
id: input.id,
|
|
504
|
-
|
|
504
|
+
fabricDataAgent: input.fabric_dataagent,
|
|
505
505
|
};
|
|
506
506
|
}
|
|
507
507
|
function convertRunStepFunctionToolCallOutput(input) {
|