@azure/ai-projects 2.8.0 → 2.9.0
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 +73 -5
- package/dist/browser/aiProjectClient.d.ts.map +1 -1
- package/dist/browser/aiProjectClient.js +1 -1
- package/dist/browser/aiProjectClient.js.map +1 -1
- package/dist/browser/classic/beta/agents/index.d.ts +2 -1
- package/dist/browser/classic/beta/agents/index.d.ts.map +1 -1
- package/dist/browser/classic/beta/agents/index.js +3 -2
- package/dist/browser/classic/beta/agents/index.js.map +1 -1
- package/dist/browser/classic/beta/index.d.ts +2 -1
- package/dist/browser/classic/beta/index.d.ts.map +1 -1
- package/dist/browser/classic/beta/index.js +3 -3
- package/dist/browser/classic/beta/index.js.map +1 -1
- package/dist/browser/classic/beta/voiceAgents/conversations/index.d.ts +2 -1
- package/dist/browser/classic/beta/voiceAgents/conversations/index.d.ts.map +1 -1
- package/dist/browser/classic/beta/voiceAgents/conversations/index.js +5 -4
- package/dist/browser/classic/beta/voiceAgents/conversations/index.js.map +1 -1
- package/dist/browser/classic/beta/voiceAgents/index.d.ts +3 -2
- package/dist/browser/classic/beta/voiceAgents/index.d.ts.map +1 -1
- package/dist/browser/classic/beta/voiceAgents/index.js +5 -5
- package/dist/browser/classic/beta/voiceAgents/index.js.map +1 -1
- package/dist/browser/classic/beta/voiceAgents/telephony/index.d.ts +2 -1
- package/dist/browser/classic/beta/voiceAgents/telephony/index.d.ts.map +1 -1
- package/dist/browser/classic/beta/voiceAgents/telephony/index.js +16 -11
- package/dist/browser/classic/beta/voiceAgents/telephony/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/index.d.ts +1 -1
- package/dist/browser/index.d.ts.map +1 -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 +203 -158
- package/dist/browser/models/models.d.ts.map +1 -1
- package/dist/browser/models/models.js +129 -120
- package/dist/browser/models/models.js.map +1 -1
- package/dist/browser/package.json +1 -1
- package/dist/browser/realtime/voiceAgentRealtimeClient.d.ts +3 -0
- package/dist/browser/realtime/voiceAgentRealtimeClient.d.ts.map +1 -1
- package/dist/browser/realtime/voiceAgentRealtimeClient.js +39 -8
- package/dist/browser/realtime/voiceAgentRealtimeClient.js.map +1 -1
- package/dist/browser/tracing/configuration.d.ts +3 -5
- package/dist/browser/tracing/configuration.d.ts.map +1 -1
- package/dist/browser/tracing/configuration.js +8 -6
- package/dist/browser/tracing/configuration.js.map +1 -1
- package/dist/browser/tracing/tracingClient.d.ts +1 -1
- package/dist/browser/tracing/tracingClient.d.ts.map +1 -1
- package/dist/browser/tracing/tracingClient.js +2 -2
- package/dist/browser/tracing/tracingClient.js.map +1 -1
- package/dist/browser/tracing/voiceAgentTracing.d.ts +63 -0
- package/dist/browser/tracing/voiceAgentTracing.d.ts.map +1 -0
- package/dist/browser/tracing/voiceAgentTracing.js +740 -0
- package/dist/browser/tracing/voiceAgentTracing.js.map +1 -0
- package/dist/commonjs/aiProjectClient.d.ts.map +1 -1
- package/dist/commonjs/aiProjectClient.js +2 -1
- package/dist/commonjs/aiProjectClient.js.map +2 -2
- package/dist/commonjs/classic/beta/agents/index.d.ts +2 -1
- package/dist/commonjs/classic/beta/agents/index.d.ts.map +1 -1
- package/dist/commonjs/classic/beta/agents/index.js +9 -2
- package/dist/commonjs/classic/beta/agents/index.js.map +2 -2
- package/dist/commonjs/classic/beta/index.d.ts +2 -1
- package/dist/commonjs/classic/beta/index.d.ts.map +1 -1
- package/dist/commonjs/classic/beta/index.js +9 -3
- package/dist/commonjs/classic/beta/index.js.map +2 -2
- package/dist/commonjs/classic/beta/voiceAgents/conversations/index.d.ts +2 -1
- package/dist/commonjs/classic/beta/voiceAgents/conversations/index.d.ts.map +1 -1
- package/dist/commonjs/classic/beta/voiceAgents/conversations/index.js +10 -4
- package/dist/commonjs/classic/beta/voiceAgents/conversations/index.js.map +2 -2
- package/dist/commonjs/classic/beta/voiceAgents/index.d.ts +3 -2
- package/dist/commonjs/classic/beta/voiceAgents/index.d.ts.map +1 -1
- package/dist/commonjs/classic/beta/voiceAgents/index.js +4 -4
- package/dist/commonjs/classic/beta/voiceAgents/index.js.map +2 -2
- package/dist/commonjs/classic/beta/voiceAgents/telephony/index.d.ts +2 -1
- package/dist/commonjs/classic/beta/voiceAgents/telephony/index.d.ts.map +1 -1
- package/dist/commonjs/classic/beta/voiceAgents/telephony/index.js +33 -11
- package/dist/commonjs/classic/beta/voiceAgents/telephony/index.js.map +2 -2
- 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/index.d.ts +1 -1
- package/dist/commonjs/index.d.ts.map +1 -1
- 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 +203 -158
- package/dist/commonjs/models/models.d.ts.map +1 -1
- package/dist/commonjs/models/models.js +145 -106
- package/dist/commonjs/models/models.js.map +2 -2
- package/dist/commonjs/package.json +1 -1
- package/dist/commonjs/realtime/voiceAgentRealtimeClient.d.ts +3 -0
- package/dist/commonjs/realtime/voiceAgentRealtimeClient.d.ts.map +1 -1
- package/dist/commonjs/realtime/voiceAgentRealtimeClient.js +45 -17
- package/dist/commonjs/realtime/voiceAgentRealtimeClient.js.map +2 -2
- package/dist/commonjs/tracing/configuration.d.ts +3 -5
- package/dist/commonjs/tracing/configuration.d.ts.map +1 -1
- package/dist/commonjs/tracing/configuration.js +5 -1
- package/dist/commonjs/tracing/configuration.js.map +2 -2
- package/dist/commonjs/tracing/tracingClient.d.ts +1 -1
- package/dist/commonjs/tracing/tracingClient.d.ts.map +1 -1
- package/dist/commonjs/tracing/tracingClient.js +2 -2
- package/dist/commonjs/tracing/tracingClient.js.map +2 -2
- package/dist/commonjs/tracing/voiceAgentTracing.d.ts +63 -0
- package/dist/commonjs/tracing/voiceAgentTracing.d.ts.map +1 -0
- package/dist/commonjs/tracing/voiceAgentTracing.js +705 -0
- package/dist/commonjs/tracing/voiceAgentTracing.js.map +7 -0
- package/dist/commonjs/tsdoc-metadata.json +1 -1
- package/dist/esm/aiProjectClient.d.ts.map +1 -1
- package/dist/esm/aiProjectClient.js +1 -1
- package/dist/esm/aiProjectClient.js.map +1 -1
- package/dist/esm/classic/beta/agents/index.d.ts +2 -1
- package/dist/esm/classic/beta/agents/index.d.ts.map +1 -1
- package/dist/esm/classic/beta/agents/index.js +3 -2
- package/dist/esm/classic/beta/agents/index.js.map +1 -1
- package/dist/esm/classic/beta/index.d.ts +2 -1
- package/dist/esm/classic/beta/index.d.ts.map +1 -1
- package/dist/esm/classic/beta/index.js +3 -3
- package/dist/esm/classic/beta/index.js.map +1 -1
- package/dist/esm/classic/beta/voiceAgents/conversations/index.d.ts +2 -1
- package/dist/esm/classic/beta/voiceAgents/conversations/index.d.ts.map +1 -1
- package/dist/esm/classic/beta/voiceAgents/conversations/index.js +5 -4
- package/dist/esm/classic/beta/voiceAgents/conversations/index.js.map +1 -1
- package/dist/esm/classic/beta/voiceAgents/index.d.ts +3 -2
- package/dist/esm/classic/beta/voiceAgents/index.d.ts.map +1 -1
- package/dist/esm/classic/beta/voiceAgents/index.js +5 -5
- package/dist/esm/classic/beta/voiceAgents/index.js.map +1 -1
- package/dist/esm/classic/beta/voiceAgents/telephony/index.d.ts +2 -1
- package/dist/esm/classic/beta/voiceAgents/telephony/index.d.ts.map +1 -1
- package/dist/esm/classic/beta/voiceAgents/telephony/index.js +16 -11
- package/dist/esm/classic/beta/voiceAgents/telephony/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/index.d.ts +1 -1
- package/dist/esm/index.d.ts.map +1 -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 +203 -158
- package/dist/esm/models/models.d.ts.map +1 -1
- package/dist/esm/models/models.js +129 -120
- package/dist/esm/models/models.js.map +1 -1
- package/dist/esm/package.json +1 -1
- package/dist/esm/realtime/voiceAgentRealtimeClient.d.ts +3 -0
- package/dist/esm/realtime/voiceAgentRealtimeClient.d.ts.map +1 -1
- package/dist/esm/realtime/voiceAgentRealtimeClient.js +39 -8
- package/dist/esm/realtime/voiceAgentRealtimeClient.js.map +1 -1
- package/dist/esm/tracing/configuration.d.ts +3 -5
- package/dist/esm/tracing/configuration.d.ts.map +1 -1
- package/dist/esm/tracing/configuration.js +8 -6
- package/dist/esm/tracing/configuration.js.map +1 -1
- package/dist/esm/tracing/tracingClient.d.ts +1 -1
- package/dist/esm/tracing/tracingClient.d.ts.map +1 -1
- package/dist/esm/tracing/tracingClient.js +2 -2
- package/dist/esm/tracing/tracingClient.js.map +1 -1
- package/dist/esm/tracing/voiceAgentTracing.d.ts +63 -0
- package/dist/esm/tracing/voiceAgentTracing.d.ts.map +1 -0
- package/dist/esm/tracing/voiceAgentTracing.js +740 -0
- package/dist/esm/tracing/voiceAgentTracing.js.map +1 -0
- package/dist/react-native/aiProjectClient.d.ts.map +1 -1
- package/dist/react-native/aiProjectClient.js +1 -1
- package/dist/react-native/aiProjectClient.js.map +1 -1
- package/dist/react-native/classic/beta/agents/index.d.ts +2 -1
- package/dist/react-native/classic/beta/agents/index.d.ts.map +1 -1
- package/dist/react-native/classic/beta/agents/index.js +3 -2
- package/dist/react-native/classic/beta/agents/index.js.map +1 -1
- package/dist/react-native/classic/beta/index.d.ts +2 -1
- package/dist/react-native/classic/beta/index.d.ts.map +1 -1
- package/dist/react-native/classic/beta/index.js +3 -3
- package/dist/react-native/classic/beta/index.js.map +1 -1
- package/dist/react-native/classic/beta/voiceAgents/conversations/index.d.ts +2 -1
- package/dist/react-native/classic/beta/voiceAgents/conversations/index.d.ts.map +1 -1
- package/dist/react-native/classic/beta/voiceAgents/conversations/index.js +5 -4
- package/dist/react-native/classic/beta/voiceAgents/conversations/index.js.map +1 -1
- package/dist/react-native/classic/beta/voiceAgents/index.d.ts +3 -2
- package/dist/react-native/classic/beta/voiceAgents/index.d.ts.map +1 -1
- package/dist/react-native/classic/beta/voiceAgents/index.js +5 -5
- package/dist/react-native/classic/beta/voiceAgents/index.js.map +1 -1
- package/dist/react-native/classic/beta/voiceAgents/telephony/index.d.ts +2 -1
- package/dist/react-native/classic/beta/voiceAgents/telephony/index.d.ts.map +1 -1
- package/dist/react-native/classic/beta/voiceAgents/telephony/index.js +16 -11
- package/dist/react-native/classic/beta/voiceAgents/telephony/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/index.d.ts +1 -1
- package/dist/react-native/index.d.ts.map +1 -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 +203 -158
- package/dist/react-native/models/models.d.ts.map +1 -1
- package/dist/react-native/models/models.js +129 -120
- package/dist/react-native/models/models.js.map +1 -1
- package/dist/react-native/package.json +1 -1
- package/dist/react-native/realtime/voiceAgentRealtimeClient.d.ts +3 -0
- package/dist/react-native/realtime/voiceAgentRealtimeClient.d.ts.map +1 -1
- package/dist/react-native/realtime/voiceAgentRealtimeClient.js +39 -8
- package/dist/react-native/realtime/voiceAgentRealtimeClient.js.map +1 -1
- package/dist/react-native/tracing/configuration.d.ts +3 -5
- package/dist/react-native/tracing/configuration.d.ts.map +1 -1
- package/dist/react-native/tracing/configuration.js +8 -6
- package/dist/react-native/tracing/configuration.js.map +1 -1
- package/dist/react-native/tracing/tracingClient.d.ts +1 -1
- package/dist/react-native/tracing/tracingClient.d.ts.map +1 -1
- package/dist/react-native/tracing/tracingClient.js +2 -2
- package/dist/react-native/tracing/tracingClient.js.map +1 -1
- package/dist/react-native/tracing/voiceAgentTracing.d.ts +63 -0
- package/dist/react-native/tracing/voiceAgentTracing.d.ts.map +1 -0
- package/dist/react-native/tracing/voiceAgentTracing.js +740 -0
- package/dist/react-native/tracing/voiceAgentTracing.js.map +1 -0
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@ resources in your Microsoft Foundry Project. Use it to:
|
|
|
11
11
|
- Azure AI Search
|
|
12
12
|
- Bing Custom Search (Preview)
|
|
13
13
|
- Bing Grounding
|
|
14
|
-
- Browser Automation
|
|
14
|
+
- Browser Automation
|
|
15
15
|
- Code Interpreter
|
|
16
16
|
- Computer Use (Preview)
|
|
17
17
|
- File Search
|
|
@@ -838,12 +838,13 @@ console.log(`Agent created (id: ${agent.id}, name: ${agent.name}, version: ${age
|
|
|
838
838
|
|
|
839
839
|
See the full sample code in [agentSharepoint.ts](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/ai/ai-projects/samples-dev/agents/tools/agentSharepoint.ts).
|
|
840
840
|
|
|
841
|
-
**Browser Automation
|
|
841
|
+
**Browser Automation**
|
|
842
842
|
|
|
843
843
|
Automate browser interactions for web scraping, testing, and interaction with web applications:
|
|
844
844
|
|
|
845
845
|
```ts snippet:agent-browser-automation
|
|
846
|
-
const browserAutomationProjectConnectionId =
|
|
846
|
+
const browserAutomationProjectConnectionId =
|
|
847
|
+
process.env["BROWSER_AUTOMATION_PROJECT_CONNECTION_ID"] || "";
|
|
847
848
|
const agent = await project.agents.createVersion("MyAgent", {
|
|
848
849
|
kind: "prompt",
|
|
849
850
|
model: deploymentName,
|
|
@@ -853,8 +854,8 @@ const agent = await project.agents.createVersion("MyAgent", {
|
|
|
853
854
|
// Define Browser Automation tool
|
|
854
855
|
tools: [
|
|
855
856
|
{
|
|
856
|
-
type: "
|
|
857
|
-
|
|
857
|
+
type: "browser_automation",
|
|
858
|
+
browser_automation: {
|
|
858
859
|
connection: {
|
|
859
860
|
project_connection_id: browserAutomationProjectConnectionId,
|
|
860
861
|
},
|
|
@@ -867,6 +868,20 @@ console.log(`Agent created (id: ${agent.id}, name: ${agent.name}, version: ${age
|
|
|
867
868
|
|
|
868
869
|
See the full sample code in [agentBrowserAutomation.ts](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/ai/ai-projects/samples-dev/agents/tools/agentBrowserAutomation.ts).
|
|
869
870
|
|
|
871
|
+
Set `FOUNDRY_PROJECT_ENDPOINT`, `FOUNDRY_MODEL_NAME`, and
|
|
872
|
+
`BROWSER_AUTOMATION_PROJECT_CONNECTION_ID` (the project connection resource ID for
|
|
873
|
+
your Azure Playwright resource) before running the sample. It uses the GA
|
|
874
|
+
`browser_automation` tool to visit `https://example.com` and report the page title
|
|
875
|
+
and visible description based on browser results. Optionally set `FOUNDRY_AGENT_NAME`
|
|
876
|
+
to choose the agent name; it defaults to `MyAgent`.
|
|
877
|
+
|
|
878
|
+
The streaming sample prints each completed text message once, including the
|
|
879
|
+
browser live-view URL, and logs remote function action names, call IDs, and
|
|
880
|
+
arguments without `browserSessionId`. Treat the live-view URL as sensitive: do not
|
|
881
|
+
share it or commit it to source control. Failed or incomplete responses exit with
|
|
882
|
+
a nonzero status instead of reporting success. The sample deletes the agent version
|
|
883
|
+
it created in a `finally` block, whether response processing succeeds or fails.
|
|
884
|
+
|
|
870
885
|
**MCP with Project Connection**
|
|
871
886
|
|
|
872
887
|
MCP integration using project-specific connections for accessing connected MCP servers:
|
|
@@ -1446,6 +1461,59 @@ Each option is resolved using the following precedence order:
|
|
|
1446
1461
|
|
|
1447
1462
|
> **Note:** Because all tracing features are currently experimental, `experimental: true` must also be set (either explicitly or via the environment variable) for any spans to be emitted.
|
|
1448
1463
|
|
|
1464
|
+
#### Voice Agents tracing
|
|
1465
|
+
|
|
1466
|
+
After configuring an OpenTelemetry provider/exporter as shown below, the existing
|
|
1467
|
+
`tracingOptions: { experimental: true }` setting also traces voice-agent generation,
|
|
1468
|
+
telephony mutations, conversation deletion, and realtime connections/responses.
|
|
1469
|
+
No separate feature flag is required. Users who do not call Voice Agents APIs
|
|
1470
|
+
receive no additional Voice Agents spans.
|
|
1471
|
+
|
|
1472
|
+
```ts snippet:ReadmeSampleVoiceAgentTracing
|
|
1473
|
+
import { AIProjectClient } from "@azure/ai-projects";
|
|
1474
|
+
import { DefaultAzureCredential } from "@azure/identity";
|
|
1475
|
+
|
|
1476
|
+
const project = new AIProjectClient("<project endpoint>", new DefaultAzureCredential(), {
|
|
1477
|
+
tracingOptions: {
|
|
1478
|
+
experimental: true,
|
|
1479
|
+
contentRecording: false,
|
|
1480
|
+
},
|
|
1481
|
+
});
|
|
1482
|
+
const connection = await project.beta.voiceAgents.realtime.connect("<voice agent name>");
|
|
1483
|
+
try {
|
|
1484
|
+
await connection.sendText("Hello.");
|
|
1485
|
+
for await (const event of connection) {
|
|
1486
|
+
if (event.type === "response.done") break;
|
|
1487
|
+
}
|
|
1488
|
+
} finally {
|
|
1489
|
+
await connection.close();
|
|
1490
|
+
}
|
|
1491
|
+
```
|
|
1492
|
+
|
|
1493
|
+
Realtime creates a session span, a short connection child, and an `invoke_agent`
|
|
1494
|
+
child for each observed `response.created`/`response.done` pair. It records status,
|
|
1495
|
+
service IDs, token usage, aggregated audio bytes, and received-first-audio latency
|
|
1496
|
+
(from `response.created`, not user speech or playback). It does not create a span
|
|
1497
|
+
per audio chunk. Service IDs appear only in traces, not metric dimensions.
|
|
1498
|
+
REST and `project.beta.voiceAgents.realtime` use the same existing project-level
|
|
1499
|
+
`tracingOptions`; no additional options or per-realtime override are required.
|
|
1500
|
+
The independently constructed `VoiceAgentRealtimeClient` keeps its existing API
|
|
1501
|
+
and does not receive the project's tracing configuration.
|
|
1502
|
+
|
|
1503
|
+
The session's input message summary represents the latest observed input, not
|
|
1504
|
+
the full conversation history. New audio replaces an older transcript with audio
|
|
1505
|
+
metadata while its item ID is pending. A completed transcript replaces that
|
|
1506
|
+
metadata only when its item ID is correlated to the current input.
|
|
1507
|
+
|
|
1508
|
+
Message summaries omit content by default. Explicit `contentRecording: true` allows
|
|
1509
|
+
bounded text/transcripts and tool arguments/results; it may expose sensitive user
|
|
1510
|
+
information. Raw media, credentials, query values, telephone numbers, SDP, and raw
|
|
1511
|
+
error/close messages are never intentionally recorded by this instrumentation.
|
|
1512
|
+
Read/list calls continue using the existing HTTP pipeline tracing.
|
|
1513
|
+
|
|
1514
|
+
See [realtime tracing sample](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/ai/ai-projects/samples-dev/agents/agentVoiceRealtimeWithTracing.ts)
|
|
1515
|
+
and [REST tracing sample](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/ai/ai-projects/samples-dev/agents/agentVoiceRestWithTracing.ts).
|
|
1516
|
+
|
|
1449
1517
|
#### Azure Monitor tracing
|
|
1450
1518
|
|
|
1451
1519
|
Here is a code sample that shows how to enable Azure Monitor tracing:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aiProjectClient.d.ts","sourceRoot":"","sources":["../../src/aiProjectClient.ts"],"names":[],"mappings":"AAIA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,OAAO,KAAK,EAAoB,6BAA6B,EAAE,MAAM,gBAAgB,CAAC;AAEtF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAElE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAExE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE9D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAE5E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AA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AC/C,SAAgB,eAAe,EAAE,yBAAyB,CAAC;IAC3D,sCAAsC;IACtC,SAAgB,MAAM,EAAE,gBAAgB,CAAC;IACzC;;;;;;;;;;;;OAYG;IACH,SAAgB,IAAI,EAAE,cAAc,CAAC;IACrC,yCAAyC;IACzC,SAAgB,SAAS,EAAE,mBAAmB,CAAC;IAC/C;;;OAGG;IAEI,eAAe,CAAC,kBAAkB,CAAC,EAAE,iCAAiC,GAAG,MAAM;IA+DtF;;;OAGG;IACH,IAAW,QAAQ,IAAI,MAAM,CAE5B;CACF"}
|
|
@@ -101,7 +101,7 @@ export class AIProjectClient {
|
|
|
101
101
|
this.connections = _getConnectionsOperations(this._azureScopeClient);
|
|
102
102
|
this.evaluationRules = _getEvaluationRulesOperations(this._azureScopeClient);
|
|
103
103
|
this.agents = _getAgentsOperations(this._azureScopeClient, this._tracingConfig);
|
|
104
|
-
this.beta = _getBetaOperations(this._cognitiveScopeClient, credential, options.endpoint ?? endpoint, resolveRealtimeOptions(options, prefixFromOptions));
|
|
104
|
+
this.beta = _getBetaOperations(this._cognitiveScopeClient, credential, options.endpoint ?? endpoint, resolveRealtimeOptions(options, prefixFromOptions), this._tracingConfig);
|
|
105
105
|
this.telemetry = _getTelemetryOperations(this.connections);
|
|
106
106
|
}
|
|
107
107
|
/** The operation groups for toolboxes */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aiProjectClient.js","sourceRoot":"","sources":["../../src/aiProjectClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,iCAAiC;AAEjC,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAEvE,O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AAE,eAAe,EACxB,YAAY,EAAE,aAAa,EAC3B,GAAG,QAAQ,EACZ,GAAG,IAAI,IAAI,EAAE,CAAC;QACf,MAAM,aAAa,GAA4C;YAC7D,GAAG,QAAQ;YACX,MAAM,EAAE,sBAAsB,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC;YACvD,OAAO;YACP,uBAAuB,EAAE,IAAI;YAC7B,cAAc,EAAE,cAAc,CAAC,MAAM,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;YAC7D,YAAY,EAAE,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS;YAC7E,KAAK,EAAE,WAAW;SACnB,CAAC;QAEF,MAAM,YAAY,GAAG,IAAI,MAAM,CAAC,aAAa,CAAC,CAAC;QAC/C,OAAO,qBAAqB,CAAC,YAAY,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;IAClF,CAAC;IACD;;;OAGG;IACH,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/* eslint-disable tsdoc/syntax */\n\nimport OpenAI from \"openai\";\nimport { getBearerTokenProvider } from \"@azure/identity\";\nimport type { AIProjectContext, AIProjectClientOptionalParams } from \"./api/index.js\";\nimport { createAIProject } from \"./api/index.js\";\nimport type { AgentsOperations } from \"./classic/agents/index.js\";\nimport { _getAgentsOperations } from \"./classic/agents/index.js\";\nimport type { ToolboxesOperations } from \"./classic/toolboxes/index.js\";\nimport { _getToolboxesOperations } from \"./classic/toolboxes/index.js\";\nimport type { BetaOperations } from \"./classic/beta/index.js\";\nimport { _getBetaOperations } from \"./classic/beta/index.js\";\nimport type { ConnectionsOperations } from \"./classic/connections/index.js\";\nimport { _getConnectionsOperations } from \"./classic/connections/index.js\";\nimport type { DatasetsOperations } from \"./classic/datasets/index.js\";\nimport { _getDatasetsOperations } from \"./classic/datasets/index.js\";\nimport type { DeploymentsOperations } from \"./classic/deployments/index.js\";\nimport { _getDeploymentsOperations } from \"./classic/deployments/index.js\";\nimport type { EvaluationRulesOperations } from \"./classic/evaluationRules/index.js\";\nimport { _getEvaluationRulesOperations } from \"./classic/evaluationRules/index.js\";\nimport type { EvaluatorsOperations } from \"./classic/evaluators/index.js\";\nimport { _getEvaluatorsOperations } from \"./classic/evaluators/index.js\";\nimport type { IndexesOperations } from \"./classic/indexes/index.js\";\nimport { _getIndexesOperations } from \"./classic/indexes/index.js\";\nimport type { TelemetryOperations } from \"./classic/telemetry/index.js\";\nimport { _getTelemetryOperations } from \"./classic/telemetry/index.js\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport { overwriteOpenAIClient } from \"./overwriteOpenAIClient.js\";\nimport { getCustomFetch } from \"#platform/getCustomFetch\";\nimport { getOpenAIDefaultHeaders } from \"./util.js\";\nimport type { OpenAIClientOptionsWithAzureAgent } from \"./azureAgent.interface.js\";\nimport { KnownApiVersions } from \"./models/models.js\";\nimport { getTracingFetch } from \"./tracing/tracingFetch.js\";\nimport { resolveTracingConfig } from \"./tracing/configuration.js\";\nimport type { ResolvedTracingConfig } from \"./tracing/configuration.js\";\nimport type { VoiceAgentRealtimeClientOptions } from \"./realtime/voiceAgentRealtimeClient.js\";\n\nexport type { AIProjectClientOptionalParams } from \"./api/aiProjectContext.js\";\n\n/**\n * Resolves the effective options for the realtime voice-agent client: explicit `realtimeOptions`\n * values win, otherwise each falls back to its corresponding top-level client option so realtime\n * connections stay consistent with the rest of the client by default.\n */\nfunction resolveRealtimeOptions(\n options: AIProjectClientOptionalParams,\n userAgentPrefix: string | undefined,\n): VoiceAgentRealtimeClientOptions {\n const { realtimeOptions } = options;\n return {\n ...realtimeOptions,\n apiVersion: realtimeOptions?.apiVersion ?? options.apiVersion,\n credentialScopes: realtimeOptions?.credentialScopes ?? options.credentials?.scopes,\n userAgentPrefix: realtimeOptions?.userAgentPrefix ?? userAgentPrefix,\n };\n}\n\n/**\n * The main client for the AIProjectClient service. It provides access to the various operations available in the service.\n * @class AIProjectClient\n * @extends {AIProjectContext}\n * @description The main client for the AIProjectClient\n * @constructor\n * @param {string} endpoint - The endpoint to use\n * @param {TokenCredential} credential - The credential to use\n * @param {AIProjectClientOptionalParams} [options] - Optional parameters for the client.\n * @property {DeploymentsOperations} deployments - The operation groups for deployments\n * @property {IndexesOperations} indexes - The operation groups for indexes\n * @property {DatasetsOperations} datasets - The operation groups for datasets\n * @property {ConnectionsOperations} connections - The operation groups for connections\n * @property {AgentsOperations} agents - The operation groups for agents\n * @property {ToolboxesOperations} toolboxes - The operation groups for toolboxes\n * @property {EvaluatorsOperations} evaluators - The operation groups for evaluators\n * @property {BetaOperations} beta - The operation groups for beta include beta features:\n * - Memory Stores\n * - Evaluators\n * - Evaluation Taxonomies\n * - Insights\n * - Schedules\n * - Red Teams\n * - agents\n * - skills\n * - routines\n * - models\n * @property {TelemetryOperations} telemetry - The operation groups for telemetry\n * @property {getEndpointUrl} getEndpointUrl - gets the endpoint of the client\n * @property {getOpenAIClient} getOpenAIClient - gets the OpenAI client with optional OpenAI client options\n */\nexport class AIProjectClient {\n private _cognitiveScopeClient: AIProjectContext;\n private _azureScopeClient: AIProjectContext;\n private _endpoint: string;\n private _credential: TokenCredential;\n private _options: AIProjectClientOptionalParams;\n private _tracingConfig: ResolvedTracingConfig;\n\n constructor(\n endpoint: string,\n credential: TokenCredential,\n options: AIProjectClientOptionalParams = {},\n ) {\n this._endpoint = endpoint;\n this._credential = credential;\n this._options = options;\n this._tracingConfig = resolveTracingConfig(options.tracingOptions);\n const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;\n const userAgentPrefix = prefixFromOptions\n ? `${prefixFromOptions} azsdk-js-client`\n : `azsdk-js-client`;\n this._cognitiveScopeClient = createAIProject(endpoint, this._credential, {\n ...options,\n userAgentOptions: { userAgentPrefix },\n credentials: {\n ...options.credentials,\n scopes: [\"https://ai.azure.com/.default\"],\n },\n });\n this._azureScopeClient = createAIProject(endpoint, credential, {\n ...options,\n userAgentOptions: { userAgentPrefix },\n });\n\n this.toolboxes = _getToolboxesOperations(this._cognitiveScopeClient);\n this.evaluators = _getEvaluatorsOperations(this._cognitiveScopeClient);\n this.indexes = _getIndexesOperations(this._azureScopeClient);\n this.deployments = _getDeploymentsOperations(this._azureScopeClient);\n this.datasets = _getDatasetsOperations(this._azureScopeClient, this._options);\n this.connections = _getConnectionsOperations(this._azureScopeClient);\n this.evaluationRules = _getEvaluationRulesOperations(this._azureScopeClient);\n this.agents = _getAgentsOperations(this._azureScopeClient, this._tracingConfig);\n this.beta = _getBetaOperations(\n this._cognitiveScopeClient,\n credential,\n options.endpoint ?? endpoint,\n resolveRealtimeOptions(options, prefixFromOptions),\n );\n this.telemetry = _getTelemetryOperations(this.connections);\n }\n\n /** The operation groups for toolboxes */\n public readonly toolboxes: ToolboxesOperations;\n /** The operation groups for evaluators */\n public readonly evaluators: EvaluatorsOperations;\n /** The operation groups for indexes */\n public readonly indexes: IndexesOperations;\n /** The operation groups for deployments */\n public readonly deployments: DeploymentsOperations;\n /** The operation groups for datasets */\n public readonly datasets: DatasetsOperations;\n /** The operation groups for connections */\n public readonly connections: ConnectionsOperations;\n /** The operation groups for evaluationRules */\n public readonly evaluationRules: EvaluationRulesOperations;\n /** The operation groups for agents */\n public readonly agents: AgentsOperations;\n /** The operation groups for beta include beta features:\n * - Memory Stores\n * - Evaluators\n * - Evaluation Taxonomies\n * - Insights\n * - Schedules\n * - Red Teams\n * - agents\n * - skills\n * - routines\n * - models\n * - realtime (voice-agent WebSocket connections)\n */\n public readonly beta: BetaOperations;\n /** The operation groups for telemetry */\n public readonly telemetry: TelemetryOperations;\n /**\n * gets the OpenAI client\n * @returns the OpenAI client\n */\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n public getOpenAIClient(optsWithAzureAgent?: OpenAIClientOptionsWithAzureAgent): OpenAI {\n const scope = \"https://ai.azure.com/.default\";\n const { azureConfig, ...opts } = optsWithAzureAgent || {};\n let customFetch: NonNullable<ConstructorParameters<typeof OpenAI>[0]>[\"fetch\"];\n\n if (\n this._options.additionalPolicies?.find((policy) => policy.policy.name === \"recording policy\")\n ) {\n customFetch = getCustomFetch(this._azureScopeClient.pipeline, this._options.httpClient);\n }\n\n // Wrap fetch with tracing to inject traceparent/tracestate headers\n customFetch = getTracingFetch(customFetch, this._tracingConfig);\n\n let baseURL: string;\n if (opts?.baseURL) {\n baseURL = opts.baseURL;\n } else if (azureConfig?.agentName) {\n if (!azureConfig.allowPreview) {\n throw new Error(\n \"Calling `getOpenAIClient` with an `agentName` requires you to set `allowPreview: true`\" +\n \"\\nwhen providing azureConfig. Note that preview features are under development and \" +\n \"\\nsubject to change. They should not be used in production environments.\",\n );\n }\n baseURL = `${this._endpoint}/agents/${azureConfig.agentName}/endpoint/protocols/openai`;\n } else {\n baseURL = `${this._endpoint}/openai/v1`;\n }\n\n const defaultHeaders = getOpenAIDefaultHeaders(\n opts?.defaultHeaders,\n this._options?.userAgentOptions?.userAgentPrefix,\n );\n\n // When targeting an agent endpoint, add api-version to defaultQuery if not already present\n const defaultQuery = {\n ...(opts?.defaultQuery || {}),\n };\n if (azureConfig?.agentName && !defaultQuery[\"api-version\"]) {\n defaultQuery[\"api-version\"] = this._options.apiVersion ?? KnownApiVersions.v1;\n }\n\n // Destructure opts to exclude defaultHeaders, baseURL, and defaultQuery, then override specific properties\n const {\n defaultHeaders: _ignoredHeaders,\n baseURL: _ignoredBaseURL,\n defaultQuery: _ignoredQuery,\n ...restOpts\n } = opts || {};\n const openAIOptions: ConstructorParameters<typeof OpenAI>[0] = {\n ...restOpts,\n apiKey: getBearerTokenProvider(this._credential, scope),\n baseURL,\n dangerouslyAllowBrowser: true,\n defaultHeaders: defaultHeaders.toJSON({ preserveCase: true }),\n defaultQuery: Object.keys(defaultQuery).length > 0 ? defaultQuery : undefined,\n fetch: customFetch,\n };\n\n const openaiClient = new OpenAI(openAIOptions);\n return overwriteOpenAIClient(openaiClient, this._endpoint, this._tracingConfig);\n }\n /**\n * gets the endpoint of the client\n * @returns the endpoint of the client\n */\n public get endpoint(): string {\n return this._endpoint;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"aiProjectClient.js","sourceRoot":"","sources":["../../src/aiProjectClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,iCAAiC;AAEjC,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAEvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAE3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAE3E,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AAEnF,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAEvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAEpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE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IAClF,CAAC;IACD;;;OAGG;IACH,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/* eslint-disable tsdoc/syntax */\n\nimport OpenAI from \"openai\";\nimport { getBearerTokenProvider } from \"@azure/identity\";\nimport type { AIProjectContext, AIProjectClientOptionalParams } from \"./api/index.js\";\nimport { createAIProject } from \"./api/index.js\";\nimport type { AgentsOperations } from \"./classic/agents/index.js\";\nimport { _getAgentsOperations } from \"./classic/agents/index.js\";\nimport type { ToolboxesOperations } from \"./classic/toolboxes/index.js\";\nimport { _getToolboxesOperations } from \"./classic/toolboxes/index.js\";\nimport type { BetaOperations } from \"./classic/beta/index.js\";\nimport { _getBetaOperations } from \"./classic/beta/index.js\";\nimport type { ConnectionsOperations } from \"./classic/connections/index.js\";\nimport { _getConnectionsOperations } from \"./classic/connections/index.js\";\nimport type { DatasetsOperations } from \"./classic/datasets/index.js\";\nimport { _getDatasetsOperations } from \"./classic/datasets/index.js\";\nimport type { DeploymentsOperations } from \"./classic/deployments/index.js\";\nimport { _getDeploymentsOperations } from \"./classic/deployments/index.js\";\nimport type { EvaluationRulesOperations } from \"./classic/evaluationRules/index.js\";\nimport { _getEvaluationRulesOperations } from \"./classic/evaluationRules/index.js\";\nimport type { EvaluatorsOperations } from \"./classic/evaluators/index.js\";\nimport { _getEvaluatorsOperations } from \"./classic/evaluators/index.js\";\nimport type { IndexesOperations } from \"./classic/indexes/index.js\";\nimport { _getIndexesOperations } from \"./classic/indexes/index.js\";\nimport type { TelemetryOperations } from \"./classic/telemetry/index.js\";\nimport { _getTelemetryOperations } from \"./classic/telemetry/index.js\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport { overwriteOpenAIClient } from \"./overwriteOpenAIClient.js\";\nimport { getCustomFetch } from \"#platform/getCustomFetch\";\nimport { getOpenAIDefaultHeaders } from \"./util.js\";\nimport type { OpenAIClientOptionsWithAzureAgent } from \"./azureAgent.interface.js\";\nimport { KnownApiVersions } from \"./models/models.js\";\nimport { getTracingFetch } from \"./tracing/tracingFetch.js\";\nimport { resolveTracingConfig } from \"./tracing/configuration.js\";\nimport type { ResolvedTracingConfig } from \"./tracing/configuration.js\";\nimport type { VoiceAgentRealtimeClientOptions } from \"./realtime/voiceAgentRealtimeClient.js\";\n\nexport type { AIProjectClientOptionalParams } from \"./api/aiProjectContext.js\";\n\n/**\n * Resolves the effective options for the realtime voice-agent client: explicit `realtimeOptions`\n * values win, otherwise each falls back to its corresponding top-level client option so realtime\n * connections stay consistent with the rest of the client by default.\n */\nfunction resolveRealtimeOptions(\n options: AIProjectClientOptionalParams,\n userAgentPrefix: string | undefined,\n): VoiceAgentRealtimeClientOptions {\n const { realtimeOptions } = options;\n return {\n ...realtimeOptions,\n apiVersion: realtimeOptions?.apiVersion ?? options.apiVersion,\n credentialScopes: realtimeOptions?.credentialScopes ?? options.credentials?.scopes,\n userAgentPrefix: realtimeOptions?.userAgentPrefix ?? userAgentPrefix,\n };\n}\n\n/**\n * The main client for the AIProjectClient service. It provides access to the various operations available in the service.\n * @class AIProjectClient\n * @extends {AIProjectContext}\n * @description The main client for the AIProjectClient\n * @constructor\n * @param {string} endpoint - The endpoint to use\n * @param {TokenCredential} credential - The credential to use\n * @param {AIProjectClientOptionalParams} [options] - Optional parameters for the client.\n * @property {DeploymentsOperations} deployments - The operation groups for deployments\n * @property {IndexesOperations} indexes - The operation groups for indexes\n * @property {DatasetsOperations} datasets - The operation groups for datasets\n * @property {ConnectionsOperations} connections - The operation groups for connections\n * @property {AgentsOperations} agents - The operation groups for agents\n * @property {ToolboxesOperations} toolboxes - The operation groups for toolboxes\n * @property {EvaluatorsOperations} evaluators - The operation groups for evaluators\n * @property {BetaOperations} beta - The operation groups for beta include beta features:\n * - Memory Stores\n * - Evaluators\n * - Evaluation Taxonomies\n * - Insights\n * - Schedules\n * - Red Teams\n * - agents\n * - skills\n * - routines\n * - models\n * @property {TelemetryOperations} telemetry - The operation groups for telemetry\n * @property {getEndpointUrl} getEndpointUrl - gets the endpoint of the client\n * @property {getOpenAIClient} getOpenAIClient - gets the OpenAI client with optional OpenAI client options\n */\nexport class AIProjectClient {\n private _cognitiveScopeClient: AIProjectContext;\n private _azureScopeClient: AIProjectContext;\n private _endpoint: string;\n private _credential: TokenCredential;\n private _options: AIProjectClientOptionalParams;\n private _tracingConfig: ResolvedTracingConfig;\n\n constructor(\n endpoint: string,\n credential: TokenCredential,\n options: AIProjectClientOptionalParams = {},\n ) {\n this._endpoint = endpoint;\n this._credential = credential;\n this._options = options;\n this._tracingConfig = resolveTracingConfig(options.tracingOptions);\n const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;\n const userAgentPrefix = prefixFromOptions\n ? `${prefixFromOptions} azsdk-js-client`\n : `azsdk-js-client`;\n this._cognitiveScopeClient = createAIProject(endpoint, this._credential, {\n ...options,\n userAgentOptions: { userAgentPrefix },\n credentials: {\n ...options.credentials,\n scopes: [\"https://ai.azure.com/.default\"],\n },\n });\n this._azureScopeClient = createAIProject(endpoint, credential, {\n ...options,\n userAgentOptions: { userAgentPrefix },\n });\n\n this.toolboxes = _getToolboxesOperations(this._cognitiveScopeClient);\n this.evaluators = _getEvaluatorsOperations(this._cognitiveScopeClient);\n this.indexes = _getIndexesOperations(this._azureScopeClient);\n this.deployments = _getDeploymentsOperations(this._azureScopeClient);\n this.datasets = _getDatasetsOperations(this._azureScopeClient, this._options);\n this.connections = _getConnectionsOperations(this._azureScopeClient);\n this.evaluationRules = _getEvaluationRulesOperations(this._azureScopeClient);\n this.agents = _getAgentsOperations(this._azureScopeClient, this._tracingConfig);\n this.beta = _getBetaOperations(\n this._cognitiveScopeClient,\n credential,\n options.endpoint ?? endpoint,\n resolveRealtimeOptions(options, prefixFromOptions),\n this._tracingConfig,\n );\n this.telemetry = _getTelemetryOperations(this.connections);\n }\n\n /** The operation groups for toolboxes */\n public readonly toolboxes: ToolboxesOperations;\n /** The operation groups for evaluators */\n public readonly evaluators: EvaluatorsOperations;\n /** The operation groups for indexes */\n public readonly indexes: IndexesOperations;\n /** The operation groups for deployments */\n public readonly deployments: DeploymentsOperations;\n /** The operation groups for datasets */\n public readonly datasets: DatasetsOperations;\n /** The operation groups for connections */\n public readonly connections: ConnectionsOperations;\n /** The operation groups for evaluationRules */\n public readonly evaluationRules: EvaluationRulesOperations;\n /** The operation groups for agents */\n public readonly agents: AgentsOperations;\n /** The operation groups for beta include beta features:\n * - Memory Stores\n * - Evaluators\n * - Evaluation Taxonomies\n * - Insights\n * - Schedules\n * - Red Teams\n * - agents\n * - skills\n * - routines\n * - models\n * - realtime (voice-agent WebSocket connections)\n */\n public readonly beta: BetaOperations;\n /** The operation groups for telemetry */\n public readonly telemetry: TelemetryOperations;\n /**\n * gets the OpenAI client\n * @returns the OpenAI client\n */\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n public getOpenAIClient(optsWithAzureAgent?: OpenAIClientOptionsWithAzureAgent): OpenAI {\n const scope = \"https://ai.azure.com/.default\";\n const { azureConfig, ...opts } = optsWithAzureAgent || {};\n let customFetch: NonNullable<ConstructorParameters<typeof OpenAI>[0]>[\"fetch\"];\n\n if (\n this._options.additionalPolicies?.find((policy) => policy.policy.name === \"recording policy\")\n ) {\n customFetch = getCustomFetch(this._azureScopeClient.pipeline, this._options.httpClient);\n }\n\n // Wrap fetch with tracing to inject traceparent/tracestate headers\n customFetch = getTracingFetch(customFetch, this._tracingConfig);\n\n let baseURL: string;\n if (opts?.baseURL) {\n baseURL = opts.baseURL;\n } else if (azureConfig?.agentName) {\n if (!azureConfig.allowPreview) {\n throw new Error(\n \"Calling `getOpenAIClient` with an `agentName` requires you to set `allowPreview: true`\" +\n \"\\nwhen providing azureConfig. Note that preview features are under development and \" +\n \"\\nsubject to change. They should not be used in production environments.\",\n );\n }\n baseURL = `${this._endpoint}/agents/${azureConfig.agentName}/endpoint/protocols/openai`;\n } else {\n baseURL = `${this._endpoint}/openai/v1`;\n }\n\n const defaultHeaders = getOpenAIDefaultHeaders(\n opts?.defaultHeaders,\n this._options?.userAgentOptions?.userAgentPrefix,\n );\n\n // When targeting an agent endpoint, add api-version to defaultQuery if not already present\n const defaultQuery = {\n ...(opts?.defaultQuery || {}),\n };\n if (azureConfig?.agentName && !defaultQuery[\"api-version\"]) {\n defaultQuery[\"api-version\"] = this._options.apiVersion ?? KnownApiVersions.v1;\n }\n\n // Destructure opts to exclude defaultHeaders, baseURL, and defaultQuery, then override specific properties\n const {\n defaultHeaders: _ignoredHeaders,\n baseURL: _ignoredBaseURL,\n defaultQuery: _ignoredQuery,\n ...restOpts\n } = opts || {};\n const openAIOptions: ConstructorParameters<typeof OpenAI>[0] = {\n ...restOpts,\n apiKey: getBearerTokenProvider(this._credential, scope),\n baseURL,\n dangerouslyAllowBrowser: true,\n defaultHeaders: defaultHeaders.toJSON({ preserveCase: true }),\n defaultQuery: Object.keys(defaultQuery).length > 0 ? defaultQuery : undefined,\n fetch: customFetch,\n };\n\n const openaiClient = new OpenAI(openAIOptions);\n return overwriteOpenAIClient(openaiClient, this._endpoint, this._tracingConfig);\n }\n /**\n * gets the endpoint of the client\n * @returns the endpoint of the client\n */\n public get endpoint(): string {\n return this._endpoint;\n }\n}\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { AIProjectContext } from "../../../api/aiProjectContext.js";
|
|
2
2
|
import type { Agent, GenerateAgentRequest } from "../../../models/models.js";
|
|
3
3
|
import type { BetaAgentsCreateFromPromptOptionalParams } from "../../../api/beta/agents/options.js";
|
|
4
|
+
import type { ResolvedTracingConfig } from "../../../tracing/configuration.js";
|
|
4
5
|
/** Operations for managing agents. */
|
|
5
6
|
export interface BetaAgentsOperations {
|
|
6
7
|
/**
|
|
@@ -9,5 +10,5 @@ export interface BetaAgentsOperations {
|
|
|
9
10
|
*/
|
|
10
11
|
createFromPrompt: (body: GenerateAgentRequest, options?: BetaAgentsCreateFromPromptOptionalParams) => Promise<Agent>;
|
|
11
12
|
}
|
|
12
|
-
export declare function _getBetaAgentsOperations(context: AIProjectContext): BetaAgentsOperations;
|
|
13
|
+
export declare function _getBetaAgentsOperations(context: AIProjectContext, tracingConfig?: ResolvedTracingConfig): BetaAgentsOperations;
|
|
13
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/classic/beta/agents/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,KAAK,EAAE,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAC7E,OAAO,KAAK,EAAE,wCAAwC,EAAE,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/classic/beta/agents/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,KAAK,EAAE,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAC7E,OAAO,KAAK,EAAE,wCAAwC,EAAE,MAAM,qCAAqC,CAAC;AAEpG,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAG/E,sCAAsC;AACtC,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,gBAAgB,EAAE,CAChB,IAAI,EAAE,oBAAoB,EAC1B,OAAO,CAAC,EAAE,wCAAwC,KAC/C,OAAO,CAAC,KAAK,CAAC,CAAC;CACrB;AAED,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,gBAAgB,EACzB,aAAa,CAAC,EAAE,qBAAqB,GACpC,oBAAoB,CActB"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
import { createFromPrompt } from "../../../api/beta/agents/operations.js";
|
|
4
|
-
|
|
4
|
+
import { traceVoiceAgentOperation } from "../../../tracing/voiceAgentTracing.js";
|
|
5
|
+
export function _getBetaAgentsOperations(context, tracingConfig) {
|
|
5
6
|
return {
|
|
6
|
-
createFromPrompt: (body, options) => createFromPrompt(context, body, options),
|
|
7
|
+
createFromPrompt: (body, options) => traceVoiceAgentOperation("create_agent", context.endpoint, tracingConfig, () => createFromPrompt(context, body, options), (agent) => ({ "gen_ai.agent.name": agent.name, "gen_ai.agent.id": agent.id })),
|
|
7
8
|
};
|
|
8
9
|
}
|
|
9
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/classic/beta/agents/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAKlC,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/classic/beta/agents/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAKlC,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAE1E,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AAcjF,MAAM,UAAU,wBAAwB,CACtC,OAAyB,EACzB,aAAqC;IAErC,OAAO;QACL,gBAAgB,EAAE,CAChB,IAA0B,EAC1B,OAAkD,EAClD,EAAE,CACF,wBAAwB,CACtB,cAAc,EACd,OAAO,CAAC,QAAQ,EAChB,aAAa,EACb,GAAG,EAAE,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,EAC9C,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,mBAAmB,EAAE,KAAK,CAAC,IAAI,EAAE,iBAAiB,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAC9E;KACJ,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AIProjectContext } from \"../../../api/aiProjectContext.js\";\nimport type { Agent, GenerateAgentRequest } from \"../../../models/models.js\";\nimport type { BetaAgentsCreateFromPromptOptionalParams } from \"../../../api/beta/agents/options.js\";\nimport { createFromPrompt } from \"../../../api/beta/agents/operations.js\";\nimport type { ResolvedTracingConfig } from \"../../../tracing/configuration.js\";\nimport { traceVoiceAgentOperation } from \"../../../tracing/voiceAgentTracing.js\";\n\n/** Operations for managing agents. */\nexport interface BetaAgentsOperations {\n /**\n * Generates and creates an agent from kind-specific high-level inputs.\n * The generated definition remains fully editable through the standard agent versioning operations.\n */\n createFromPrompt: (\n body: GenerateAgentRequest,\n options?: BetaAgentsCreateFromPromptOptionalParams,\n ) => Promise<Agent>;\n}\n\nexport function _getBetaAgentsOperations(\n context: AIProjectContext,\n tracingConfig?: ResolvedTracingConfig,\n): BetaAgentsOperations {\n return {\n createFromPrompt: (\n body: GenerateAgentRequest,\n options?: BetaAgentsCreateFromPromptOptionalParams,\n ) =>\n traceVoiceAgentOperation(\n \"create_agent\",\n context.endpoint,\n tracingConfig,\n () => createFromPrompt(context, body, options),\n (agent) => ({ \"gen_ai.agent.name\": agent.name, \"gen_ai.agent.id\": agent.id }),\n ),\n };\n}\n"]}
|
|
@@ -13,6 +13,7 @@ import type { BetaRoutinesOperations } from "./routines/index.js";
|
|
|
13
13
|
import type { BetaSchedulesOperations } from "./schedules/index.js";
|
|
14
14
|
import type { BetaVoiceAgentsOperations } from "./voiceAgents/index.js";
|
|
15
15
|
import type { VoiceAgentRealtimeClientOptions } from "../../realtime/voiceAgentRealtimeClient.js";
|
|
16
|
+
import type { ResolvedTracingConfig } from "../../tracing/configuration.js";
|
|
16
17
|
/** Interface representing a Beta operations. */
|
|
17
18
|
export interface BetaOperations {
|
|
18
19
|
/** Operations for managing skills. */
|
|
@@ -40,5 +41,5 @@ export interface BetaOperations {
|
|
|
40
41
|
/** Operations for managing voice agent conversations and telephony. */
|
|
41
42
|
voiceAgents: BetaVoiceAgentsOperations;
|
|
42
43
|
}
|
|
43
|
-
export declare function _getBetaOperations(context: AIProjectContext, credential: TokenCredential, endpoint: string, realtimeOptions?: VoiceAgentRealtimeClientOptions): BetaOperations;
|
|
44
|
+
export declare function _getBetaOperations(context: AIProjectContext, credential: TokenCredential, endpoint: string, realtimeOptions?: VoiceAgentRealtimeClientOptions, tracingConfig?: ResolvedTracingConfig): BetaOperations;
|
|
44
45
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/classic/beta/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,iCAAiC,CAAC;AAE1F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE9D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE9D,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,iCAAiC,CAAC;AAE1F,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAEtE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAElE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAE1E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE9D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAElE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAElE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAEpE,OAAO,K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B,yCAAyC;IACzC,SAAS,EAAE,uBAAuB,CAAC;IACnC,wCAAwC;IACxC,QAAQ,EAAE,sBAAsB,CAAC;IACjC,oDAAoD;IACpD,QAAQ,EAAE,sBAAsB,CAAC;IACjC,sCAAsC;IACtC,MAAM,EAAE,oBAAoB,CAAC;IAC7B,6CAA6C;IAC7C,YAAY,EAAE,0BAA0B,CAAC;IACzC,mDAAmD;IACnD,QAAQ,EAAE,sBAAsB,CAAC;IACjC,0CAA0C;IAC1C,UAAU,EAAE,wBAAwB,CAAC;IACrC,qDAAqD;IACrD,oBAAoB,EAAE,kCAAkC,CAAC;IACzD,sCAAsC;IACtC,MAAM,EAAE,oBAAoB,CAAC;IAC7B,uDAAuD;IACvD,oBAAoB,EAAE,kCAAkC,CAAC;IACzD,uEAAuE;IACvE,WAAW,EAAE,yBAAyB,CAAC;CACxC;AAED,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,gBAAgB,EACzB,UAAU,EAAE,eAAe,EAC3B,QAAQ,EAAE,MAAM,EAChB,eAAe,CAAC,EAAE,+BAA+B,EACjD,aAAa,CAAC,EAAE,qBAAqB,GACpC,cAAc,CAiChB"}
|
|
@@ -12,7 +12,7 @@ import { _getBetaRedTeamsOperations } from "./redTeams/index.js";
|
|
|
12
12
|
import { _getBetaRoutinesOperations } from "./routines/index.js";
|
|
13
13
|
import { _getBetaSchedulesOperations } from "./schedules/index.js";
|
|
14
14
|
import { _getBetaVoiceAgentsOperations } from "./voiceAgents/index.js";
|
|
15
|
-
export function _getBetaOperations(context, credential, endpoint, realtimeOptions) {
|
|
15
|
+
export function _getBetaOperations(context, credential, endpoint, realtimeOptions, tracingConfig) {
|
|
16
16
|
return {
|
|
17
17
|
/** Operations for managing skills. */
|
|
18
18
|
skills: _getBetaSkillsOperations(context),
|
|
@@ -33,11 +33,11 @@ export function _getBetaOperations(context, credential, endpoint, realtimeOption
|
|
|
33
33
|
/** Operations for managing evaluation taxonomies. */
|
|
34
34
|
evaluationTaxonomies: _getBetaEvaluationTaxonomiesOperations(context),
|
|
35
35
|
/** Operations for managing agents. */
|
|
36
|
-
agents: _getBetaAgentsOperations(context),
|
|
36
|
+
agents: _getBetaAgentsOperations(context, tracingConfig),
|
|
37
37
|
/** Operations for managing Agent Insights monitors. */
|
|
38
38
|
agentInsightMonitors: _getBetaAgentInsightMonitorsOperations(context),
|
|
39
39
|
/** Operations for managing voice agent conversations and telephony. */
|
|
40
|
-
voiceAgents: _getBetaVoiceAgentsOperations(context, credential, endpoint, realtimeOptions),
|
|
40
|
+
voiceAgents: _getBetaVoiceAgentsOperations(context, credential, endpoint, realtimeOptions, tracingConfig),
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
43
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/classic/beta/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAKlC,OAAO,EAAE,sCAAsC,EAAE,MAAM,iCAAiC,CAAC;AAEzF,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAE7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAE7D,OAAO,EAAE,sCAAsC,EAAE,MAAM,iCAAiC,CAAC;AAEzF,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AAErE,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,EAAE,8BAA8B,EAAE,MAAM,yBAAyB,CAAC;AAEzE,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAE7D,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAC;AAEnE,OAAO,EAAE,6BAA6B,EAAE,MAAM,wBAAwB,CAA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D,mDAAmD;QACnD,QAAQ,EAAE,0BAA0B,CAAC,OAAO,CAAC;QAC7C,0CAA0C;QAC1C,UAAU,EAAE,4BAA4B,CAAC,OAAO,CAAC;QACjD,qDAAqD;QACrD,oBAAoB,EAAE,sCAAsC,CAAC,OAAO,CAAC;QACrE,sCAAsC;QACtC,MAAM,EAAE,wBAAwB,CAAC,OAAO,EAAE,aAAa,CAAC;QACxD,uDAAuD;QACvD,oBAAoB,EAAE,sCAAsC,CAAC,OAAO,CAAC;QACrE,uEAAuE;QACvE,WAAW,EAAE,6BAA6B,CACxC,OAAO,EACP,UAAU,EACV,QAAQ,EACR,eAAe,EACf,aAAa,CACd;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AIProjectContext } from \"../../api/aiProjectContext.js\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport type { BetaAgentInsightMonitorsOperations } from \"./agentInsightMonitors/index.js\";\nimport { _getBetaAgentInsightMonitorsOperations } from \"./agentInsightMonitors/index.js\";\nimport type { BetaAgentsOperations } from \"./agents/index.js\";\nimport { _getBetaAgentsOperations } from \"./agents/index.js\";\nimport type { BetaSkillsOperations } from \"./skills/index.js\";\nimport { _getBetaSkillsOperations } from \"./skills/index.js\";\nimport type { BetaEvaluationTaxonomiesOperations } from \"./evaluationTaxonomies/index.js\";\nimport { _getBetaEvaluationTaxonomiesOperations } from \"./evaluationTaxonomies/index.js\";\nimport type { BetaEvaluatorsOperations } from \"./evaluators/index.js\";\nimport { _getBetaEvaluatorsOperations } from \"./evaluators/index.js\";\nimport type { BetaInsightsOperations } from \"./insights/index.js\";\nimport { _getBetaInsightsOperations } from \"./insights/index.js\";\nimport type { BetaMemoryStoresOperations } from \"./memoryStores/index.js\";\nimport { _getBetaMemoryStoresOperations } from \"./memoryStores/index.js\";\nimport type { BetaModelsOperations } from \"./models/index.js\";\nimport { _getBetaModelsOperations } from \"./models/index.js\";\nimport type { BetaRedTeamsOperations } from \"./redTeams/index.js\";\nimport { _getBetaRedTeamsOperations } from \"./redTeams/index.js\";\nimport type { BetaRoutinesOperations } from \"./routines/index.js\";\nimport { _getBetaRoutinesOperations } from \"./routines/index.js\";\nimport type { BetaSchedulesOperations } from \"./schedules/index.js\";\nimport { _getBetaSchedulesOperations } from \"./schedules/index.js\";\nimport type { BetaVoiceAgentsOperations } from \"./voiceAgents/index.js\";\nimport { _getBetaVoiceAgentsOperations } from \"./voiceAgents/index.js\";\nimport type { VoiceAgentRealtimeClientOptions } from \"../../realtime/voiceAgentRealtimeClient.js\";\nimport type { ResolvedTracingConfig } from \"../../tracing/configuration.js\";\n\n/** Interface representing a Beta operations. */\nexport interface BetaOperations {\n /** Operations for managing skills. */\n skills: BetaSkillsOperations;\n /** Operations for managing schedules. */\n schedules: BetaSchedulesOperations;\n /** Operations for managing routines. */\n routines: BetaRoutinesOperations;\n /** Operations for managing red team evaluations. */\n redTeams: BetaRedTeamsOperations;\n /** Operations for managing models. */\n models: BetaModelsOperations;\n /** Operations for managing memory stores. */\n memoryStores: BetaMemoryStoresOperations;\n /** Operations for managing evaluation insights. */\n insights: BetaInsightsOperations;\n /** Operations for managing evaluators. */\n evaluators: BetaEvaluatorsOperations;\n /** Operations for managing evaluation taxonomies. */\n evaluationTaxonomies: BetaEvaluationTaxonomiesOperations;\n /** Operations for managing agents. */\n agents: BetaAgentsOperations;\n /** Operations for managing Agent Insights monitors. */\n agentInsightMonitors: BetaAgentInsightMonitorsOperations;\n /** Operations for managing voice agent conversations and telephony. */\n voiceAgents: BetaVoiceAgentsOperations;\n}\n\nexport function _getBetaOperations(\n context: AIProjectContext,\n credential: TokenCredential,\n endpoint: string,\n realtimeOptions?: VoiceAgentRealtimeClientOptions,\n tracingConfig?: ResolvedTracingConfig,\n): BetaOperations {\n return {\n /** Operations for managing skills. */\n skills: _getBetaSkillsOperations(context),\n /** Operations for managing schedules. */\n schedules: _getBetaSchedulesOperations(context),\n /** Operations for managing routines. */\n routines: _getBetaRoutinesOperations(context),\n /** Operations for managing red team evaluations. */\n redTeams: _getBetaRedTeamsOperations(context),\n /** Operations for managing models. */\n models: _getBetaModelsOperations(context),\n /** Operations for managing memory stores. */\n memoryStores: _getBetaMemoryStoresOperations(context),\n /** Operations for managing evaluation insights. */\n insights: _getBetaInsightsOperations(context),\n /** Operations for managing evaluators. */\n evaluators: _getBetaEvaluatorsOperations(context),\n /** Operations for managing evaluation taxonomies. */\n evaluationTaxonomies: _getBetaEvaluationTaxonomiesOperations(context),\n /** Operations for managing agents. */\n agents: _getBetaAgentsOperations(context, tracingConfig),\n /** Operations for managing Agent Insights monitors. */\n agentInsightMonitors: _getBetaAgentInsightMonitorsOperations(context),\n /** Operations for managing voice agent conversations and telephony. */\n voiceAgents: _getBetaVoiceAgentsOperations(\n context,\n credential,\n endpoint,\n realtimeOptions,\n tracingConfig,\n ),\n };\n}\n"]}
|
|
@@ -2,6 +2,7 @@ import type { AIProjectContext } from "../../../../api/aiProjectContext.js";
|
|
|
2
2
|
import type { BetaVoiceAgentsConversationsDownloadAudioOptionalParams, BetaVoiceAgentsConversationsGetAudioOptionalParams, BetaVoiceAgentsConversationsDownloadGeneratedAudioItemOptionalParams, BetaVoiceAgentsConversationsGetGeneratedAudioItemOptionalParams, BetaVoiceAgentsConversationsDownloadAudioItemOptionalParams, BetaVoiceAgentsConversationsGetAudioItemOptionalParams, BetaVoiceAgentsConversationsGetItemOptionalParams, BetaVoiceAgentsConversationsListItemsOptionalParams, BetaVoiceAgentsConversationsListResponseItemsOptionalParams, BetaVoiceAgentsConversationsGetResponseOptionalParams, BetaVoiceAgentsConversationsListResponsesOptionalParams, BetaVoiceAgentsConversationsDeleteOptionalParams, BetaVoiceAgentsConversationsGetOptionalParams, BetaVoiceAgentsConversationsListOptionalParams } from "../../../../api/beta/voiceAgents/conversations/options.js";
|
|
3
3
|
import type { VoiceConversation, VoiceResponse, RealtimeConversationItemUnion, VoiceAudioItem, VoiceGeneratedAudioItem, VoiceRecording, BetaVoiceAgentsConversationsDownloadAudioResponse, BetaVoiceAgentsConversationsDownloadGeneratedAudioItemResponse, BetaVoiceAgentsConversationsDownloadAudioItemResponse } from "../../../../models/models.js";
|
|
4
4
|
import type { PagedAsyncIterableIterator } from "@azure/core-paging";
|
|
5
|
+
import type { ResolvedTracingConfig } from "../../../../tracing/configuration.js";
|
|
5
6
|
/** Operations for managing voice agent conversations. */
|
|
6
7
|
export interface BetaVoiceAgentsConversationsOperations {
|
|
7
8
|
/**
|
|
@@ -111,5 +112,5 @@ export interface BetaVoiceAgentsConversationsOperations {
|
|
|
111
112
|
*/
|
|
112
113
|
list: (agentName: string, options?: BetaVoiceAgentsConversationsListOptionalParams) => PagedAsyncIterableIterator<VoiceConversation>;
|
|
113
114
|
}
|
|
114
|
-
export declare function _getBetaVoiceAgentsConversationsOperations(context: AIProjectContext): BetaVoiceAgentsConversationsOperations;
|
|
115
|
+
export declare function _getBetaVoiceAgentsConversationsOperations(context: AIProjectContext, tracingConfig?: ResolvedTracingConfig): BetaVoiceAgentsConversationsOperations;
|
|
115
116
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/classic/beta/voiceAgents/conversations/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AAiB5E,OAAO,KAAK,EACV,uDAAuD,EACvD,kDAAkD,EAClD,oEAAoE,EACpE,+DAA+D,EAC/D,2DAA2D,EAC3D,sDAAsD,EACtD,iDAAiD,EACjD,mDAAmD,EACnD,2DAA2D,EAC3D,qDAAqD,EACrD,uDAAuD,EACvD,gDAAgD,EAChD,6CAA6C,EAC7C,8CAA8C,EAC/C,MAAM,2DAA2D,CAAC;AACnE,OAAO,KAAK,EACV,iBAAiB,EACjB,aAAa,EACb,6BAA6B,EAC7B,cAAc,EACd,uBAAuB,EACvB,cAAc,EACd,iDAAiD,EACjD,8DAA8D,EAC9D,qDAAqD,EACtD,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/classic/beta/voiceAgents/conversations/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AAiB5E,OAAO,KAAK,EACV,uDAAuD,EACvD,kDAAkD,EAClD,oEAAoE,EACpE,+DAA+D,EAC/D,2DAA2D,EAC3D,sDAAsD,EACtD,iDAAiD,EACjD,mDAAmD,EACnD,2DAA2D,EAC3D,qDAAqD,EACrD,uDAAuD,EACvD,gDAAgD,EAChD,6CAA6C,EAC7C,8CAA8C,EAC/C,MAAM,2DAA2D,CAAC;AACnE,OAAO,KAAK,EACV,iBAAiB,EACjB,aAAa,EACb,6BAA6B,EAC7B,cAAc,EACd,uBAAuB,EACvB,cAAc,EACd,iDAAiD,EACjD,8DAA8D,EAC9D,qDAAqD,EACtD,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAGlF,yDAAyD;AACzD,MAAM,WAAW,sCAAsC;IACrD;;;;;;;;;;OAUG;IACH,aAAa,EAAE,CACb,SAAS,EAAE,MAAM,EACjB,cAAc,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE,uDAAuD,KAC9D,OAAO,CAAC,iDAAiD,CAAC,CAAC;IAChE;;;;;;;;;;;OAWG;IACH,QAAQ,EAAE,CACR,SAAS,EAAE,MAAM,EACjB,cAAc,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE,kDAAkD,KACzD,OAAO,CAAC,cAAc,CAAC,CAAC;IAC7B;;;;;;;OAOG;IACH,0BAA0B,EAAE,CAC1B,SAAS,EAA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,EACjB,cAAc,EAAE,MAAM,EACtB,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,qDAAqD,KAC5D,OAAO,CAAC,aAAa,CAAC,CAAC;IAC5B;;;;OAIG;IACH,aAAa,EAAE,CACb,SAAS,EAAE,MAAM,EACjB,cAAc,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE,uDAAuD,KAC9D,0BAA0B,CAAC,aAAa,CAAC,CAAC;IAC/C;;;OAGG;IACH,MAAM,EAAE,CACN,SAAS,EAAE,MAAM,EACjB,cAAc,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE,gDAAgD,KACvD,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB;;;OAGG;IACH,GAAG,EAAE,CACH,SAAS,EAAE,MAAM,EACjB,cAAc,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE,6CAA6C,KACpD,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAChC;;;;OAIG;IACH,IAAI,EAAE,CACJ,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,8CAA8C,KACrD,0BAA0B,CAAC,iBAAiB,CAAC,CAAC;CACpD;AA0FD,wBAAgB,0CAA0C,CACxD,OAAO,EAAE,gBAAgB,EACzB,aAAa,CAAC,EAAE,qBAAqB,GACpC,sCAAsC,CAExC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
import { downloadAudio, getAudio, downloadGeneratedAudioItem, getGeneratedAudioItem, downloadAudioItem, getAudioItem, getItem, listItems, listResponseItems, getResponse, listResponses, $delete, get, list, } from "../../../../api/beta/voiceAgents/conversations/operations.js";
|
|
4
|
-
|
|
4
|
+
import { traceVoiceAgentOperation } from "../../../../tracing/voiceAgentTracing.js";
|
|
5
|
+
function _getBetaVoiceAgentsConversations(context, tracingConfig) {
|
|
5
6
|
return {
|
|
6
7
|
downloadAudio: (agentName, conversationId, options) => downloadAudio(context, agentName, conversationId, options),
|
|
7
8
|
getAudio: (agentName, conversationId, options) => getAudio(context, agentName, conversationId, options),
|
|
@@ -14,12 +15,12 @@ function _getBetaVoiceAgentsConversations(context) {
|
|
|
14
15
|
listResponseItems: (agentName, conversationId, responseId, options) => listResponseItems(context, agentName, conversationId, responseId, options),
|
|
15
16
|
getResponse: (agentName, conversationId, responseId, options) => getResponse(context, agentName, conversationId, responseId, options),
|
|
16
17
|
listResponses: (agentName, conversationId, options) => listResponses(context, agentName, conversationId, options),
|
|
17
|
-
delete: (agentName, conversationId, options) => $delete(context, agentName, conversationId, options),
|
|
18
|
+
delete: (agentName, conversationId, options) => traceVoiceAgentOperation("voice_agents.conversations.delete", context.endpoint, tracingConfig, () => $delete(context, agentName, conversationId, options)),
|
|
18
19
|
get: (agentName, conversationId, options) => get(context, agentName, conversationId, options),
|
|
19
20
|
list: (agentName, options) => list(context, agentName, options),
|
|
20
21
|
};
|
|
21
22
|
}
|
|
22
|
-
export function _getBetaVoiceAgentsConversationsOperations(context) {
|
|
23
|
-
return { ..._getBetaVoiceAgentsConversations(context) };
|
|
23
|
+
export function _getBetaVoiceAgentsConversationsOperations(context, tracingConfig) {
|
|
24
|
+
return { ..._getBetaVoiceAgentsConversations(context, tracingConfig) };
|
|
24
25
|
}
|
|
25
26
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/classic/beta/voiceAgents/conversations/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EACL,aAAa,EACb,QAAQ,EACR,0BAA0B,EAC1B,qBAAqB,EACrB,iBAAiB,EACjB,YAAY,EACZ,OAAO,EACP,SAAS,EACT,iBAAiB,EACjB,WAAW,EACX,aAAa,EACb,OAAO,EACP,GAAG,EACH,IAAI,GACL,MAAM,8DAA8D,CAAC;AA0MtE,SAAS,gCAAgC,CACvC,OAAyB;IAEzB,OAAO;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BAAiB,EAAE,CACjB,SAAiB,EACjB,cAAsB,EACtB,UAAkB,EAClB,OAAqE,EACrE,EAAE,CAAC,iBAAiB,CAAC,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,UAAU,EAAE,OAAO,CAAC;QAC/E,WAAW,EAAE,CACX,SAAiB,EACjB,cAAsB,EACtB,UAAkB,EAClB,OAA+D,EAC/D,EAAE,CAAC,WAAW,CAAC,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,UAAU,EAAE,OAAO,CAAC;QACzE,aAAa,EAAE,CACb,SAAiB,EACjB,cAAsB,EACtB,OAAiE,EACjE,EAAE,CAAC,aAAa,CAAC,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,OAAO,CAAC;QAC/D,MAAM,EAAE,CACN,SAAiB,EACjB,cAAsB,EACtB,OAA0D,EAC1D,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,OAAO,CAAC;QACzD,GAAG,EAAE,CACH,SAAiB,EACjB,cAAsB,EACtB,OAAuD,EACvD,EAAE,CAAC,GAAG,CAAC,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,OAAO,CAAC;QACrD,IAAI,EAAE,CAAC,SAAiB,EAAE,OAAwD,EAAE,EAAE,CACpF,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC;KACpC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,0CAA0C,CACxD,OAAyB;IAEzB,OAAO,EAAE,GAAG,gCAAgC,CAAC,OAAO,CAAC,EAAE,CAAC;AAC1D,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AIProjectContext } from \"../../../../api/aiProjectContext.js\";\nimport {\n downloadAudio,\n getAudio,\n downloadGeneratedAudioItem,\n getGeneratedAudioItem,\n downloadAudioItem,\n getAudioItem,\n getItem,\n listItems,\n listResponseItems,\n getResponse,\n listResponses,\n $delete,\n get,\n list,\n} from \"../../../../api/beta/voiceAgents/conversations/operations.js\";\nimport type {\n BetaVoiceAgentsConversationsDownloadAudioOptionalParams,\n BetaVoiceAgentsConversationsGetAudioOptionalParams,\n BetaVoiceAgentsConversationsDownloadGeneratedAudioItemOptionalParams,\n BetaVoiceAgentsConversationsGetGeneratedAudioItemOptionalParams,\n BetaVoiceAgentsConversationsDownloadAudioItemOptionalParams,\n BetaVoiceAgentsConversationsGetAudioItemOptionalParams,\n BetaVoiceAgentsConversationsGetItemOptionalParams,\n BetaVoiceAgentsConversationsListItemsOptionalParams,\n BetaVoiceAgentsConversationsListResponseItemsOptionalParams,\n BetaVoiceAgentsConversationsGetResponseOptionalParams,\n BetaVoiceAgentsConversationsListResponsesOptionalParams,\n BetaVoiceAgentsConversationsDeleteOptionalParams,\n BetaVoiceAgentsConversationsGetOptionalParams,\n BetaVoiceAgentsConversationsListOptionalParams,\n} from \"../../../../api/beta/voiceAgents/conversations/options.js\";\nimport type {\n VoiceConversation,\n VoiceResponse,\n RealtimeConversationItemUnion,\n VoiceAudioItem,\n VoiceGeneratedAudioItem,\n VoiceRecording,\n BetaVoiceAgentsConversationsDownloadAudioResponse,\n BetaVoiceAgentsConversationsDownloadGeneratedAudioItemResponse,\n BetaVoiceAgentsConversationsDownloadAudioItemResponse,\n} from \"../../../../models/models.js\";\nimport type { PagedAsyncIterableIterator } from \"@azure/core-paging\";\n\n/** Operations for managing voice agent conversations. */\nexport interface BetaVoiceAgentsConversationsOperations {\n /**\n * Streams the whole-call merged stereo recording as a WAV (`audio/wav`) byte stream through the service\n * (no SAS URL). This route serves Foundry-managed storage only. For bring-your-own-storage (BYOS)\n * recordings the bytes are not proxied — the caller must download directly from customer storage using the\n * `blob_uri` returned by the metadata route — so this route returns `409 Conflict` for BYOS recordings.\n * While the conversation is `in_progress`, this route returns retriable `409 Conflict` with\n * `error.code = recording_not_ready` and a `Retry-After` header when retry guidance is available. When the\n * conversation is `failed`, it returns terminal `409 Conflict` with `error.code = recording_unavailable`.\n * For a `completed` conversation, content is available subject to the existing BYOS behavior. A conversation\n * without persisted audio (`store = false`) returns `404`.\n */\n downloadAudio: (\n agentName: string,\n conversationId: string,\n options?: BetaVoiceAgentsConversationsDownloadAudioOptionalParams,\n ) => Promise<BetaVoiceAgentsConversationsDownloadAudioResponse>;\n /**\n * Returns metadata for the whole-call merged stereo recording (user audio on the left channel, agent audio\n * on the right). The common metadata (format, sample rate, channels, channel layout, duration) is returned\n * for both Foundry-managed and bring-your-own-storage (BYOS) recordings; for BYOS the response additionally\n * includes `blob_uri`, the URI of the recording in the customer's own storage (no SAS) that the customer downloads\n * with their own credentials. The recording is built once from the per-turn segments after persistence\n * finalization succeeds. While the conversation is `in_progress`, this route returns retriable `409 Conflict`\n * with `error.code = recording_not_ready` and a `Retry-After` header when retry guidance is available. When the\n * conversation is `failed`, it returns terminal `409 Conflict` with `error.code = recording_unavailable`.\n * For a `completed` conversation, metadata is available subject to the existing BYOS behavior. Requires the\n * conversation to have persisted audio (`store = true`); otherwise returns `404`.\n */\n getAudio: (\n agentName: string,\n conversationId: string,\n options?: BetaVoiceAgentsConversationsGetAudioOptionalParams,\n ) => Promise<VoiceRecording>;\n /**\n * Streams a conversation item's generated audio as a WAV (`audio/wav`) byte stream through the service. This\n * subordinate artifact exists only when playback was interrupted and the service rendered more audio than the\n * listener heard, including when the response ends as cancelled. This route serves Foundry-managed storage only.\n * For bring-your-own-storage (BYOS) recordings the bytes are not proxied, so this route returns `409 Conflict`.\n * Returns `404` when the conversation or item was not persisted, or when no generated audio exists beyond the\n * heard segment.\n */\n downloadGeneratedAudioItem: (\n agentName: string,\n conversationId: string,\n itemId: string,\n options?: BetaVoiceAgentsConversationsDownloadGeneratedAudioItemOptionalParams,\n ) => Promise<BetaVoiceAgentsConversationsDownloadGeneratedAudioItemResponse>;\n /**\n * Returns metadata for a conversation item's generated audio. This subordinate artifact is separate from the\n * canonical heard-audio segment and exists only when playback was interrupted and the service rendered more audio\n * than the listener heard, including when the response ends as cancelled. Returns `404` when the conversation or\n * item was not persisted, or when no generated audio exists beyond the heard segment.\n */\n getGeneratedAudioItem: (\n agentName: string,\n conversationId: string,\n itemId: string,\n options?: BetaVoiceAgentsConversationsGetGeneratedAudioItemOptionalParams,\n ) => Promise<VoiceGeneratedAudioItem>;\n /**\n * Streams a single conversation item's audio as a WAV (`audio/wav`) byte stream through the service (no SAS\n * URL). This route serves Foundry-managed storage only. For bring-your-own-storage (BYOS) recordings the\n * bytes are not proxied — the caller must download directly from customer storage using the `blob_uri`\n * returned by the item's `/audio` metadata route — so this route returns `409 Conflict` for BYOS recordings.\n * Returns `404` when the conversation, item, or its audio was not persisted (`store = false`).\n */\n downloadAudioItem: (\n agentName: string,\n conversationId: string,\n itemId: string,\n options?: BetaVoiceAgentsConversationsDownloadAudioItemOptionalParams,\n ) => Promise<BetaVoiceAgentsConversationsDownloadAudioItemResponse>;\n /**\n * Returns metadata for a single conversation item's audio segment, including the common playback facts\n * (role, format/codec, sample rate, channels, offset, duration) for both Foundry-managed and\n * bring-your-own-storage (BYOS) recordings; for BYOS the response additionally includes `blob_uri`, the URI\n * of the recording in the customer's own storage (no SAS) that the customer downloads with their own credentials.\n * Requires the conversation to have persisted audio (`store = true`); returns `404` when the conversation,\n * item, or its audio was not persisted.\n */\n getAudioItem: (\n agentName: string,\n conversationId: string,\n itemId: string,\n options?: BetaVoiceAgentsConversationsGetAudioItemOptionalParams,\n ) => Promise<VoiceAudioItem>;\n /**\n * Retrieves a single item from the specified conversation by its id, including its transcript. An\n * `input_audio`/`output_audio` content part indicates that audio is available for the item; the canonical per-item\n * audio metadata is the `/items/{item_id}/audio` resource, and the bytes are streamed by\n * `/items/{item_id}/audio/content`. Returns `404` when the conversation or item was not persisted\n * (`store = false`).\n */\n getItem: (\n agentName: string,\n conversationId: string,\n itemId: string,\n options?: BetaVoiceAgentsConversationsGetItemOptionalParams,\n ) => Promise<RealtimeConversationItemUnion>;\n /**\n * Returns a paged collection of items — the complete ordered conversation history, including user input,\n * assistant output, and client-created tool outputs (transcripts + tool events). Returns `404` when the\n * conversation was not persisted (`store = false`).\n */\n listItems: (\n agentName: string,\n conversationId: string,\n options?: BetaVoiceAgentsConversationsListItemsOptionalParams,\n ) => PagedAsyncIterableIterator<RealtimeConversationItemUnion>;\n /**\n * Returns a paged collection of the output items produced by a specific response (the response's output\n * projection). For the complete ordered conversation history — including user input and client-created\n * tool outputs — use the conversation items route instead. Returns `404` when the conversation or\n * response was not persisted (`store = false`).\n */\n listResponseItems: (\n agentName: string,\n conversationId: string,\n responseId: string,\n options?: BetaVoiceAgentsConversationsListResponseItemsOptionalParams,\n ) => PagedAsyncIterableIterator<RealtimeConversationItemUnion>;\n /**\n * Retrieves a single response from the specified conversation by its id, including its `output` items,\n * `usage`, and status. Returns `404` when the conversation or response was not persisted (`store = false`).\n */\n getResponse: (\n agentName: string,\n conversationId: string,\n responseId: string,\n options?: BetaVoiceAgentsConversationsGetResponseOptionalParams,\n ) => Promise<VoiceResponse>;\n /**\n * Returns a paged collection of the responses (model inference turns) recorded for the specified\n * conversation. The per-response `output` projection may be omitted here; use the response-items route\n * for the canonical paged output. Returns `404` when the conversation was not persisted (`store = false`).\n */\n listResponses: (\n agentName: string,\n conversationId: string,\n options?: BetaVoiceAgentsConversationsListResponsesOptionalParams,\n ) => PagedAsyncIterableIterator<VoiceResponse>;\n /**\n * Deletes a conversation and all of its stored data — responses, items, and any audio (cascade). This is\n * the customer's explicit data-deletion control for voice conversations.\n */\n delete: (\n agentName: string,\n conversationId: string,\n options?: BetaVoiceAgentsConversationsDeleteOptionalParams,\n ) => Promise<void>;\n /**\n * Retrieves a single conversation recorded for the specified voice agent endpoint by its id.\n * Returns `404` when the conversation was not persisted (`store = false`) or does not exist.\n */\n get: (\n agentName: string,\n conversationId: string,\n options?: BetaVoiceAgentsConversationsGetOptionalParams,\n ) => Promise<VoiceConversation>;\n /**\n * Returns the conversations persisted for the specified voice agent endpoint.\n * Conversations are present when the session's effective `store` setting is `true`, whether inherited from the\n * agent definition or enabled by the WebSocket session override.\n */\n list: (\n agentName: string,\n options?: BetaVoiceAgentsConversationsListOptionalParams,\n ) => PagedAsyncIterableIterator<VoiceConversation>;\n}\n\nfunction _getBetaVoiceAgentsConversations(\n context: AIProjectContext,\n): BetaVoiceAgentsConversationsOperations {\n return {\n downloadAudio: (\n agentName: string,\n conversationId: string,\n options?: BetaVoiceAgentsConversationsDownloadAudioOptionalParams,\n ) => downloadAudio(context, agentName, conversationId, options),\n getAudio: (\n agentName: string,\n conversationId: string,\n options?: BetaVoiceAgentsConversationsGetAudioOptionalParams,\n ) => getAudio(context, agentName, conversationId, options),\n downloadGeneratedAudioItem: (\n agentName: string,\n conversationId: string,\n itemId: string,\n options?: BetaVoiceAgentsConversationsDownloadGeneratedAudioItemOptionalParams,\n ) => downloadGeneratedAudioItem(context, agentName, conversationId, itemId, options),\n getGeneratedAudioItem: (\n agentName: string,\n conversationId: string,\n itemId: string,\n options?: BetaVoiceAgentsConversationsGetGeneratedAudioItemOptionalParams,\n ) => getGeneratedAudioItem(context, agentName, conversationId, itemId, options),\n downloadAudioItem: (\n agentName: string,\n conversationId: string,\n itemId: string,\n options?: BetaVoiceAgentsConversationsDownloadAudioItemOptionalParams,\n ) => downloadAudioItem(context, agentName, conversationId, itemId, options),\n getAudioItem: (\n agentName: string,\n conversationId: string,\n itemId: string,\n options?: BetaVoiceAgentsConversationsGetAudioItemOptionalParams,\n ) => getAudioItem(context, agentName, conversationId, itemId, options),\n getItem: (\n agentName: string,\n conversationId: string,\n itemId: string,\n options?: BetaVoiceAgentsConversationsGetItemOptionalParams,\n ) => getItem(context, agentName, conversationId, itemId, options),\n listItems: (\n agentName: string,\n conversationId: string,\n options?: BetaVoiceAgentsConversationsListItemsOptionalParams,\n ) => listItems(context, agentName, conversationId, options),\n listResponseItems: (\n agentName: string,\n conversationId: string,\n responseId: string,\n options?: BetaVoiceAgentsConversationsListResponseItemsOptionalParams,\n ) => listResponseItems(context, agentName, conversationId, responseId, options),\n getResponse: (\n agentName: string,\n conversationId: string,\n responseId: string,\n options?: BetaVoiceAgentsConversationsGetResponseOptionalParams,\n ) => getResponse(context, agentName, conversationId, responseId, options),\n listResponses: (\n agentName: string,\n conversationId: string,\n options?: BetaVoiceAgentsConversationsListResponsesOptionalParams,\n ) => listResponses(context, agentName, conversationId, options),\n delete: (\n agentName: string,\n conversationId: string,\n options?: BetaVoiceAgentsConversationsDeleteOptionalParams,\n ) => $delete(context, agentName, conversationId, options),\n get: (\n agentName: string,\n conversationId: string,\n options?: BetaVoiceAgentsConversationsGetOptionalParams,\n ) => get(context, agentName, conversationId, options),\n list: (agentName: string, options?: BetaVoiceAgentsConversationsListOptionalParams) =>\n list(context, agentName, options),\n };\n}\n\nexport function _getBetaVoiceAgentsConversationsOperations(\n context: AIProjectContext,\n): BetaVoiceAgentsConversationsOperations {\n return { ..._getBetaVoiceAgentsConversations(context) };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/classic/beta/voiceAgents/conversations/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EACL,aAAa,EACb,QAAQ,EACR,0BAA0B,EAC1B,qBAAqB,EACrB,iBAAiB,EACjB,YAAY,EACZ,OAAO,EACP,SAAS,EACT,iBAAiB,EACjB,WAAW,EACX,aAAa,EACb,OAAO,EACP,GAAG,EACH,IAAI,GACL,MAAM,8DAA8D,CAAC;AA8BtE,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AA8KpF,SAAS,gCAAgC,CACvC,OAAyB,EACzB,aAAqC;IAErC,OAAO;QACL,aAAa,EAAE,CACb,SAAiB,EACjB,cAAsB,EACtB,OAAiE,EACjE,EAAE,CAAC,aAAa,CAAC,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,OAAO,CAAC;QAC/D,QAAQ,EAAE,CACR,SAAiB,EACjB,cAAsB,EACtB,OAA4D,EAC5D,EAAE,CAAC,QAAQ,CAAC,OAAO,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AC/D,EAAE,CAAC,WAAW,CAAC,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,UAAU,EAAE,OAAO,CAAC;QACzE,aAAa,EAAE,CACb,SAAiB,EACjB,cAAsB,EACtB,OAAiE,EACjE,EAAE,CAAC,aAAa,CAAC,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,OAAO,CAAC;QAC/D,MAAM,EAAE,CACN,SAAiB,EACjB,cAAsB,EACtB,OAA0D,EAC1D,EAAE,CACF,wBAAwB,CACtB,mCAAmC,EACnC,OAAO,CAAC,QAAQ,EAChB,aAAa,EACb,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,OAAO,CAAC,CAC3D;QACH,GAAG,EAAE,CACH,SAAiB,EACjB,cAAsB,EACtB,OAAuD,EACvD,EAAE,CAAC,GAAG,CAAC,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,OAAO,CAAC;QACrD,IAAI,EAAE,CAAC,SAAiB,EAAE,OAAwD,EAAE,EAAE,CACpF,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC;KACpC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,0CAA0C,CACxD,OAAyB,EACzB,aAAqC;IAErC,OAAO,EAAE,GAAG,gCAAgC,CAAC,OAAO,EAAE,aAAa,CAAC,EAAE,CAAC;AACzE,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AIProjectContext } from \"../../../../api/aiProjectContext.js\";\nimport {\n downloadAudio,\n getAudio,\n downloadGeneratedAudioItem,\n getGeneratedAudioItem,\n downloadAudioItem,\n getAudioItem,\n getItem,\n listItems,\n listResponseItems,\n getResponse,\n listResponses,\n $delete,\n get,\n list,\n} from \"../../../../api/beta/voiceAgents/conversations/operations.js\";\nimport type {\n BetaVoiceAgentsConversationsDownloadAudioOptionalParams,\n BetaVoiceAgentsConversationsGetAudioOptionalParams,\n BetaVoiceAgentsConversationsDownloadGeneratedAudioItemOptionalParams,\n BetaVoiceAgentsConversationsGetGeneratedAudioItemOptionalParams,\n BetaVoiceAgentsConversationsDownloadAudioItemOptionalParams,\n BetaVoiceAgentsConversationsGetAudioItemOptionalParams,\n BetaVoiceAgentsConversationsGetItemOptionalParams,\n BetaVoiceAgentsConversationsListItemsOptionalParams,\n BetaVoiceAgentsConversationsListResponseItemsOptionalParams,\n BetaVoiceAgentsConversationsGetResponseOptionalParams,\n BetaVoiceAgentsConversationsListResponsesOptionalParams,\n BetaVoiceAgentsConversationsDeleteOptionalParams,\n BetaVoiceAgentsConversationsGetOptionalParams,\n BetaVoiceAgentsConversationsListOptionalParams,\n} from \"../../../../api/beta/voiceAgents/conversations/options.js\";\nimport type {\n VoiceConversation,\n VoiceResponse,\n RealtimeConversationItemUnion,\n VoiceAudioItem,\n VoiceGeneratedAudioItem,\n VoiceRecording,\n BetaVoiceAgentsConversationsDownloadAudioResponse,\n BetaVoiceAgentsConversationsDownloadGeneratedAudioItemResponse,\n BetaVoiceAgentsConversationsDownloadAudioItemResponse,\n} from \"../../../../models/models.js\";\nimport type { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport type { ResolvedTracingConfig } from \"../../../../tracing/configuration.js\";\nimport { traceVoiceAgentOperation } from \"../../../../tracing/voiceAgentTracing.js\";\n\n/** Operations for managing voice agent conversations. */\nexport interface BetaVoiceAgentsConversationsOperations {\n /**\n * Streams the whole-call merged stereo recording as a WAV (`audio/wav`) byte stream through the service\n * (no SAS URL). This route serves Foundry-managed storage only. For bring-your-own-storage (BYOS)\n * recordings the bytes are not proxied — the caller must download directly from customer storage using the\n * `blob_uri` returned by the metadata route — so this route returns `409 Conflict` for BYOS recordings.\n * While the conversation is `in_progress`, this route returns retriable `409 Conflict` with\n * `error.code = recording_not_ready` and a `Retry-After` header when retry guidance is available. When the\n * conversation is `failed`, it returns terminal `409 Conflict` with `error.code = recording_unavailable`.\n * For a `completed` conversation, content is available subject to the existing BYOS behavior. A conversation\n * without persisted audio (`store = false`) returns `404`.\n */\n downloadAudio: (\n agentName: string,\n conversationId: string,\n options?: BetaVoiceAgentsConversationsDownloadAudioOptionalParams,\n ) => Promise<BetaVoiceAgentsConversationsDownloadAudioResponse>;\n /**\n * Returns metadata for the whole-call merged stereo recording (user audio on the left channel, agent audio\n * on the right). The common metadata (format, sample rate, channels, channel layout, duration) is returned\n * for both Foundry-managed and bring-your-own-storage (BYOS) recordings; for BYOS the response additionally\n * includes `blob_uri`, the URI of the recording in the customer's own storage (no SAS) that the customer downloads\n * with their own credentials. The recording is built once from the per-turn segments after persistence\n * finalization succeeds. While the conversation is `in_progress`, this route returns retriable `409 Conflict`\n * with `error.code = recording_not_ready` and a `Retry-After` header when retry guidance is available. When the\n * conversation is `failed`, it returns terminal `409 Conflict` with `error.code = recording_unavailable`.\n * For a `completed` conversation, metadata is available subject to the existing BYOS behavior. Requires the\n * conversation to have persisted audio (`store = true`); otherwise returns `404`.\n */\n getAudio: (\n agentName: string,\n conversationId: string,\n options?: BetaVoiceAgentsConversationsGetAudioOptionalParams,\n ) => Promise<VoiceRecording>;\n /**\n * Streams a conversation item's generated audio as a WAV (`audio/wav`) byte stream through the service. This\n * subordinate artifact exists only when playback was interrupted and the service rendered more audio than the\n * listener heard, including when the response ends as cancelled. This route serves Foundry-managed storage only.\n * For bring-your-own-storage (BYOS) recordings the bytes are not proxied, so this route returns `409 Conflict`.\n * Returns `404` when the conversation or item was not persisted, or when no generated audio exists beyond the\n * heard segment.\n */\n downloadGeneratedAudioItem: (\n agentName: string,\n conversationId: string,\n itemId: string,\n options?: BetaVoiceAgentsConversationsDownloadGeneratedAudioItemOptionalParams,\n ) => Promise<BetaVoiceAgentsConversationsDownloadGeneratedAudioItemResponse>;\n /**\n * Returns metadata for a conversation item's generated audio. This subordinate artifact is separate from the\n * canonical heard-audio segment and exists only when playback was interrupted and the service rendered more audio\n * than the listener heard, including when the response ends as cancelled. Returns `404` when the conversation or\n * item was not persisted, or when no generated audio exists beyond the heard segment.\n */\n getGeneratedAudioItem: (\n agentName: string,\n conversationId: string,\n itemId: string,\n options?: BetaVoiceAgentsConversationsGetGeneratedAudioItemOptionalParams,\n ) => Promise<VoiceGeneratedAudioItem>;\n /**\n * Streams a single conversation item's audio as a WAV (`audio/wav`) byte stream through the service (no SAS\n * URL). This route serves Foundry-managed storage only. For bring-your-own-storage (BYOS) recordings the\n * bytes are not proxied — the caller must download directly from customer storage using the `blob_uri`\n * returned by the item's `/audio` metadata route — so this route returns `409 Conflict` for BYOS recordings.\n * Returns `404` when the conversation, item, or its audio was not persisted (`store = false`).\n */\n downloadAudioItem: (\n agentName: string,\n conversationId: string,\n itemId: string,\n options?: BetaVoiceAgentsConversationsDownloadAudioItemOptionalParams,\n ) => Promise<BetaVoiceAgentsConversationsDownloadAudioItemResponse>;\n /**\n * Returns metadata for a single conversation item's audio segment, including the common playback facts\n * (role, format/codec, sample rate, channels, offset, duration) for both Foundry-managed and\n * bring-your-own-storage (BYOS) recordings; for BYOS the response additionally includes `blob_uri`, the URI\n * of the recording in the customer's own storage (no SAS) that the customer downloads with their own credentials.\n * Requires the conversation to have persisted audio (`store = true`); returns `404` when the conversation,\n * item, or its audio was not persisted.\n */\n getAudioItem: (\n agentName: string,\n conversationId: string,\n itemId: string,\n options?: BetaVoiceAgentsConversationsGetAudioItemOptionalParams,\n ) => Promise<VoiceAudioItem>;\n /**\n * Retrieves a single item from the specified conversation by its id, including its transcript. An\n * `input_audio`/`output_audio` content part indicates that audio is available for the item; the canonical per-item\n * audio metadata is the `/items/{item_id}/audio` resource, and the bytes are streamed by\n * `/items/{item_id}/audio/content`. Returns `404` when the conversation or item was not persisted\n * (`store = false`).\n */\n getItem: (\n agentName: string,\n conversationId: string,\n itemId: string,\n options?: BetaVoiceAgentsConversationsGetItemOptionalParams,\n ) => Promise<RealtimeConversationItemUnion>;\n /**\n * Returns a paged collection of items — the complete ordered conversation history, including user input,\n * assistant output, and client-created tool outputs (transcripts + tool events). Returns `404` when the\n * conversation was not persisted (`store = false`).\n */\n listItems: (\n agentName: string,\n conversationId: string,\n options?: BetaVoiceAgentsConversationsListItemsOptionalParams,\n ) => PagedAsyncIterableIterator<RealtimeConversationItemUnion>;\n /**\n * Returns a paged collection of the output items produced by a specific response (the response's output\n * projection). For the complete ordered conversation history — including user input and client-created\n * tool outputs — use the conversation items route instead. Returns `404` when the conversation or\n * response was not persisted (`store = false`).\n */\n listResponseItems: (\n agentName: string,\n conversationId: string,\n responseId: string,\n options?: BetaVoiceAgentsConversationsListResponseItemsOptionalParams,\n ) => PagedAsyncIterableIterator<RealtimeConversationItemUnion>;\n /**\n * Retrieves a single response from the specified conversation by its id, including its `output` items,\n * `usage`, and status. Returns `404` when the conversation or response was not persisted (`store = false`).\n */\n getResponse: (\n agentName: string,\n conversationId: string,\n responseId: string,\n options?: BetaVoiceAgentsConversationsGetResponseOptionalParams,\n ) => Promise<VoiceResponse>;\n /**\n * Returns a paged collection of the responses (model inference turns) recorded for the specified\n * conversation. The per-response `output` projection may be omitted here; use the response-items route\n * for the canonical paged output. Returns `404` when the conversation was not persisted (`store = false`).\n */\n listResponses: (\n agentName: string,\n conversationId: string,\n options?: BetaVoiceAgentsConversationsListResponsesOptionalParams,\n ) => PagedAsyncIterableIterator<VoiceResponse>;\n /**\n * Deletes a conversation and all of its stored data — responses, items, and any audio (cascade). This is\n * the customer's explicit data-deletion control for voice conversations.\n */\n delete: (\n agentName: string,\n conversationId: string,\n options?: BetaVoiceAgentsConversationsDeleteOptionalParams,\n ) => Promise<void>;\n /**\n * Retrieves a single conversation recorded for the specified voice agent endpoint by its id.\n * Returns `404` when the conversation was not persisted (`store = false`) or does not exist.\n */\n get: (\n agentName: string,\n conversationId: string,\n options?: BetaVoiceAgentsConversationsGetOptionalParams,\n ) => Promise<VoiceConversation>;\n /**\n * Returns the conversations persisted for the specified voice agent endpoint.\n * Conversations are present when the session's effective `store` setting is `true`, whether inherited from the\n * agent definition or enabled by the WebSocket session override.\n */\n list: (\n agentName: string,\n options?: BetaVoiceAgentsConversationsListOptionalParams,\n ) => PagedAsyncIterableIterator<VoiceConversation>;\n}\n\nfunction _getBetaVoiceAgentsConversations(\n context: AIProjectContext,\n tracingConfig?: ResolvedTracingConfig,\n): BetaVoiceAgentsConversationsOperations {\n return {\n downloadAudio: (\n agentName: string,\n conversationId: string,\n options?: BetaVoiceAgentsConversationsDownloadAudioOptionalParams,\n ) => downloadAudio(context, agentName, conversationId, options),\n getAudio: (\n agentName: string,\n conversationId: string,\n options?: BetaVoiceAgentsConversationsGetAudioOptionalParams,\n ) => getAudio(context, agentName, conversationId, options),\n downloadGeneratedAudioItem: (\n agentName: string,\n conversationId: string,\n itemId: string,\n options?: BetaVoiceAgentsConversationsDownloadGeneratedAudioItemOptionalParams,\n ) => downloadGeneratedAudioItem(context, agentName, conversationId, itemId, options),\n getGeneratedAudioItem: (\n agentName: string,\n conversationId: string,\n itemId: string,\n options?: BetaVoiceAgentsConversationsGetGeneratedAudioItemOptionalParams,\n ) => getGeneratedAudioItem(context, agentName, conversationId, itemId, options),\n downloadAudioItem: (\n agentName: string,\n conversationId: string,\n itemId: string,\n options?: BetaVoiceAgentsConversationsDownloadAudioItemOptionalParams,\n ) => downloadAudioItem(context, agentName, conversationId, itemId, options),\n getAudioItem: (\n agentName: string,\n conversationId: string,\n itemId: string,\n options?: BetaVoiceAgentsConversationsGetAudioItemOptionalParams,\n ) => getAudioItem(context, agentName, conversationId, itemId, options),\n getItem: (\n agentName: string,\n conversationId: string,\n itemId: string,\n options?: BetaVoiceAgentsConversationsGetItemOptionalParams,\n ) => getItem(context, agentName, conversationId, itemId, options),\n listItems: (\n agentName: string,\n conversationId: string,\n options?: BetaVoiceAgentsConversationsListItemsOptionalParams,\n ) => listItems(context, agentName, conversationId, options),\n listResponseItems: (\n agentName: string,\n conversationId: string,\n responseId: string,\n options?: BetaVoiceAgentsConversationsListResponseItemsOptionalParams,\n ) => listResponseItems(context, agentName, conversationId, responseId, options),\n getResponse: (\n agentName: string,\n conversationId: string,\n responseId: string,\n options?: BetaVoiceAgentsConversationsGetResponseOptionalParams,\n ) => getResponse(context, agentName, conversationId, responseId, options),\n listResponses: (\n agentName: string,\n conversationId: string,\n options?: BetaVoiceAgentsConversationsListResponsesOptionalParams,\n ) => listResponses(context, agentName, conversationId, options),\n delete: (\n agentName: string,\n conversationId: string,\n options?: BetaVoiceAgentsConversationsDeleteOptionalParams,\n ) =>\n traceVoiceAgentOperation(\n \"voice_agents.conversations.delete\",\n context.endpoint,\n tracingConfig,\n () => $delete(context, agentName, conversationId, options),\n ),\n get: (\n agentName: string,\n conversationId: string,\n options?: BetaVoiceAgentsConversationsGetOptionalParams,\n ) => get(context, agentName, conversationId, options),\n list: (agentName: string, options?: BetaVoiceAgentsConversationsListOptionalParams) =>\n list(context, agentName, options),\n };\n}\n\nexport function _getBetaVoiceAgentsConversationsOperations(\n context: AIProjectContext,\n tracingConfig?: ResolvedTracingConfig,\n): BetaVoiceAgentsConversationsOperations {\n return { ..._getBetaVoiceAgentsConversations(context, tracingConfig) };\n}\n"]}
|
|
@@ -2,7 +2,8 @@ import type { AIProjectContext } from "../../../api/aiProjectContext.js";
|
|
|
2
2
|
import type { TokenCredential } from "@azure/core-auth";
|
|
3
3
|
import type { BetaVoiceAgentsConversationsOperations } from "./conversations/index.js";
|
|
4
4
|
import type { BetaVoiceAgentsTelephonyOperations } from "./telephony/index.js";
|
|
5
|
-
import { VoiceAgentRealtimeClient,
|
|
5
|
+
import type { VoiceAgentRealtimeClient, VoiceAgentRealtimeClientOptions } from "../../../realtime/voiceAgentRealtimeClient.js";
|
|
6
|
+
import type { ResolvedTracingConfig } from "../../../tracing/configuration.js";
|
|
6
7
|
/** Operations for managing voice agent conversations and telephony. */
|
|
7
8
|
export interface BetaVoiceAgentsOperations {
|
|
8
9
|
/** Operations for managing telephony bindings and calls. */
|
|
@@ -12,5 +13,5 @@ export interface BetaVoiceAgentsOperations {
|
|
|
12
13
|
/** Realtime voice-agent connections. */
|
|
13
14
|
realtime: VoiceAgentRealtimeClient;
|
|
14
15
|
}
|
|
15
|
-
export declare function _getBetaVoiceAgentsOperations(context: AIProjectContext, credential: TokenCredential, endpoint: string, realtimeOptions?: VoiceAgentRealtimeClientOptions): BetaVoiceAgentsOperations;
|
|
16
|
+
export declare function _getBetaVoiceAgentsOperations(context: AIProjectContext, credential: TokenCredential, endpoint: string, realtimeOptions?: VoiceAgentRealtimeClientOptions, tracingConfig?: ResolvedTracingConfig): BetaVoiceAgentsOperations;
|
|
16
17
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/classic/beta/voiceAgents/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EAAE,sCAAsC,EAAE,MAAM,0BAA0B,CAAC;AAEvF,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,sBAAsB,CAAC;AAE/E,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/classic/beta/voiceAgents/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EAAE,sCAAsC,EAAE,MAAM,0BAA0B,CAAC;AAEvF,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,sBAAsB,CAAC;AAE/E,OAAO,KAAK,EACV,wBAAwB,EACxB,+BAA+B,EAChC,MAAM,+CAA+C,CAAC;AAEvD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAE/E,uEAAuE;AACvE,MAAM,WAAW,yBAAyB;IACxC,4DAA4D;IAC5D,SAAS,EAAE,kCAAkC,CAAC;IAC9C,sEAAsE;IACtE,aAAa,EAAE,sCAAsC,CAAC;IACtD,wCAAwC;IACxC,QAAQ,EAAE,wBAAwB,CAAC;CACpC;AAED,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,gBAAgB,EACzB,UAAU,EAAE,eAAe,EAC3B,QAAQ,EAAE,MAAM,EAChB,eAAe,CAAC,EAAE,+BAA+B,EACjD,aAAa,CAAC,EAAE,qBAAqB,GACpC,yBAAyB,CAS3B"}
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
import { _getBetaVoiceAgentsConversationsOperations } from "./conversations/index.js";
|
|
4
4
|
import { _getBetaVoiceAgentsTelephonyOperations } from "./telephony/index.js";
|
|
5
|
-
import {
|
|
6
|
-
export function _getBetaVoiceAgentsOperations(context, credential, endpoint, realtimeOptions) {
|
|
5
|
+
import { createVoiceAgentRealtimeClient } from "../../../realtime/voiceAgentRealtimeClient.js";
|
|
6
|
+
export function _getBetaVoiceAgentsOperations(context, credential, endpoint, realtimeOptions, tracingConfig) {
|
|
7
7
|
return {
|
|
8
|
-
telephony: _getBetaVoiceAgentsTelephonyOperations(context),
|
|
9
|
-
conversations: _getBetaVoiceAgentsConversationsOperations(context),
|
|
8
|
+
telephony: _getBetaVoiceAgentsTelephonyOperations(context, tracingConfig),
|
|
9
|
+
conversations: _getBetaVoiceAgentsConversationsOperations(context, tracingConfig),
|
|
10
10
|
// VoiceAgentRealtimeClient defers https-only endpoint validation to connect() (not its
|
|
11
11
|
// constructor), so eagerly constructing it here doesn't reject callers who intentionally use an
|
|
12
12
|
// insecure local endpoint for the REST surface and never touch realtime connections.
|
|
13
|
-
realtime:
|
|
13
|
+
realtime: createVoiceAgentRealtimeClient(endpoint, credential, realtimeOptions, tracingConfig),
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
16
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/classic/beta/voiceAgents/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAKlC,OAAO,EAAE,0CAA0C,EAAE,MAAM,0BAA0B,CAAC;AAEtF,OAAO,EAAE,sCAAsC,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/classic/beta/voiceAgents/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAKlC,OAAO,EAAE,0CAA0C,EAAE,MAAM,0BAA0B,CAAC;AAEtF,OAAO,EAAE,sCAAsC,EAAE,MAAM,sBAAsB,CAAC;AAK9E,OAAO,EAAE,8BAA8B,EAAE,MAAM,+CAA+C,CAAC;AAa/F,MAAM,UAAU,6BAA6B,CAC3C,OAAyB,EACzB,UAA2B,EAC3B,QAAgB,EAChB,eAAiD,EACjD,aAAqC;IAErC,OAAO;QACL,SAAS,EAAE,sCAAsC,CAAC,OAAO,EAAE,aAAa,CAAC;QACzE,aAAa,EAAE,0CAA0C,CAAC,OAAO,EAAE,aAAa,CAAC;QACjF,uFAAuF;QACvF,gGAAgG;QAChG,qFAAqF;QACrF,QAAQ,EAAE,8BAA8B,CAAC,QAAQ,EAAE,UAAU,EAAE,eAAe,EAAE,aAAa,CAAC;KAC/F,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AIProjectContext } from \"../../../api/aiProjectContext.js\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport type { BetaVoiceAgentsConversationsOperations } from \"./conversations/index.js\";\nimport { _getBetaVoiceAgentsConversationsOperations } from \"./conversations/index.js\";\nimport type { BetaVoiceAgentsTelephonyOperations } from \"./telephony/index.js\";\nimport { _getBetaVoiceAgentsTelephonyOperations } from \"./telephony/index.js\";\nimport type {\n VoiceAgentRealtimeClient,\n VoiceAgentRealtimeClientOptions,\n} from \"../../../realtime/voiceAgentRealtimeClient.js\";\nimport { createVoiceAgentRealtimeClient } from \"../../../realtime/voiceAgentRealtimeClient.js\";\nimport type { ResolvedTracingConfig } from \"../../../tracing/configuration.js\";\n\n/** Operations for managing voice agent conversations and telephony. */\nexport interface BetaVoiceAgentsOperations {\n /** Operations for managing telephony bindings and calls. */\n telephony: BetaVoiceAgentsTelephonyOperations;\n /** Operations for reading persisted voice conversations and audio. */\n conversations: BetaVoiceAgentsConversationsOperations;\n /** Realtime voice-agent connections. */\n realtime: VoiceAgentRealtimeClient;\n}\n\nexport function _getBetaVoiceAgentsOperations(\n context: AIProjectContext,\n credential: TokenCredential,\n endpoint: string,\n realtimeOptions?: VoiceAgentRealtimeClientOptions,\n tracingConfig?: ResolvedTracingConfig,\n): BetaVoiceAgentsOperations {\n return {\n telephony: _getBetaVoiceAgentsTelephonyOperations(context, tracingConfig),\n conversations: _getBetaVoiceAgentsConversationsOperations(context, tracingConfig),\n // VoiceAgentRealtimeClient defers https-only endpoint validation to connect() (not its\n // constructor), so eagerly constructing it here doesn't reject callers who intentionally use an\n // insecure local endpoint for the REST surface and never touch realtime connections.\n realtime: createVoiceAgentRealtimeClient(endpoint, credential, realtimeOptions, tracingConfig),\n };\n}\n"]}
|
|
@@ -2,6 +2,7 @@ import type { AIProjectContext } from "../../../../api/aiProjectContext.js";
|
|
|
2
2
|
import type { BetaVoiceAgentsTelephonyCancelCallJobOptionalParams, BetaVoiceAgentsTelephonyGetCallJobOptionalParams, BetaVoiceAgentsTelephonyCreateCallJobOptionalParams, BetaVoiceAgentsTelephonyCreateBindingOptionalParams, BetaVoiceAgentsTelephonyDeleteBindingOptionalParams, BetaVoiceAgentsTelephonyEndCallOptionalParams, BetaVoiceAgentsTelephonyGetBindingOptionalParams, BetaVoiceAgentsTelephonyGetCallOptionalParams, BetaVoiceAgentsTelephonyGetTransferTargetsOptionalParams, BetaVoiceAgentsTelephonyListBindingsOptionalParams, BetaVoiceAgentsTelephonyListCallsOptionalParams, BetaVoiceAgentsTelephonyReplaceTransferTargetsOptionalParams, BetaVoiceAgentsTelephonyTransferCallOptionalParams, BetaVoiceAgentsTelephonyUpdateBindingOptionalParams } from "../../../../api/beta/voiceAgents/telephony/options.js";
|
|
3
3
|
import type { CreateTelephonyCallJobRequest, TelephonyCallJob, CreateTelephonyBindingRequestUnion, TelephonyBindingListItemUnion, TelephonyBindingUnion, TelephonyCallRecord, TelephonyCallSummary, TelephonyTransferTarget, TelephonyTransferTargets, UpdateTelephonyBindingRequest } from "../../../../models/models.js";
|
|
4
4
|
import type { PagedAsyncIterableIterator } from "@azure/core-paging";
|
|
5
|
+
import type { ResolvedTracingConfig } from "../../../../tracing/configuration.js";
|
|
5
6
|
/** Operations for managing voice agent telephony. */
|
|
6
7
|
export interface BetaVoiceAgentsTelephonyOperations {
|
|
7
8
|
/** Requests cancellation of a durable outbound call job. A connected call is allowed to finish. */
|
|
@@ -33,5 +34,5 @@ export interface BetaVoiceAgentsTelephonyOperations {
|
|
|
33
34
|
/** Creates a telephony binding for the voice agent named in the path. */
|
|
34
35
|
createBinding: (agentName: string, telephonyBinding: CreateTelephonyBindingRequestUnion, options?: BetaVoiceAgentsTelephonyCreateBindingOptionalParams) => Promise<TelephonyBindingUnion>;
|
|
35
36
|
}
|
|
36
|
-
export declare function _getBetaVoiceAgentsTelephonyOperations(context: AIProjectContext): BetaVoiceAgentsTelephonyOperations;
|
|
37
|
+
export declare function _getBetaVoiceAgentsTelephonyOperations(context: AIProjectContext, tracingConfig?: ResolvedTracingConfig): BetaVoiceAgentsTelephonyOperations;
|
|
37
38
|
//# sourceMappingURL=index.d.ts.map
|