@azure/ai-agents 1.0.0-beta.2 → 1.0.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -34
- package/dist/browser/api/agentsContext.d.ts.map +1 -1
- package/dist/browser/api/agentsContext.js +7 -4
- package/dist/browser/api/agentsContext.js.map +1 -1
- package/dist/browser/api/operations.d.ts +3 -3
- package/dist/browser/api/operations.d.ts.map +1 -1
- package/dist/browser/api/operations.js +14 -14
- package/dist/browser/api/operations.js.map +1 -1
- package/dist/browser/api/poller.d.ts +7 -2
- package/dist/browser/api/poller.d.ts.map +1 -1
- package/dist/browser/api/poller.js +31 -9
- package/dist/browser/api/poller.js.map +1 -1
- package/dist/browser/api/runs/operations.d.ts +12 -7
- package/dist/browser/api/runs/operations.d.ts.map +1 -1
- package/dist/browser/api/runs/operations.js +59 -9
- package/dist/browser/api/runs/operations.js.map +1 -1
- package/dist/browser/api/runs/options.d.ts +2 -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/classic/runs/index.d.ts +4 -1
- package/dist/browser/classic/runs/index.d.ts.map +1 -1
- package/dist/browser/classic/runs/index.js +2 -1
- package/dist/browser/classic/runs/index.js.map +1 -1
- package/dist/browser/constants.d.ts +1 -1
- package/dist/browser/constants.js +1 -1
- package/dist/browser/constants.js.map +1 -1
- package/dist/browser/models/models.d.ts +6 -2
- package/dist/browser/models/models.d.ts.map +1 -1
- package/dist/browser/models/models.js +8 -0
- package/dist/browser/models/models.js.map +1 -1
- package/dist/browser/models/streamingModels.d.ts +1 -67
- package/dist/browser/models/streamingModels.d.ts.map +1 -1
- package/dist/browser/models/streamingModels.js +1 -72
- package/dist/browser/models/streamingModels.js.map +1 -1
- package/dist/browser/utils.d.ts +20 -1
- package/dist/browser/utils.d.ts.map +1 -1
- package/dist/browser/utils.js +33 -1
- package/dist/browser/utils.js.map +1 -1
- package/dist/commonjs/api/agentsContext.d.ts.map +1 -1
- package/dist/commonjs/api/agentsContext.js +7 -4
- package/dist/commonjs/api/agentsContext.js.map +1 -1
- package/dist/commonjs/api/operations.d.ts +3 -3
- package/dist/commonjs/api/operations.d.ts.map +1 -1
- package/dist/commonjs/api/operations.js +18 -18
- package/dist/commonjs/api/operations.js.map +1 -1
- package/dist/commonjs/api/poller.d.ts +7 -2
- package/dist/commonjs/api/poller.d.ts.map +1 -1
- package/dist/commonjs/api/poller.js +32 -9
- package/dist/commonjs/api/poller.js.map +1 -1
- package/dist/commonjs/api/runs/operations.d.ts +12 -7
- package/dist/commonjs/api/runs/operations.d.ts.map +1 -1
- package/dist/commonjs/api/runs/operations.js +58 -6
- package/dist/commonjs/api/runs/operations.js.map +1 -1
- package/dist/commonjs/api/runs/options.d.ts +2 -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/classic/runs/index.d.ts +4 -1
- package/dist/commonjs/classic/runs/index.d.ts.map +1 -1
- package/dist/commonjs/classic/runs/index.js +1 -0
- package/dist/commonjs/classic/runs/index.js.map +1 -1
- package/dist/commonjs/constants.d.ts +1 -1
- package/dist/commonjs/constants.js +1 -1
- package/dist/commonjs/constants.js.map +1 -1
- package/dist/commonjs/models/models.d.ts +6 -2
- package/dist/commonjs/models/models.d.ts.map +1 -1
- package/dist/commonjs/models/models.js +8 -0
- package/dist/commonjs/models/models.js.map +1 -1
- package/dist/commonjs/models/streamingModels.d.ts +1 -67
- package/dist/commonjs/models/streamingModels.d.ts.map +1 -1
- package/dist/commonjs/models/streamingModels.js +0 -73
- package/dist/commonjs/models/streamingModels.js.map +1 -1
- package/dist/commonjs/tsdoc-metadata.json +1 -1
- package/dist/commonjs/utils.d.ts +20 -1
- package/dist/commonjs/utils.d.ts.map +1 -1
- package/dist/commonjs/utils.js +33 -1
- package/dist/commonjs/utils.js.map +1 -1
- package/dist/esm/api/agentsContext.d.ts.map +1 -1
- package/dist/esm/api/agentsContext.js +7 -4
- package/dist/esm/api/agentsContext.js.map +1 -1
- package/dist/esm/api/operations.d.ts +3 -3
- package/dist/esm/api/operations.d.ts.map +1 -1
- package/dist/esm/api/operations.js +14 -14
- package/dist/esm/api/operations.js.map +1 -1
- package/dist/esm/api/poller.d.ts +7 -2
- package/dist/esm/api/poller.d.ts.map +1 -1
- package/dist/esm/api/poller.js +31 -9
- package/dist/esm/api/poller.js.map +1 -1
- package/dist/esm/api/runs/operations.d.ts +12 -7
- package/dist/esm/api/runs/operations.d.ts.map +1 -1
- package/dist/esm/api/runs/operations.js +59 -9
- package/dist/esm/api/runs/operations.js.map +1 -1
- package/dist/esm/api/runs/options.d.ts +2 -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/classic/runs/index.d.ts +4 -1
- package/dist/esm/classic/runs/index.d.ts.map +1 -1
- package/dist/esm/classic/runs/index.js +2 -1
- package/dist/esm/classic/runs/index.js.map +1 -1
- package/dist/esm/constants.d.ts +1 -1
- package/dist/esm/constants.js +1 -1
- package/dist/esm/constants.js.map +1 -1
- package/dist/esm/models/models.d.ts +6 -2
- package/dist/esm/models/models.d.ts.map +1 -1
- package/dist/esm/models/models.js +8 -0
- package/dist/esm/models/models.js.map +1 -1
- package/dist/esm/models/streamingModels.d.ts +1 -67
- package/dist/esm/models/streamingModels.d.ts.map +1 -1
- package/dist/esm/models/streamingModels.js +1 -72
- package/dist/esm/models/streamingModels.js.map +1 -1
- package/dist/esm/utils.d.ts +20 -1
- package/dist/esm/utils.d.ts.map +1 -1
- package/dist/esm/utils.js +33 -1
- package/dist/esm/utils.js.map +1 -1
- package/dist/react-native/api/agentsContext.d.ts.map +1 -1
- package/dist/react-native/api/agentsContext.js +7 -4
- package/dist/react-native/api/agentsContext.js.map +1 -1
- package/dist/react-native/api/operations.d.ts +3 -3
- package/dist/react-native/api/operations.d.ts.map +1 -1
- package/dist/react-native/api/operations.js +14 -14
- package/dist/react-native/api/operations.js.map +1 -1
- package/dist/react-native/api/poller.d.ts +7 -2
- package/dist/react-native/api/poller.d.ts.map +1 -1
- package/dist/react-native/api/poller.js +31 -9
- package/dist/react-native/api/poller.js.map +1 -1
- package/dist/react-native/api/runs/operations.d.ts +12 -7
- package/dist/react-native/api/runs/operations.d.ts.map +1 -1
- package/dist/react-native/api/runs/operations.js +59 -9
- package/dist/react-native/api/runs/operations.js.map +1 -1
- package/dist/react-native/api/runs/options.d.ts +2 -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/classic/runs/index.d.ts +4 -1
- package/dist/react-native/classic/runs/index.d.ts.map +1 -1
- package/dist/react-native/classic/runs/index.js +2 -1
- package/dist/react-native/classic/runs/index.js.map +1 -1
- package/dist/react-native/constants.d.ts +1 -1
- package/dist/react-native/constants.js +1 -1
- package/dist/react-native/constants.js.map +1 -1
- package/dist/react-native/models/models.d.ts +6 -2
- package/dist/react-native/models/models.d.ts.map +1 -1
- package/dist/react-native/models/models.js +8 -0
- package/dist/react-native/models/models.js.map +1 -1
- package/dist/react-native/models/streamingModels.d.ts +1 -67
- package/dist/react-native/models/streamingModels.d.ts.map +1 -1
- package/dist/react-native/models/streamingModels.js +1 -72
- package/dist/react-native/models/streamingModels.js.map +1 -1
- package/dist/react-native/utils.d.ts +20 -1
- package/dist/react-native/utils.d.ts.map +1 -1
- package/dist/react-native/utils.js +33 -1
- package/dist/react-native/utils.js.map +1 -1
- package/package.json +7 -13
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AgentStreamEvent, AgentThread, MessageDeltaChunk, RunStep, RunStepDeltaChunk, ThreadMessage, ThreadRun } from "./models.js";
|
|
1
|
+
import type { AgentStreamEvent, AgentThread, MessageDeltaChunk, RunStep, RunStepDeltaChunk, ThreadMessage, ThreadRun } from "./models.js";
|
|
2
2
|
/**
|
|
3
3
|
Each event in a server-sent events stream has an `event` and `data` property:
|
|
4
4
|
*
|
|
@@ -26,72 +26,6 @@ export interface AgentEventMessage {
|
|
|
26
26
|
}
|
|
27
27
|
/** Represents a stream event data in the agent. */
|
|
28
28
|
export type AgentEventStreamData = AgentThread | ThreadRun | RunStep | ThreadMessage | MessageDeltaChunk | RunStepDeltaChunk | string;
|
|
29
|
-
/** Thread operation related streaming events */
|
|
30
|
-
export declare enum ThreadStreamEvent {
|
|
31
|
-
/** Event sent when a new thread is created. The data of this event is of type AgentThread */
|
|
32
|
-
ThreadCreated = "thread.created"
|
|
33
|
-
}
|
|
34
|
-
/** Run operation related streaming events */
|
|
35
|
-
export declare enum RunStreamEvent {
|
|
36
|
-
/** Event sent when a new run is created. The data of this event is of type ThreadRun */
|
|
37
|
-
ThreadRunCreated = "thread.run.created",
|
|
38
|
-
/** Event sent when a run moves to `queued` status. The data of this event is of type ThreadRun */
|
|
39
|
-
ThreadRunQueued = "thread.run.queued",
|
|
40
|
-
/** Event sent when a run moves to `in_progress` status. The data of this event is of type ThreadRun */
|
|
41
|
-
ThreadRunInProgress = "thread.run.in_progress",
|
|
42
|
-
/** Event sent when a run moves to `requires_action` status. The data of this event is of type ThreadRun */
|
|
43
|
-
ThreadRunRequiresAction = "thread.run.requires_action",
|
|
44
|
-
/** Event sent when a run is completed. The data of this event is of type ThreadRun */
|
|
45
|
-
ThreadRunCompleted = "thread.run.completed",
|
|
46
|
-
/** Event sent when a run fails. The data of this event is of type ThreadRun */
|
|
47
|
-
ThreadRunFailed = "thread.run.failed",
|
|
48
|
-
/** Event sent when a run moves to `cancelling` status. The data of this event is of type ThreadRun */
|
|
49
|
-
ThreadRunCancelling = "thread.run.cancelling",
|
|
50
|
-
/** Event sent when a run is cancelled. The data of this event is of type ThreadRun */
|
|
51
|
-
ThreadRunCancelled = "thread.run.cancelled",
|
|
52
|
-
/** Event sent when a run is expired. The data of this event is of type ThreadRun */
|
|
53
|
-
ThreadRunExpired = "thread.run.expired"
|
|
54
|
-
}
|
|
55
|
-
/** Run step operation related streaming events */
|
|
56
|
-
export declare enum RunStepStreamEvent {
|
|
57
|
-
/** Event sent when a new thread run step is created. The data of this event is of type RunStep */
|
|
58
|
-
ThreadRunStepCreated = "thread.run.step.created",
|
|
59
|
-
/** Event sent when a run step moves to `in_progress` status. The data of this event is of type RunStep */
|
|
60
|
-
ThreadRunStepInProgress = "thread.run.step.in_progress",
|
|
61
|
-
/** Event sent when a run step is being streamed. The data of this event is of type RunStepDeltaChunk */
|
|
62
|
-
ThreadRunStepDelta = "thread.run.step.delta",
|
|
63
|
-
/** Event sent when a run step is completed. The data of this event is of type RunStep */
|
|
64
|
-
ThreadRunStepCompleted = "thread.run.step.completed",
|
|
65
|
-
/** Event sent when a run step fails. The data of this event is of type RunStep */
|
|
66
|
-
ThreadRunStepFailed = "thread.run.step.failed",
|
|
67
|
-
/** Event sent when a run step is cancelled. The data of this event is of type RunStep */
|
|
68
|
-
ThreadRunStepCancelled = "thread.run.step.cancelled",
|
|
69
|
-
/** Event sent when a run step is expired. The data of this event is of type RunStep */
|
|
70
|
-
ThreadRunStepExpired = "thread.run.step.expired"
|
|
71
|
-
}
|
|
72
|
-
/** Message operation related streaming events */
|
|
73
|
-
export declare enum MessageStreamEvent {
|
|
74
|
-
/** Event sent when a new message is created. The data of this event is of type ThreadMessage */
|
|
75
|
-
ThreadMessageCreated = "thread.message.created",
|
|
76
|
-
/** Event sent when a message moves to `in_progress` status. The data of this event is of type ThreadMessage */
|
|
77
|
-
ThreadMessageInProgress = "thread.message.in_progress",
|
|
78
|
-
/** Event sent when a message is being streamed. The data of this event is of type MessageDeltaChunk */
|
|
79
|
-
ThreadMessageDelta = "thread.message.delta",
|
|
80
|
-
/** Event sent when a message is completed. The data of this event is of type ThreadMessage */
|
|
81
|
-
ThreadMessageCompleted = "thread.message.completed",
|
|
82
|
-
/** Event sent before a message is completed. The data of this event is of type ThreadMessage */
|
|
83
|
-
ThreadMessageIncomplete = "thread.message.incomplete"
|
|
84
|
-
}
|
|
85
|
-
/** Terminal event indicating a server side error while streaming. */
|
|
86
|
-
export declare enum ErrorEvent {
|
|
87
|
-
/** Event sent when an error occurs, such as an internal server error or a timeout. */
|
|
88
|
-
Error = "error"
|
|
89
|
-
}
|
|
90
|
-
/** Terminal event indicating the successful end of a stream. */
|
|
91
|
-
export declare enum DoneEvent {
|
|
92
|
-
/** Event sent when the stream is done. */
|
|
93
|
-
Done = "done"
|
|
94
|
-
}
|
|
95
29
|
/** Represents a stream of agent event message. */
|
|
96
30
|
export interface AgentEventMessageStream extends AsyncDisposable, AsyncIterable<AgentEventMessage> {
|
|
97
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streamingModels.d.ts","sourceRoot":"","sources":["../../../src/models/streamingModels.ts"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"streamingModels.d.ts","sourceRoot":"","sources":["../../../src/models/streamingModels.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,gBAAgB,EAChB,WAAW,EACX,iBAAiB,EACjB,OAAO,EACP,iBAAiB,EACjB,aAAa,EACb,SAAS,EACV,MAAM,aAAa,CAAC;AAErB;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,WAAW,iBAAiB;IAChC,kKAAkK;IAClK,IAAI,EAAE,oBAAoB,CAAC;IAC3B,6BAA6B;IAC7B,KAAK,EAAE,gBAAgB,GAAG,MAAM,CAAC;CAClC;AAED,mDAAmD;AACnD,MAAM,MAAM,oBAAoB,GAC5B,WAAW,GACX,SAAS,GACT,OAAO,GACP,aAAa,GACb,iBAAiB,GACjB,iBAAiB,GACjB,MAAM,CAAC;AAEX,kDAAkD;AAClD,MAAM,WAAW,uBACf,SAAQ,eAAe,EACrB,aAAa,CAAC,iBAAiB,CAAC;CAAG;AAEvC;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,WAAW,CAAC,SAAS,CAAC,GAAG;IACtD;;;OAGG;IACH,MAAM,EAAE,MAAM,OAAO,CAAC,uBAAuB,CAAC,CAAC;CAChD,CAAC"}
|
|
@@ -1,75 +1,4 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
|
-
|
|
4
|
-
export var ThreadStreamEvent;
|
|
5
|
-
(function (ThreadStreamEvent) {
|
|
6
|
-
/** Event sent when a new thread is created. The data of this event is of type AgentThread */
|
|
7
|
-
ThreadStreamEvent["ThreadCreated"] = "thread.created";
|
|
8
|
-
})(ThreadStreamEvent || (ThreadStreamEvent = {}));
|
|
9
|
-
/** Run operation related streaming events */
|
|
10
|
-
export var RunStreamEvent;
|
|
11
|
-
(function (RunStreamEvent) {
|
|
12
|
-
/** Event sent when a new run is created. The data of this event is of type ThreadRun */
|
|
13
|
-
RunStreamEvent["ThreadRunCreated"] = "thread.run.created";
|
|
14
|
-
/** Event sent when a run moves to `queued` status. The data of this event is of type ThreadRun */
|
|
15
|
-
RunStreamEvent["ThreadRunQueued"] = "thread.run.queued";
|
|
16
|
-
/** Event sent when a run moves to `in_progress` status. The data of this event is of type ThreadRun */
|
|
17
|
-
RunStreamEvent["ThreadRunInProgress"] = "thread.run.in_progress";
|
|
18
|
-
/** Event sent when a run moves to `requires_action` status. The data of this event is of type ThreadRun */
|
|
19
|
-
RunStreamEvent["ThreadRunRequiresAction"] = "thread.run.requires_action";
|
|
20
|
-
/** Event sent when a run is completed. The data of this event is of type ThreadRun */
|
|
21
|
-
RunStreamEvent["ThreadRunCompleted"] = "thread.run.completed";
|
|
22
|
-
/** Event sent when a run fails. The data of this event is of type ThreadRun */
|
|
23
|
-
RunStreamEvent["ThreadRunFailed"] = "thread.run.failed";
|
|
24
|
-
/** Event sent when a run moves to `cancelling` status. The data of this event is of type ThreadRun */
|
|
25
|
-
RunStreamEvent["ThreadRunCancelling"] = "thread.run.cancelling";
|
|
26
|
-
/** Event sent when a run is cancelled. The data of this event is of type ThreadRun */
|
|
27
|
-
RunStreamEvent["ThreadRunCancelled"] = "thread.run.cancelled";
|
|
28
|
-
/** Event sent when a run is expired. The data of this event is of type ThreadRun */
|
|
29
|
-
RunStreamEvent["ThreadRunExpired"] = "thread.run.expired";
|
|
30
|
-
})(RunStreamEvent || (RunStreamEvent = {}));
|
|
31
|
-
/** Run step operation related streaming events */
|
|
32
|
-
export var RunStepStreamEvent;
|
|
33
|
-
(function (RunStepStreamEvent) {
|
|
34
|
-
/** Event sent when a new thread run step is created. The data of this event is of type RunStep */
|
|
35
|
-
RunStepStreamEvent["ThreadRunStepCreated"] = "thread.run.step.created";
|
|
36
|
-
/** Event sent when a run step moves to `in_progress` status. The data of this event is of type RunStep */
|
|
37
|
-
RunStepStreamEvent["ThreadRunStepInProgress"] = "thread.run.step.in_progress";
|
|
38
|
-
/** Event sent when a run step is being streamed. The data of this event is of type RunStepDeltaChunk */
|
|
39
|
-
RunStepStreamEvent["ThreadRunStepDelta"] = "thread.run.step.delta";
|
|
40
|
-
/** Event sent when a run step is completed. The data of this event is of type RunStep */
|
|
41
|
-
RunStepStreamEvent["ThreadRunStepCompleted"] = "thread.run.step.completed";
|
|
42
|
-
/** Event sent when a run step fails. The data of this event is of type RunStep */
|
|
43
|
-
RunStepStreamEvent["ThreadRunStepFailed"] = "thread.run.step.failed";
|
|
44
|
-
/** Event sent when a run step is cancelled. The data of this event is of type RunStep */
|
|
45
|
-
RunStepStreamEvent["ThreadRunStepCancelled"] = "thread.run.step.cancelled";
|
|
46
|
-
/** Event sent when a run step is expired. The data of this event is of type RunStep */
|
|
47
|
-
RunStepStreamEvent["ThreadRunStepExpired"] = "thread.run.step.expired";
|
|
48
|
-
})(RunStepStreamEvent || (RunStepStreamEvent = {}));
|
|
49
|
-
/** Message operation related streaming events */
|
|
50
|
-
export var MessageStreamEvent;
|
|
51
|
-
(function (MessageStreamEvent) {
|
|
52
|
-
/** Event sent when a new message is created. The data of this event is of type ThreadMessage */
|
|
53
|
-
MessageStreamEvent["ThreadMessageCreated"] = "thread.message.created";
|
|
54
|
-
/** Event sent when a message moves to `in_progress` status. The data of this event is of type ThreadMessage */
|
|
55
|
-
MessageStreamEvent["ThreadMessageInProgress"] = "thread.message.in_progress";
|
|
56
|
-
/** Event sent when a message is being streamed. The data of this event is of type MessageDeltaChunk */
|
|
57
|
-
MessageStreamEvent["ThreadMessageDelta"] = "thread.message.delta";
|
|
58
|
-
/** Event sent when a message is completed. The data of this event is of type ThreadMessage */
|
|
59
|
-
MessageStreamEvent["ThreadMessageCompleted"] = "thread.message.completed";
|
|
60
|
-
/** Event sent before a message is completed. The data of this event is of type ThreadMessage */
|
|
61
|
-
MessageStreamEvent["ThreadMessageIncomplete"] = "thread.message.incomplete";
|
|
62
|
-
})(MessageStreamEvent || (MessageStreamEvent = {}));
|
|
63
|
-
/** Terminal event indicating a server side error while streaming. */
|
|
64
|
-
export var ErrorEvent;
|
|
65
|
-
(function (ErrorEvent) {
|
|
66
|
-
/** Event sent when an error occurs, such as an internal server error or a timeout. */
|
|
67
|
-
ErrorEvent["Error"] = "error";
|
|
68
|
-
})(ErrorEvent || (ErrorEvent = {}));
|
|
69
|
-
/** Terminal event indicating the successful end of a stream. */
|
|
70
|
-
export var DoneEvent;
|
|
71
|
-
(function (DoneEvent) {
|
|
72
|
-
/** Event sent when the stream is done. */
|
|
73
|
-
DoneEvent["Done"] = "done";
|
|
74
|
-
})(DoneEvent || (DoneEvent = {}));
|
|
3
|
+
export {};
|
|
75
4
|
//# sourceMappingURL=streamingModels.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streamingModels.js","sourceRoot":"","sources":["../../../src/models/streamingModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC
|
|
1
|
+
{"version":3,"file":"streamingModels.js","sourceRoot":"","sources":["../../../src/models/streamingModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n AgentStreamEvent,\n AgentThread,\n MessageDeltaChunk,\n RunStep,\n RunStepDeltaChunk,\n ThreadMessage,\n ThreadRun,\n} from \"./models.js\";\n\n/**\nEach event in a server-sent events stream has an `event` and `data` property:\n* \n* @example\n* ``` ts\n* event: thread.created\n* data: {\"id\": \"thread_123\", \"object\": \"thread\", ...}\n* ``` \n* \n* We emit events whenever a new object is created, transitions to a new state, or is being\n* streamed in parts (deltas). For example, we emit `thread.run.created` when a new run\n* is created, `thread.run.completed` when a run completes, and so on. When an Agent chooses\n* to create a message during a run, we emit a `thread.message.created event`, a\n* `thread.message.in_progress` event, many `thread.message.delta` events, and finally a\n* `thread.message.completed` event.\n* \n* We may add additional events over time, so we recommend handling unknown events gracefully\n* in your code.\n**/\nexport interface AgentEventMessage {\n /** The data of the event. The data can be of type AgentThreadOutput, ThreadRunOutput, RunStepOutput, ThreadMessageOutput, MessageDeltaChunk,RunStepDeltaChunk */\n data: AgentEventStreamData;\n /** The type of the event. */\n event: AgentStreamEvent | string;\n}\n\n/** Represents a stream event data in the agent. */\nexport type AgentEventStreamData =\n | AgentThread\n | ThreadRun\n | RunStep\n | ThreadMessage\n | MessageDeltaChunk\n | RunStepDeltaChunk\n | string;\n\n/** Represents a stream of agent event message. */\nexport interface AgentEventMessageStream\n extends AsyncDisposable,\n AsyncIterable<AgentEventMessage> {}\n\n/**\n * Agent run response with support to stream.\n */\nexport type AgentRunResponse = PromiseLike<ThreadRun> & {\n /**\n * Function to start streaming the agent event messages.\n * @returns A promise that resolves to an AgentEventMessageStream.\n */\n stream: () => Promise<AgentEventMessageStream>;\n};\n"]}
|
package/dist/browser/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AzureAISearchToolDefinition, CodeInterpreterToolDefinition, FileSearchToolDefinition, FileSearchToolDefinitionDetails, FunctionDefinition, FunctionToolDefinition, OpenApiToolDefinition, RequiredAction, RequiredToolCall, ToolDefinition, ToolDefinitionUnion, ToolResources, VectorStoreConfigurations, VectorStoreDataSource, OpenApiFunctionDefinition, AISearchIndexResource, BingGroundingToolDefinition, MicrosoftFabricToolDefinition, BingCustomSearchToolDefinition, BingCustomSearchConfiguration, SharepointToolDefinition, BingGroundingSearchConfiguration } from "./index.js";
|
|
1
|
+
import type { AzureAISearchToolDefinition, CodeInterpreterToolDefinition, FileSearchToolDefinition, FileSearchToolDefinitionDetails, FunctionDefinition, FunctionToolDefinition, OpenApiToolDefinition, RequiredAction, RequiredToolCall, ToolDefinition, ToolDefinitionUnion, ToolResources, VectorStoreConfigurations, VectorStoreDataSource, OpenApiFunctionDefinition, AISearchIndexResource, BingGroundingToolDefinition, MicrosoftFabricToolDefinition, BingCustomSearchToolDefinition, BingCustomSearchConfiguration, SharepointToolDefinition, BingGroundingSearchConfiguration, ConnectedAgentToolDefinition } from "./index.js";
|
|
2
2
|
/**
|
|
3
3
|
* Determines if the given output is of the specified type.
|
|
4
4
|
*
|
|
@@ -106,6 +106,14 @@ export declare class ToolUtility {
|
|
|
106
106
|
definition: AzureAISearchToolDefinition;
|
|
107
107
|
resources: ToolResources;
|
|
108
108
|
};
|
|
109
|
+
/**
|
|
110
|
+
* Creates a connected agent tool
|
|
111
|
+
*
|
|
112
|
+
* @returns An object containing the definition for the connected agent tool.
|
|
113
|
+
*/
|
|
114
|
+
static createConnectedAgentTool(id: string, name: string, description: string): {
|
|
115
|
+
definition: ConnectedAgentToolDefinition;
|
|
116
|
+
};
|
|
109
117
|
/**
|
|
110
118
|
* Creates a Microsoft Fabric tool
|
|
111
119
|
*
|
|
@@ -212,6 +220,17 @@ export declare class ToolSet {
|
|
|
212
220
|
addBingGroundingTool(searchConfigurations: BingGroundingSearchConfiguration[]): {
|
|
213
221
|
definition: BingGroundingToolDefinition;
|
|
214
222
|
};
|
|
223
|
+
/**
|
|
224
|
+
* Adds a connected agent tool to the tool set.
|
|
225
|
+
*
|
|
226
|
+
* @param id - The ID of the connected agent.
|
|
227
|
+
* @param name - The name of the connected agent.
|
|
228
|
+
* @param description - The description of the connected agent.
|
|
229
|
+
* @returns An object containing the definition for the connected agent tool
|
|
230
|
+
*/
|
|
231
|
+
addConnectedAgentTool(id: string, name: string, description: string): {
|
|
232
|
+
definition: ConnectedAgentToolDefinition;
|
|
233
|
+
};
|
|
215
234
|
/**
|
|
216
235
|
* Adds a Microsoft Fabric tool to the tool set.
|
|
217
236
|
*
|
|
@@ -1 +1 @@
|
|
|
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,6BAA6B,EAC7B,8BAA8B,EAC9B,6BAA6B,EAC7B,wBAAwB,EACxB,gCAAgC,
|
|
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,6BAA6B,EAC7B,8BAA8B,EAC9B,6BAA6B,EAC7B,wBAAwB,EACxB,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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aAAa,CAAA;KAAE;IAOrE;;;;;;;OAOG;IACH,sBAAsB,CACpB,OAAO,CAAC,EAAE,MAAM,EAAE,EAClB,WAAW,CAAC,EAAE,KAAK,CAAC,qBAAqB,CAAC,GACzC;QAAE,UAAU,EAAE,6BAA6B,CAAC;QAAC,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"}
|
package/dist/browser/utils.js
CHANGED
|
@@ -84,11 +84,13 @@ export class ToolUtility {
|
|
|
84
84
|
*
|
|
85
85
|
*/
|
|
86
86
|
static createBingGroundingTool(searchConfigurations) {
|
|
87
|
+
// Ensure searchConfigurations is an array even if it's undefined
|
|
88
|
+
const configs = searchConfigurations || [];
|
|
87
89
|
return {
|
|
88
90
|
definition: {
|
|
89
91
|
type: "bing_grounding",
|
|
90
92
|
bingGrounding: {
|
|
91
|
-
searchConfigurations:
|
|
93
|
+
searchConfigurations: configs.map((searchConfiguration) => ({
|
|
92
94
|
connectionId: searchConfiguration.connectionId,
|
|
93
95
|
market: searchConfiguration === null || searchConfiguration === void 0 ? void 0 : searchConfiguration.market,
|
|
94
96
|
setLang: searchConfiguration === null || searchConfiguration === void 0 ? void 0 : searchConfiguration.setLang,
|
|
@@ -177,6 +179,23 @@ export class ToolUtility {
|
|
|
177
179
|
},
|
|
178
180
|
};
|
|
179
181
|
}
|
|
182
|
+
/**
|
|
183
|
+
* Creates a connected agent tool
|
|
184
|
+
*
|
|
185
|
+
* @returns An object containing the definition for the connected agent tool.
|
|
186
|
+
*/
|
|
187
|
+
static createConnectedAgentTool(id, name, description) {
|
|
188
|
+
return {
|
|
189
|
+
definition: {
|
|
190
|
+
type: "connected_agent",
|
|
191
|
+
connectedAgent: {
|
|
192
|
+
id: id,
|
|
193
|
+
name: name,
|
|
194
|
+
description: description,
|
|
195
|
+
},
|
|
196
|
+
},
|
|
197
|
+
};
|
|
198
|
+
}
|
|
180
199
|
/**
|
|
181
200
|
* Creates a Microsoft Fabric tool
|
|
182
201
|
*
|
|
@@ -320,6 +339,19 @@ export class ToolSet {
|
|
|
320
339
|
this.toolDefinitions.push(tool.definition);
|
|
321
340
|
return tool;
|
|
322
341
|
}
|
|
342
|
+
/**
|
|
343
|
+
* Adds a connected agent tool to the tool set.
|
|
344
|
+
*
|
|
345
|
+
* @param id - The ID of the connected agent.
|
|
346
|
+
* @param name - The name of the connected agent.
|
|
347
|
+
* @param description - The description of the connected agent.
|
|
348
|
+
* @returns An object containing the definition for the connected agent tool
|
|
349
|
+
*/
|
|
350
|
+
addConnectedAgentTool(id, name, description) {
|
|
351
|
+
const tool = ToolUtility.createConnectedAgentTool(id, name, description);
|
|
352
|
+
this.toolDefinitions.push(tool.definition);
|
|
353
|
+
return tool;
|
|
354
|
+
}
|
|
323
355
|
/**
|
|
324
356
|
* Adds a Microsoft Fabric tool to the tool set.
|
|
325
357
|
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AAW,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 BingGroundingToolDefinition,\n MicrosoftFabricToolDefinition,\n BingCustomSearchToolDefinition,\n BingCustomSearchConfiguration,\n SharepointToolDefinition,\n BingGroundingSearchConfiguration,\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 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 return {\n definition: {\n type: \"bing_grounding\",\n bingGrounding: {\n searchConfigurations: searchConfigurations.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 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/**\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 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"]}
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AA4BlC;;;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oB,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;IAED;;;;;OAKG;IACH,aAAa,CAAC,YAAoB;QAChC,MAAM,IAAI,GAAG,WAAW,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC;QACxD,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC3C,OAAO,IAAI,CAAC;IACd,CAAC;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 BingGroundingToolDefinition,\n MicrosoftFabricToolDefinition,\n BingCustomSearchToolDefinition,\n BingCustomSearchConfiguration,\n SharepointToolDefinition,\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 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/**\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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agentsContext.d.ts","sourceRoot":"","sources":["../../../src/api/agentsContext.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,aAAa,EAAa,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAmB,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnF,MAAM,WAAW,aAAc,SAAQ,MAAM;IAC3C,iDAAiD;IACjD,sEAAsE;IACtE,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,0CAA0C;AAC1C,MAAM,WAAW,0BAA2B,SAAQ,aAAa;IAC/D,iDAAiD;IACjD,sEAAsE;IACtE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,YAAY,CAC1B,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,aAAa,GAAG,eAAe,EAC3C,OAAO,GAAE,0BAA+B,GACvC,aAAa,
|
|
1
|
+
{"version":3,"file":"agentsContext.d.ts","sourceRoot":"","sources":["../../../src/api/agentsContext.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,aAAa,EAAa,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAmB,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnF,MAAM,WAAW,aAAc,SAAQ,MAAM;IAC3C,iDAAiD;IACjD,sEAAsE;IACtE,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,0CAA0C;AAC1C,MAAM,WAAW,0BAA2B,SAAQ,aAAa;IAC/D,iDAAiD;IACjD,sEAAsE;IACtE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,YAAY,CAC1B,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,aAAa,GAAG,eAAe,EAC3C,OAAO,GAAE,0BAA+B,GACvC,aAAa,CA4Cf"}
|
|
@@ -10,7 +10,7 @@ const core_auth_1 = require("@azure/core-auth");
|
|
|
10
10
|
function createAgents(endpointParam, credential, options = {}) {
|
|
11
11
|
var _a, _b, _c, _d, _e, _f;
|
|
12
12
|
const prefixFromOptions = (_a = options === null || options === void 0 ? void 0 : options.userAgentOptions) === null || _a === void 0 ? void 0 : _a.userAgentPrefix;
|
|
13
|
-
const userAgentInfo = `azsdk-js-ai-agents/1.0.0-beta.
|
|
13
|
+
const userAgentInfo = `azsdk-js-ai-agents/1.0.0-beta.4`;
|
|
14
14
|
const userAgentPrefix = prefixFromOptions
|
|
15
15
|
? `${prefixFromOptions} azsdk-js-api ${userAgentInfo}`
|
|
16
16
|
: `azsdk-js-api ${userAgentInfo}`;
|
|
@@ -32,12 +32,15 @@ function createAgents(endpointParam, credential, options = {}) {
|
|
|
32
32
|
clientContext.pipeline.addPolicy({
|
|
33
33
|
name: "ClientApiVersionPolicy",
|
|
34
34
|
sendRequest: (req, next) => {
|
|
35
|
+
var _a;
|
|
35
36
|
// Use the apiVersion defined in request url directly
|
|
36
37
|
// Append one if there is no apiVersion and we have one at client options
|
|
37
38
|
const url = new URL(req.url);
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
const defaultApiVersion = (_a = url.searchParams.get("api-version")) !== null && _a !== void 0 ? _a : apiVersion;
|
|
40
|
+
// remove api-version from url
|
|
41
|
+
url.searchParams.delete("api-version");
|
|
42
|
+
// add api-version to url
|
|
43
|
+
req.url = `${url.toString()}${Array.from(url.searchParams.keys()).length > 0 ? "&" : "?"}api-version=${defaultApiVersion}`;
|
|
41
44
|
return next(req);
|
|
42
45
|
},
|
|
43
46
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agentsContext.js","sourceRoot":"","sources":["../../../src/api/agentsContext.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAoBlC,
|
|
1
|
+
{"version":3,"file":"agentsContext.js","sourceRoot":"","sources":["../../../src/api/agentsContext.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAoBlC,oCAgDC;;AAlED,4CAAsC;AAEtC,yDAA2E;AAC3E,gDAAmF;AAenF,SAAgB,YAAY,CAC1B,aAAqB,EACrB,UAA2C,EAC3C,UAAsC,EAAE;;IAExC,MAAM,iBAAiB,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,gBAAgB,0CAAE,eAAe,CAAC;IACrE,MAAM,aAAa,GAAG,iCAAiC,CAAC;IACxD,MAAM,eAAe,GAAG,iBAAiB;QACvC,CAAC,CAAC,GAAG,iBAAiB,iBAAiB,aAAa,EAAE;QACtD,CAAC,CAAC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,GAAG,MAAA,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,aAAa,CAAC,mCAAI,UAAU,CAAC;YAC5E,8BAA8B;YAC9B,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;YACvC,yBAAyB;YACzB,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,QAAQ,EAAE,GACzB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GACzD,eAAe,iBAAiB,EAAE,CAAC;YACnC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;KACF,CAAC,CAAC;IACH,OAAO,gCAAK,aAAa,KAAE,UAAU,GAAmB,CAAC;AAC3D,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { logger } from \"../logger.js\";\nimport { KnownVersions } from \"../models/models.js\";\nimport { Client, ClientOptions, getClient } from \"@azure-rest/core-client\";\nimport { KeyCredential, isKeyCredential, TokenCredential } from \"@azure/core-auth\";\n\nexport interface AgentsContext extends Client {\n /** The API version to use for this operation. */\n /** Known values of {@link KnownVersions} that the service accepts. */\n apiVersion: string;\n}\n\n/** Optional parameters for the client. */\nexport interface AgentsClientOptionalParams extends ClientOptions {\n /** The API version to use for this operation. */\n /** Known values of {@link KnownVersions} that the service accepts. */\n apiVersion?: string;\n}\n\nexport function createAgents(\n endpointParam: string,\n credential: KeyCredential | TokenCredential,\n options: AgentsClientOptionalParams = {},\n): AgentsContext {\n const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;\n const userAgentInfo = `azsdk-js-ai-agents/1.0.0-beta.4`;\n const userAgentPrefix = prefixFromOptions\n ? `${prefixFromOptions} azsdk-js-api ${userAgentInfo}`\n : `azsdk-js-api ${userAgentInfo}`;\n const { apiVersion: _, ...updatedOptions } = {\n ...options,\n userAgentOptions: { userAgentPrefix },\n loggingOptions: { logger: options.loggingOptions?.logger ?? logger.info },\n credentials: {\n scopes: options.credentials?.scopes ?? [\"https://ai.azure.com/.default\"],\n },\n };\n const clientContext = getClient(endpointParam, credential, updatedOptions);\n\n if (isKeyCredential(credential)) {\n clientContext.pipeline.addPolicy({\n name: \"customKeyCredentialPolicy\",\n sendRequest(request, next) {\n request.headers.set(\"Authorization\", \"Bearer \" + credential.key);\n return next(request);\n },\n });\n }\n clientContext.pipeline.removePolicy({ name: \"ApiVersionPolicy\" });\n const apiVersion = options.apiVersion ?? \"2025-05-15-preview\";\n clientContext.pipeline.addPolicy({\n name: \"ClientApiVersionPolicy\",\n sendRequest: (req, next) => {\n // Use the apiVersion defined in request url directly\n // Append one if there is no apiVersion and we have one at client options\n const url = new URL(req.url);\n const defaultApiVersion = url.searchParams.get(\"api-version\") ?? apiVersion;\n // remove api-version from url\n url.searchParams.delete(\"api-version\");\n // add api-version to url\n req.url = `${url.toString()}${\n Array.from(url.searchParams.keys()).length > 0 ? \"&\" : \"?\"\n }api-version=${defaultApiVersion}`;\n return next(req);\n },\n });\n return { ...clientContext, apiVersion } as AgentsContext;\n}\n"]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { AgentsContext as Client } from "./index.js";
|
|
2
|
-
import { Agent, _AgentsPagedResultAgent, AgentDeletionStatus, ThreadRun } from "../models/models.js";
|
|
2
|
+
import { Agent, _AgentsPagedResultAgent, AgentDeletionStatus, ThreadRun, ToolOutput } from "../models/models.js";
|
|
3
3
|
import { CreateThreadAndRunOptionalParams, DeleteAgentOptionalParams, UpdateAgentOptionalParams, GetAgentOptionalParams, ListAgentsOptionalParams, CreateAgentOptionalParams } from "./options.js";
|
|
4
4
|
import { PagedAsyncIterableIterator } from "../static-helpers/pagingHelpers.js";
|
|
5
5
|
import { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client";
|
|
6
6
|
import { AgentEventMessageStream, AgentRunResponse } from "../models/streamingModels.js";
|
|
7
|
-
import { RunsCreateRunOptionalParams, RunsSubmitToolOutputsToRunOptionalParams } from "./runs/options.js";
|
|
7
|
+
import type { RunsCreateRunOptionalParams, RunsSubmitToolOutputsToRunOptionalParams } from "./runs/options.js";
|
|
8
8
|
export declare function _createThreadAndRunSend(context: Client, assistantId: string, options?: CreateThreadAndRunOptionalParams): StreamableMethod;
|
|
9
9
|
export declare function _createThreadAndRunDeserialize(result: PathUncheckedResponse): Promise<ThreadRun>;
|
|
10
10
|
/** Creates a new agent thread and immediately starts a run using that new thread. */
|
|
@@ -33,5 +33,5 @@ export declare function createAgent(context: Client, model: string, options?: Cr
|
|
|
33
33
|
export declare function createRunStreaming(context: Client, assistantId: string, threadId: string, options?: RunsCreateRunOptionalParams): Promise<AgentEventMessageStream>;
|
|
34
34
|
/** Create a thread and run and stream the events */
|
|
35
35
|
export declare function createThreadAndRunStreaming(context: Client, assistantId: string, options?: CreateThreadAndRunOptionalParams): Promise<AgentEventMessageStream>;
|
|
36
|
-
export declare function submitToolOutputsToRunStreaming(context: Client, threadId: string, runId: string, options?: RunsSubmitToolOutputsToRunOptionalParams): Promise<AgentEventMessageStream>;
|
|
36
|
+
export declare function submitToolOutputsToRunStreaming(context: Client, threadId: string, runId: string, toolOutputs: ToolOutput[], options?: RunsSubmitToolOutputsToRunOptionalParams): Promise<AgentEventMessageStream>;
|
|
37
37
|
//# sourceMappingURL=operations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../../src/api/operations.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,IAAI,MAAM,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAIL,KAAK,EAEL,uBAAuB,EAEvB,mBAAmB,EAMnB,SAAS,
|
|
1
|
+
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../../src/api/operations.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,IAAI,MAAM,EAA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AO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,yBAAkD,GAC1D,OAAO,CAAC,KAAK,CAAC,CAGhB;AAmED,yCAAyC;AACzC,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,2BAAoD,GAC5D,OAAO,CAAC,uBAAuB,CAAC,CAIlC;AAED,oDAAoD;AACpD,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,gCAAyD,GACjE,OAAO,CAAC,uBAAuB,CAAC,CAGlC;AAED,wBAAsB,+BAA+B,CACnD,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,UAAU,EAAE,EACzB,OAAO,GAAE,wCAAiE,GACzE,OAAO,CAAC,uBAAuB,CAAC,CAMlC"}
|
|
@@ -28,7 +28,6 @@ const models_js_1 = require("../models/models.js");
|
|
|
28
28
|
const pagingHelpers_js_1 = require("../static-helpers/pagingHelpers.js");
|
|
29
29
|
const urlTemplate_js_1 = require("../static-helpers/urlTemplate.js");
|
|
30
30
|
const core_client_1 = require("@azure-rest/core-client");
|
|
31
|
-
const streamingModels_js_1 = require("../models/streamingModels.js");
|
|
32
31
|
const core_sse_1 = require("@azure/core-sse");
|
|
33
32
|
const core_util_1 = require("@azure/core-util");
|
|
34
33
|
const logger_js_1 = require("../logger.js");
|
|
@@ -233,10 +232,10 @@ async function createAgent(context, model, options = { requestOptions: {} }) {
|
|
|
233
232
|
return _createAgentDeserialize(result);
|
|
234
233
|
}
|
|
235
234
|
const handlers = [
|
|
236
|
-
{ events: Object.values(
|
|
237
|
-
{ events: Object.values(
|
|
238
|
-
{ events: Object.values(
|
|
239
|
-
{ events: Object.values(
|
|
235
|
+
{ events: Object.values(models_js_1.ThreadStreamEvent) },
|
|
236
|
+
{ events: Object.values(models_js_1.RunStreamEvent) },
|
|
237
|
+
{ events: Object.values(models_js_1.RunStepStreamEvent) },
|
|
238
|
+
{ events: Object.values(models_js_1.MessageStreamEvent) },
|
|
240
239
|
];
|
|
241
240
|
function createAgentStream(stream) {
|
|
242
241
|
const asyncIterator = toAsyncIterable(stream);
|
|
@@ -267,11 +266,14 @@ function toAsyncIterable(stream) {
|
|
|
267
266
|
function deserializeEventData(event) {
|
|
268
267
|
try {
|
|
269
268
|
const jsonData = JSON.parse(event.data);
|
|
269
|
+
if (Object.values(models_js_1.RunStreamEvent).includes(event.event)) {
|
|
270
|
+
return (0, models_js_1.threadRunDeserializer)(jsonData);
|
|
271
|
+
}
|
|
270
272
|
switch (event.event) {
|
|
271
|
-
case
|
|
272
|
-
return jsonData;
|
|
273
|
-
case
|
|
274
|
-
return jsonData;
|
|
273
|
+
case models_js_1.MessageStreamEvent.ThreadMessageDelta:
|
|
274
|
+
return (0, models_js_1.threadMessageDeserializer)(jsonData);
|
|
275
|
+
case models_js_1.RunStepStreamEvent.ThreadRunStepDelta:
|
|
276
|
+
return (0, models_js_1.runStepDeserializer)(jsonData);
|
|
275
277
|
default: {
|
|
276
278
|
for (const { events } of handlers) {
|
|
277
279
|
if (events.includes(event.event)) {
|
|
@@ -305,18 +307,16 @@ async function processStream(streamResponse) {
|
|
|
305
307
|
}
|
|
306
308
|
/** Create a run and stream the events */
|
|
307
309
|
async function createRunStreaming(context, assistantId, threadId, options = { requestOptions: {} }) {
|
|
308
|
-
options
|
|
309
|
-
return processStream((0, operations_js_1._createRunSend)(context, threadId, assistantId,
|
|
310
|
+
const streamOptions = Object.assign(Object.assign({}, options), { stream: true });
|
|
311
|
+
return processStream((0, operations_js_1._createRunSend)(context, threadId, assistantId, streamOptions));
|
|
310
312
|
}
|
|
311
313
|
/** Create a thread and run and stream the events */
|
|
312
314
|
async function createThreadAndRunStreaming(context, assistantId, options = { requestOptions: {} }) {
|
|
313
|
-
options
|
|
314
|
-
return processStream(_createThreadAndRunSend(context, assistantId,
|
|
315
|
+
const streamOptions = Object.assign(Object.assign({}, options), { stream: true });
|
|
316
|
+
return processStream(_createThreadAndRunSend(context, assistantId, streamOptions));
|
|
315
317
|
}
|
|
316
|
-
async function submitToolOutputsToRunStreaming(context, threadId, runId, options = { requestOptions: {} }) {
|
|
317
|
-
options
|
|
318
|
-
return processStream(context
|
|
319
|
-
.path("/threads/{threadId}/runs/{runId}/submit_tool_outputs", threadId, runId)
|
|
320
|
-
.post(options));
|
|
318
|
+
async function submitToolOutputsToRunStreaming(context, threadId, runId, toolOutputs, options = { requestOptions: {} }) {
|
|
319
|
+
const streamOptions = Object.assign(Object.assign({}, options), { stream: true });
|
|
320
|
+
return processStream((0, operations_js_1._submitToolOutputsToRunSend)(context, threadId, runId, toolOutputs, streamOptions));
|
|
321
321
|
}
|
|
322
322
|
//# sourceMappingURL=operations.js.map
|