@azure/ai-agents 1.0.0 → 1.1.0-beta.2
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 +104 -1
- package/dist/browser/agentsClient.js +24 -3
- package/dist/browser/agentsClient.js.map +1 -1
- package/dist/browser/api/agentsContext.js +13 -10
- package/dist/browser/api/agentsContext.js.map +1 -1
- package/dist/browser/api/files/operations.js +51 -26
- package/dist/browser/api/files/operations.js.map +1 -1
- package/dist/browser/api/messages/operations.js +54 -30
- package/dist/browser/api/messages/operations.js.map +1 -1
- package/dist/browser/api/operations.d.ts.map +1 -1
- package/dist/browser/api/operations.js +147 -134
- package/dist/browser/api/operations.js.map +1 -1
- package/dist/browser/api/poller.js +12 -15
- package/dist/browser/api/poller.js.map +1 -1
- package/dist/browser/api/runSteps/operations.js +30 -20
- package/dist/browser/api/runSteps/operations.js.map +1 -1
- package/dist/browser/api/runs/operations.d.ts.map +1 -1
- package/dist/browser/api/runs/operations.js +108 -67
- package/dist/browser/api/runs/operations.js.map +1 -1
- package/dist/browser/api/runs/options.d.ts +7 -1
- package/dist/browser/api/runs/options.d.ts.map +1 -1
- package/dist/browser/api/runs/options.js.map +1 -1
- package/dist/browser/api/threads/operations.js +71 -42
- package/dist/browser/api/threads/operations.js.map +1 -1
- package/dist/browser/api/vectorStoreFileBatches/operations.d.ts +2 -2
- package/dist/browser/api/vectorStoreFileBatches/operations.d.ts.map +1 -1
- package/dist/browser/api/vectorStoreFileBatches/operations.js +50 -33
- package/dist/browser/api/vectorStoreFileBatches/operations.js.map +1 -1
- package/dist/browser/api/vectorStoreFiles/operations.js +49 -29
- package/dist/browser/api/vectorStoreFiles/operations.js.map +1 -1
- package/dist/browser/api/vectorStores/operations.js +68 -44
- package/dist/browser/api/vectorStores/operations.js.map +1 -1
- package/dist/browser/classic/files/index.js +3 -1
- package/dist/browser/classic/files/index.js.map +1 -1
- package/dist/browser/classic/messages/index.js +3 -1
- package/dist/browser/classic/messages/index.js.map +1 -1
- package/dist/browser/classic/runSteps/index.js +3 -1
- package/dist/browser/classic/runSteps/index.js.map +1 -1
- package/dist/browser/classic/runs/index.js +3 -1
- package/dist/browser/classic/runs/index.js.map +1 -1
- package/dist/browser/classic/threads/index.js +3 -1
- package/dist/browser/classic/threads/index.js.map +1 -1
- package/dist/browser/classic/vectorStoreFileBatches/index.d.ts +2 -2
- package/dist/browser/classic/vectorStoreFileBatches/index.d.ts.map +1 -1
- package/dist/browser/classic/vectorStoreFileBatches/index.js +3 -1
- package/dist/browser/classic/vectorStoreFileBatches/index.js.map +1 -1
- package/dist/browser/classic/vectorStoreFiles/index.js +3 -1
- package/dist/browser/classic/vectorStoreFiles/index.js.map +1 -1
- package/dist/browser/classic/vectorStores/index.js +3 -1
- package/dist/browser/classic/vectorStores/index.js.map +1 -1
- package/dist/browser/constants.d.ts +1 -1
- package/dist/browser/constants.d.ts.map +1 -1
- package/dist/browser/constants.js +1 -1
- package/dist/browser/constants.js.map +1 -1
- package/dist/browser/index.d.ts +3 -2
- package/dist/browser/index.d.ts.map +1 -1
- package/dist/browser/index.js +2 -1
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/models/index.d.ts +1 -1
- package/dist/browser/models/index.d.ts.map +1 -1
- package/dist/browser/models/index.js.map +1 -1
- package/dist/browser/models/models.d.ts +260 -22
- package/dist/browser/models/models.d.ts.map +1 -1
- package/dist/browser/models/models.js +337 -14
- package/dist/browser/models/models.js.map +1 -1
- package/dist/browser/static-helpers/multipartHelpers.js +1 -2
- package/dist/browser/static-helpers/multipartHelpers.js.map +1 -1
- package/dist/browser/static-helpers/pagingHelpers.js +31 -50
- package/dist/browser/static-helpers/pagingHelpers.js.map +1 -1
- package/dist/browser/static-helpers/urlTemplate.js +2 -2
- package/dist/browser/static-helpers/urlTemplate.js.map +1 -1
- package/dist/browser/utils/MCPTool.d.ts +78 -0
- package/dist/browser/utils/MCPTool.d.ts.map +1 -0
- package/dist/browser/utils/MCPTool.js +133 -0
- package/dist/browser/utils/MCPTool.js.map +1 -0
- package/dist/browser/{utils.d.ts → utils/utils.d.ts} +61 -1
- package/dist/browser/utils/utils.d.ts.map +1 -0
- package/dist/{esm → browser/utils}/utils.js +104 -16
- package/dist/browser/utils/utils.js.map +1 -0
- package/dist/commonjs/agentsClient.js +24 -3
- package/dist/commonjs/agentsClient.js.map +1 -1
- package/dist/commonjs/api/agentsContext.js +13 -10
- package/dist/commonjs/api/agentsContext.js.map +1 -1
- package/dist/commonjs/api/files/operations.js +51 -26
- package/dist/commonjs/api/files/operations.js.map +1 -1
- package/dist/commonjs/api/messages/operations.js +54 -30
- package/dist/commonjs/api/messages/operations.js.map +1 -1
- package/dist/commonjs/api/operations.d.ts.map +1 -1
- package/dist/commonjs/api/operations.js +146 -133
- package/dist/commonjs/api/operations.js.map +1 -1
- package/dist/commonjs/api/poller.js +12 -15
- package/dist/commonjs/api/poller.js.map +1 -1
- package/dist/commonjs/api/runSteps/operations.js +30 -20
- package/dist/commonjs/api/runSteps/operations.js.map +1 -1
- package/dist/commonjs/api/runs/operations.d.ts.map +1 -1
- package/dist/commonjs/api/runs/operations.js +107 -66
- package/dist/commonjs/api/runs/operations.js.map +1 -1
- package/dist/commonjs/api/runs/options.d.ts +7 -1
- package/dist/commonjs/api/runs/options.d.ts.map +1 -1
- package/dist/commonjs/api/runs/options.js.map +1 -1
- package/dist/commonjs/api/threads/operations.js +71 -42
- package/dist/commonjs/api/threads/operations.js.map +1 -1
- package/dist/commonjs/api/vectorStoreFileBatches/operations.d.ts +2 -2
- package/dist/commonjs/api/vectorStoreFileBatches/operations.d.ts.map +1 -1
- package/dist/commonjs/api/vectorStoreFileBatches/operations.js +50 -33
- package/dist/commonjs/api/vectorStoreFileBatches/operations.js.map +1 -1
- package/dist/commonjs/api/vectorStoreFiles/operations.js +49 -29
- package/dist/commonjs/api/vectorStoreFiles/operations.js.map +1 -1
- package/dist/commonjs/api/vectorStores/operations.js +68 -44
- package/dist/commonjs/api/vectorStores/operations.js.map +1 -1
- package/dist/commonjs/classic/files/index.js +3 -1
- package/dist/commonjs/classic/files/index.js.map +1 -1
- package/dist/commonjs/classic/messages/index.js +3 -1
- package/dist/commonjs/classic/messages/index.js.map +1 -1
- package/dist/commonjs/classic/runSteps/index.js +3 -1
- package/dist/commonjs/classic/runSteps/index.js.map +1 -1
- package/dist/commonjs/classic/runs/index.js +3 -1
- package/dist/commonjs/classic/runs/index.js.map +1 -1
- package/dist/commonjs/classic/threads/index.js +3 -1
- package/dist/commonjs/classic/threads/index.js.map +1 -1
- package/dist/commonjs/classic/vectorStoreFileBatches/index.d.ts +2 -2
- package/dist/commonjs/classic/vectorStoreFileBatches/index.d.ts.map +1 -1
- package/dist/commonjs/classic/vectorStoreFileBatches/index.js +3 -1
- package/dist/commonjs/classic/vectorStoreFileBatches/index.js.map +1 -1
- package/dist/commonjs/classic/vectorStoreFiles/index.js +3 -1
- package/dist/commonjs/classic/vectorStoreFiles/index.js.map +1 -1
- package/dist/commonjs/classic/vectorStores/index.js +3 -1
- package/dist/commonjs/classic/vectorStores/index.js.map +1 -1
- package/dist/commonjs/constants.d.ts +1 -1
- package/dist/commonjs/constants.d.ts.map +1 -1
- package/dist/commonjs/constants.js +1 -1
- package/dist/commonjs/constants.js.map +1 -1
- package/dist/commonjs/index.d.ts +3 -2
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +4 -2
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/models/index.d.ts +1 -1
- package/dist/commonjs/models/index.d.ts.map +1 -1
- package/dist/commonjs/models/index.js.map +1 -1
- package/dist/commonjs/models/models.d.ts +260 -22
- package/dist/commonjs/models/models.d.ts.map +1 -1
- package/dist/commonjs/models/models.js +382 -16
- package/dist/commonjs/models/models.js.map +1 -1
- package/dist/commonjs/static-helpers/multipartHelpers.js +1 -2
- package/dist/commonjs/static-helpers/multipartHelpers.js.map +1 -1
- package/dist/commonjs/static-helpers/pagingHelpers.js +31 -50
- package/dist/commonjs/static-helpers/pagingHelpers.js.map +1 -1
- package/dist/commonjs/static-helpers/urlTemplate.js +2 -2
- package/dist/commonjs/static-helpers/urlTemplate.js.map +1 -1
- package/dist/commonjs/tsdoc-metadata.json +11 -11
- package/dist/commonjs/utils/MCPTool.d.ts +78 -0
- package/dist/commonjs/utils/MCPTool.d.ts.map +1 -0
- package/dist/commonjs/utils/MCPTool.js +137 -0
- package/dist/commonjs/utils/MCPTool.js.map +1 -0
- package/dist/commonjs/{utils.d.ts → utils/utils.d.ts} +61 -1
- package/dist/commonjs/utils/utils.d.ts.map +1 -0
- package/dist/commonjs/{utils.js → utils/utils.js} +104 -16
- package/dist/commonjs/utils/utils.js.map +1 -0
- package/dist/esm/agentsClient.js +24 -3
- package/dist/esm/agentsClient.js.map +1 -1
- package/dist/esm/api/agentsContext.js +13 -10
- package/dist/esm/api/agentsContext.js.map +1 -1
- package/dist/esm/api/files/operations.js +51 -26
- package/dist/esm/api/files/operations.js.map +1 -1
- package/dist/esm/api/messages/operations.js +54 -30
- package/dist/esm/api/messages/operations.js.map +1 -1
- package/dist/esm/api/operations.d.ts.map +1 -1
- package/dist/esm/api/operations.js +147 -134
- package/dist/esm/api/operations.js.map +1 -1
- package/dist/esm/api/poller.js +12 -15
- package/dist/esm/api/poller.js.map +1 -1
- package/dist/esm/api/runSteps/operations.js +30 -20
- package/dist/esm/api/runSteps/operations.js.map +1 -1
- package/dist/esm/api/runs/operations.d.ts.map +1 -1
- package/dist/esm/api/runs/operations.js +108 -67
- package/dist/esm/api/runs/operations.js.map +1 -1
- package/dist/esm/api/runs/options.d.ts +7 -1
- package/dist/esm/api/runs/options.d.ts.map +1 -1
- package/dist/esm/api/runs/options.js.map +1 -1
- package/dist/esm/api/threads/operations.js +71 -42
- package/dist/esm/api/threads/operations.js.map +1 -1
- package/dist/esm/api/vectorStoreFileBatches/operations.d.ts +2 -2
- package/dist/esm/api/vectorStoreFileBatches/operations.d.ts.map +1 -1
- package/dist/esm/api/vectorStoreFileBatches/operations.js +50 -33
- package/dist/esm/api/vectorStoreFileBatches/operations.js.map +1 -1
- package/dist/esm/api/vectorStoreFiles/operations.js +49 -29
- package/dist/esm/api/vectorStoreFiles/operations.js.map +1 -1
- package/dist/esm/api/vectorStores/operations.js +68 -44
- package/dist/esm/api/vectorStores/operations.js.map +1 -1
- package/dist/esm/classic/files/index.js +3 -1
- package/dist/esm/classic/files/index.js.map +1 -1
- package/dist/esm/classic/messages/index.js +3 -1
- package/dist/esm/classic/messages/index.js.map +1 -1
- package/dist/esm/classic/runSteps/index.js +3 -1
- package/dist/esm/classic/runSteps/index.js.map +1 -1
- package/dist/esm/classic/runs/index.js +3 -1
- package/dist/esm/classic/runs/index.js.map +1 -1
- package/dist/esm/classic/threads/index.js +3 -1
- package/dist/esm/classic/threads/index.js.map +1 -1
- package/dist/esm/classic/vectorStoreFileBatches/index.d.ts +2 -2
- package/dist/esm/classic/vectorStoreFileBatches/index.d.ts.map +1 -1
- package/dist/esm/classic/vectorStoreFileBatches/index.js +3 -1
- package/dist/esm/classic/vectorStoreFileBatches/index.js.map +1 -1
- package/dist/esm/classic/vectorStoreFiles/index.js +3 -1
- package/dist/esm/classic/vectorStoreFiles/index.js.map +1 -1
- package/dist/esm/classic/vectorStores/index.js +3 -1
- package/dist/esm/classic/vectorStores/index.js.map +1 -1
- package/dist/esm/constants.d.ts +1 -1
- package/dist/esm/constants.d.ts.map +1 -1
- package/dist/esm/constants.js +1 -1
- package/dist/esm/constants.js.map +1 -1
- package/dist/esm/index.d.ts +3 -2
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +2 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/models/index.d.ts +1 -1
- package/dist/esm/models/index.d.ts.map +1 -1
- package/dist/esm/models/index.js.map +1 -1
- package/dist/esm/models/models.d.ts +260 -22
- package/dist/esm/models/models.d.ts.map +1 -1
- package/dist/esm/models/models.js +337 -14
- package/dist/esm/models/models.js.map +1 -1
- package/dist/esm/static-helpers/multipartHelpers.js +1 -2
- package/dist/esm/static-helpers/multipartHelpers.js.map +1 -1
- package/dist/esm/static-helpers/pagingHelpers.js +31 -50
- package/dist/esm/static-helpers/pagingHelpers.js.map +1 -1
- package/dist/esm/static-helpers/urlTemplate.js +2 -2
- package/dist/esm/static-helpers/urlTemplate.js.map +1 -1
- package/dist/esm/utils/MCPTool.d.ts +78 -0
- package/dist/esm/utils/MCPTool.d.ts.map +1 -0
- package/dist/esm/utils/MCPTool.js +133 -0
- package/dist/esm/utils/MCPTool.js.map +1 -0
- package/dist/{react-native → esm/utils}/utils.d.ts +61 -1
- package/dist/esm/utils/utils.d.ts.map +1 -0
- package/dist/{react-native → esm/utils}/utils.js +104 -16
- package/dist/esm/utils/utils.js.map +1 -0
- package/dist/react-native/agentsClient.js +24 -3
- package/dist/react-native/agentsClient.js.map +1 -1
- package/dist/react-native/api/agentsContext.js +13 -10
- package/dist/react-native/api/agentsContext.js.map +1 -1
- package/dist/react-native/api/files/operations.js +51 -26
- package/dist/react-native/api/files/operations.js.map +1 -1
- package/dist/react-native/api/messages/operations.js +54 -30
- package/dist/react-native/api/messages/operations.js.map +1 -1
- package/dist/react-native/api/operations.d.ts.map +1 -1
- package/dist/react-native/api/operations.js +147 -134
- package/dist/react-native/api/operations.js.map +1 -1
- package/dist/react-native/api/poller.js +12 -15
- package/dist/react-native/api/poller.js.map +1 -1
- package/dist/react-native/api/runSteps/operations.js +30 -20
- package/dist/react-native/api/runSteps/operations.js.map +1 -1
- package/dist/react-native/api/runs/operations.d.ts.map +1 -1
- package/dist/react-native/api/runs/operations.js +108 -67
- package/dist/react-native/api/runs/operations.js.map +1 -1
- package/dist/react-native/api/runs/options.d.ts +7 -1
- package/dist/react-native/api/runs/options.d.ts.map +1 -1
- package/dist/react-native/api/runs/options.js.map +1 -1
- package/dist/react-native/api/threads/operations.js +71 -42
- package/dist/react-native/api/threads/operations.js.map +1 -1
- package/dist/react-native/api/vectorStoreFileBatches/operations.d.ts +2 -2
- package/dist/react-native/api/vectorStoreFileBatches/operations.d.ts.map +1 -1
- package/dist/react-native/api/vectorStoreFileBatches/operations.js +50 -33
- package/dist/react-native/api/vectorStoreFileBatches/operations.js.map +1 -1
- package/dist/react-native/api/vectorStoreFiles/operations.js +49 -29
- package/dist/react-native/api/vectorStoreFiles/operations.js.map +1 -1
- package/dist/react-native/api/vectorStores/operations.js +68 -44
- package/dist/react-native/api/vectorStores/operations.js.map +1 -1
- package/dist/react-native/classic/files/index.js +3 -1
- package/dist/react-native/classic/files/index.js.map +1 -1
- package/dist/react-native/classic/messages/index.js +3 -1
- package/dist/react-native/classic/messages/index.js.map +1 -1
- package/dist/react-native/classic/runSteps/index.js +3 -1
- package/dist/react-native/classic/runSteps/index.js.map +1 -1
- package/dist/react-native/classic/runs/index.js +3 -1
- package/dist/react-native/classic/runs/index.js.map +1 -1
- package/dist/react-native/classic/threads/index.js +3 -1
- package/dist/react-native/classic/threads/index.js.map +1 -1
- package/dist/react-native/classic/vectorStoreFileBatches/index.d.ts +2 -2
- package/dist/react-native/classic/vectorStoreFileBatches/index.d.ts.map +1 -1
- package/dist/react-native/classic/vectorStoreFileBatches/index.js +3 -1
- package/dist/react-native/classic/vectorStoreFileBatches/index.js.map +1 -1
- package/dist/react-native/classic/vectorStoreFiles/index.js +3 -1
- package/dist/react-native/classic/vectorStoreFiles/index.js.map +1 -1
- package/dist/react-native/classic/vectorStores/index.js +3 -1
- package/dist/react-native/classic/vectorStores/index.js.map +1 -1
- package/dist/react-native/constants.d.ts +1 -1
- package/dist/react-native/constants.d.ts.map +1 -1
- package/dist/react-native/constants.js +1 -1
- package/dist/react-native/constants.js.map +1 -1
- package/dist/react-native/index.d.ts +3 -2
- package/dist/react-native/index.d.ts.map +1 -1
- package/dist/react-native/index.js +2 -1
- package/dist/react-native/index.js.map +1 -1
- package/dist/react-native/models/index.d.ts +1 -1
- package/dist/react-native/models/index.d.ts.map +1 -1
- package/dist/react-native/models/index.js.map +1 -1
- package/dist/react-native/models/models.d.ts +260 -22
- package/dist/react-native/models/models.d.ts.map +1 -1
- package/dist/react-native/models/models.js +337 -14
- package/dist/react-native/models/models.js.map +1 -1
- package/dist/react-native/static-helpers/multipartHelpers.js +1 -2
- package/dist/react-native/static-helpers/multipartHelpers.js.map +1 -1
- package/dist/react-native/static-helpers/pagingHelpers.js +31 -50
- package/dist/react-native/static-helpers/pagingHelpers.js.map +1 -1
- package/dist/react-native/static-helpers/urlTemplate.js +2 -2
- package/dist/react-native/static-helpers/urlTemplate.js.map +1 -1
- package/dist/react-native/utils/MCPTool.d.ts +78 -0
- package/dist/react-native/utils/MCPTool.d.ts.map +1 -0
- package/dist/react-native/utils/MCPTool.js +133 -0
- package/dist/react-native/utils/MCPTool.js.map +1 -0
- package/dist/{esm → react-native/utils}/utils.d.ts +61 -1
- package/dist/react-native/utils/utils.d.ts.map +1 -0
- package/dist/{browser → react-native/utils}/utils.js +104 -16
- package/dist/react-native/utils/utils.js.map +1 -0
- package/package.json +2 -2
- package/dist/browser/utils.d.ts.map +0 -1
- package/dist/browser/utils.js.map +0 -1
- package/dist/commonjs/utils.d.ts.map +0 -1
- package/dist/commonjs/utils.js.map +0 -1
- package/dist/esm/utils.d.ts.map +0 -1
- package/dist/esm/utils.js.map +0 -1
- package/dist/react-native/utils.d.ts.map +0 -1
- package/dist/react-native/utils.js.map +0 -1
|
@@ -29,15 +29,20 @@ const core_client_1 = require("@azure-rest/core-client");
|
|
|
29
29
|
const operations_js_1 = require("../operations.js");
|
|
30
30
|
const poller_js_1 = require("../poller.js");
|
|
31
31
|
function _cancelRunSend(context, threadId, runId, options = { requestOptions: {} }) {
|
|
32
|
-
|
|
33
|
-
const path = (0, urlTemplate_js_1.expandUrlTemplate)("/threads/{threadId}/runs/{runId}/cancel{?api%2Dversion}", {
|
|
32
|
+
const path = (0, urlTemplate_js_1.expandUrlTemplate)("/threads/{threadId}/runs/{runId}/cancel{?api-version}", {
|
|
34
33
|
threadId: threadId,
|
|
35
34
|
runId: runId,
|
|
36
|
-
"api
|
|
35
|
+
"api-version": context.apiVersion,
|
|
37
36
|
}, {
|
|
38
|
-
allowReserved:
|
|
37
|
+
allowReserved: options?.requestOptions?.skipUrlEncoding,
|
|
38
|
+
});
|
|
39
|
+
return context.path(path).post({
|
|
40
|
+
...(0, core_client_1.operationOptionsToRequestParameters)(options),
|
|
41
|
+
headers: {
|
|
42
|
+
accept: "application/json",
|
|
43
|
+
...options.requestOptions?.headers,
|
|
44
|
+
},
|
|
39
45
|
});
|
|
40
|
-
return context.path(path).post(Object.assign(Object.assign({}, (0, core_client_1.operationOptionsToRequestParameters)(options)), { headers: Object.assign({ accept: "application/json" }, (_b = options.requestOptions) === null || _b === void 0 ? void 0 : _b.headers) }));
|
|
41
46
|
}
|
|
42
47
|
async function _cancelRunDeserialize(result) {
|
|
43
48
|
const expectedStatuses = ["200"];
|
|
@@ -54,18 +59,28 @@ async function cancelRun(context, threadId, runId, options = { requestOptions: {
|
|
|
54
59
|
return _cancelRunDeserialize(result);
|
|
55
60
|
}
|
|
56
61
|
function _submitToolOutputsToRunSend(context, threadId, runId, toolOutputs, options = { requestOptions: {} }) {
|
|
57
|
-
|
|
58
|
-
const path = (0, urlTemplate_js_1.expandUrlTemplate)("/threads/{threadId}/runs/{runId}/submit_tool_outputs{?api%2Dversion}", {
|
|
62
|
+
const path = (0, urlTemplate_js_1.expandUrlTemplate)("/threads/{threadId}/runs/{runId}/submit_tool_outputs{?api-version}", {
|
|
59
63
|
threadId: threadId,
|
|
60
64
|
runId: runId,
|
|
61
|
-
"api
|
|
65
|
+
"api-version": context.apiVersion,
|
|
62
66
|
}, {
|
|
63
|
-
allowReserved:
|
|
67
|
+
allowReserved: options?.requestOptions?.skipUrlEncoding,
|
|
68
|
+
});
|
|
69
|
+
return context.path(path).post({
|
|
70
|
+
...(0, core_client_1.operationOptionsToRequestParameters)(options),
|
|
71
|
+
contentType: "application/json",
|
|
72
|
+
headers: {
|
|
73
|
+
accept: "application/json",
|
|
74
|
+
...options.requestOptions?.headers,
|
|
75
|
+
},
|
|
76
|
+
body: {
|
|
77
|
+
tool_outputs: toolOutputs.length > 0 ? (0, models_js_1.toolOutputArraySerializer)(toolOutputs) : undefined,
|
|
78
|
+
tool_approvals: !options?.toolApprovals
|
|
79
|
+
? options?.toolApprovals
|
|
80
|
+
: (0, models_js_1.toolApprovalArraySerializer)(options?.toolApprovals),
|
|
81
|
+
stream: options?.stream ?? false,
|
|
82
|
+
},
|
|
64
83
|
});
|
|
65
|
-
return context.path(path).post(Object.assign(Object.assign({}, (0, core_client_1.operationOptionsToRequestParameters)(options)), { contentType: "application/json", headers: Object.assign({ accept: "application/json" }, (_b = options.requestOptions) === null || _b === void 0 ? void 0 : _b.headers), body: {
|
|
66
|
-
tool_outputs: (0, models_js_1.toolOutputArraySerializer)(toolOutputs),
|
|
67
|
-
stream: (_c = options === null || options === void 0 ? void 0 : options.stream) !== null && _c !== void 0 ? _c : false,
|
|
68
|
-
} }));
|
|
69
84
|
}
|
|
70
85
|
async function _submitToolOutputsToRunDeserialize(result) {
|
|
71
86
|
const expectedStatuses = ["200"];
|
|
@@ -92,15 +107,22 @@ function submitToolOutputsToRun(context, threadId, runId, toolOutputs, options =
|
|
|
92
107
|
};
|
|
93
108
|
}
|
|
94
109
|
function _updateRunSend(context, threadId, runId, options = { requestOptions: {} }) {
|
|
95
|
-
|
|
96
|
-
const path = (0, urlTemplate_js_1.expandUrlTemplate)("/threads/{threadId}/runs/{runId}{?api%2Dversion}", {
|
|
110
|
+
const path = (0, urlTemplate_js_1.expandUrlTemplate)("/threads/{threadId}/runs/{runId}{?api-version}", {
|
|
97
111
|
threadId: threadId,
|
|
98
112
|
runId: runId,
|
|
99
|
-
"api
|
|
113
|
+
"api-version": context.apiVersion,
|
|
100
114
|
}, {
|
|
101
|
-
allowReserved:
|
|
115
|
+
allowReserved: options?.requestOptions?.skipUrlEncoding,
|
|
116
|
+
});
|
|
117
|
+
return context.path(path).post({
|
|
118
|
+
...(0, core_client_1.operationOptionsToRequestParameters)(options),
|
|
119
|
+
contentType: "application/json",
|
|
120
|
+
headers: {
|
|
121
|
+
accept: "application/json",
|
|
122
|
+
...options.requestOptions?.headers,
|
|
123
|
+
},
|
|
124
|
+
body: { metadata: options?.metadata },
|
|
102
125
|
});
|
|
103
|
-
return context.path(path).post(Object.assign(Object.assign({}, (0, core_client_1.operationOptionsToRequestParameters)(options)), { contentType: "application/json", headers: Object.assign({ accept: "application/json" }, (_b = options.requestOptions) === null || _b === void 0 ? void 0 : _b.headers), body: { metadata: options === null || options === void 0 ? void 0 : options.metadata } }));
|
|
104
126
|
}
|
|
105
127
|
async function _updateRunDeserialize(result) {
|
|
106
128
|
const expectedStatuses = ["200"];
|
|
@@ -117,15 +139,20 @@ async function updateRun(context, threadId, runId, options = { requestOptions: {
|
|
|
117
139
|
return _updateRunDeserialize(result);
|
|
118
140
|
}
|
|
119
141
|
function _getRunSend(context, threadId, runId, options = { requestOptions: {} }) {
|
|
120
|
-
|
|
121
|
-
const path = (0, urlTemplate_js_1.expandUrlTemplate)("/threads/{threadId}/runs/{runId}{?api%2Dversion}", {
|
|
142
|
+
const path = (0, urlTemplate_js_1.expandUrlTemplate)("/threads/{threadId}/runs/{runId}{?api-version}", {
|
|
122
143
|
threadId: threadId,
|
|
123
144
|
runId: runId,
|
|
124
|
-
"api
|
|
145
|
+
"api-version": context.apiVersion,
|
|
125
146
|
}, {
|
|
126
|
-
allowReserved:
|
|
147
|
+
allowReserved: options?.requestOptions?.skipUrlEncoding,
|
|
148
|
+
});
|
|
149
|
+
return context.path(path).get({
|
|
150
|
+
...(0, core_client_1.operationOptionsToRequestParameters)(options),
|
|
151
|
+
headers: {
|
|
152
|
+
accept: "application/json",
|
|
153
|
+
...options.requestOptions?.headers,
|
|
154
|
+
},
|
|
127
155
|
});
|
|
128
|
-
return context.path(path).get(Object.assign(Object.assign({}, (0, core_client_1.operationOptionsToRequestParameters)(options)), { headers: Object.assign({ accept: "application/json" }, (_b = options.requestOptions) === null || _b === void 0 ? void 0 : _b.headers) }));
|
|
129
156
|
}
|
|
130
157
|
async function _getRunDeserialize(result) {
|
|
131
158
|
const expectedStatuses = ["200"];
|
|
@@ -142,18 +169,23 @@ async function getRun(context, threadId, runId, options = { requestOptions: {} }
|
|
|
142
169
|
return _getRunDeserialize(result);
|
|
143
170
|
}
|
|
144
171
|
function _listRunsSend(context, threadId, options = { requestOptions: {} }) {
|
|
145
|
-
|
|
146
|
-
const path = (0, urlTemplate_js_1.expandUrlTemplate)("/threads/{threadId}/runs{?api%2Dversion,limit,order,after,before}", {
|
|
172
|
+
const path = (0, urlTemplate_js_1.expandUrlTemplate)("/threads/{threadId}/runs{?api-version,limit,order,after,before}", {
|
|
147
173
|
threadId: threadId,
|
|
148
|
-
"api
|
|
149
|
-
limit: options
|
|
150
|
-
order: options
|
|
151
|
-
after: options
|
|
152
|
-
before: options
|
|
174
|
+
"api-version": context.apiVersion,
|
|
175
|
+
limit: options?.limit,
|
|
176
|
+
order: options?.order,
|
|
177
|
+
after: options?.after,
|
|
178
|
+
before: options?.before,
|
|
153
179
|
}, {
|
|
154
|
-
allowReserved:
|
|
180
|
+
allowReserved: options?.requestOptions?.skipUrlEncoding,
|
|
181
|
+
});
|
|
182
|
+
return context.path(path).get({
|
|
183
|
+
...(0, core_client_1.operationOptionsToRequestParameters)(options),
|
|
184
|
+
headers: {
|
|
185
|
+
accept: "application/json",
|
|
186
|
+
...options.requestOptions?.headers,
|
|
187
|
+
},
|
|
155
188
|
});
|
|
156
|
-
return context.path(path).get(Object.assign(Object.assign({}, (0, core_client_1.operationOptionsToRequestParameters)(options)), { headers: Object.assign({ accept: "application/json" }, (_b = options.requestOptions) === null || _b === void 0 ? void 0 : _b.headers) }));
|
|
157
189
|
}
|
|
158
190
|
async function _listRunsDeserialize(result) {
|
|
159
191
|
const expectedStatuses = ["200"];
|
|
@@ -169,44 +201,54 @@ function listRuns(context, threadId, options = { requestOptions: {} }) {
|
|
|
169
201
|
return (0, pagingHelpers_js_1.buildPagedAsyncIterator)(context, () => _listRunsSend(context, threadId, options), _listRunsDeserialize, ["200"], { itemName: "data" });
|
|
170
202
|
}
|
|
171
203
|
function _createRunSend(context, threadId, assistantId, options = { requestOptions: {} }) {
|
|
172
|
-
|
|
173
|
-
const path = (0, urlTemplate_js_1.expandUrlTemplate)("/threads/{threadId}/runs{?api%2Dversion,include%5B%5D}", {
|
|
204
|
+
const path = (0, urlTemplate_js_1.expandUrlTemplate)("/threads/{threadId}/runs{?api-version,include%5B%5D}", {
|
|
174
205
|
threadId: threadId,
|
|
175
|
-
"api
|
|
176
|
-
"include%5B%5D": !
|
|
177
|
-
? options
|
|
178
|
-
: options
|
|
206
|
+
"api-version": context.apiVersion,
|
|
207
|
+
"include%5B%5D": !options?.include
|
|
208
|
+
? options?.include
|
|
209
|
+
: options?.include.map((p) => {
|
|
179
210
|
return p;
|
|
180
211
|
}),
|
|
181
212
|
}, {
|
|
182
|
-
allowReserved:
|
|
213
|
+
allowReserved: options?.requestOptions?.skipUrlEncoding,
|
|
183
214
|
});
|
|
184
|
-
return context.path(path).post(
|
|
215
|
+
return context.path(path).post({
|
|
216
|
+
...(0, core_client_1.operationOptionsToRequestParameters)(options),
|
|
217
|
+
contentType: "application/json",
|
|
218
|
+
headers: {
|
|
219
|
+
accept: "application/json",
|
|
220
|
+
...options.requestOptions?.headers,
|
|
221
|
+
},
|
|
222
|
+
body: {
|
|
185
223
|
assistant_id: assistantId,
|
|
186
|
-
model: options
|
|
187
|
-
instructions: options
|
|
188
|
-
additional_instructions: options
|
|
189
|
-
additional_messages: !
|
|
190
|
-
? options
|
|
191
|
-
: (0, models_js_1.threadMessageOptionsArraySerializer)(options
|
|
192
|
-
tools: !
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
? options
|
|
203
|
-
: (0, models_js_1.
|
|
204
|
-
|
|
205
|
-
? options
|
|
206
|
-
: (0, models_js_1.
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
224
|
+
model: options?.model,
|
|
225
|
+
instructions: options?.instructions,
|
|
226
|
+
additional_instructions: options?.additionalInstructions,
|
|
227
|
+
additional_messages: !options?.additionalMessages
|
|
228
|
+
? options?.additionalMessages
|
|
229
|
+
: (0, models_js_1.threadMessageOptionsArraySerializer)(options?.additionalMessages),
|
|
230
|
+
tools: !options?.tools ? options?.tools : (0, models_js_1.toolDefinitionUnionArraySerializer)(options?.tools),
|
|
231
|
+
tool_resources: !options?.toolResources
|
|
232
|
+
? options?.toolResources
|
|
233
|
+
: (0, models_js_1.toolResourcesSerializer)(options?.toolResources),
|
|
234
|
+
stream: options?.stream,
|
|
235
|
+
temperature: options?.temperature,
|
|
236
|
+
top_p: options?.topP,
|
|
237
|
+
max_prompt_tokens: options?.maxPromptTokens,
|
|
238
|
+
max_completion_tokens: options?.maxCompletionTokens,
|
|
239
|
+
truncation_strategy: !options?.truncationStrategy
|
|
240
|
+
? options?.truncationStrategy
|
|
241
|
+
: (0, models_js_1.truncationObjectSerializer)(options?.truncationStrategy),
|
|
242
|
+
tool_choice: !options?.toolChoice
|
|
243
|
+
? options?.toolChoice
|
|
244
|
+
: (0, models_js_1.agentsToolChoiceOptionSerializer)(options?.toolChoice),
|
|
245
|
+
response_format: !options?.responseFormat
|
|
246
|
+
? options?.responseFormat
|
|
247
|
+
: (0, models_js_1.agentsResponseFormatOptionSerializer)(options?.responseFormat),
|
|
248
|
+
parallel_tool_calls: options?.parallelToolCalls,
|
|
249
|
+
metadata: options?.metadata,
|
|
250
|
+
},
|
|
251
|
+
});
|
|
210
252
|
}
|
|
211
253
|
async function _createRunDeserialize(result) {
|
|
212
254
|
const expectedStatuses = ["200"];
|
|
@@ -238,7 +280,6 @@ function createRun(context, threadId, assistantId, options = { requestOptions: {
|
|
|
238
280
|
}
|
|
239
281
|
/** Creates a new run for an agent thread with polling */
|
|
240
282
|
function createRunAndPoll(context, threadId, assistantId, options = { requestOptions: {} }) {
|
|
241
|
-
var _a;
|
|
242
283
|
return (0, poller_js_1.createPoller)({
|
|
243
284
|
initOperation: async () => {
|
|
244
285
|
return createRunInternal(context, threadId, assistantId, options);
|
|
@@ -252,7 +293,7 @@ function createRunAndPoll(context, threadId, assistantId, options = { requestOpt
|
|
|
252
293
|
? new Error(`Operation failed: ${result.lastError.message}`)
|
|
253
294
|
: undefined;
|
|
254
295
|
},
|
|
255
|
-
intervalInMs:
|
|
296
|
+
intervalInMs: options.pollingOptions?.intervalInMs,
|
|
256
297
|
});
|
|
257
298
|
}
|
|
258
299
|
function getLroOperationStatus(result) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations.js","sourceRoot":"","sources":["../../../../src/api/runs/operations.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAiClC,wCAwBC;AAED,sDASC;AAGD,8BAQC;AAED,kEA8BC;AAED,gFAWC;AAGD,wDA0BC;AAED,wCA0BC;AAED,sDASC;AAGD,8BAQC;AAED,kCAwBC;AAED,gDASC;AAGD,wBAQC;AAED,sCA0BC;AAED,oDAWC;AAGD,4BAYC;AAED,wCAuDC;AAED,sDASC;AAGD,8CAQC;AAGD,8BAkBC;AAGD,4CAqBC;AA3aD,sDAUgC;AAUhC,4EAAgF;AAChF,wEAAwE;AAExE,yDAA+F;AAE/F,oDAAuF;AAEvF,4CAA4C;AAE5C,SAAgB,cAAc,CAC5B,OAAe,EACf,QAAgB,EAChB,KAAa,EACb,UAAuC,EAAE,cAAc,EAAE,EAAE,EAAE;;IAE7D,MAAM,IAAI,GAAG,IAAA,kCAAiB,EAC5B,yDAAyD,EACzD;QACE,QAAQ,EAAE,QAAQ;QAClB,KAAK,EAAE,KAAK;QACZ,eAAe,EAAE,OAAO,CAAC,UAAU;KACpC,EACD;QACE,aAAa,EAAE,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,cAAc,0CAAE,eAAe;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EAAE,OAAO,CAAC,CAAC;QACpE,CAAC;QACD,aAAa,EAAE,KAAK,EAAE,UAAqB,EAAE,EAAE;YAC7C,OAAO,MAAM,CAAC,OAAO,EAAE,QAAQ,EAAE,UAAU,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QAC3D,CAAC;QACD,kBAAkB,EAAE,qBAAqB;QACzC,iBAAiB,EAAE,CAAC,MAAiB,EAAE,EAAE;YACvC,OAAO,qBAAqB,CAAC,MAAM,CAAC,KAAK,QAAQ,IAAI,MAAM,CAAC,SAAS;gBACnE,CAAC,CAAC,IAAI,KAAK,CAAC,qBAAqB,MAAM,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;gBAC5D,CAAC,CAAC,SAAS,CAAC;QAChB,CAAC;QACD,YAAY,EAAE,MAAA,OAAO,CAAC,cAAc,0CAAE,YAAY;KACnD,CAAC,CAAC;AACL,CAAC;AAED,SAAS,qBAAqB,CAAC,MAAiB;IAC9C,QAAQ,MAAM,CAAC,MAAM,EAAE,CAAC;QACtB,KAAK,QAAQ;YACX,OAAO,YAAY,CAAC;QACtB,KAAK,aAAa;YAChB,OAAO,SAAS,CAAC;QACnB,KAAK,iBAAiB;YACpB,OAAO,SAAS,CAAC;QACnB,KAAK,WAAW;YACd,OAAO,WAAW,CAAC;QACrB,KAAK,WAAW,CAAC;QACjB,KAAK,SAAS,CAAC;QACf;YACE,OAAO,QAAQ,CAAC;IACpB,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AgentsContext as Client } from \"../index.js\";\nimport type { ThreadRun, _AgentsPagedResultThreadRun, ToolOutput } from \"../../models/models.js\";\nimport {\n toolDefinitionUnionArraySerializer,\n agentsResponseFormatOptionSerializer,\n agentV1ErrorDeserializer,\n threadMessageOptionsArraySerializer,\n truncationObjectSerializer,\n agentsToolChoiceOptionSerializer,\n threadRunDeserializer,\n _agentsPagedResultThreadRunDeserializer,\n toolOutputArraySerializer,\n} from \"../../models/models.js\";\nimport type {\n RunsCancelRunOptionalParams,\n RunsSubmitToolOutputsToRunOptionalParams,\n RunsUpdateRunOptionalParams,\n RunsGetRunOptionalParams,\n RunsListRunsOptionalParams,\n RunsCreateRunOptionalParams,\n} from \"./options.js\";\nimport type { PagedAsyncIterableIterator } from \"../../static-helpers/pagingHelpers.js\";\nimport { buildPagedAsyncIterator } from \"../../static-helpers/pagingHelpers.js\";\nimport { expandUrlTemplate } from \"../../static-helpers/urlTemplate.js\";\nimport type { StreamableMethod, PathUncheckedResponse } from \"@azure-rest/core-client\";\nimport { createRestError, operationOptionsToRequestParameters } from \"@azure-rest/core-client\";\nimport type { AgentRunResponse, AgentEventMessageStream } from \"../../models/streamingModels.js\";\nimport { createRunStreaming, submitToolOutputsToRunStreaming } from \"../operations.js\";\nimport type { OperationState, OperationStatus, PollerLike } from \"@azure/core-lro\";\nimport { createPoller } from \"../poller.js\";\n\nexport function _cancelRunSend(\n context: Client,\n threadId: string,\n runId: string,\n options: RunsCancelRunOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/threads/{threadId}/runs/{runId}/cancel{?api%2Dversion}\",\n {\n threadId: threadId,\n runId: runId,\n \"api%2Dversion\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).post({\n ...operationOptionsToRequestParameters(options),\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _cancelRunDeserialize(result: PathUncheckedResponse): Promise<ThreadRun> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n const error = createRestError(result);\n error.details = agentV1ErrorDeserializer(result.body);\n throw error;\n }\n\n return threadRunDeserializer(result.body);\n}\n\n/** Cancels a run of an in‐progress thread. */\nexport async function cancelRun(\n context: Client,\n threadId: string,\n runId: string,\n options: RunsCancelRunOptionalParams = { requestOptions: {} },\n): Promise<ThreadRun> {\n const result = await _cancelRunSend(context, threadId, runId, options);\n return _cancelRunDeserialize(result);\n}\n\nexport function _submitToolOutputsToRunSend(\n context: Client,\n threadId: string,\n runId: string,\n toolOutputs: ToolOutput[],\n options: RunsSubmitToolOutputsToRunOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/threads/{threadId}/runs/{runId}/submit_tool_outputs{?api%2Dversion}\",\n {\n threadId: threadId,\n runId: runId,\n \"api%2Dversion\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).post({\n ...operationOptionsToRequestParameters(options),\n contentType: \"application/json\",\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n body: {\n tool_outputs: toolOutputArraySerializer(toolOutputs),\n stream: options?.stream ?? false,\n },\n });\n}\n\nexport async function _submitToolOutputsToRunDeserialize(\n result: PathUncheckedResponse,\n): Promise<ThreadRun> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n const error = createRestError(result);\n error.details = agentV1ErrorDeserializer(result.body);\n throw error;\n }\n\n return threadRunDeserializer(result.body);\n}\n\n/** Submits outputs from tools as requested by tool calls in a run. */\nexport function submitToolOutputsToRun(\n context: Client,\n threadId: string,\n runId: string,\n toolOutputs: ToolOutput[],\n options: RunsSubmitToolOutputsToRunOptionalParams = { requestOptions: {} },\n): AgentRunResponse {\n async function executeSubmitToolOutputsToRun(): Promise<ThreadRun> {\n const result = await _submitToolOutputsToRunSend(\n context,\n threadId,\n runId,\n toolOutputs,\n options,\n );\n return _submitToolOutputsToRunDeserialize(result);\n }\n\n return {\n then: function (onFulfilled, onRejected) {\n return executeSubmitToolOutputsToRun().then(onFulfilled, onRejected).catch(onRejected);\n },\n async stream(): Promise<AgentEventMessageStream> {\n return submitToolOutputsToRunStreaming(context, threadId, runId, toolOutputs, options);\n },\n };\n}\n\nexport function _updateRunSend(\n context: Client,\n threadId: string,\n runId: string,\n options: RunsUpdateRunOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/threads/{threadId}/runs/{runId}{?api%2Dversion}\",\n {\n threadId: threadId,\n runId: runId,\n \"api%2Dversion\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).post({\n ...operationOptionsToRequestParameters(options),\n contentType: \"application/json\",\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n body: { metadata: options?.metadata },\n });\n}\n\nexport async function _updateRunDeserialize(result: PathUncheckedResponse): Promise<ThreadRun> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n const error = createRestError(result);\n error.details = agentV1ErrorDeserializer(result.body);\n throw error;\n }\n\n return threadRunDeserializer(result.body);\n}\n\n/** Modifies an existing thread run. */\nexport async function updateRun(\n context: Client,\n threadId: string,\n runId: string,\n options: RunsUpdateRunOptionalParams = { requestOptions: {} },\n): Promise<ThreadRun> {\n const result = await _updateRunSend(context, threadId, runId, options);\n return _updateRunDeserialize(result);\n}\n\nexport function _getRunSend(\n context: Client,\n threadId: string,\n runId: string,\n options: RunsGetRunOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/threads/{threadId}/runs/{runId}{?api%2Dversion}\",\n {\n threadId: threadId,\n runId: runId,\n \"api%2Dversion\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).get({\n ...operationOptionsToRequestParameters(options),\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _getRunDeserialize(result: PathUncheckedResponse): Promise<ThreadRun> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n const error = createRestError(result);\n error.details = agentV1ErrorDeserializer(result.body);\n throw error;\n }\n\n return threadRunDeserializer(result.body);\n}\n\n/** Gets an existing run from an existing thread. */\nexport async function getRun(\n context: Client,\n threadId: string,\n runId: string,\n options: RunsGetRunOptionalParams = { requestOptions: {} },\n): Promise<ThreadRun> {\n const result = await _getRunSend(context, threadId, runId, options);\n return _getRunDeserialize(result);\n}\n\nexport function _listRunsSend(\n context: Client,\n threadId: string,\n options: RunsListRunsOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/threads/{threadId}/runs{?api%2Dversion,limit,order,after,before}\",\n {\n threadId: threadId,\n \"api%2Dversion\": context.apiVersion,\n limit: options?.limit,\n order: options?.order,\n after: options?.after,\n before: options?.before,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).get({\n ...operationOptionsToRequestParameters(options),\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _listRunsDeserialize(\n result: PathUncheckedResponse,\n): Promise<_AgentsPagedResultThreadRun> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n const error = createRestError(result);\n error.details = agentV1ErrorDeserializer(result.body);\n throw error;\n }\n\n return _agentsPagedResultThreadRunDeserializer(result.body);\n}\n\n/** Gets a list of runs for a specified thread. */\nexport function listRuns(\n context: Client,\n threadId: string,\n options: RunsListRunsOptionalParams = { requestOptions: {} },\n): PagedAsyncIterableIterator<ThreadRun> {\n return buildPagedAsyncIterator(\n context,\n () => _listRunsSend(context, threadId, options),\n _listRunsDeserialize,\n [\"200\"],\n { itemName: \"data\" },\n );\n}\n\nexport function _createRunSend(\n context: Client,\n threadId: string,\n assistantId: string,\n options: RunsCreateRunOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/threads/{threadId}/runs{?api%2Dversion,include%5B%5D}\",\n {\n threadId: threadId,\n \"api%2Dversion\": context.apiVersion,\n \"include%5B%5D\": !options?.include\n ? options?.include\n : options?.include.map((p: any) => {\n return p;\n }),\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).post({\n ...operationOptionsToRequestParameters(options),\n contentType: \"application/json\",\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n body: {\n assistant_id: assistantId,\n model: options?.model,\n instructions: options?.instructions,\n additional_instructions: options?.additionalInstructions,\n additional_messages: !options?.additionalMessages\n ? options?.additionalMessages\n : threadMessageOptionsArraySerializer(options?.additionalMessages),\n tools: !options?.tools ? options?.tools : toolDefinitionUnionArraySerializer(options?.tools),\n stream: options?.stream,\n temperature: options?.temperature,\n top_p: options?.topP,\n max_prompt_tokens: options?.maxPromptTokens,\n max_completion_tokens: options?.maxCompletionTokens,\n truncation_strategy: !options?.truncationStrategy\n ? options?.truncationStrategy\n : truncationObjectSerializer(options?.truncationStrategy),\n tool_choice: !options?.toolChoice\n ? options?.toolChoice\n : agentsToolChoiceOptionSerializer(options?.toolChoice),\n response_format: !options?.responseFormat\n ? options?.responseFormat\n : agentsResponseFormatOptionSerializer(options?.responseFormat),\n parallel_tool_calls: options?.parallelToolCalls,\n metadata: options?.metadata,\n },\n });\n}\n\nexport async function _createRunDeserialize(result: PathUncheckedResponse): Promise<ThreadRun> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n const error = createRestError(result);\n error.details = agentV1ErrorDeserializer(result.body);\n throw error;\n }\n\n return threadRunDeserializer(result.body);\n}\n\n/** Creates a new run for an agent thread (internal implementation). */\nexport async function createRunInternal(\n context: Client,\n threadId: string,\n assistantId: string,\n options: RunsCreateRunOptionalParams = { requestOptions: {} },\n): Promise<ThreadRun> {\n const result = await _createRunSend(context, threadId, assistantId, options);\n return _createRunDeserialize(result);\n}\n\n/** Creates a new run for an agent thread. */\nexport function createRun(\n context: Client,\n threadId: string,\n assistantId: string,\n options: RunsCreateRunOptionalParams = { requestOptions: {} },\n): AgentRunResponse {\n async function executeCreateRun(): Promise<ThreadRun> {\n return createRunInternal(context, threadId, assistantId, options);\n }\n\n return {\n then: function (onFulfilled, onRejected) {\n return executeCreateRun().then(onFulfilled, onRejected).catch(onRejected);\n },\n async stream(): Promise<AgentEventMessageStream> {\n return createRunStreaming(context, assistantId, threadId, options);\n },\n };\n}\n\n/** Creates a new run for an agent thread with polling */\nexport function createRunAndPoll(\n context: Client,\n threadId: string,\n assistantId: string,\n options: RunsCreateRunOptionalParams = { requestOptions: {} },\n): PollerLike<OperationState<ThreadRun>, ThreadRun> {\n return createPoller<ThreadRun>({\n initOperation: async () => {\n return createRunInternal(context, threadId, assistantId, options);\n },\n pollOperation: async (currentRun: ThreadRun) => {\n return getRun(context, threadId, currentRun.id, options);\n },\n getOperationStatus: getLroOperationStatus,\n getOperationError: (result: ThreadRun) => {\n return getLroOperationStatus(result) === \"failed\" && result.lastError\n ? new Error(`Operation failed: ${result.lastError.message}`)\n : undefined;\n },\n intervalInMs: options.pollingOptions?.intervalInMs,\n });\n}\n\nfunction getLroOperationStatus(result: ThreadRun): OperationStatus {\n switch (result.status) {\n case \"queued\":\n return \"notStarted\";\n case \"in_progress\":\n return \"running\";\n case \"requires_action\":\n return \"running\";\n case \"completed\":\n return \"succeeded\";\n case \"cancelled\":\n case \"expired\":\n default:\n return \"failed\";\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"operations.js","sourceRoot":"","sources":["../../../../src/api/runs/operations.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAmClC,wCAwBC;AAED,sDASC;AAGD,8BAQC;AAED,kEAiCC;AAED,gFAWC;AAGD,wDA2BC;AAED,wCA0BC;AAED,sDASC;AAGD,8BAQC;AAED,kCAwBC;AAED,gDASC;AAGD,wBAQC;AAED,sCA0BC;AAED,oDAWC;AAGD,4BAYC;AAED,wCA0DC;AAED,sDASC;AAGD,8CAQC;AAGD,8BAkBC;AAGD,4CAqBC;AApbD,sDAYgC;AAUhC,4EAAgF;AAChF,wEAAwE;AAExE,yDAA+F;AAE/F,oDAAuF;AAEvF,4CAA4C;AAE5C,SAAgB,cAAc,CAC5B,OAAe,EACf,QAAgB,EAChB,KAAa,EACb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CAAC,CAAC,IAAI,KAAK,CAAC,qBAAqB,MAAM,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;gBAC5D,CAAC,CAAC,SAAS,CAAC;QAChB,CAAC;QACD,YAAY,EAAE,OAAO,CAAC,cAAc,EAAE,YAAY;KACnD,CAAC,CAAC;AACL,CAAC;AAED,SAAS,qBAAqB,CAAC,MAAiB;IAC9C,QAAQ,MAAM,CAAC,MAAM,EAAE,CAAC;QACtB,KAAK,QAAQ;YACX,OAAO,YAAY,CAAC;QACtB,KAAK,aAAa;YAChB,OAAO,SAAS,CAAC;QACnB,KAAK,iBAAiB;YACpB,OAAO,SAAS,CAAC;QACnB,KAAK,WAAW;YACd,OAAO,WAAW,CAAC;QACrB,KAAK,WAAW,CAAC;QACjB,KAAK,SAAS,CAAC;QACf;YACE,OAAO,QAAQ,CAAC;IACpB,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AgentsContext as Client } from \"../index.js\";\nimport type { ThreadRun, _AgentsPagedResultThreadRun, ToolOutput } from \"../../models/models.js\";\nimport {\n toolResourcesSerializer,\n toolDefinitionUnionArraySerializer,\n agentsResponseFormatOptionSerializer,\n agentV1ErrorDeserializer,\n threadMessageOptionsArraySerializer,\n truncationObjectSerializer,\n agentsToolChoiceOptionSerializer,\n threadRunDeserializer,\n _agentsPagedResultThreadRunDeserializer,\n toolOutputArraySerializer,\n toolApprovalArraySerializer,\n} from \"../../models/models.js\";\nimport type {\n RunsCancelRunOptionalParams,\n RunsSubmitToolOutputsToRunOptionalParams,\n RunsUpdateRunOptionalParams,\n RunsGetRunOptionalParams,\n RunsListRunsOptionalParams,\n RunsCreateRunOptionalParams,\n} from \"./options.js\";\nimport type { PagedAsyncIterableIterator } from \"../../static-helpers/pagingHelpers.js\";\nimport { buildPagedAsyncIterator } from \"../../static-helpers/pagingHelpers.js\";\nimport { expandUrlTemplate } from \"../../static-helpers/urlTemplate.js\";\nimport type { StreamableMethod, PathUncheckedResponse } from \"@azure-rest/core-client\";\nimport { createRestError, operationOptionsToRequestParameters } from \"@azure-rest/core-client\";\nimport type { AgentRunResponse, AgentEventMessageStream } from \"../../models/streamingModels.js\";\nimport { createRunStreaming, submitToolOutputsToRunStreaming } from \"../operations.js\";\nimport type { OperationState, OperationStatus, PollerLike } from \"@azure/core-lro\";\nimport { createPoller } from \"../poller.js\";\n\nexport function _cancelRunSend(\n context: Client,\n threadId: string,\n runId: string,\n options: RunsCancelRunOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/threads/{threadId}/runs/{runId}/cancel{?api-version}\",\n {\n threadId: threadId,\n runId: runId,\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).post({\n ...operationOptionsToRequestParameters(options),\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _cancelRunDeserialize(result: PathUncheckedResponse): Promise<ThreadRun> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n const error = createRestError(result);\n error.details = agentV1ErrorDeserializer(result.body);\n throw error;\n }\n\n return threadRunDeserializer(result.body);\n}\n\n/** Cancels a run of an in‐progress thread. */\nexport async function cancelRun(\n context: Client,\n threadId: string,\n runId: string,\n options: RunsCancelRunOptionalParams = { requestOptions: {} },\n): Promise<ThreadRun> {\n const result = await _cancelRunSend(context, threadId, runId, options);\n return _cancelRunDeserialize(result);\n}\n\nexport function _submitToolOutputsToRunSend(\n context: Client,\n threadId: string,\n runId: string,\n toolOutputs: ToolOutput[],\n options: RunsSubmitToolOutputsToRunOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/threads/{threadId}/runs/{runId}/submit_tool_outputs{?api-version}\",\n {\n threadId: threadId,\n runId: runId,\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).post({\n ...operationOptionsToRequestParameters(options),\n contentType: \"application/json\",\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n body: {\n tool_outputs: toolOutputs.length > 0 ? toolOutputArraySerializer(toolOutputs) : undefined,\n tool_approvals: !options?.toolApprovals\n ? options?.toolApprovals\n : toolApprovalArraySerializer(options?.toolApprovals),\n stream: options?.stream ?? false,\n },\n });\n}\n\nexport async function _submitToolOutputsToRunDeserialize(\n result: PathUncheckedResponse,\n): Promise<ThreadRun> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n const error = createRestError(result);\n error.details = agentV1ErrorDeserializer(result.body);\n throw error;\n }\n\n return threadRunDeserializer(result.body);\n}\n\n/** Submits outputs from tools as requested by tool calls in a run. */\nexport function submitToolOutputsToRun(\n context: Client,\n threadId: string,\n runId: string,\n toolOutputs: ToolOutput[],\n options: RunsSubmitToolOutputsToRunOptionalParams = { requestOptions: {} },\n): AgentRunResponse {\n async function executeSubmitToolOutputsToRun(): Promise<ThreadRun> {\n const result = await _submitToolOutputsToRunSend(\n context,\n threadId,\n runId,\n toolOutputs,\n options,\n );\n\n return _submitToolOutputsToRunDeserialize(result);\n }\n\n return {\n then: function (onFulfilled, onRejected) {\n return executeSubmitToolOutputsToRun().then(onFulfilled, onRejected).catch(onRejected);\n },\n async stream(): Promise<AgentEventMessageStream> {\n return submitToolOutputsToRunStreaming(context, threadId, runId, toolOutputs, options);\n },\n };\n}\n\nexport function _updateRunSend(\n context: Client,\n threadId: string,\n runId: string,\n options: RunsUpdateRunOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/threads/{threadId}/runs/{runId}{?api-version}\",\n {\n threadId: threadId,\n runId: runId,\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).post({\n ...operationOptionsToRequestParameters(options),\n contentType: \"application/json\",\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n body: { metadata: options?.metadata },\n });\n}\n\nexport async function _updateRunDeserialize(result: PathUncheckedResponse): Promise<ThreadRun> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n const error = createRestError(result);\n error.details = agentV1ErrorDeserializer(result.body);\n throw error;\n }\n\n return threadRunDeserializer(result.body);\n}\n\n/** Modifies an existing thread run. */\nexport async function updateRun(\n context: Client,\n threadId: string,\n runId: string,\n options: RunsUpdateRunOptionalParams = { requestOptions: {} },\n): Promise<ThreadRun> {\n const result = await _updateRunSend(context, threadId, runId, options);\n return _updateRunDeserialize(result);\n}\n\nexport function _getRunSend(\n context: Client,\n threadId: string,\n runId: string,\n options: RunsGetRunOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/threads/{threadId}/runs/{runId}{?api-version}\",\n {\n threadId: threadId,\n runId: runId,\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).get({\n ...operationOptionsToRequestParameters(options),\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _getRunDeserialize(result: PathUncheckedResponse): Promise<ThreadRun> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n const error = createRestError(result);\n error.details = agentV1ErrorDeserializer(result.body);\n throw error;\n }\n\n return threadRunDeserializer(result.body);\n}\n\n/** Gets an existing run from an existing thread. */\nexport async function getRun(\n context: Client,\n threadId: string,\n runId: string,\n options: RunsGetRunOptionalParams = { requestOptions: {} },\n): Promise<ThreadRun> {\n const result = await _getRunSend(context, threadId, runId, options);\n return _getRunDeserialize(result);\n}\n\nexport function _listRunsSend(\n context: Client,\n threadId: string,\n options: RunsListRunsOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/threads/{threadId}/runs{?api-version,limit,order,after,before}\",\n {\n threadId: threadId,\n \"api-version\": context.apiVersion,\n limit: options?.limit,\n order: options?.order,\n after: options?.after,\n before: options?.before,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).get({\n ...operationOptionsToRequestParameters(options),\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _listRunsDeserialize(\n result: PathUncheckedResponse,\n): Promise<_AgentsPagedResultThreadRun> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n const error = createRestError(result);\n error.details = agentV1ErrorDeserializer(result.body);\n throw error;\n }\n\n return _agentsPagedResultThreadRunDeserializer(result.body);\n}\n\n/** Gets a list of runs for a specified thread. */\nexport function listRuns(\n context: Client,\n threadId: string,\n options: RunsListRunsOptionalParams = { requestOptions: {} },\n): PagedAsyncIterableIterator<ThreadRun> {\n return buildPagedAsyncIterator(\n context,\n () => _listRunsSend(context, threadId, options),\n _listRunsDeserialize,\n [\"200\"],\n { itemName: \"data\" },\n );\n}\n\nexport function _createRunSend(\n context: Client,\n threadId: string,\n assistantId: string,\n options: RunsCreateRunOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/threads/{threadId}/runs{?api-version,include%5B%5D}\",\n {\n threadId: threadId,\n \"api-version\": context.apiVersion,\n \"include%5B%5D\": !options?.include\n ? options?.include\n : options?.include.map((p: any) => {\n return p;\n }),\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).post({\n ...operationOptionsToRequestParameters(options),\n contentType: \"application/json\",\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n body: {\n assistant_id: assistantId,\n model: options?.model,\n instructions: options?.instructions,\n additional_instructions: options?.additionalInstructions,\n additional_messages: !options?.additionalMessages\n ? options?.additionalMessages\n : threadMessageOptionsArraySerializer(options?.additionalMessages),\n tools: !options?.tools ? options?.tools : toolDefinitionUnionArraySerializer(options?.tools),\n tool_resources: !options?.toolResources\n ? options?.toolResources\n : toolResourcesSerializer(options?.toolResources),\n stream: options?.stream,\n temperature: options?.temperature,\n top_p: options?.topP,\n max_prompt_tokens: options?.maxPromptTokens,\n max_completion_tokens: options?.maxCompletionTokens,\n truncation_strategy: !options?.truncationStrategy\n ? options?.truncationStrategy\n : truncationObjectSerializer(options?.truncationStrategy),\n tool_choice: !options?.toolChoice\n ? options?.toolChoice\n : agentsToolChoiceOptionSerializer(options?.toolChoice),\n response_format: !options?.responseFormat\n ? options?.responseFormat\n : agentsResponseFormatOptionSerializer(options?.responseFormat),\n parallel_tool_calls: options?.parallelToolCalls,\n metadata: options?.metadata,\n },\n });\n}\n\nexport async function _createRunDeserialize(result: PathUncheckedResponse): Promise<ThreadRun> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n const error = createRestError(result);\n error.details = agentV1ErrorDeserializer(result.body);\n throw error;\n }\n\n return threadRunDeserializer(result.body);\n}\n\n/** Creates a new run for an agent thread (internal implementation). */\nexport async function createRunInternal(\n context: Client,\n threadId: string,\n assistantId: string,\n options: RunsCreateRunOptionalParams = { requestOptions: {} },\n): Promise<ThreadRun> {\n const result = await _createRunSend(context, threadId, assistantId, options);\n return _createRunDeserialize(result);\n}\n\n/** Creates a new run for an agent thread. */\nexport function createRun(\n context: Client,\n threadId: string,\n assistantId: string,\n options: RunsCreateRunOptionalParams = { requestOptions: {} },\n): AgentRunResponse {\n async function executeCreateRun(): Promise<ThreadRun> {\n return createRunInternal(context, threadId, assistantId, options);\n }\n\n return {\n then: function (onFulfilled, onRejected) {\n return executeCreateRun().then(onFulfilled, onRejected).catch(onRejected);\n },\n async stream(): Promise<AgentEventMessageStream> {\n return createRunStreaming(context, assistantId, threadId, options);\n },\n };\n}\n\n/** Creates a new run for an agent thread with polling */\nexport function createRunAndPoll(\n context: Client,\n threadId: string,\n assistantId: string,\n options: RunsCreateRunOptionalParams = { requestOptions: {} },\n): PollerLike<OperationState<ThreadRun>, ThreadRun> {\n return createPoller<ThreadRun>({\n initOperation: async () => {\n return createRunInternal(context, threadId, assistantId, options);\n },\n pollOperation: async (currentRun: ThreadRun) => {\n return getRun(context, threadId, currentRun.id, options);\n },\n getOperationStatus: getLroOperationStatus,\n getOperationError: (result: ThreadRun) => {\n return getLroOperationStatus(result) === \"failed\" && result.lastError\n ? new Error(`Operation failed: ${result.lastError.message}`)\n : undefined;\n },\n intervalInMs: options.pollingOptions?.intervalInMs,\n });\n}\n\nfunction getLroOperationStatus(result: ThreadRun): OperationStatus {\n switch (result.status) {\n case \"queued\":\n return \"notStarted\";\n case \"in_progress\":\n return \"running\";\n case \"requires_action\":\n return \"running\";\n case \"completed\":\n return \"succeeded\";\n case \"cancelled\":\n case \"expired\":\n default:\n return \"failed\";\n }\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ToolDefinitionUnion, AgentsResponseFormatOption, ThreadMessageOptions, TruncationObject, AgentsToolChoiceOption, ListSortOrder, RunAdditionalFieldList } from "../../models/models.js";
|
|
1
|
+
import type { ToolDefinitionUnion, ToolResources, AgentsResponseFormatOption, ThreadMessageOptions, TruncationObject, AgentsToolChoiceOption, ToolOutput, ToolApproval, ListSortOrder, RunAdditionalFieldList } from "../../models/models.js";
|
|
2
2
|
import type { OperationOptions } from "@azure-rest/core-client";
|
|
3
3
|
import type { PollingOptionsParams } from "../options.js";
|
|
4
4
|
/** Optional parameters. */
|
|
@@ -6,6 +6,10 @@ export interface RunsCancelRunOptionalParams extends OperationOptions {
|
|
|
6
6
|
}
|
|
7
7
|
/** Optional parameters. */
|
|
8
8
|
export interface RunsSubmitToolOutputsToRunOptionalParams extends OperationOptions {
|
|
9
|
+
/** A list of tools for which the outputs are being submitted */
|
|
10
|
+
toolOutputs?: ToolOutput[];
|
|
11
|
+
/** A list of tool approvals allowing data to be sent to tools. */
|
|
12
|
+
toolApprovals?: ToolApproval[];
|
|
9
13
|
/** If true, returns a stream of events that happen during the Run as SSE, terminating at `[DONE]`. */
|
|
10
14
|
stream?: boolean | null;
|
|
11
15
|
}
|
|
@@ -49,6 +53,8 @@ export interface RunsCreateRunOptionalParams extends OperationOptions, PollingOp
|
|
|
49
53
|
additionalMessages?: ThreadMessageOptions[] | null;
|
|
50
54
|
/** The overridden list of enabled tools that the agent should use to run the thread. */
|
|
51
55
|
tools?: ToolDefinitionUnion[] | null;
|
|
56
|
+
/** The overridden enabled tool resources that the agent should use to run the thread. */
|
|
57
|
+
toolResources?: ToolResources | null;
|
|
52
58
|
/**
|
|
53
59
|
* If `true`, returns a stream of events that happen during the Run as server-sent events,
|
|
54
60
|
* terminating when the Run enters a terminal state with a `data: [DONE]` message.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../../src/api/runs/options.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,mBAAmB,EACnB,0BAA0B,EAC1B,oBAAoB,EACpB,gBAAgB,EAChB,sBAAsB,EACtB,aAAa,EACb,sBAAsB,EACvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAE1D,2BAA2B;AAC3B,MAAM,WAAW,2BAA4B,SAAQ,gBAAgB;CAAG;AAExE,2BAA2B;AAC3B,MAAM,WAAW,wCAAyC,SAAQ,gBAAgB;IAChF,sGAAsG;IACtG,MAAM,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CACzB;AAED,2BAA2B;AAC3B,MAAM,WAAW,2BAA4B,SAAQ,gBAAgB;IACnE,yPAAyP;IACzP,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;CAC1C;AAED,2BAA2B;AAC3B,MAAM,WAAW,wBAAyB,SAAQ,gBAAgB;CAAG;AAErE,2BAA2B;AAC3B,MAAM,WAAW,0BAA2B,SAAQ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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../../../src/api/runs/options.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n ToolDefinitionUnion,\n AgentsResponseFormatOption,\n ThreadMessageOptions,\n TruncationObject,\n AgentsToolChoiceOption,\n ListSortOrder,\n RunAdditionalFieldList,\n} from \"../../models/models.js\";\nimport type { OperationOptions } from \"@azure-rest/core-client\";\nimport type { PollingOptionsParams } from \"../options.js\";\n\n/** Optional parameters. */\nexport interface RunsCancelRunOptionalParams extends OperationOptions {}\n\n/** Optional parameters. */\nexport interface RunsSubmitToolOutputsToRunOptionalParams extends OperationOptions {\n /** If true, returns a stream of events that happen during the Run as SSE, terminating at `[DONE]`. */\n stream?: boolean | null;\n}\n\n/** Optional parameters. */\nexport interface RunsUpdateRunOptionalParams extends OperationOptions {\n /** A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. */\n metadata?: Record<string, string> | null;\n}\n\n/** Optional parameters. */\nexport interface RunsGetRunOptionalParams extends OperationOptions {}\n\n/** Optional parameters. */\nexport interface RunsListRunsOptionalParams extends OperationOptions {\n /** A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. */\n limit?: number;\n /** Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order. */\n order?: ListSortOrder;\n /** A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. */\n after?: string;\n /** A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. */\n before?: string;\n}\n\n/** Optional parameters. */\nexport interface RunsCreateRunOptionalParams extends OperationOptions, PollingOptionsParams {\n /**\n * A list of additional fields to include in the response.\n * Currently the only supported value is `step_details.tool_calls[*].file_search.results[*].content`\n * to fetch the file search result content.\n */\n include?: RunAdditionalFieldList[];\n /** The overridden model name that the agent should use to run the thread. */\n model?: string | null;\n /** The overridden system instructions that the agent should use to run the thread. */\n instructions?: string | null;\n /**\n * Additional instructions to append at the end of the instructions for the run. This is useful for modifying the behavior\n * on a per-run basis without overriding other instructions.\n */\n additionalInstructions?: string | null;\n /** Adds additional messages to the thread before creating the run. */\n additionalMessages?: ThreadMessageOptions[] | null;\n /** The overridden list of enabled tools that the agent should use to run the thread. */\n tools?: ToolDefinitionUnion[] | null;\n /**\n * If `true`, returns a stream of events that happen during the Run as server-sent events,\n * terminating when the Run enters a terminal state with a `data: [DONE]` message.\n */\n stream?: boolean;\n /**\n * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output\n * more random, while lower values like 0.2 will make it more focused and deterministic.\n */\n temperature?: number | null;\n /**\n * An alternative to sampling with temperature, called nucleus sampling, where the model\n * considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens\n * comprising the top 10% probability mass are considered.\n *\n * We generally recommend altering this or temperature but not both.\n */\n topP?: number | null;\n /**\n * The maximum number of prompt tokens that may be used over the course of the run. The run will make a best effort to use only\n * the number of prompt tokens specified, across multiple turns of the run. If the run exceeds the number of prompt tokens specified,\n * the run will end with status `incomplete`. See `incomplete_details` for more info.\n */\n maxPromptTokens?: number | null;\n /**\n * The maximum number of completion tokens that may be used over the course of the run. The run will make a best effort\n * to use only the number of completion tokens specified, across multiple turns of the run. If the run exceeds the number of\n * completion tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info.\n */\n maxCompletionTokens?: number | null;\n /** The strategy to use for dropping messages as the context windows moves forward. */\n truncationStrategy?: TruncationObject | null;\n /** Controls whether or not and which tool is called by the model. */\n toolChoice?: AgentsToolChoiceOption | null;\n /** Specifies the format that the model must output. */\n responseFormat?: AgentsResponseFormatOption | null;\n /** If `true` functions will run in parallel during tool use. */\n parallelToolCalls?: boolean;\n /** A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. */\n metadata?: Record<string, string> | null;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../../../src/api/runs/options.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n ToolDefinitionUnion,\n ToolResources,\n AgentsResponseFormatOption,\n ThreadMessageOptions,\n TruncationObject,\n AgentsToolChoiceOption,\n ToolOutput,\n ToolApproval,\n ListSortOrder,\n RunAdditionalFieldList,\n} from \"../../models/models.js\";\nimport type { OperationOptions } from \"@azure-rest/core-client\";\nimport type { PollingOptionsParams } from \"../options.js\";\n\n/** Optional parameters. */\nexport interface RunsCancelRunOptionalParams extends OperationOptions {}\n\n/** Optional parameters. */\nexport interface RunsSubmitToolOutputsToRunOptionalParams extends OperationOptions {\n /** A list of tools for which the outputs are being submitted */\n toolOutputs?: ToolOutput[];\n /** A list of tool approvals allowing data to be sent to tools. */\n toolApprovals?: ToolApproval[];\n /** If true, returns a stream of events that happen during the Run as SSE, terminating at `[DONE]`. */\n stream?: boolean | null;\n}\n\n/** Optional parameters. */\nexport interface RunsUpdateRunOptionalParams extends OperationOptions {\n /** A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. */\n metadata?: Record<string, string> | null;\n}\n\n/** Optional parameters. */\nexport interface RunsGetRunOptionalParams extends OperationOptions {}\n\n/** Optional parameters. */\nexport interface RunsListRunsOptionalParams extends OperationOptions {\n /** A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. */\n limit?: number;\n /** Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order. */\n order?: ListSortOrder;\n /** A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. */\n after?: string;\n /** A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. */\n before?: string;\n}\n\n/** Optional parameters. */\nexport interface RunsCreateRunOptionalParams extends OperationOptions, PollingOptionsParams {\n /**\n * A list of additional fields to include in the response.\n * Currently the only supported value is `step_details.tool_calls[*].file_search.results[*].content`\n * to fetch the file search result content.\n */\n include?: RunAdditionalFieldList[];\n /** The overridden model name that the agent should use to run the thread. */\n model?: string | null;\n /** The overridden system instructions that the agent should use to run the thread. */\n instructions?: string | null;\n /**\n * Additional instructions to append at the end of the instructions for the run. This is useful for modifying the behavior\n * on a per-run basis without overriding other instructions.\n */\n additionalInstructions?: string | null;\n /** Adds additional messages to the thread before creating the run. */\n additionalMessages?: ThreadMessageOptions[] | null;\n /** The overridden list of enabled tools that the agent should use to run the thread. */\n tools?: ToolDefinitionUnion[] | null;\n /** The overridden enabled tool resources that the agent should use to run the thread. */\n toolResources?: ToolResources | null;\n /**\n * If `true`, returns a stream of events that happen during the Run as server-sent events,\n * terminating when the Run enters a terminal state with a `data: [DONE]` message.\n */\n stream?: boolean;\n /**\n * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output\n * more random, while lower values like 0.2 will make it more focused and deterministic.\n */\n temperature?: number | null;\n /**\n * An alternative to sampling with temperature, called nucleus sampling, where the model\n * considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens\n * comprising the top 10% probability mass are considered.\n *\n * We generally recommend altering this or temperature but not both.\n */\n topP?: number | null;\n /**\n * The maximum number of prompt tokens that may be used over the course of the run. The run will make a best effort to use only\n * the number of prompt tokens specified, across multiple turns of the run. If the run exceeds the number of prompt tokens specified,\n * the run will end with status `incomplete`. See `incomplete_details` for more info.\n */\n maxPromptTokens?: number | null;\n /**\n * The maximum number of completion tokens that may be used over the course of the run. The run will make a best effort\n * to use only the number of completion tokens specified, across multiple turns of the run. If the run exceeds the number of\n * completion tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info.\n */\n maxCompletionTokens?: number | null;\n /** The strategy to use for dropping messages as the context windows moves forward. */\n truncationStrategy?: TruncationObject | null;\n /** Controls whether or not and which tool is called by the model. */\n toolChoice?: AgentsToolChoiceOption | null;\n /** Specifies the format that the model must output. */\n responseFormat?: AgentsResponseFormatOption | null;\n /** If `true` functions will run in parallel during tool use. */\n parallelToolCalls?: boolean;\n /** A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. */\n metadata?: Record<string, string> | null;\n}\n"]}
|
|
@@ -22,14 +22,19 @@ const pagingHelpers_js_1 = require("../../static-helpers/pagingHelpers.js");
|
|
|
22
22
|
const urlTemplate_js_1 = require("../../static-helpers/urlTemplate.js");
|
|
23
23
|
const core_client_1 = require("@azure-rest/core-client");
|
|
24
24
|
function _deleteThreadSend(context, threadId, options = { requestOptions: {} }) {
|
|
25
|
-
|
|
26
|
-
const path = (0, urlTemplate_js_1.expandUrlTemplate)("/threads/{threadId}{?api%2Dversion}", {
|
|
25
|
+
const path = (0, urlTemplate_js_1.expandUrlTemplate)("/threads/{threadId}{?api-version}", {
|
|
27
26
|
threadId: threadId,
|
|
28
|
-
"api
|
|
27
|
+
"api-version": context.apiVersion,
|
|
29
28
|
}, {
|
|
30
|
-
allowReserved:
|
|
29
|
+
allowReserved: options?.requestOptions?.skipUrlEncoding,
|
|
30
|
+
});
|
|
31
|
+
return context.path(path).delete({
|
|
32
|
+
...(0, core_client_1.operationOptionsToRequestParameters)(options),
|
|
33
|
+
headers: {
|
|
34
|
+
accept: "application/json",
|
|
35
|
+
...options.requestOptions?.headers,
|
|
36
|
+
},
|
|
31
37
|
});
|
|
32
|
-
return context.path(path).delete(Object.assign(Object.assign({}, (0, core_client_1.operationOptionsToRequestParameters)(options)), { headers: Object.assign({ accept: "application/json" }, (_b = options.requestOptions) === null || _b === void 0 ? void 0 : _b.headers) }));
|
|
33
38
|
}
|
|
34
39
|
async function _deleteThreadDeserialize(result) {
|
|
35
40
|
const expectedStatuses = ["200"];
|
|
@@ -46,19 +51,26 @@ async function deleteThread(context, threadId, options = { requestOptions: {} })
|
|
|
46
51
|
return _deleteThreadDeserialize(result);
|
|
47
52
|
}
|
|
48
53
|
function _updateThreadSend(context, threadId, options = { requestOptions: {} }) {
|
|
49
|
-
|
|
50
|
-
const path = (0, urlTemplate_js_1.expandUrlTemplate)("/threads/{threadId}{?api%2Dversion}", {
|
|
54
|
+
const path = (0, urlTemplate_js_1.expandUrlTemplate)("/threads/{threadId}{?api-version}", {
|
|
51
55
|
threadId: threadId,
|
|
52
|
-
"api
|
|
56
|
+
"api-version": context.apiVersion,
|
|
53
57
|
}, {
|
|
54
|
-
allowReserved:
|
|
58
|
+
allowReserved: options?.requestOptions?.skipUrlEncoding,
|
|
59
|
+
});
|
|
60
|
+
return context.path(path).post({
|
|
61
|
+
...(0, core_client_1.operationOptionsToRequestParameters)(options),
|
|
62
|
+
contentType: "application/json",
|
|
63
|
+
headers: {
|
|
64
|
+
accept: "application/json",
|
|
65
|
+
...options.requestOptions?.headers,
|
|
66
|
+
},
|
|
67
|
+
body: {
|
|
68
|
+
tool_resources: !options?.toolResources
|
|
69
|
+
? options?.toolResources
|
|
70
|
+
: (0, models_js_1.toolResourcesSerializer)(options?.toolResources),
|
|
71
|
+
metadata: options?.metadata,
|
|
72
|
+
},
|
|
55
73
|
});
|
|
56
|
-
return context.path(path).post(Object.assign(Object.assign({}, (0, core_client_1.operationOptionsToRequestParameters)(options)), { contentType: "application/json", headers: Object.assign({ accept: "application/json" }, (_b = options.requestOptions) === null || _b === void 0 ? void 0 : _b.headers), body: {
|
|
57
|
-
tool_resources: !(options === null || options === void 0 ? void 0 : options.toolResources)
|
|
58
|
-
? options === null || options === void 0 ? void 0 : options.toolResources
|
|
59
|
-
: (0, models_js_1.toolResourcesSerializer)(options === null || options === void 0 ? void 0 : options.toolResources),
|
|
60
|
-
metadata: options === null || options === void 0 ? void 0 : options.metadata,
|
|
61
|
-
} }));
|
|
62
74
|
}
|
|
63
75
|
async function _updateThreadDeserialize(result) {
|
|
64
76
|
const expectedStatuses = ["200"];
|
|
@@ -75,14 +87,19 @@ async function updateThread(context, threadId, options = { requestOptions: {} })
|
|
|
75
87
|
return _updateThreadDeserialize(result);
|
|
76
88
|
}
|
|
77
89
|
function _getThreadSend(context, threadId, options = { requestOptions: {} }) {
|
|
78
|
-
|
|
79
|
-
const path = (0, urlTemplate_js_1.expandUrlTemplate)("/threads/{threadId}{?api%2Dversion}", {
|
|
90
|
+
const path = (0, urlTemplate_js_1.expandUrlTemplate)("/threads/{threadId}{?api-version}", {
|
|
80
91
|
threadId: threadId,
|
|
81
|
-
"api
|
|
92
|
+
"api-version": context.apiVersion,
|
|
82
93
|
}, {
|
|
83
|
-
allowReserved:
|
|
94
|
+
allowReserved: options?.requestOptions?.skipUrlEncoding,
|
|
95
|
+
});
|
|
96
|
+
return context.path(path).get({
|
|
97
|
+
...(0, core_client_1.operationOptionsToRequestParameters)(options),
|
|
98
|
+
headers: {
|
|
99
|
+
accept: "application/json",
|
|
100
|
+
...options.requestOptions?.headers,
|
|
101
|
+
},
|
|
84
102
|
});
|
|
85
|
-
return context.path(path).get(Object.assign(Object.assign({}, (0, core_client_1.operationOptionsToRequestParameters)(options)), { headers: Object.assign({ accept: "application/json" }, (_b = options.requestOptions) === null || _b === void 0 ? void 0 : _b.headers) }));
|
|
86
103
|
}
|
|
87
104
|
async function _getThreadDeserialize(result) {
|
|
88
105
|
const expectedStatuses = ["200"];
|
|
@@ -99,17 +116,22 @@ async function getThread(context, threadId, options = { requestOptions: {} }) {
|
|
|
99
116
|
return _getThreadDeserialize(result);
|
|
100
117
|
}
|
|
101
118
|
function _listThreadsSend(context, options = { requestOptions: {} }) {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
before: options === null || options === void 0 ? void 0 : options.before,
|
|
119
|
+
const path = (0, urlTemplate_js_1.expandUrlTemplate)("/threads{?api-version,limit,order,after,before}", {
|
|
120
|
+
"api-version": context.apiVersion,
|
|
121
|
+
limit: options?.limit,
|
|
122
|
+
order: options?.order,
|
|
123
|
+
after: options?.after,
|
|
124
|
+
before: options?.before,
|
|
109
125
|
}, {
|
|
110
|
-
allowReserved:
|
|
126
|
+
allowReserved: options?.requestOptions?.skipUrlEncoding,
|
|
127
|
+
});
|
|
128
|
+
return context.path(path).get({
|
|
129
|
+
...(0, core_client_1.operationOptionsToRequestParameters)(options),
|
|
130
|
+
headers: {
|
|
131
|
+
accept: "application/json",
|
|
132
|
+
...options.requestOptions?.headers,
|
|
133
|
+
},
|
|
111
134
|
});
|
|
112
|
-
return context.path(path).get(Object.assign(Object.assign({}, (0, core_client_1.operationOptionsToRequestParameters)(options)), { headers: Object.assign({ accept: "application/json" }, (_b = options.requestOptions) === null || _b === void 0 ? void 0 : _b.headers) }));
|
|
113
135
|
}
|
|
114
136
|
async function _listThreadsDeserialize(result) {
|
|
115
137
|
const expectedStatuses = ["200"];
|
|
@@ -125,21 +147,28 @@ function listThreads(context, options = { requestOptions: {} }) {
|
|
|
125
147
|
return (0, pagingHelpers_js_1.buildPagedAsyncIterator)(context, () => _listThreadsSend(context, options), _listThreadsDeserialize, ["200"], { itemName: "data" });
|
|
126
148
|
}
|
|
127
149
|
function _createThreadSend(context, options = { requestOptions: {} }) {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
"api%2Dversion": context.apiVersion,
|
|
150
|
+
const path = (0, urlTemplate_js_1.expandUrlTemplate)("/threads{?api-version}", {
|
|
151
|
+
"api-version": context.apiVersion,
|
|
131
152
|
}, {
|
|
132
|
-
allowReserved:
|
|
153
|
+
allowReserved: options?.requestOptions?.skipUrlEncoding,
|
|
154
|
+
});
|
|
155
|
+
return context.path(path).post({
|
|
156
|
+
...(0, core_client_1.operationOptionsToRequestParameters)(options),
|
|
157
|
+
contentType: "application/json",
|
|
158
|
+
headers: {
|
|
159
|
+
accept: "application/json",
|
|
160
|
+
...options.requestOptions?.headers,
|
|
161
|
+
},
|
|
162
|
+
body: {
|
|
163
|
+
messages: !options?.messages
|
|
164
|
+
? options?.messages
|
|
165
|
+
: (0, models_js_1.threadMessageOptionsArraySerializer)(options?.messages),
|
|
166
|
+
tool_resources: !options?.toolResources
|
|
167
|
+
? options?.toolResources
|
|
168
|
+
: (0, models_js_1.toolResourcesSerializer)(options?.toolResources),
|
|
169
|
+
metadata: options?.metadata,
|
|
170
|
+
},
|
|
133
171
|
});
|
|
134
|
-
return context.path(path).post(Object.assign(Object.assign({}, (0, core_client_1.operationOptionsToRequestParameters)(options)), { contentType: "application/json", headers: Object.assign({ accept: "application/json" }, (_b = options.requestOptions) === null || _b === void 0 ? void 0 : _b.headers), body: {
|
|
135
|
-
messages: !(options === null || options === void 0 ? void 0 : options.messages)
|
|
136
|
-
? options === null || options === void 0 ? void 0 : options.messages
|
|
137
|
-
: (0, models_js_1.threadMessageOptionsArraySerializer)(options === null || options === void 0 ? void 0 : options.messages),
|
|
138
|
-
tool_resources: !(options === null || options === void 0 ? void 0 : options.toolResources)
|
|
139
|
-
? options === null || options === void 0 ? void 0 : options.toolResources
|
|
140
|
-
: (0, models_js_1.toolResourcesSerializer)(options === null || options === void 0 ? void 0 : options.toolResources),
|
|
141
|
-
metadata: options === null || options === void 0 ? void 0 : options.metadata,
|
|
142
|
-
} }));
|
|
143
172
|
}
|
|
144
173
|
async function _createThreadDeserialize(result) {
|
|
145
174
|
const expectedStatuses = ["200"];
|