@azure/ai-agents 1.0.0 → 1.1.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (203) hide show
  1. package/README.md +103 -0
  2. package/dist/browser/api/agentsContext.js +2 -2
  3. package/dist/browser/api/agentsContext.js.map +1 -1
  4. package/dist/browser/api/files/operations.js +6 -6
  5. package/dist/browser/api/files/operations.js.map +1 -1
  6. package/dist/browser/api/messages/operations.js +8 -8
  7. package/dist/browser/api/messages/operations.js.map +1 -1
  8. package/dist/browser/api/operations.js +12 -12
  9. package/dist/browser/api/operations.js.map +1 -1
  10. package/dist/browser/api/runSteps/operations.js +4 -4
  11. package/dist/browser/api/runSteps/operations.js.map +1 -1
  12. package/dist/browser/api/runs/operations.d.ts.map +1 -1
  13. package/dist/browser/api/runs/operations.js +20 -14
  14. package/dist/browser/api/runs/operations.js.map +1 -1
  15. package/dist/browser/api/runs/options.d.ts +7 -1
  16. package/dist/browser/api/runs/options.d.ts.map +1 -1
  17. package/dist/browser/api/runs/options.js.map +1 -1
  18. package/dist/browser/api/threads/operations.js +10 -10
  19. package/dist/browser/api/threads/operations.js.map +1 -1
  20. package/dist/browser/api/vectorStoreFileBatches/operations.d.ts +2 -2
  21. package/dist/browser/api/vectorStoreFileBatches/operations.d.ts.map +1 -1
  22. package/dist/browser/api/vectorStoreFileBatches/operations.js +2 -2
  23. package/dist/browser/api/vectorStoreFileBatches/operations.js.map +1 -1
  24. package/dist/browser/classic/vectorStoreFileBatches/index.d.ts +2 -2
  25. package/dist/browser/classic/vectorStoreFileBatches/index.d.ts.map +1 -1
  26. package/dist/browser/classic/vectorStoreFileBatches/index.js.map +1 -1
  27. package/dist/browser/constants.d.ts +1 -1
  28. package/dist/browser/constants.d.ts.map +1 -1
  29. package/dist/browser/constants.js +1 -1
  30. package/dist/browser/constants.js.map +1 -1
  31. package/dist/browser/index.d.ts +3 -2
  32. package/dist/browser/index.d.ts.map +1 -1
  33. package/dist/browser/index.js +2 -1
  34. package/dist/browser/index.js.map +1 -1
  35. package/dist/browser/models/index.d.ts +1 -1
  36. package/dist/browser/models/index.d.ts.map +1 -1
  37. package/dist/browser/models/index.js.map +1 -1
  38. package/dist/browser/models/models.d.ts +260 -22
  39. package/dist/browser/models/models.d.ts.map +1 -1
  40. package/dist/browser/models/models.js +332 -12
  41. package/dist/browser/models/models.js.map +1 -1
  42. package/dist/browser/utils/MCPTool.d.ts +78 -0
  43. package/dist/browser/utils/MCPTool.d.ts.map +1 -0
  44. package/dist/browser/utils/MCPTool.js +128 -0
  45. package/dist/browser/utils/MCPTool.js.map +1 -0
  46. package/dist/browser/{utils.d.ts → utils/utils.d.ts} +61 -1
  47. package/dist/browser/utils/utils.d.ts.map +1 -0
  48. package/dist/{esm → browser/utils}/utils.js +90 -0
  49. package/dist/browser/utils/utils.js.map +1 -0
  50. package/dist/commonjs/api/agentsContext.js +2 -2
  51. package/dist/commonjs/api/agentsContext.js.map +1 -1
  52. package/dist/commonjs/api/files/operations.js +6 -6
  53. package/dist/commonjs/api/files/operations.js.map +1 -1
  54. package/dist/commonjs/api/messages/operations.js +8 -8
  55. package/dist/commonjs/api/messages/operations.js.map +1 -1
  56. package/dist/commonjs/api/operations.js +12 -12
  57. package/dist/commonjs/api/operations.js.map +1 -1
  58. package/dist/commonjs/api/runSteps/operations.js +4 -4
  59. package/dist/commonjs/api/runSteps/operations.js.map +1 -1
  60. package/dist/commonjs/api/runs/operations.d.ts.map +1 -1
  61. package/dist/commonjs/api/runs/operations.js +19 -13
  62. package/dist/commonjs/api/runs/operations.js.map +1 -1
  63. package/dist/commonjs/api/runs/options.d.ts +7 -1
  64. package/dist/commonjs/api/runs/options.d.ts.map +1 -1
  65. package/dist/commonjs/api/runs/options.js.map +1 -1
  66. package/dist/commonjs/api/threads/operations.js +10 -10
  67. package/dist/commonjs/api/threads/operations.js.map +1 -1
  68. package/dist/commonjs/api/vectorStoreFileBatches/operations.d.ts +2 -2
  69. package/dist/commonjs/api/vectorStoreFileBatches/operations.d.ts.map +1 -1
  70. package/dist/commonjs/api/vectorStoreFileBatches/operations.js +2 -2
  71. package/dist/commonjs/api/vectorStoreFileBatches/operations.js.map +1 -1
  72. package/dist/commonjs/classic/vectorStoreFileBatches/index.d.ts +2 -2
  73. package/dist/commonjs/classic/vectorStoreFileBatches/index.d.ts.map +1 -1
  74. package/dist/commonjs/classic/vectorStoreFileBatches/index.js.map +1 -1
  75. package/dist/commonjs/constants.d.ts +1 -1
  76. package/dist/commonjs/constants.d.ts.map +1 -1
  77. package/dist/commonjs/constants.js +1 -1
  78. package/dist/commonjs/constants.js.map +1 -1
  79. package/dist/commonjs/index.d.ts +3 -2
  80. package/dist/commonjs/index.d.ts.map +1 -1
  81. package/dist/commonjs/index.js +4 -2
  82. package/dist/commonjs/index.js.map +1 -1
  83. package/dist/commonjs/models/index.d.ts +1 -1
  84. package/dist/commonjs/models/index.d.ts.map +1 -1
  85. package/dist/commonjs/models/index.js.map +1 -1
  86. package/dist/commonjs/models/models.d.ts +260 -22
  87. package/dist/commonjs/models/models.d.ts.map +1 -1
  88. package/dist/commonjs/models/models.js +377 -14
  89. package/dist/commonjs/models/models.js.map +1 -1
  90. package/dist/commonjs/tsdoc-metadata.json +11 -11
  91. package/dist/commonjs/utils/MCPTool.d.ts +78 -0
  92. package/dist/commonjs/utils/MCPTool.d.ts.map +1 -0
  93. package/dist/commonjs/utils/MCPTool.js +132 -0
  94. package/dist/commonjs/utils/MCPTool.js.map +1 -0
  95. package/dist/commonjs/{utils.d.ts → utils/utils.d.ts} +61 -1
  96. package/dist/commonjs/utils/utils.d.ts.map +1 -0
  97. package/dist/commonjs/{utils.js → utils/utils.js} +90 -0
  98. package/dist/commonjs/utils/utils.js.map +1 -0
  99. package/dist/esm/api/agentsContext.js +2 -2
  100. package/dist/esm/api/agentsContext.js.map +1 -1
  101. package/dist/esm/api/files/operations.js +6 -6
  102. package/dist/esm/api/files/operations.js.map +1 -1
  103. package/dist/esm/api/messages/operations.js +8 -8
  104. package/dist/esm/api/messages/operations.js.map +1 -1
  105. package/dist/esm/api/operations.js +12 -12
  106. package/dist/esm/api/operations.js.map +1 -1
  107. package/dist/esm/api/runSteps/operations.js +4 -4
  108. package/dist/esm/api/runSteps/operations.js.map +1 -1
  109. package/dist/esm/api/runs/operations.d.ts.map +1 -1
  110. package/dist/esm/api/runs/operations.js +20 -14
  111. package/dist/esm/api/runs/operations.js.map +1 -1
  112. package/dist/esm/api/runs/options.d.ts +7 -1
  113. package/dist/esm/api/runs/options.d.ts.map +1 -1
  114. package/dist/esm/api/runs/options.js.map +1 -1
  115. package/dist/esm/api/threads/operations.js +10 -10
  116. package/dist/esm/api/threads/operations.js.map +1 -1
  117. package/dist/esm/api/vectorStoreFileBatches/operations.d.ts +2 -2
  118. package/dist/esm/api/vectorStoreFileBatches/operations.d.ts.map +1 -1
  119. package/dist/esm/api/vectorStoreFileBatches/operations.js +2 -2
  120. package/dist/esm/api/vectorStoreFileBatches/operations.js.map +1 -1
  121. package/dist/esm/classic/vectorStoreFileBatches/index.d.ts +2 -2
  122. package/dist/esm/classic/vectorStoreFileBatches/index.d.ts.map +1 -1
  123. package/dist/esm/classic/vectorStoreFileBatches/index.js.map +1 -1
  124. package/dist/esm/constants.d.ts +1 -1
  125. package/dist/esm/constants.d.ts.map +1 -1
  126. package/dist/esm/constants.js +1 -1
  127. package/dist/esm/constants.js.map +1 -1
  128. package/dist/esm/index.d.ts +3 -2
  129. package/dist/esm/index.d.ts.map +1 -1
  130. package/dist/esm/index.js +2 -1
  131. package/dist/esm/index.js.map +1 -1
  132. package/dist/esm/models/index.d.ts +1 -1
  133. package/dist/esm/models/index.d.ts.map +1 -1
  134. package/dist/esm/models/index.js.map +1 -1
  135. package/dist/esm/models/models.d.ts +260 -22
  136. package/dist/esm/models/models.d.ts.map +1 -1
  137. package/dist/esm/models/models.js +332 -12
  138. package/dist/esm/models/models.js.map +1 -1
  139. package/dist/esm/utils/MCPTool.d.ts +78 -0
  140. package/dist/esm/utils/MCPTool.d.ts.map +1 -0
  141. package/dist/esm/utils/MCPTool.js +128 -0
  142. package/dist/esm/utils/MCPTool.js.map +1 -0
  143. package/dist/{react-native → esm/utils}/utils.d.ts +61 -1
  144. package/dist/esm/utils/utils.d.ts.map +1 -0
  145. package/dist/{react-native → esm/utils}/utils.js +90 -0
  146. package/dist/esm/utils/utils.js.map +1 -0
  147. package/dist/react-native/api/agentsContext.js +2 -2
  148. package/dist/react-native/api/agentsContext.js.map +1 -1
  149. package/dist/react-native/api/files/operations.js +6 -6
  150. package/dist/react-native/api/files/operations.js.map +1 -1
  151. package/dist/react-native/api/messages/operations.js +8 -8
  152. package/dist/react-native/api/messages/operations.js.map +1 -1
  153. package/dist/react-native/api/operations.js +12 -12
  154. package/dist/react-native/api/operations.js.map +1 -1
  155. package/dist/react-native/api/runSteps/operations.js +4 -4
  156. package/dist/react-native/api/runSteps/operations.js.map +1 -1
  157. package/dist/react-native/api/runs/operations.d.ts.map +1 -1
  158. package/dist/react-native/api/runs/operations.js +20 -14
  159. package/dist/react-native/api/runs/operations.js.map +1 -1
  160. package/dist/react-native/api/runs/options.d.ts +7 -1
  161. package/dist/react-native/api/runs/options.d.ts.map +1 -1
  162. package/dist/react-native/api/runs/options.js.map +1 -1
  163. package/dist/react-native/api/threads/operations.js +10 -10
  164. package/dist/react-native/api/threads/operations.js.map +1 -1
  165. package/dist/react-native/api/vectorStoreFileBatches/operations.d.ts +2 -2
  166. package/dist/react-native/api/vectorStoreFileBatches/operations.d.ts.map +1 -1
  167. package/dist/react-native/api/vectorStoreFileBatches/operations.js +2 -2
  168. package/dist/react-native/api/vectorStoreFileBatches/operations.js.map +1 -1
  169. package/dist/react-native/classic/vectorStoreFileBatches/index.d.ts +2 -2
  170. package/dist/react-native/classic/vectorStoreFileBatches/index.d.ts.map +1 -1
  171. package/dist/react-native/classic/vectorStoreFileBatches/index.js.map +1 -1
  172. package/dist/react-native/constants.d.ts +1 -1
  173. package/dist/react-native/constants.d.ts.map +1 -1
  174. package/dist/react-native/constants.js +1 -1
  175. package/dist/react-native/constants.js.map +1 -1
  176. package/dist/react-native/index.d.ts +3 -2
  177. package/dist/react-native/index.d.ts.map +1 -1
  178. package/dist/react-native/index.js +2 -1
  179. package/dist/react-native/index.js.map +1 -1
  180. package/dist/react-native/models/index.d.ts +1 -1
  181. package/dist/react-native/models/index.d.ts.map +1 -1
  182. package/dist/react-native/models/index.js.map +1 -1
  183. package/dist/react-native/models/models.d.ts +260 -22
  184. package/dist/react-native/models/models.d.ts.map +1 -1
  185. package/dist/react-native/models/models.js +332 -12
  186. package/dist/react-native/models/models.js.map +1 -1
  187. package/dist/react-native/utils/MCPTool.d.ts +78 -0
  188. package/dist/react-native/utils/MCPTool.d.ts.map +1 -0
  189. package/dist/react-native/utils/MCPTool.js +128 -0
  190. package/dist/react-native/utils/MCPTool.js.map +1 -0
  191. package/dist/{esm → react-native/utils}/utils.d.ts +61 -1
  192. package/dist/react-native/utils/utils.d.ts.map +1 -0
  193. package/dist/{browser → react-native/utils}/utils.js +90 -0
  194. package/dist/react-native/utils/utils.js.map +1 -0
  195. package/package.json +1 -1
  196. package/dist/browser/utils.d.ts.map +0 -1
  197. package/dist/browser/utils.js.map +0 -1
  198. package/dist/commonjs/utils.d.ts.map +0 -1
  199. package/dist/commonjs/utils.js.map +0 -1
  200. package/dist/esm/utils.d.ts.map +0 -1
  201. package/dist/esm/utils.js.map +0 -1
  202. package/dist/react-native/utils.d.ts.map +0 -1
  203. package/dist/react-native/utils.js.map +0 -1
@@ -0,0 +1,78 @@
1
+ import { MCPToolDefinition, ToolResources } from "../index.js";
2
+ /**
3
+ * A tool that connects to Model Context Protocol (MCP) servers.
4
+ * Supports managing MCP server connections and allowed tools dynamically.
5
+ */
6
+ export declare class MCPTool {
7
+ private _serverLabel;
8
+ private _serverUrl;
9
+ private _allowedTools;
10
+ private _requireApproval?;
11
+ private _headers;
12
+ /**
13
+ * Constructor initializes the tool with MCP server configuration.
14
+ * @param serverLabel - The label for the MCP server
15
+ * @param serverUrl - The endpoint for the MCP server
16
+ * @param allowedTools - List of allowed tools for MCP server
17
+ */
18
+ constructor(serverLabel: string, serverUrl: string, allowedTools?: string[]);
19
+ /**
20
+ * Get the MCP tool resource.
21
+ * @returns The MCP tool resource
22
+ */
23
+ private get _resource();
24
+ /**
25
+ * Set the MCP tool definition.
26
+ * @returns The MCP tool definition
27
+ * */
28
+ private get _definition();
29
+ /**
30
+ * Get the MCP tool definition.
31
+ * @returns A list containing the MCP tool definition
32
+ */
33
+ get definitions(): MCPToolDefinition[];
34
+ /**
35
+ * Add a tool to the list of allowed tools.
36
+ * @param toolName - The name of the tool to allow
37
+ */
38
+ allowTool(toolName: string): void;
39
+ /**
40
+ * Remove a tool from the list of allowed tools.
41
+ * @param toolName - The name of the tool to remove from allowed tools
42
+ * @throws Error if the tool is not in the allowed tools list
43
+ */
44
+ disallowTool(toolName: string): void;
45
+ /**
46
+ * Update the approval mode for the MCP tool.
47
+ * @param requireApproval - The require_approval setting to update
48
+ */
49
+ setApprovalMode(requireApproval?: "always" | "never"): void;
50
+ /**
51
+ * Update the headers for the MCP tool.
52
+ * @param key - The header key to update
53
+ * @param value - The new value for the header key
54
+ * @throws Error if the key is empty
55
+ */
56
+ updateHeaders(key: string, value: string): void;
57
+ /**
58
+ * Get the server label for the MCP tool.
59
+ */
60
+ get serverLabel(): string;
61
+ /**
62
+ * Get the server URL for the MCP tool.
63
+ */
64
+ get serverUrl(): string;
65
+ /**
66
+ * Get the list of allowed tools for the MCP server.
67
+ */
68
+ get allowedTools(): string[];
69
+ /**
70
+ * Get the headers for the MCP tool.
71
+ */
72
+ get headers(): Record<string, string>;
73
+ /**
74
+ * Get the tool resources for the agent.
75
+ */
76
+ get resources(): ToolResources;
77
+ }
78
+ //# sourceMappingURL=MCPTool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MCPTool.d.ts","sourceRoot":"","sources":["../../../src/utils/MCPTool.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAmB,aAAa,EAAE,MAAM,aAAa,CAAC;AAChF;;;GAGG;AACH,qBAAa,OAAO;IAClB,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,aAAa,CAAW;IAChC,OAAO,CAAC,gBAAgB,CAAC,CAAqB;IAC9C,OAAO,CAAC,QAAQ,CAAyB;IAEzC;;;;;OAKG;gBACS,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,EAAE;IAO3E;;;OAGG;IACH,OAAO,KAAK,SAAS,GAMpB;IAED;;;SAGK;IACL,OAAO,KAAK,WAAW,GAOtB;IAED;;;OAGG;IACH,IAAI,WAAW,IAAI,iBAAiB,EAAE,CAErC;IAED;;;OAGG;IACH,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAMjC;;;;OAIG;IACH,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IASpC;;;OAGG;IACH,eAAe,CAAC,eAAe,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,IAAI;IAI3D;;;;;OAKG;IACH,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAQ/C;;OAEG;IACH,IAAI,WAAW,IAAI,MAAM,CAExB;IAED;;OAEG;IACH,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED;;OAEG;IACH,IAAI,YAAY,IAAI,MAAM,EAAE,CAE3B;IAED;;OAEG;IACH,IAAI,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAEpC;IAED;;OAEG;IACH,IAAI,SAAS,IAAI,aAAa,CAI7B;CACF"}
@@ -0,0 +1,128 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ /**
4
+ * A tool that connects to Model Context Protocol (MCP) servers.
5
+ * Supports managing MCP server connections and allowed tools dynamically.
6
+ */
7
+ export class MCPTool {
8
+ /**
9
+ * Constructor initializes the tool with MCP server configuration.
10
+ * @param serverLabel - The label for the MCP server
11
+ * @param serverUrl - The endpoint for the MCP server
12
+ * @param allowedTools - List of allowed tools for MCP server
13
+ */
14
+ constructor(serverLabel, serverUrl, allowedTools) {
15
+ this._serverLabel = serverLabel;
16
+ this._serverUrl = serverUrl;
17
+ this._allowedTools = allowedTools || [];
18
+ this._requireApproval = "always"; // Default to always require approval
19
+ this._headers = {};
20
+ }
21
+ /**
22
+ * Get the MCP tool resource.
23
+ * @returns The MCP tool resource
24
+ */
25
+ get _resource() {
26
+ return {
27
+ serverLabel: this._serverLabel,
28
+ headers: this._headers,
29
+ requireApproval: this._requireApproval,
30
+ };
31
+ }
32
+ /**
33
+ * Set the MCP tool definition.
34
+ * @returns The MCP tool definition
35
+ * */
36
+ get _definition() {
37
+ return {
38
+ type: "mcp",
39
+ serverLabel: this._serverLabel,
40
+ serverUrl: this._serverUrl,
41
+ allowedTools: this._allowedTools.length > 0 ? this._allowedTools : undefined,
42
+ };
43
+ }
44
+ /**
45
+ * Get the MCP tool definition.
46
+ * @returns A list containing the MCP tool definition
47
+ */
48
+ get definitions() {
49
+ return [this._definition];
50
+ }
51
+ /**
52
+ * Add a tool to the list of allowed tools.
53
+ * @param toolName - The name of the tool to allow
54
+ */
55
+ allowTool(toolName) {
56
+ if (!this._allowedTools.includes(toolName)) {
57
+ this._allowedTools.push(toolName);
58
+ }
59
+ }
60
+ /**
61
+ * Remove a tool from the list of allowed tools.
62
+ * @param toolName - The name of the tool to remove from allowed tools
63
+ * @throws Error if the tool is not in the allowed tools list
64
+ */
65
+ disallowTool(toolName) {
66
+ const index = this._allowedTools.indexOf(toolName);
67
+ if (index > -1) {
68
+ this._allowedTools.splice(index, 1);
69
+ }
70
+ else {
71
+ throw new Error(`Tool '${toolName}' is not in the allowed tools list.`);
72
+ }
73
+ }
74
+ /**
75
+ * Update the approval mode for the MCP tool.
76
+ * @param requireApproval - The require_approval setting to update
77
+ */
78
+ setApprovalMode(requireApproval) {
79
+ this._requireApproval = requireApproval;
80
+ }
81
+ /**
82
+ * Update the headers for the MCP tool.
83
+ * @param key - The header key to update
84
+ * @param value - The new value for the header key
85
+ * @throws Error if the key is empty
86
+ */
87
+ updateHeaders(key, value) {
88
+ if (key) {
89
+ this._headers[key] = value;
90
+ }
91
+ else {
92
+ throw new Error("Header key cannot be empty.");
93
+ }
94
+ }
95
+ /**
96
+ * Get the server label for the MCP tool.
97
+ */
98
+ get serverLabel() {
99
+ return this._serverLabel;
100
+ }
101
+ /**
102
+ * Get the server URL for the MCP tool.
103
+ */
104
+ get serverUrl() {
105
+ return this._serverUrl;
106
+ }
107
+ /**
108
+ * Get the list of allowed tools for the MCP server.
109
+ */
110
+ get allowedTools() {
111
+ return [...this._allowedTools];
112
+ }
113
+ /**
114
+ * Get the headers for the MCP tool.
115
+ */
116
+ get headers() {
117
+ return Object.assign({}, this._headers);
118
+ }
119
+ /**
120
+ * Get the tool resources for the agent.
121
+ */
122
+ get resources() {
123
+ return {
124
+ mcp: [this._resource],
125
+ };
126
+ }
127
+ }
128
+ //# sourceMappingURL=MCPTool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MCPTool.js","sourceRoot":"","sources":["../../../src/utils/MCPTool.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC;;;GAGG;AACH,MAAM,OAAO,OAAO;IAOlB;;;;;OAKG;IACH,YAAY,WAAmB,EAAE,SAAiB,EAAE,YAAuB;QACzE,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;QAChC,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,aAAa,GAAG,YAAY,IAAI,EAAE,CAAC;QACxC,IAAI,CAAC,gBAAgB,GAAG,QAAQ,CAAC,CAAC,qCAAqC;QACvE,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;IACrB,CAAC;IACD;;;OAGG;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AAa;QACtC,IAAI,GAAG,EAAE,CAAC;YACR,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QAC7B,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;QACjD,CAAC;IACH,CAAC;IAED;;OAEG;IACH,IAAI,WAAW;QACb,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAED;;OAEG;IACH,IAAI,YAAY;QACd,OAAO,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC;IACjC,CAAC;IAED;;OAEG;IACH,IAAI,OAAO;QACT,yBAAY,IAAI,CAAC,QAAQ,EAAG;IAC9B,CAAC;IAED;;OAEG;IACH,IAAI,SAAS;QACX,OAAO;YACL,GAAG,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC;SACtB,CAAC;IACJ,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { MCPToolDefinition, MCPToolResource, ToolResources } from \"../index.js\";\n/**\n * A tool that connects to Model Context Protocol (MCP) servers.\n * Supports managing MCP server connections and allowed tools dynamically.\n */\nexport class MCPTool {\n private _serverLabel: string;\n private _serverUrl: string;\n private _allowedTools: string[];\n private _requireApproval?: \"always\" | \"never\";\n private _headers: Record<string, string>;\n\n /**\n * Constructor initializes the tool with MCP server configuration.\n * @param serverLabel - The label for the MCP server\n * @param serverUrl - The endpoint for the MCP server\n * @param allowedTools - List of allowed tools for MCP server\n */\n constructor(serverLabel: string, serverUrl: string, allowedTools?: string[]) {\n this._serverLabel = serverLabel;\n this._serverUrl = serverUrl;\n this._allowedTools = allowedTools || [];\n this._requireApproval = \"always\"; // Default to always require approval\n this._headers = {};\n }\n /**\n * Get the MCP tool resource.\n * @returns The MCP tool resource\n */\n private get _resource(): MCPToolResource {\n return {\n serverLabel: this._serverLabel,\n headers: this._headers,\n requireApproval: this._requireApproval,\n };\n }\n\n /**\n * Set the MCP tool definition.\n * @returns The MCP tool definition\n * */\n private get _definition(): MCPToolDefinition {\n return {\n type: \"mcp\",\n serverLabel: this._serverLabel,\n serverUrl: this._serverUrl,\n allowedTools: this._allowedTools.length > 0 ? this._allowedTools : undefined,\n };\n }\n\n /**\n * Get the MCP tool definition.\n * @returns A list containing the MCP tool definition\n */\n get definitions(): MCPToolDefinition[] {\n return [this._definition];\n }\n\n /**\n * Add a tool to the list of allowed tools.\n * @param toolName - The name of the tool to allow\n */\n allowTool(toolName: string): void {\n if (!this._allowedTools.includes(toolName)) {\n this._allowedTools.push(toolName);\n }\n }\n\n /**\n * Remove a tool from the list of allowed tools.\n * @param toolName - The name of the tool to remove from allowed tools\n * @throws Error if the tool is not in the allowed tools list\n */\n disallowTool(toolName: string): void {\n const index = this._allowedTools.indexOf(toolName);\n if (index > -1) {\n this._allowedTools.splice(index, 1);\n } else {\n throw new Error(`Tool '${toolName}' is not in the allowed tools list.`);\n }\n }\n\n /**\n * Update the approval mode for the MCP tool.\n * @param requireApproval - The require_approval setting to update\n */\n setApprovalMode(requireApproval?: \"always\" | \"never\"): void {\n this._requireApproval = requireApproval;\n }\n\n /**\n * Update the headers for the MCP tool.\n * @param key - The header key to update\n * @param value - The new value for the header key\n * @throws Error if the key is empty\n */\n updateHeaders(key: string, value: string): void {\n if (key) {\n this._headers[key] = value;\n } else {\n throw new Error(\"Header key cannot be empty.\");\n }\n }\n\n /**\n * Get the server label for the MCP tool.\n */\n get serverLabel(): string {\n return this._serverLabel;\n }\n\n /**\n * Get the server URL for the MCP tool.\n */\n get serverUrl(): string {\n return this._serverUrl;\n }\n\n /**\n * Get the list of allowed tools for the MCP server.\n */\n get allowedTools(): string[] {\n return [...this._allowedTools];\n }\n\n /**\n * Get the headers for the MCP tool.\n */\n get headers(): Record<string, string> {\n return { ...this._headers };\n }\n\n /**\n * Get the tool resources for the agent.\n */\n get resources(): ToolResources {\n return {\n mcp: [this._resource],\n };\n }\n}\n"]}
@@ -1,4 +1,5 @@
1
- import type { AzureAISearchToolDefinition, CodeInterpreterToolDefinition, FileSearchToolDefinition, FileSearchToolDefinitionDetails, FunctionDefinition, FunctionToolDefinition, OpenApiToolDefinition, RequiredAction, RequiredToolCall, ToolDefinition, ToolDefinitionUnion, ToolResources, VectorStoreConfigurations, VectorStoreDataSource, OpenApiFunctionDefinition, AISearchIndexResource, BingGroundingToolDefinition, BingGroundingSearchConfiguration, ConnectedAgentToolDefinition } from "./index.js";
1
+ import type { AzureAISearchToolDefinition, CodeInterpreterToolDefinition, FileSearchToolDefinition, FileSearchToolDefinitionDetails, FunctionDefinition, FunctionToolDefinition, OpenApiToolDefinition, RequiredAction, RequiredToolCall, ToolDefinition, ToolDefinitionUnion, ToolResources, VectorStoreConfigurations, VectorStoreDataSource, OpenApiFunctionDefinition, AISearchIndexResource, BingCustomSearchConfiguration, BingCustomSearchToolDefinition, BingGroundingToolDefinition, BingGroundingSearchConfiguration, ConnectedAgentToolDefinition, MicrosoftFabricToolDefinition, SharepointToolDefinition } from "../index.js";
2
+ import { MCPTool } from "./MCPTool.js";
2
3
  /**
3
4
  * Determines if the given output is of the specified type.
4
5
  *
@@ -37,6 +38,17 @@ export declare class ToolUtility {
37
38
  static createConnectionTool(toolType: connectionToolType, connectionIds: string[]): {
38
39
  definition: ToolDefinitionUnion;
39
40
  };
41
+ /**
42
+ * Creates a sharepoint grounding search tool
43
+ *
44
+ * @param connectionId - The ID of the sharepoint search connection.
45
+ *
46
+ * @returns An object containing the definition and resources for the sharepoint grounding search tool
47
+ *
48
+ */
49
+ static createSharepointGroundingTool(connectionId: string): {
50
+ definition: SharepointToolDefinition;
51
+ };
40
52
  /**
41
53
  * Creates a bing grounding search tool
42
54
  *
@@ -48,6 +60,16 @@ export declare class ToolUtility {
48
60
  static createBingGroundingTool(searchConfigurations: BingGroundingSearchConfiguration[]): {
49
61
  definition: BingGroundingToolDefinition;
50
62
  };
63
+ /**
64
+ * Creates a bing custom search tool
65
+ *
66
+ * @param searchConfigurations - The ID of bing search connection and instanceName.
67
+ *
68
+ * @returns An object containing the definition and resources for the bing custom search tool
69
+ */
70
+ static createBingCustomSearchTool(searchConfigurations: BingCustomSearchConfiguration[]): {
71
+ definition: BingCustomSearchToolDefinition;
72
+ };
51
73
  /**
52
74
  * Creates a file search tool
53
75
  *
@@ -93,6 +115,15 @@ export declare class ToolUtility {
93
115
  static createConnectedAgentTool(id: string, name: string, description: string): {
94
116
  definition: ConnectedAgentToolDefinition;
95
117
  };
118
+ /**
119
+ * Creates a Microsoft Fabric tool
120
+ *
121
+ * @param connectionIds - A list of the IDs of the Fabric connections to use.
122
+ * @returns An object containing the definition for the Microsoft Fabric tool
123
+ */
124
+ static createFabricTool(connectionId: string): {
125
+ definition: MicrosoftFabricToolDefinition;
126
+ };
96
127
  /**
97
128
  * Creates a function tool
98
129
  *
@@ -113,6 +144,16 @@ export declare class ToolUtility {
113
144
  static createOpenApiTool(openApiFunctionDefinition: OpenApiFunctionDefinition): {
114
145
  definition: OpenApiToolDefinition;
115
146
  };
147
+ /**
148
+ * Creates an MCP tool with the provided configuration.
149
+ * @param options - Configuration options for the MCP tool
150
+ * @returns A new MCPTool instance
151
+ */
152
+ static createMCPTool(options: {
153
+ serverLabel: string;
154
+ serverUrl: string;
155
+ allowedTools?: string[];
156
+ }): MCPTool;
116
157
  }
117
158
  /**
118
159
  * Represents a set of tools with their definitions and resources.
@@ -201,5 +242,24 @@ export declare class ToolSet {
201
242
  addConnectedAgentTool(id: string, name: string, description: string): {
202
243
  definition: ConnectedAgentToolDefinition;
203
244
  };
245
+ /**
246
+ * Adds a Microsoft Fabric tool to the tool set.
247
+ *
248
+ * @param connectionId - The ID of the Fabric connection to use.
249
+ * @returns An object containing the definition for the Microsoft Fabric tool
250
+ */
251
+ addFabricTool(connectionId: string): {
252
+ definition: MicrosoftFabricToolDefinition;
253
+ };
254
+ /**
255
+ * Adds sharepoint grounding search tool to the tool set.
256
+ *
257
+ * @param connectionId - The ID of the sharepoint search connection.
258
+ *
259
+ * @returns An object containing the definition and resources for the sharepoint grounding search tool
260
+ */
261
+ addSharepointGroundingTool(connectionId: string): {
262
+ definition: SharepointToolDefinition;
263
+ };
204
264
  }
205
265
  //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/utils/utils.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,2BAA2B,EAC3B,6BAA6B,EAC7B,wBAAwB,EACxB,+BAA+B,EAC/B,kBAAkB,EAClB,sBAAsB,EACtB,qBAAqB,EACrB,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,yBAAyB,EACzB,qBAAqB,EACrB,yBAAyB,EACzB,qBAAqB,EACrB,6BAA6B,EAC7B,8BAA8B,EAC9B,2BAA2B,EAC3B,gCAAgC,EAChC,4BAA4B,EAC5B,6BAA6B,EAC7B,wBAAwB,EACzB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,EACvD,MAAM,EAAE,cAAc,GAAG,gBAAgB,GAAG,mBAAmB,EAC/D,IAAI,EAAE,MAAM,GACX,MAAM,IAAI,CAAC,CAEb;AAED,2DAA2D;AAC3D,oBAAY,kBAAkB;IAC5B,iCAAiC;IACjC,aAAa,mBAAmB;IAChC,4BAA4B;IAC5B,eAAe,qBAAqB;IACpC,sBAAsB;IACtB,mBAAmB,yBAAyB;IAC5C,0BAA0B;IAC1B,aAAa,mBAAmB;IAChC,8BAA8B;IAC9B,gBAAgB,uBAAuB;CACxC;AAUD;;GAEG;AACH,qBAAa,WAAW;IACtB;;;;;;OAMG;IACH,MAAM,CAAC,oBAAoB,CACzB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AAC,SAAS,EAAE,aAAa,CAAA;KAAE;IAO1E;;;;;;;OAOG;IACH,oBAAoB,CAClB,iBAAiB,EAAE,MAAM,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;;;;;;OAMG;IACH,oBAAoB,CAAC,oBAAoB,EAAE,gCAAgC,EAAE,GAAG;QAC9E,UAAU,EAAE,2BAA2B,CAAC;KACzC;IAMD;;;;;;;OAOG;IACH,qBAAqB,CACnB,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,GAClB;QAAE,UAAU,EAAE,4BAA4B,CAAA;KAAE;IAM/C;;;;;OAKG;IACH,aAAa,CAAC,YAAY,EAAE,MAAM,GAAG;QAAE,UAAU,EAAE,6BAA6B,CAAA;KAAE;IAMlF;;;;;;OAMG;IACH,0BAA0B,CAAC,YAAY,EAAE,MAAM,GAAG;QAAE,UAAU,EAAE,wBAAwB,CAAA;KAAE;CAK3F"}
@@ -1,5 +1,6 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
+ import { MCPTool } from "./MCPTool.js";
3
4
  /**
4
5
  * Determines if the given output is of the specified type.
5
6
  *
@@ -53,6 +54,28 @@ export class ToolUtility {
53
54
  },
54
55
  };
55
56
  }
57
+ /**
58
+ * Creates a sharepoint grounding search tool
59
+ *
60
+ * @param connectionId - The ID of the sharepoint search connection.
61
+ *
62
+ * @returns An object containing the definition and resources for the sharepoint grounding search tool
63
+ *
64
+ */
65
+ static createSharepointGroundingTool(connectionId) {
66
+ return {
67
+ definition: {
68
+ type: "sharepoint_grounding",
69
+ sharepointGrounding: {
70
+ connectionList: [
71
+ {
72
+ connectionId: connectionId,
73
+ },
74
+ ],
75
+ },
76
+ },
77
+ };
78
+ }
56
79
  /**
57
80
  * Creates a bing grounding search tool
58
81
  *
@@ -79,6 +102,26 @@ export class ToolUtility {
79
102
  },
80
103
  };
81
104
  }
105
+ /**
106
+ * Creates a bing custom search tool
107
+ *
108
+ * @param searchConfigurations - The ID of bing search connection and instanceName.
109
+ *
110
+ * @returns An object containing the definition and resources for the bing custom search tool
111
+ */
112
+ static createBingCustomSearchTool(searchConfigurations) {
113
+ return {
114
+ definition: {
115
+ type: "bing_custom_search",
116
+ bingCustomSearch: {
117
+ searchConfigurations: searchConfigurations.map((searchConfiguration) => ({
118
+ connectionId: searchConfiguration.connectionId,
119
+ instanceName: searchConfiguration.instanceName,
120
+ })),
121
+ },
122
+ },
123
+ };
124
+ }
82
125
  /**
83
126
  * Creates a file search tool
84
127
  *
@@ -154,6 +197,22 @@ export class ToolUtility {
154
197
  },
155
198
  };
156
199
  }
200
+ /**
201
+ * Creates a Microsoft Fabric tool
202
+ *
203
+ * @param connectionIds - A list of the IDs of the Fabric connections to use.
204
+ * @returns An object containing the definition for the Microsoft Fabric tool
205
+ */
206
+ static createFabricTool(connectionId) {
207
+ return {
208
+ definition: {
209
+ type: "fabric_dataagent",
210
+ fabricDataagent: {
211
+ connectionList: [{ connectionId: connectionId }],
212
+ },
213
+ },
214
+ };
215
+ }
157
216
  /**
158
217
  * Creates a function tool
159
218
  *
@@ -190,6 +249,14 @@ export class ToolUtility {
190
249
  },
191
250
  };
192
251
  }
252
+ /**
253
+ * Creates an MCP tool with the provided configuration.
254
+ * @param options - Configuration options for the MCP tool
255
+ * @returns A new MCPTool instance
256
+ */
257
+ static createMCPTool(options) {
258
+ return new MCPTool(options.serverLabel, options.serverUrl, options.allowedTools);
259
+ }
193
260
  }
194
261
  /**
195
262
  * Represents a set of tools with their definitions and resources.
@@ -294,5 +361,28 @@ export class ToolSet {
294
361
  this.toolDefinitions.push(tool.definition);
295
362
  return tool;
296
363
  }
364
+ /**
365
+ * Adds a Microsoft Fabric tool to the tool set.
366
+ *
367
+ * @param connectionId - The ID of the Fabric connection to use.
368
+ * @returns An object containing the definition for the Microsoft Fabric tool
369
+ */
370
+ addFabricTool(connectionId) {
371
+ const tool = ToolUtility.createFabricTool(connectionId);
372
+ this.toolDefinitions.push(tool.definition);
373
+ return tool;
374
+ }
375
+ /**
376
+ * Adds sharepoint grounding search tool to the tool set.
377
+ *
378
+ * @param connectionId - The ID of the sharepoint search connection.
379
+ *
380
+ * @returns An object containing the definition and resources for the sharepoint grounding search tool
381
+ */
382
+ addSharepointGroundingTool(connectionId) {
383
+ const tool = ToolUtility.createSharepointGroundingTool(connectionId);
384
+ this.toolDefinitions.push(tool.definition);
385
+ return tool;
386
+ }
297
387
  }
298
388
  //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/utils/utils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AA2BlC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAC5B,MAA+D,EAC/D,IAAY;IAEZ,OAAO,MAAM,CAAC,IAAI,KAAK,IAAI,CAAC;AAC9B,CAAC;AAED,2DAA2D;AAC3D,MAAM,CAAN,IAAY,kBAWX;AAXD,WAAY,kBAAkB;IAC5B,iCAAiC;IACjC,sDAAgC,CAAA;IAChC,4BAA4B;IAC5B,0DAAoC,CAAA;IACpC,sBAAsB;IACtB,kEAA4C,CAAA;IAC5C,0BAA0B;IAC1B,sDAAgC,CAAA;IAChC,8BAA8B;IAC9B,6DAAuC,CAAA;AACzC,CAAC,EAXW,kBAAkB,KAAlB,kBAAkB,QAW7B;AAED,MAAM,OAAO,GAAG;IACd,cAAc,EAAE,eAAe;IAC/B,gBAAgB,EAAE,kBAAkB;IACpC,oBAAoB,EAAE,qBAAqB;IAC3C,cAAc,EAAE,eAAe;IAC/B,kBAAkB,EAAE,kB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AKG;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;IAED;;;;;;OAMG;IACH,0BAA0B,CAAC,YAAoB;QAC7C,MAAM,IAAI,GAAG,WAAW,CAAC,6BAA6B,CAAC,YAAY,CAAC,CAAC;QACrE,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 CodeInterpreterToolDefinition,\n FileSearchToolDefinition,\n FileSearchToolDefinitionDetails,\n FunctionDefinition,\n FunctionToolDefinition,\n OpenApiToolDefinition,\n RequiredAction,\n RequiredToolCall,\n ToolDefinition,\n ToolDefinitionUnion,\n ToolResources,\n VectorStoreConfigurations,\n VectorStoreDataSource,\n OpenApiFunctionDefinition,\n AISearchIndexResource,\n BingCustomSearchConfiguration,\n BingCustomSearchToolDefinition,\n BingGroundingToolDefinition,\n BingGroundingSearchConfiguration,\n ConnectedAgentToolDefinition,\n MicrosoftFabricToolDefinition,\n SharepointToolDefinition,\n} from \"../index.js\";\nimport { MCPTool } from \"./MCPTool.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 `RequiredAction`, `RequiredToolCall`, or `ToolDefinitionUnion`.\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: RequiredAction | RequiredToolCall | ToolDefinitionUnion,\n type: string,\n): output is T {\n return output.type === type;\n}\n\n/** Types of connection tools used to configure an agent */\nexport enum connectionToolType {\n /** Bing grounding search tool */\n BingGrounding = \"bing_grounding\",\n /** Microsoft Fabric tool */\n MicrosoftFabric = \"fabric_dataagent\",\n /** Sharepoint tool */\n SharepointGrounding = \"sharepoint_grounding\",\n /** Azure Function tool */\n AzureFunction = \"azure_function\",\n /** Bing custom search tool */\n BingCustomSearch = \"bing_custom_search\",\n}\n\nconst toolMap = {\n bing_grounding: \"bingGrounding\",\n fabric_dataagent: \"fabric_dataagent\",\n sharepoint_grounding: \"sharepointGrounding\",\n azure_function: \"azureFunction\",\n bing_custom_search: \"bingCustomSearch\",\n};\n\n/**\n * Utility class for creating various tools.\n */\nexport class ToolUtility {\n /**\n * Creates a connection tool\n *\n * @param toolType - The type of the connection tool.\n * @param connectionIds - A list of the IDs of the connections to use.\n * @returns An object containing the definition for the connection tool\n */\n static createConnectionTool(\n toolType: connectionToolType,\n connectionIds: string[],\n ): { definition: ToolDefinitionUnion } {\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 sharepoint grounding search tool\n *\n * @param connectionId - The ID of the sharepoint search connection.\n *\n * @returns An object containing the definition and resources for the sharepoint grounding search tool\n *\n */\n static createSharepointGroundingTool(connectionId: string): {\n definition: SharepointToolDefinition;\n } {\n return {\n definition: {\n type: \"sharepoint_grounding\",\n sharepointGrounding: {\n connectionList: [\n {\n connectionId: connectionId,\n },\n ],\n },\n },\n };\n }\n\n /**\n * Creates a bing grounding search tool\n *\n * @param connectionId - The ID of the bing search connection.\n *\n * @returns An object containing the definition and resources for the bing grounding search tool\n *\n */\n static createBingGroundingTool(searchConfigurations: BingGroundingSearchConfiguration[]): {\n definition: BingGroundingToolDefinition;\n } {\n // Ensure searchConfigurations is an array even if it's undefined\n const configs = searchConfigurations || [];\n return {\n definition: {\n type: \"bing_grounding\",\n bingGrounding: {\n searchConfigurations: configs.map((searchConfiguration) => ({\n connectionId: searchConfiguration.connectionId,\n market: searchConfiguration?.market,\n setLang: searchConfiguration?.setLang,\n count: searchConfiguration?.count,\n freshness: searchConfiguration?.freshness,\n })),\n },\n },\n };\n }\n\n /**\n * Creates a bing custom search tool\n *\n * @param searchConfigurations - The ID of bing search connection and instanceName.\n *\n * @returns An object containing the definition and resources for the bing custom search tool\n */\n\n static createBingCustomSearchTool(searchConfigurations: BingCustomSearchConfiguration[]): {\n definition: BingCustomSearchToolDefinition;\n } {\n return {\n definition: {\n type: \"bing_custom_search\",\n bingCustomSearch: {\n searchConfigurations: searchConfigurations.map((searchConfiguration) => ({\n connectionId: searchConfiguration.connectionId,\n instanceName: searchConfiguration.instanceName,\n })),\n },\n },\n };\n }\n\n /**\n * Creates a file search tool\n *\n * @param vectorStoreIds - The ID of the vector store attached to this agent. There can be a maximum of 1 vector store attached to the agent.\n * @param vectorStores - The list of vector store configuration objects from Azure. This list is limited to one element. The only element of this list contains the list of azure asset IDs used by the search tool.\n * @param definitionDetails - The input definition information for a file search tool as used to configure an agent.\n *\n * @returns An object containing the definition and resources for the file search tool\n */\n static createFileSearchTool(\n vectorStoreIds?: string[],\n vectorStores?: Array<VectorStoreConfigurations>,\n definitionDetails?: FileSearchToolDefinitionDetails,\n ): { definition: FileSearchToolDefinition; resources: ToolResources } {\n return {\n definition: { type: \"file_search\", fileSearch: definitionDetails },\n resources: { fileSearch: { vectorStoreIds: vectorStoreIds, vectorStores: vectorStores } },\n };\n }\n\n /**\n * Creates a code interpreter tool\n *\n * @param fileIds - A list of file IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool.\n * @param dataSources - The data sources to be used. This option is mutually exclusive with fileIds.\n *\n * @returns An object containing the definition and resources for the code interpreter tool.\n */\n static createCodeInterpreterTool(\n fileIds?: string[],\n dataSources?: Array<VectorStoreDataSource>,\n ): { definition: CodeInterpreterToolDefinition; resources: ToolResources } {\n if (fileIds && dataSources) {\n throw new Error(\"Cannot specify both fileIds and dataSources\");\n }\n\n return {\n definition: { type: \"code_interpreter\" },\n resources: { codeInterpreter: { fileIds: fileIds, dataSources: dataSources } },\n };\n }\n\n /**\n * Creates an Azure AI search tool\n *\n * @param indexConnectionId - The connection ID of the Azure AI search index.\n * @param indexName - The name of the Azure AI search index.\n *\n * @returns An object containing the definition and resources for the Azure AI search tool.\n */\n static createAzureAISearchTool(\n indexConnectionId: string,\n indexName: string,\n options?: AISearchIndexResource,\n ): { definition: AzureAISearchToolDefinition; resources: ToolResources } {\n return {\n definition: { type: \"azure_ai_search\" },\n resources: {\n azureAISearch: {\n indexList: [\n {\n indexConnectionId: indexConnectionId,\n indexName: indexName,\n queryType: options?.queryType,\n topK: options?.topK,\n filter: options?.filter,\n },\n ],\n },\n },\n };\n }\n\n /**\n * Creates a connected agent tool\n *\n * @returns An object containing the definition for the connected agent tool.\n */\n static createConnectedAgentTool(\n id: string,\n name: string,\n description: string,\n ): { definition: ConnectedAgentToolDefinition } {\n return {\n definition: {\n type: \"connected_agent\",\n connectedAgent: {\n id: id,\n name: name,\n description: description,\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: MicrosoftFabricToolDefinition } {\n return {\n definition: {\n type: \"fabric_dataagent\",\n fabricDataagent: {\n connectionList: [{ 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: {\n name: openApiFunctionDefinition.name,\n spec: openApiFunctionDefinition.spec,\n description: openApiFunctionDefinition.description,\n auth: openApiFunctionDefinition.auth,\n defaultParams: openApiFunctionDefinition.defaultParams,\n },\n },\n };\n }\n /**\n * Creates an MCP tool with the provided configuration.\n * @param options - Configuration options for the MCP tool\n * @returns A new MCPTool instance\n */\n static createMCPTool(options: {\n serverLabel: string;\n serverUrl: string;\n allowedTools?: string[];\n }): MCPTool {\n return new MCPTool(options.serverLabel, options.serverUrl, options.allowedTools);\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 a bing grounding search tool to the tool set.\n *\n * @param connectionId - The ID of the bing search connection.\n *\n * @returns An object containing the definition and resources for the bing grounding search tool\n */\n addBingGroundingTool(searchConfigurations: BingGroundingSearchConfiguration[]): {\n definition: BingGroundingToolDefinition;\n } {\n const tool = ToolUtility.createBingGroundingTool(searchConfigurations);\n this.toolDefinitions.push(tool.definition);\n return tool;\n }\n\n /**\n * Adds a connected agent tool to the tool set.\n *\n * @param id - The ID of the connected agent.\n * @param name - The name of the connected agent.\n * @param description - The description of the connected agent.\n * @returns An object containing the definition for the connected agent tool\n */\n addConnectedAgentTool(\n id: string,\n name: string,\n description: string,\n ): { definition: ConnectedAgentToolDefinition } {\n const tool = ToolUtility.createConnectedAgentTool(id, name, description);\n this.toolDefinitions.push(tool.definition);\n return tool;\n }\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: MicrosoftFabricToolDefinition } {\n const tool = ToolUtility.createFabricTool(connectionId);\n this.toolDefinitions.push(tool.definition);\n return tool;\n }\n\n /**\n * Adds sharepoint grounding search tool to the tool set.\n *\n * @param connectionId - The ID of the sharepoint search connection.\n *\n * @returns An object containing the definition and resources for the sharepoint grounding search tool\n */\n addSharepointGroundingTool(connectionId: string): { definition: SharepointToolDefinition } {\n const tool = ToolUtility.createSharepointGroundingTool(connectionId);\n this.toolDefinitions.push(tool.definition);\n return tool;\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azure/ai-agents",
3
- "version": "1.0.0",
3
+ "version": "1.1.0-beta.1",
4
4
  "description": "Azure AI Agents client library.",
5
5
  "engines": {
6
6
  "node": ">=20.0.0"
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,2BAA2B,EAC3B,6BAA6B,EAC7B,wBAAwB,EACxB,+BAA+B,EAC/B,kBAAkB,EAClB,sBAAsB,EACtB,qBAAqB,EACrB,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,yBAAyB,EACzB,qBAAqB,EACrB,yBAAyB,EACzB,qBAAqB,EACrB,2BAA2B,EAC3B,gCAAgC,EAChC,4BAA4B,EAC7B,MAAM,YAA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,qBAAqB,CACnB,EAAU,EACV,IAAY,EACZ,WAAmB;QAEnB,MAAM,IAAI,GAAG,WAAW,CAAC,wBAAwB,CAAC,EAAE,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC;QACzE,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 CodeInterpreterToolDefinition,\n FileSearchToolDefinition,\n FileSearchToolDefinitionDetails,\n FunctionDefinition,\n FunctionToolDefinition,\n OpenApiToolDefinition,\n RequiredAction,\n RequiredToolCall,\n ToolDefinition,\n ToolDefinitionUnion,\n ToolResources,\n VectorStoreConfigurations,\n VectorStoreDataSource,\n OpenApiFunctionDefinition,\n AISearchIndexResource,\n BingGroundingToolDefinition,\n BingGroundingSearchConfiguration,\n ConnectedAgentToolDefinition,\n} from \"./index.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 `RequiredAction`, `RequiredToolCall`, or `ToolDefinitionUnion`.\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: RequiredAction | RequiredToolCall | ToolDefinitionUnion,\n type: string,\n): output is T {\n return output.type === type;\n}\n\n/** Types of connection tools used to configure an agent */\nexport enum connectionToolType {\n /** Bing grounding search tool */\n BingGrounding = \"bing_grounding\",\n /** Microsoft Fabric tool */\n MicrosoftFabric = \"fabric_dataagent\",\n /** Sharepoint tool */\n SharepointGrounding = \"sharepoint_grounding\",\n /** Azure Function tool */\n AzureFunction = \"azure_function\",\n /** Bing custom search tool */\n BingCustomSearch = \"bing_custom_search\",\n}\n\nconst toolMap = {\n bing_grounding: \"bingGrounding\",\n fabric_dataagent: \"fabric_dataagent\",\n sharepoint_grounding: \"sharepointGrounding\",\n azure_function: \"azureFunction\",\n bing_custom_search: \"bingCustomSearch\",\n};\n\n/**\n * Utility class for creating various tools.\n */\nexport class ToolUtility {\n /**\n * Creates a connection tool\n *\n * @param toolType - The type of the connection tool.\n * @param connectionIds - A list of the IDs of the connections to use.\n * @returns An object containing the definition for the connection tool\n */\n static createConnectionTool(\n toolType: connectionToolType,\n connectionIds: string[],\n ): { definition: ToolDefinitionUnion } {\n return {\n definition: {\n type: toolType,\n [toolMap[toolType]]: {\n connections: connectionIds.map((connectionId) => ({ connectionId: connectionId })),\n },\n },\n };\n }\n\n /**\n * Creates a bing grounding search tool\n *\n * @param connectionId - The ID of the bing search connection.\n *\n * @returns An object containing the definition and resources for the bing grounding search tool\n *\n */\n static createBingGroundingTool(searchConfigurations: BingGroundingSearchConfiguration[]): {\n definition: BingGroundingToolDefinition;\n } {\n // Ensure searchConfigurations is an array even if it's undefined\n const configs = searchConfigurations || [];\n return {\n definition: {\n type: \"bing_grounding\",\n bingGrounding: {\n searchConfigurations: configs.map((searchConfiguration) => ({\n connectionId: searchConfiguration.connectionId,\n market: searchConfiguration?.market,\n setLang: searchConfiguration?.setLang,\n count: searchConfiguration?.count,\n freshness: searchConfiguration?.freshness,\n })),\n },\n },\n };\n }\n\n /**\n * Creates a file search tool\n *\n * @param vectorStoreIds - The ID of the vector store attached to this agent. There can be a maximum of 1 vector store attached to the agent.\n * @param vectorStores - The list of vector store configuration objects from Azure. This list is limited to one element. The only element of this list contains the list of azure asset IDs used by the search tool.\n * @param definitionDetails - The input definition information for a file search tool as used to configure an agent.\n *\n * @returns An object containing the definition and resources for the file search tool\n */\n static createFileSearchTool(\n vectorStoreIds?: string[],\n vectorStores?: Array<VectorStoreConfigurations>,\n definitionDetails?: FileSearchToolDefinitionDetails,\n ): { definition: FileSearchToolDefinition; resources: ToolResources } {\n return {\n definition: { type: \"file_search\", fileSearch: definitionDetails },\n resources: { fileSearch: { vectorStoreIds: vectorStoreIds, vectorStores: vectorStores } },\n };\n }\n\n /**\n * Creates a code interpreter tool\n *\n * @param fileIds - A list of file IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool.\n * @param dataSources - The data sources to be used. This option is mutually exclusive with fileIds.\n *\n * @returns An object containing the definition and resources for the code interpreter tool.\n */\n static createCodeInterpreterTool(\n fileIds?: string[],\n dataSources?: Array<VectorStoreDataSource>,\n ): { definition: CodeInterpreterToolDefinition; resources: ToolResources } {\n if (fileIds && dataSources) {\n throw new Error(\"Cannot specify both fileIds and dataSources\");\n }\n\n return {\n definition: { type: \"code_interpreter\" },\n resources: { codeInterpreter: { fileIds: fileIds, dataSources: dataSources } },\n };\n }\n\n /**\n * Creates an Azure AI search tool\n *\n * @param indexConnectionId - The connection ID of the Azure AI search index.\n * @param indexName - The name of the Azure AI search index.\n *\n * @returns An object containing the definition and resources for the Azure AI search tool.\n */\n static createAzureAISearchTool(\n indexConnectionId: string,\n indexName: string,\n options?: AISearchIndexResource,\n ): { definition: AzureAISearchToolDefinition; resources: ToolResources } {\n return {\n definition: { type: \"azure_ai_search\" },\n resources: {\n azureAISearch: {\n indexList: [\n {\n indexConnectionId: indexConnectionId,\n indexName: indexName,\n queryType: options?.queryType,\n topK: options?.topK,\n filter: options?.filter,\n },\n ],\n },\n },\n };\n }\n\n /**\n * Creates a connected agent tool\n *\n * @returns An object containing the definition for the connected agent tool.\n */\n static createConnectedAgentTool(\n id: string,\n name: string,\n description: string,\n ): { definition: ConnectedAgentToolDefinition } {\n return {\n definition: {\n type: \"connected_agent\",\n connectedAgent: {\n id: id,\n name: name,\n description: description,\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: {\n name: openApiFunctionDefinition.name,\n spec: openApiFunctionDefinition.spec,\n description: openApiFunctionDefinition.description,\n auth: openApiFunctionDefinition.auth,\n defaultParams: openApiFunctionDefinition.defaultParams,\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 a bing grounding search tool to the tool set.\n *\n * @param connectionId - The ID of the bing search connection.\n *\n * @returns An object containing the definition and resources for the bing grounding search tool\n */\n addBingGroundingTool(searchConfigurations: BingGroundingSearchConfiguration[]): {\n definition: BingGroundingToolDefinition;\n } {\n const tool = ToolUtility.createBingGroundingTool(searchConfigurations);\n this.toolDefinitions.push(tool.definition);\n return tool;\n }\n\n /**\n * Adds a connected agent tool to the tool set.\n *\n * @param id - The ID of the connected agent.\n * @param name - The name of the connected agent.\n * @param description - The description of the connected agent.\n * @returns An object containing the definition for the connected agent tool\n */\n addConnectedAgentTool(\n id: string,\n name: string,\n description: string,\n ): { definition: ConnectedAgentToolDefinition } {\n const tool = ToolUtility.createConnectedAgentTool(id, name, description);\n this.toolDefinitions.push(tool.definition);\n return tool;\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,2BAA2B,EAC3B,6BAA6B,EAC7B,wBAAwB,EACxB,+BAA+B,EAC/B,kBAAkB,EAClB,sBAAsB,EACtB,qBAAqB,EACrB,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,yBAAyB,EACzB,qBAAqB,EACrB,yBAAyB,EACzB,qBAAqB,EACrB,2BAA2B,EAC3B,gCAAgC,EAChC,4BAA4B,EAC7B,MAAM,YAAY,CAAC;AAEpB;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,EACvD,MAAM,EAAE,cAAc,GAAG,gBAAgB,GAAG,mBAAmB,EAC/D,IAAI,EAAE,MAAM,GACX,MAAM,IAAI,CAAC,CAEb;AAED,2DAA2D;AAC3D,oBAAY,kBAAkB;IAC5B,iCAAiC;IACjC,aAAa,mBAAmB;IAChC,4BAA4B;IAC5B,eAAe,qBAAqB;IACpC,sBAAsB;IACtB,mBAAmB,yBAAyB;IAC5C,0BAA0B;IAC1B,aAAa,mBAAmB;IAChC,8BAA8B;IAC9B,gBAAgB,uBAAuB;CACxC;AAUD;;GAEG;AACH,qBAAa,WAAW;IACtB;;;;;;OAMG;IACH,MAAM,CAAC,oBAAoB,CACzB,QAAQ,EAAE,kBAAkB,EAC5B,aAAa,EAAE,MAAM,EAAE,GACtB;QAAE,UAAU,EAAE,mBAAmB,CAAA;KAAE;IAWtC;;;;;;;OAOG;IACH,MAAM,CAAC,uBAAuB,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,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;;;;;;OAMG;IACH,oBAAoB,CAAC,oBAAwD;QAG3E,MAAM,IAAI,GAAG,WAAW,CAAC,uBAAuB,CAAC,oBAAoB,CAAC,CAAC;QACvE,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC3C,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;;OAOG;IACH,qBAAqB,CACnB,EAAU,EACV,IAAY,EACZ,WAAmB;QAEnB,MAAM,IAAI,GAAG,WAAW,CAAC,wBAAwB,CAAC,EAAE,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC;QACzE,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC3C,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AA/HD,0BA+HC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n AzureAISearchToolDefinition,\n CodeInterpreterToolDefinition,\n FileSearchToolDefinition,\n FileSearchToolDefinitionDetails,\n FunctionDefinition,\n FunctionToolDefinition,\n OpenApiToolDefinition,\n RequiredAction,\n RequiredToolCall,\n ToolDefinition,\n ToolDefinitionUnion,\n ToolResources,\n VectorStoreConfigurations,\n VectorStoreDataSource,\n OpenApiFunctionDefinition,\n AISearchIndexResource,\n BingGroundingToolDefinition,\n BingGroundingSearchConfiguration,\n ConnectedAgentToolDefinition,\n} from \"./index.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 `RequiredAction`, `RequiredToolCall`, or `ToolDefinitionUnion`.\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: RequiredAction | RequiredToolCall | ToolDefinitionUnion,\n type: string,\n): output is T {\n return output.type === type;\n}\n\n/** Types of connection tools used to configure an agent */\nexport enum connectionToolType {\n /** Bing grounding search tool */\n BingGrounding = \"bing_grounding\",\n /** Microsoft Fabric tool */\n MicrosoftFabric = \"fabric_dataagent\",\n /** Sharepoint tool */\n SharepointGrounding = \"sharepoint_grounding\",\n /** Azure Function tool */\n AzureFunction = \"azure_function\",\n /** Bing custom search tool */\n BingCustomSearch = \"bing_custom_search\",\n}\n\nconst toolMap = {\n bing_grounding: \"bingGrounding\",\n fabric_dataagent: \"fabric_dataagent\",\n sharepoint_grounding: \"sharepointGrounding\",\n azure_function: \"azureFunction\",\n bing_custom_search: \"bingCustomSearch\",\n};\n\n/**\n * Utility class for creating various tools.\n */\nexport class ToolUtility {\n /**\n * Creates a connection tool\n *\n * @param toolType - The type of the connection tool.\n * @param connectionIds - A list of the IDs of the connections to use.\n * @returns An object containing the definition for the connection tool\n */\n static createConnectionTool(\n toolType: connectionToolType,\n connectionIds: string[],\n ): { definition: ToolDefinitionUnion } {\n return {\n definition: {\n type: toolType,\n [toolMap[toolType]]: {\n connections: connectionIds.map((connectionId) => ({ connectionId: connectionId })),\n },\n },\n };\n }\n\n /**\n * Creates a bing grounding search tool\n *\n * @param connectionId - The ID of the bing search connection.\n *\n * @returns An object containing the definition and resources for the bing grounding search tool\n *\n */\n static createBingGroundingTool(searchConfigurations: BingGroundingSearchConfiguration[]): {\n definition: BingGroundingToolDefinition;\n } {\n // Ensure searchConfigurations is an array even if it's undefined\n const configs = searchConfigurations || [];\n return {\n definition: {\n type: \"bing_grounding\",\n bingGrounding: {\n searchConfigurations: configs.map((searchConfiguration) => ({\n connectionId: searchConfiguration.connectionId,\n market: searchConfiguration?.market,\n setLang: searchConfiguration?.setLang,\n count: searchConfiguration?.count,\n freshness: searchConfiguration?.freshness,\n })),\n },\n },\n };\n }\n\n /**\n * Creates a file search tool\n *\n * @param vectorStoreIds - The ID of the vector store attached to this agent. There can be a maximum of 1 vector store attached to the agent.\n * @param vectorStores - The list of vector store configuration objects from Azure. This list is limited to one element. The only element of this list contains the list of azure asset IDs used by the search tool.\n * @param definitionDetails - The input definition information for a file search tool as used to configure an agent.\n *\n * @returns An object containing the definition and resources for the file search tool\n */\n static createFileSearchTool(\n vectorStoreIds?: string[],\n vectorStores?: Array<VectorStoreConfigurations>,\n definitionDetails?: FileSearchToolDefinitionDetails,\n ): { definition: FileSearchToolDefinition; resources: ToolResources } {\n return {\n definition: { type: \"file_search\", fileSearch: definitionDetails },\n resources: { fileSearch: { vectorStoreIds: vectorStoreIds, vectorStores: vectorStores } },\n };\n }\n\n /**\n * Creates a code interpreter tool\n *\n * @param fileIds - A list of file IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool.\n * @param dataSources - The data sources to be used. This option is mutually exclusive with fileIds.\n *\n * @returns An object containing the definition and resources for the code interpreter tool.\n */\n static createCodeInterpreterTool(\n fileIds?: string[],\n dataSources?: Array<VectorStoreDataSource>,\n ): { definition: CodeInterpreterToolDefinition; resources: ToolResources } {\n if (fileIds && dataSources) {\n throw new Error(\"Cannot specify both fileIds and dataSources\");\n }\n\n return {\n definition: { type: \"code_interpreter\" },\n resources: { codeInterpreter: { fileIds: fileIds, dataSources: dataSources } },\n };\n }\n\n /**\n * Creates an Azure AI search tool\n *\n * @param indexConnectionId - The connection ID of the Azure AI search index.\n * @param indexName - The name of the Azure AI search index.\n *\n * @returns An object containing the definition and resources for the Azure AI search tool.\n */\n static createAzureAISearchTool(\n indexConnectionId: string,\n indexName: string,\n options?: AISearchIndexResource,\n ): { definition: AzureAISearchToolDefinition; resources: ToolResources } {\n return {\n definition: { type: \"azure_ai_search\" },\n resources: {\n azureAISearch: {\n indexList: [\n {\n indexConnectionId: indexConnectionId,\n indexName: indexName,\n queryType: options?.queryType,\n topK: options?.topK,\n filter: options?.filter,\n },\n ],\n },\n },\n };\n }\n\n /**\n * Creates a connected agent tool\n *\n * @returns An object containing the definition for the connected agent tool.\n */\n static createConnectedAgentTool(\n id: string,\n name: string,\n description: string,\n ): { definition: ConnectedAgentToolDefinition } {\n return {\n definition: {\n type: \"connected_agent\",\n connectedAgent: {\n id: id,\n name: name,\n description: description,\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: {\n name: openApiFunctionDefinition.name,\n spec: openApiFunctionDefinition.spec,\n description: openApiFunctionDefinition.description,\n auth: openApiFunctionDefinition.auth,\n defaultParams: openApiFunctionDefinition.defaultParams,\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 a bing grounding search tool to the tool set.\n *\n * @param connectionId - The ID of the bing search connection.\n *\n * @returns An object containing the definition and resources for the bing grounding search tool\n */\n addBingGroundingTool(searchConfigurations: BingGroundingSearchConfiguration[]): {\n definition: BingGroundingToolDefinition;\n } {\n const tool = ToolUtility.createBingGroundingTool(searchConfigurations);\n this.toolDefinitions.push(tool.definition);\n return tool;\n }\n\n /**\n * Adds a connected agent tool to the tool set.\n *\n * @param id - The ID of the connected agent.\n * @param name - The name of the connected agent.\n * @param description - The description of the connected agent.\n * @returns An object containing the definition for the connected agent tool\n */\n addConnectedAgentTool(\n id: string,\n name: string,\n description: string,\n ): { definition: ConnectedAgentToolDefinition } {\n const tool = ToolUtility.createConnectedAgentTool(id, name, description);\n this.toolDefinitions.push(tool.definition);\n return tool;\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,2BAA2B,EAC3B,6BAA6B,EAC7B,wBAAwB,EACxB,+BAA+B,EAC/B,kBAAkB,EAClB,sBAAsB,EACtB,qBAAqB,EACrB,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,yBAAyB,EACzB,qBAAqB,EACrB,yBAAyB,EACzB,qBAAqB,EACrB,2BAA2B,EAC3B,gCAAgC,EAChC,4BAA4B,EAC7B,MAAM,YAAY,CAAC;AAEpB;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS;IAAE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