diff --git a/.vscode/cspell.json b/.vscode/cspell.json index 60c5b116004f..3111d4b33ef2 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -401,6 +401,7 @@ "prevsnapshot", "prompty", "pschema", + "pscustomobject", "PSECRET", "pstn", "pydantic", @@ -469,6 +470,8 @@ "uninstrument", "uninstrumented", "uninstrumenting", + "unmute", + "unmuted", "unpad", "unpadder", "unpartial", @@ -2175,6 +2178,28 @@ "Hundredkm" ] }, + { + "filename": "sdk/ai/azure-ai-projects/**", + "words": [ + "azcopy", + "brise", + "csdl", + "dedup", + "flitz", + "genai", + "harema", + "inpainting", + "juni", + "nira", + "noeul", + "nuri", + "shida", + "simpleqna", + "upia", + "webrtc", + "xhigh" + ] + }, { "filename": "sdk/ai/azure-ai-voicelive/**", "words": ["viseme","VISEME","ulaw","ULAW","logprobs","pyaudio","PyAudio","libasound","webrtc","WEBRTC"] diff --git a/eng/emitter-package-lock.json b/eng/emitter-package-lock.json index 6dea4b09bc34..f6c58377b724 100644 --- a/eng/emitter-package-lock.json +++ b/eng/emitter-package-lock.json @@ -9,7 +9,7 @@ "@azure-tools/typespec-python": "0.63.10" }, "devDependencies": { - "@azure-tools/openai-typespec": "1.28.0", + "@azure-tools/openai-typespec": "1.32.0", "@azure-tools/typespec-autorest": "~0.73.0", "@azure-tools/typespec-azure-core": "~0.73.0", "@azure-tools/typespec-azure-portal-core": "~0.73.0", @@ -31,9 +31,9 @@ } }, "node_modules/@azure-tools/openai-typespec": { - "version": "1.28.0", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure-tools/openai-typespec/-/openai-typespec-1.28.0.tgz", - "integrity": "sha1-rXCoTFopEeA3qKL8/P3Uim0ZuuA=", + "version": "1.32.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure-tools/openai-typespec/-/openai-typespec-1.32.0.tgz", + "integrity": "sha512-jLREAF3X/WLnOJdBbsP3gldPBCumhdFwpUc+kmo/l3MGxd/7CugsojaWOnYxqhaQ0LMfwIAzR/GYa4rBx/foTQ==", "dev": true, "license": "MIT", "peerDependencies": { diff --git a/eng/emitter-package.json b/eng/emitter-package.json index 79c0abbe49bf..fa583234642a 100644 --- a/eng/emitter-package.json +++ b/eng/emitter-package.json @@ -22,6 +22,6 @@ "@azure-tools/typespec-client-generator-core": "~0.73.0", "@azure-tools/typespec-azure-portal-core": "~0.73.0", "@azure-tools/typespec-liftr-base": "0.13.0", - "@azure-tools/openai-typespec": "1.28.0" + "@azure-tools/openai-typespec": "1.32.0" } } diff --git a/sdk/ai/azure-ai-projects/.github/skills/README.md b/sdk/ai/azure-ai-projects/.github/skills/README.md index ce50c2376e5d..558c0af9dac7 100644 --- a/sdk/ai/azure-ai-projects/.github/skills/README.md +++ b/sdk/ai/azure-ai-projects/.github/skills/README.md @@ -57,6 +57,10 @@ This skill compares a newly emitted or merged public API surface with its select This skill updates existing pytest coverage and authors complete sync/async Test Proxy tests for new behavior. New recorded service tests remain enabled so missing-recording errors surface in PR validation and authors can contact the SDK maintainer for help. +### azure-ai-projects-record-sample + +This skill prompts for record-and-playback, record-only, playback-only, or live test locally, then runs one parameterized sample test. It scans required environment variables and passes effective `.env` values as pytest arguments. + ### azure-ai-projects-model-reference-graph This skill generates structured and readable graphs that trace every generated model through direct references, inheritance, runtime ownership, and public operation methods. It supports model-usage investigation and TypeSpec removal analysis without treating static reachability as proof that a model is safe to remove. diff --git a/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/SKILL.md b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/SKILL.md new file mode 100644 index 000000000000..f6f9a9020d8a --- /dev/null +++ b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/SKILL.md @@ -0,0 +1,87 @@ +--- +name: azure-ai-projects-record-sample +description: 'Record, play back, or run an azure-ai-projects Python sample live with the Test Proxy. WHEN: record sample, rerecord sample, record and playback, record only, playback only, live test locally, validate recording. Always prompts for an execution mode. Scans required environment variables and passes effective .env values as pytest command-line arguments. DO NOT USE FOR: authoring tests or samples; non-sample service tests; other packages.' +argument-hint: 'Sample path or node ID; choose mode when prompted' +--- + +# Record and verify an azure-ai-projects sample + +Run from `sdk\ai\azure-ai-projects`. This workflow may modify Test Proxy recordings. Never commit `.env`, credentials, access tokens, API keys, or unsanitized resource identifiers. + +## Execution modes + +Before previewing, always use the question tool to ask the user to choose exactly one mode. Do this even when the request appears to imply a mode; never infer or default it. + +| Mode | `AZURE_TEST_RUN_LIVE` | `AZURE_SKIP_LIVE_RECORDING` | Behavior | +| --- | --- | --- | --- | +| `record-and-playback` | `true`, then `false` | `false`, then `true` | Record, then verify playback even if recording fails. | +| `record-only` | `true` | `false` | Record without running playback. | +| `playback-only` | `false` | `true` | Run only from an existing recording. | +| `live-test-locally` | `true` | `true` | Contact the live service locally without creating or updating a recording. | + +Do not silently substitute one mode for another. Include the selected mode in the final report. + +## 1. Preview the plan + +Run the orchestrator without `-Run`: + +```powershell +.\.github\skills\azure-ai-projects-record-sample\scripts\InvokeSampleTest.ps1 ` + -SamplePath "" ` + -Mode "" +``` + +It deterministically resolves the collected pytest node, scans required sample variables, detects selected `AdditionalSampleTestDetail` values and LLM validation, reads effective `.env` assignments, maps supported pytest options, selects mode flags, and prints a plan. The plan includes the resolved sample path, pytest node, and effective environment variables as `key=value` entries. Pytest command previews remain redacted. Treat the preview as sensitive and do not paste it into reports or source files. + +If multiple nodes execute the sample, the script lists them and stops. Ask the user which scenario to use, then rerun preview with `-NodeId ""`. If a required name is missing or empty, report the name and remind the user to check `.env`; do not invent a value. + +Lower-level scripts under `scripts\` are for diagnosing the orchestrator only. Do not repeat their work manually during a normal run. + +## 2. Obtain approval + +For `record-and-playback`, `record-only`, and `live-test-locally`, use the question tool to ask for input confirmation immediately before execution: + +**Confirm inputs:** "Use sample ``, pytest node ``, and the displayed `key=value` environment variables?" + +Include the preview's environment entries plus missing and empty variable names in the question's supporting message. If the user does not confirm, update the requested sample, node, or `.env` as directed and rerun preview before asking again. + +Also ask the action-specific approval in the same question-tool call: + +- For `record-and-playback` and `record-only`: **Approve recording:** "Start recording now? It may update Test Proxy recordings." +- For `live-test-locally`: **Approve live test:** "Start the live test locally without recording now?" + +Do not run unless both input confirmation and action approval are `Yes`. `playback-only` needs neither confirmation. + +## 3. Execute + +Use the same sample, selected node, and mode from preview: + +```powershell +# record-and-playback or record-only +.\.github\skills\azure-ai-projects-record-sample\scripts\InvokeSampleTest.ps1 ` + -SamplePath "" -NodeId "" -Mode "" ` + -Run -ConfirmSelection -ConfirmRecording + +# playback-only +.\.github\skills\azure-ai-projects-record-sample\scripts\InvokeSampleTest.ps1 ` + -SamplePath "" -NodeId "" -Mode "playback-only" -Run + +# live-test-locally +.\.github\skills\azure-ai-projects-record-sample\scripts\InvokeSampleTest.ps1 ` + -SamplePath "" -NodeId "" -Mode "live-test-locally" ` + -Run -ConfirmSelection -ConfirmLive +``` + +The orchestrator keeps values internal, loads only relevant `.env` names, and handles all mode flags. Immediately before recording, it stops `*testproxy*` processes and deletes `.pytest_cache`. `record-and-playback` proceeds to playback even when recording fails. After a successful hosted-agent recording it runs `tests\samples\repair_hosted_agent_sample_recording.py` before playback or completion. + +Recording modes invoke `scripts\TestRecordingGitConflicts.ps1` during preview and again immediately before cleanup. Treat that script's result as authoritative; do not reproduce its conflict checks in the skill workflow. + +## 4. Diagnose only relevant failures + +If playback fails, inspect only the selected node's mismatch and named recording. Make the smallest sanitizer or deterministic-input fix. Before another recording attempt, rerun preview and ask both recording questions again. + +Do not repair unrelated failures, edit recordings by hand, or fall back to bare pytest/VS Code playback. Never stage, commit, or push recordings unless explicitly requested. + +## 5. Validate and report + +Run `git diff --check` and `git status --short`. Report the selected mode, sample, and node; environment variable names used; required, harness-supplied, missing, and empty names; recording, repair, playback, and live results; and changed recording paths. Do not repeat environment values in the final report. Report unselected steps as `not run`. Never claim `record-and-playback` success unless playback passed. \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/scripts/GetEnvironmentFileVariables.ps1 b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/scripts/GetEnvironmentFileVariables.ps1 new file mode 100644 index 000000000000..8dd0f42250ac --- /dev/null +++ b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/scripts/GetEnvironmentFileVariables.ps1 @@ -0,0 +1,85 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +[CmdletBinding()] +param( + [string]$EnvFile, + [string]$PythonExecutable, + [string]$PackageRoot, + [switch]$IncludeValues +) + +$ErrorActionPreference = "Stop" +if ($PackageRoot) { + $packageRoot = (Get-Item -LiteralPath (Resolve-Path -LiteralPath $PackageRoot).Path).FullName +} else { + $packageRoot = (Get-Item -LiteralPath (Resolve-Path (Join-Path $PSScriptRoot "..\..\..\..")).Path).FullName +} + +if (-not $EnvFile) { + $EnvFile = Join-Path $packageRoot ".env" +} elseif (-not [System.IO.Path]::IsPathRooted($EnvFile)) { + $EnvFile = Join-Path $packageRoot $EnvFile +} +if (-not (Test-Path -LiteralPath $EnvFile -PathType Leaf)) { + throw "Environment file not found: $EnvFile" +} +$EnvFile = (Get-Item -LiteralPath $EnvFile).FullName + +if (-not $PythonExecutable) { + $windowsVenvPython = Join-Path $packageRoot ".venv\Scripts\python.exe" + $posixVenvPython = Join-Path $packageRoot ".venv\bin\python" + if (Test-Path -LiteralPath $windowsVenvPython) { + $PythonExecutable = $windowsVenvPython + } elseif (Test-Path -LiteralPath $posixVenvPython) { + $PythonExecutable = $posixVenvPython + } else { + $PythonExecutable = "python" + } +} + +$pythonScript = @' +from __future__ import annotations + +import json +from pathlib import Path +import sys + +from dotenv import dotenv_values +from dotenv.parser import parse_stream + + +env_path = Path(sys.argv[1]) +with env_path.open(encoding="utf-8-sig") as stream: + bindings = list(parse_stream(stream)) + +effective_values = dotenv_values(env_path, encoding="utf-8-sig") +seen: set[str] = set() +variables: list[dict[str, object]] = [] +for binding in reversed(bindings): + name = binding.key + if not name or name in seen: + continue + seen.add(name) + variables.append( + { + "Name": name, + "Value": effective_values.get(name), + "LineNumber": binding.original.line, + } + ) + +print(json.dumps(variables)) +'@ + +$output = @($pythonScript | & $PythonExecutable - $EnvFile) +if ($LASTEXITCODE -ne 0) { + throw "Unable to parse environment file '$EnvFile'." +} +$variables = @($output -join [Environment]::NewLine | ConvertFrom-Json) + +if ($IncludeValues) { + $variables +} else { + $variables | Select-Object -ExpandProperty Name +} \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/scripts/GetSampleRequiredEnvironmentVariables.ps1 b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/scripts/GetSampleRequiredEnvironmentVariables.ps1 new file mode 100644 index 000000000000..6a7c538d7805 --- /dev/null +++ b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/scripts/GetSampleRequiredEnvironmentVariables.ps1 @@ -0,0 +1,68 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +[CmdletBinding()] +param( + [Parameter(Position = 0)] + [Alias("Sample")] + [string[]]$SamplePath, + + [string]$PackageRoot +) + +$ErrorActionPreference = "Stop" +if ($PackageRoot) { + $packageRoot = (Get-Item -LiteralPath (Resolve-Path -LiteralPath $PackageRoot).Path).FullName +} else { + $packageRoot = (Get-Item -LiteralPath (Resolve-Path (Join-Path $PSScriptRoot "..\..\..\..")).Path).FullName +} +$samplesRoot = Join-Path $packageRoot "samples" + +function Resolve-SampleFile { + param([string]$RequestedPath) + + $candidate = $RequestedPath + if (-not [System.IO.Path]::IsPathRooted($candidate)) { + $candidate = Join-Path $packageRoot $candidate + } + if (Test-Path -LiteralPath $candidate -PathType Leaf) { + return (Get-Item -LiteralPath $candidate).FullName + } + + $name = [System.IO.Path]::GetFileName($RequestedPath) + if (-not $name.EndsWith(".py", [System.StringComparison]::OrdinalIgnoreCase)) { + $name += ".py" + } + $sampleMatches = @(Get-ChildItem -Path $samplesRoot -Recurse -File -Filter $name) + if ($sampleMatches.Count -eq 0) { + throw "Could not find sample '$RequestedPath' under '$samplesRoot'." + } + if ($sampleMatches.Count -gt 1) { + throw "Sample '$RequestedPath' matched multiple files. Pass a path relative to the package root." + } + return $sampleMatches[0].FullName +} + +$files = if ($SamplePath) { + @($SamplePath | ForEach-Object { Resolve-SampleFile $_ }) +} else { + @(Get-ChildItem -Path $samplesRoot -Recurse -File -Filter "*.py" | ForEach-Object { $_.FullName }) +} + +$patterns = @( + 'os\.environ\s*\[\s*["''](?[A-Z][A-Z0-9_]*)["'']\s*\](?!\s*=)', + '(?:os\.environ\.get|os\.getenv)\s*\(\s*["''](?[A-Z][A-Z0-9_]*)["'']\s*\)(?!\s*or\b)', + 'get_required_env_var\s*\(\s*["''](?[A-Z][A-Z0-9_]*)["'']\s*\)' +) + +$names = [System.Collections.Generic.HashSet[string]]::new([System.StringComparer]::Ordinal) +foreach ($file in $files) { + $content = Get-Content -LiteralPath $file -Raw + foreach ($pattern in $patterns) { + foreach ($match in [regex]::Matches($content, $pattern, [System.Text.RegularExpressions.RegexOptions]::Singleline)) { + $null = $names.Add($match.Groups["name"].Value) + } + } +} + +$names | Sort-Object \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/scripts/InvokeSampleTest.ps1 b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/scripts/InvokeSampleTest.ps1 new file mode 100644 index 000000000000..a6e632ed001c --- /dev/null +++ b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/scripts/InvokeSampleTest.ps1 @@ -0,0 +1,356 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +[CmdletBinding()] +param( + [Parameter(Mandatory = $true, Position = 0)] + [Alias("Sample")] + [string]$SamplePath, + + [string]$NodeId, + + [ValidateSet("record-and-playback", "record-only", "playback-only", "live-test-locally")] + [string]$Mode, + + [string]$EnvFile, + [string]$PythonExecutable, + [string]$PackageRoot, + [ValidateSet("main", "feature/azure-ai-projects/vnext")] + [string]$BaseBranch, + [string]$RecordingConflictCheckScript, + [string]$RecordingCleanupScript, + [switch]$Run, + [switch]$ConfirmSelection, + [switch]$ConfirmRecording, + [switch]$ConfirmLive +) + +$ErrorActionPreference = "Stop" +if ([string]::IsNullOrWhiteSpace($Mode)) { + throw "Mode is required. Choose record-and-playback, record-only, playback-only, or live-test-locally." +} +$scriptRoot = $PSScriptRoot +if ($PackageRoot) { + $packageRoot = (Get-Item -LiteralPath (Resolve-Path -LiteralPath $PackageRoot).Path).FullName +} else { + $packageRoot = (Get-Item -LiteralPath (Resolve-Path (Join-Path $scriptRoot "..\..\..\..")).Path).FullName +} +if (-not $PythonExecutable) { + $windowsVenvPython = Join-Path $packageRoot ".venv\Scripts\python.exe" + $posixVenvPython = Join-Path $packageRoot ".venv\bin\python" + if (Test-Path -LiteralPath $windowsVenvPython) { + $PythonExecutable = $windowsVenvPython + } elseif (Test-Path -LiteralPath $posixVenvPython) { + $PythonExecutable = $posixVenvPython + } else { + $PythonExecutable = "python" + } +} +if (-not $EnvFile) { + $EnvFile = Join-Path $packageRoot ".env" +} + +$resolver = Join-Path $scriptRoot "ResolveSampleTest.ps1" +$requiredVariableScanner = Join-Path $scriptRoot "GetSampleRequiredEnvironmentVariables.ps1" +$environmentFileScanner = Join-Path $scriptRoot "GetEnvironmentFileVariables.ps1" +if (-not $RecordingCleanupScript) { + $RecordingCleanupScript = Join-Path $scriptRoot "ResetRecordingState.ps1" +} +if (-not $RecordingConflictCheckScript) { + $RecordingConflictCheckScript = Join-Path $scriptRoot "TestRecordingGitConflicts.ps1" +} + +$resolvedNodes = @( + & $resolver -SamplePath $SamplePath -PackageRoot $packageRoot -PythonExecutable $PythonExecutable +) +if ($NodeId) { + $normalizedRequestedNode = $NodeId.Replace("\", "/") + $resolvedNodes = @( + $resolvedNodes | Where-Object { + $candidate = $_.NodeId.Replace("\", "/") + $candidate -eq $normalizedRequestedNode -or $candidate.EndsWith($normalizedRequestedNode) + } + ) + if ($resolvedNodes.Count -eq 0) { + throw "The requested node id does not execute '$SamplePath': $NodeId" + } +} +if ($resolvedNodes.Count -gt 1) { + $choices = $resolvedNodes.NodeId -join [Environment]::NewLine + throw "Multiple pytest nodes execute this sample. Rerun with -NodeId and one of:$([Environment]::NewLine)$choices" +} +$resolved = $resolvedNodes[0] +$NodeId = $resolved.NodeId +$resolvedSamplePath = Join-Path $packageRoot $resolved.SamplePath + +$requiredNames = @( + & $requiredVariableScanner -SamplePath $resolvedSamplePath -PackageRoot $packageRoot +) + +$metadataScript = @' +from __future__ import annotations + +import ast +import json +from pathlib import Path +import re +import sys + + +root = Path(sys.argv[1]).resolve() +sample_path = Path(sys.argv[2]).resolve() +node_id = sys.argv[3].replace("\\", "/") + + +def parse(path: Path) -> ast.Module: + return ast.parse(path.read_text(encoding="utf-8-sig"), filename=str(path)) + + +def literal_keyword(call: ast.Call, name: str): + keyword = next((item for item in call.keywords if item.arg == name), None) + if keyword is None: + return None + try: + return ast.literal_eval(keyword.value) + except (TypeError, ValueError): + return None + + +tests_index = node_id.find("tests/") +if tests_index < 0: + raise RuntimeError(f"Node id has no tests/ path: {node_id}") +parts = node_id[tests_index:].split("::") +test_path = root / parts[0] +method_name = parts[-1].split("[", 1)[0] +parameter_match = re.search(r"\[(?P.*)\]$", node_id) +parameter_id = parameter_match.group("id") if parameter_match else "" +tree = parse(test_path) + +uses_llm_validation = False +for node in ast.walk(tree): + if isinstance(node, (ast.FunctionDef, ast.AsyncFunctionDef)) and node.name == method_name: + uses_llm_validation = any( + isinstance(child, ast.Attribute) + and child.attr in {"validate_print_calls_by_llm", "validate_print_calls_by_llm_async"} + for child in ast.walk(node) + ) + break + +harness_names: set[str] = set() +for call in (node for node in ast.walk(tree) if isinstance(node, ast.Call)): + function_name = call.func.id if isinstance(call.func, ast.Name) else getattr(call.func, "attr", None) + if function_name != "AdditionalSampleTestDetail": + continue + filename = literal_keyword(call, "sample_filename") + test_id = literal_keyword(call, "test_id") + env_vars = literal_keyword(call, "env_vars") or {} + if not test_id: + test_id = f"{Path(filename).stem}-[{','.join(sorted(env_vars))}]" + if filename == sample_path.name and test_id == parameter_id: + harness_names.update(env_vars) + +option_map: dict[str, str] = {} +test_base_path = root / "tests" / "test_base.py" +if test_base_path.is_file(): + for node in parse(test_base_path).body: + if not isinstance(node, ast.Assign): + continue + if not any(isinstance(target, ast.Name) and target.id == "servicePreparer" for target in node.targets): + continue + if isinstance(node.value, ast.Call): + for keyword in node.value.keywords: + if keyword.arg: + option_map[keyword.arg.upper()] = keyword.arg + +print( + json.dumps( + { + "HarnessNames": sorted(harness_names), + "UsesLlmValidation": uses_llm_validation, + "OptionMap": option_map, + } + ) +) +'@ +$metadataJson = @($metadataScript | & $PythonExecutable - $packageRoot $resolvedSamplePath $NodeId) +if ($LASTEXITCODE -ne 0) { + throw "Unable to inspect the selected sample test metadata." +} +$metadata = $metadataJson -join [Environment]::NewLine | ConvertFrom-Json + +$allRequiredNames = [System.Collections.Generic.HashSet[string]]::new([System.StringComparer]::Ordinal) +foreach ($name in $requiredNames) { + $null = $allRequiredNames.Add([string]$name) +} +if ($metadata.UsesLlmValidation) { + $null = $allRequiredNames.Add("LLM_VALIDATION_PROJECT_ENDPOINT") +} +$harnessNames = @($metadata.HarnessNames) + +$envFileVariables = if (Test-Path -LiteralPath $EnvFile -PathType Leaf) { + @( + & $environmentFileScanner -EnvFile $EnvFile -PackageRoot $packageRoot ` + -PythonExecutable $PythonExecutable -IncludeValues + ) +} else { + @() +} +$envByName = @{} +foreach ($variable in $envFileVariables) { + $envByName[$variable.Name] = $variable.Value +} + +$optionMap = @{} +foreach ($property in $metadata.OptionMap.PSObject.Properties) { + $optionMap[$property.Name] = [string]$property.Value +} +$commandLineValues = [ordered]@{} +$processEnvironmentValues = [ordered]@{} +$missingNames = [System.Collections.Generic.List[string]]::new() +$emptyNames = [System.Collections.Generic.List[string]]::new() +$usedEnvironmentNames = [System.Collections.Generic.HashSet[string]]::new([System.StringComparer]::Ordinal) + +foreach ($name in @($allRequiredNames | Sort-Object)) { + if (-not $envByName.ContainsKey($name)) { + $missingNames.Add($name) + continue + } + $value = $envByName[$name] + if ([string]::IsNullOrEmpty([string]$value)) { + $emptyNames.Add($name) + continue + } + if ($optionMap.ContainsKey($name)) { + $commandLineValues[$optionMap[$name]] = [string]$value + } else { + $processEnvironmentValues[$name] = [string]$value + } + $null = $usedEnvironmentNames.Add($name) +} +foreach ($name in $harnessNames) { + if (-not $envByName.ContainsKey($name) -or [string]::IsNullOrEmpty([string]$envByName[$name])) { + continue + } + if ($optionMap.ContainsKey($name)) { + $commandLineValues[$optionMap[$name]] = [string]$envByName[$name] + } else { + $processEnvironmentValues[$name] = [string]$envByName[$name] + } + $null = $usedEnvironmentNames.Add([string]$name) +} + +$steps = switch ($Mode) { + "record-and-playback" { @("record", "playback") } + "record-only" { @("record") } + "playback-only" { @("playback") } + "live-test-locally" { @("live") } +} +$flags = @{ + record = @("--azure_test_run_live=true", "--azure_skip_live_recording=false") + playback = @("--azure_test_run_live=false", "--azure_skip_live_recording=true") + live = @("--azure_test_run_live=true", "--azure_skip_live_recording=true") +} + +$conflictCheckArguments = $null +$recordingConflictResult = $null +if ($steps -contains "record") { + $conflictCheckArguments = @{ PackageRoot = $packageRoot } + if ($BaseBranch) { + $conflictCheckArguments.BaseBranch = $BaseBranch + } + $recordingConflictResult = & $RecordingConflictCheckScript @conflictCheckArguments +} + +Write-Output "Mode: $Mode" +Write-Output "Sample: $($resolved.SamplePath)" +Write-Output "Node: $NodeId" +Write-Output "Required: $((@($allRequiredNames | Sort-Object) -join ', '))" +Write-Output "Harness-supplied: $($harnessNames -join ', ')" +Write-Output "Missing: $($missingNames -join ', ')" +Write-Output "Empty: $($emptyNames -join ', ')" +if ($usedEnvironmentNames.Count -eq 0) { + Write-Output "Environment variables used: " +} else { + Write-Output "Environment variables used:" + foreach ($name in @($usedEnvironmentNames | Sort-Object)) { + Write-Output " $name=$($envByName[$name])" + } +} +Write-Output "Steps: $($steps -join ', ')" +if ($recordingConflictResult) { + Write-Output "Recording conflict check: safe ($($recordingConflictResult.AssetRelationship))" +} +Write-Output "CLI values loaded: $($commandLineValues.Count); process values loaded: $($processEnvironmentValues.Count)" + +if (-not $Run) { + foreach ($step in $steps) { + $redactedOptions = @($commandLineValues.Keys | ForEach-Object { "--$_=" }) + Write-Output "$step command: pytest -s $($redactedOptions -join ' ') $($flags[$step] -join ' ')" + } + return +} + +if (($steps -contains "record" -or $steps -contains "live") -and -not $ConfirmSelection) { + throw "Execution selection was not confirmed. Review the sample, node, and environment variable names, then rerun with -Run -ConfirmSelection." +} +if ($steps -contains "record" -and -not $ConfirmRecording) { + throw "Recording may modify files. Rerun with -Run -ConfirmRecording after user approval." +} +if ($steps -contains "live" -and -not $ConfirmLive) { + throw "Live execution contacts Azure. Rerun with -Run -ConfirmLive after user approval." +} + +$originalEnvironment = @{} +foreach ($entry in $processEnvironmentValues.GetEnumerator()) { + $originalEnvironment[$entry.Key] = [Environment]::GetEnvironmentVariable($entry.Key, "Process") + [Environment]::SetEnvironmentVariable($entry.Key, $entry.Value, "Process") +} + +$results = [ordered]@{} +try { + foreach ($step in $steps) { + if ($step -eq "record") { + $recordingConflictResult = & $RecordingConflictCheckScript @conflictCheckArguments + Write-Output "recording conflict recheck: safe ($($recordingConflictResult.AssetRelationship))" + & $RecordingCleanupScript -PackageRoot $packageRoot + Write-Output "recording cleanup: completed" + } + $pytestArguments = @("-m", "pytest", $NodeId, "-s") + foreach ($entry in $commandLineValues.GetEnumerator()) { + $pytestArguments += "--$($entry.Key)=$($entry.Value)" + } + $pytestArguments += $flags[$step] + Push-Location $packageRoot + try { + & $PythonExecutable @pytestArguments + $results[$step] = $LASTEXITCODE + } finally { + Pop-Location + } + + if ($step -eq "record" -and $resolved.SamplePath.Replace("/", "\").StartsWith("samples\hosted_agents\")) { + $repairScript = Join-Path $packageRoot "tests\samples\repair_hosted_agent_sample_recording.py" + if ($results[$step] -eq 0 -and (Test-Path -LiteralPath $repairScript)) { + & $PythonExecutable $repairScript $NodeId + $results["repair"] = $LASTEXITCODE + } else { + $results["repair"] = "not run" + } + } + } +} finally { + foreach ($entry in $originalEnvironment.GetEnumerator()) { + [Environment]::SetEnvironmentVariable($entry.Key, $entry.Value, "Process") + } +} + +foreach ($entry in $results.GetEnumerator()) { + Write-Output "$($entry.Key) result: $($entry.Value)" +} +$failedResults = @( + $results.GetEnumerator() | Where-Object { $_.Value -is [int] -and $_.Value -ne 0 } +) +if ($failedResults.Count -gt 0) { + $failureSummary = @($failedResults | ForEach-Object { "$($_.Key)=$($_.Value)" }) -join ", " + throw "Sample test workflow failed: $failureSummary" +} \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/scripts/ResetRecordingState.ps1 b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/scripts/ResetRecordingState.ps1 new file mode 100644 index 000000000000..efa81a831820 --- /dev/null +++ b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/scripts/ResetRecordingState.ps1 @@ -0,0 +1,25 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +[CmdletBinding()] +param( + [string]$PackageRoot, + [scriptblock]$ProcessProvider = { Get-Process }, + [scriptblock]$ProcessStopper = { param($Processes) $Processes | Stop-Process -Force } +) + +$ErrorActionPreference = "Stop" +if ($PackageRoot) { + $packageRoot = (Get-Item -LiteralPath (Resolve-Path -LiteralPath $PackageRoot).Path).FullName +} else { + $packageRoot = (Get-Item -LiteralPath (Resolve-Path (Join-Path $PSScriptRoot "..\..\..\..")).Path).FullName +} + +$testProxyProcesses = @( + & $ProcessProvider | Where-Object { $_.ProcessName -like "*testproxy*" } +) +if ($testProxyProcesses.Count -gt 0) { + & $ProcessStopper $testProxyProcesses +} + +Remove-Item -Recurse -Force (Join-Path $packageRoot ".pytest_cache") -ErrorAction SilentlyContinue \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/scripts/ResolveSampleTest.ps1 b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/scripts/ResolveSampleTest.ps1 new file mode 100644 index 000000000000..8d06b9945f01 --- /dev/null +++ b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/scripts/ResolveSampleTest.ps1 @@ -0,0 +1,154 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +[CmdletBinding()] +param( + [Parameter(Mandatory = $true, Position = 0)] + [Alias("Sample")] + [string]$SamplePath, + + [string]$PythonExecutable, + [string]$PackageRoot +) + +$ErrorActionPreference = "Stop" +if ($PackageRoot) { + $packageRoot = (Get-Item -LiteralPath (Resolve-Path -LiteralPath $PackageRoot).Path).FullName +} else { + $packageRoot = (Get-Item -LiteralPath (Resolve-Path (Join-Path $PSScriptRoot "..\..\..\..")).Path).FullName +} +$samplesRoot = Join-Path $packageRoot "samples" + +if (-not $PythonExecutable) { + $windowsVenvPython = Join-Path $packageRoot ".venv\Scripts\python.exe" + $posixVenvPython = Join-Path $packageRoot ".venv\bin\python" + if (Test-Path -LiteralPath $windowsVenvPython) { + $PythonExecutable = $windowsVenvPython + } elseif (Test-Path -LiteralPath $posixVenvPython) { + $PythonExecutable = $posixVenvPython + } else { + $PythonExecutable = "python" + } +} + +function Resolve-SampleFile { + param([string]$RequestedPath) + + $candidate = $RequestedPath + if (-not [System.IO.Path]::IsPathRooted($candidate)) { + $candidate = Join-Path $packageRoot $candidate + } + if (Test-Path -LiteralPath $candidate -PathType Leaf) { + return (Get-Item -LiteralPath $candidate).FullName + } + + $name = [System.IO.Path]::GetFileName($RequestedPath) + if (-not $name.EndsWith(".py", [System.StringComparison]::OrdinalIgnoreCase)) { + $name += ".py" + } + $sampleMatches = @(Get-ChildItem -Path $samplesRoot -Recurse -File -Filter $name) + if ($sampleMatches.Count -eq 0) { + throw "Could not find sample '$RequestedPath' under '$samplesRoot'." + } + if ($sampleMatches.Count -gt 1) { + throw "Sample '$RequestedPath' matched multiple files. Pass a path relative to the package root." + } + return $sampleMatches[0].FullName +} + +$resolvedSample = Resolve-SampleFile $SamplePath +$testFiles = @( + Get-ChildItem -Path (Join-Path $packageRoot "tests\samples") -File -Filter "test_samples*.py" | + Where-Object { -not $_.Name.EndsWith("_helpers.py") } | + ForEach-Object { $_.FullName } +) + +$temporaryDirectory = Join-Path ([System.IO.Path]::GetTempPath()) ("resolve-sample-test-{0}" -f [guid]::NewGuid()) +$pluginPath = Join-Path $temporaryDirectory "sample_node_collector.py" +$outputPath = Join-Path $temporaryDirectory "sample-nodes.json" +$pluginSource = @' +import json +import os +from pathlib import Path + + +def pytest_collection_finish(session): + records = [] + for item in session.items: + callspec = getattr(item, "callspec", None) + if callspec is None: + continue + sample_path = callspec.params.get("sample_path") + if sample_path is None: + continue + records.append( + { + "samplePath": str(Path(str(sample_path)).resolve()), + "nodeId": item.nodeid, + } + ) + Path(os.environ["AZURE_AI_PROJECTS_SAMPLE_NODE_OUTPUT"]).write_text( + json.dumps(records), encoding="utf-8" + ) +'@ + +New-Item -ItemType Directory -Path $temporaryDirectory | Out-Null +[System.IO.File]::WriteAllText($pluginPath, $pluginSource, [System.Text.UTF8Encoding]::new($false)) + +$oldPythonPath = $env:PYTHONPATH +$oldOutputPath = $env:AZURE_AI_PROJECTS_SAMPLE_NODE_OUTPUT +try { + $env:PYTHONPATH = if ($oldPythonPath) { "$temporaryDirectory$([System.IO.Path]::PathSeparator)$oldPythonPath" } else { $temporaryDirectory } + $env:AZURE_AI_PROJECTS_SAMPLE_NODE_OUTPUT = $outputPath + Push-Location $packageRoot + try { + $collectionOutput = @( + & $PythonExecutable -m pytest --collect-only -q -p sample_node_collector @testFiles ` + --azure_test_run_live=false --azure_skip_live_recording=true 2>&1 + ) + if ($LASTEXITCODE -ne 0) { + throw "pytest collection failed:`n$($collectionOutput -join [Environment]::NewLine)" + } + } finally { + Pop-Location + } + + $records = @(Get-Content -LiteralPath $outputPath -Raw | ConvertFrom-Json) +} finally { + $env:PYTHONPATH = $oldPythonPath + $env:AZURE_AI_PROJECTS_SAMPLE_NODE_OUTPUT = $oldOutputPath + Remove-Item -LiteralPath $temporaryDirectory -Recurse -Force -ErrorAction SilentlyContinue +} + +$pathComparison = if ($env:OS -eq "Windows_NT") { + [System.StringComparison]::OrdinalIgnoreCase +} else { + [System.StringComparison]::Ordinal +} +$matchingNodes = @( + $records | + Where-Object { [string]::Equals($_.samplePath, $resolvedSample, $pathComparison) } | + Select-Object -ExpandProperty nodeId -Unique | + ForEach-Object { + $normalizedNodeId = $_.Replace("\", "/") + $testsIndex = $normalizedNodeId.IndexOf("tests/") + if ($testsIndex -ge 0) { + $normalizedNodeId.Substring($testsIndex) + } else { + $normalizedNodeId + } + } | + Sort-Object +) + +if ($matchingNodes.Count -eq 0) { + throw "No collected sample test executes '$resolvedSample'. The sample may be excluded from the recorded sample harness." +} + +$relativeSample = [System.IO.Path]::GetRelativePath($packageRoot, $resolvedSample).Replace("/", "\") +foreach ($nodeId in $matchingNodes) { + [pscustomobject]@{ + SamplePath = $relativeSample + NodeId = $nodeId + } +} \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/scripts/TestRecordingGitConflicts.ps1 b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/scripts/TestRecordingGitConflicts.ps1 new file mode 100644 index 000000000000..df7ba29fde01 --- /dev/null +++ b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/scripts/TestRecordingGitConflicts.ps1 @@ -0,0 +1,152 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +[CmdletBinding()] +param( + [string]$PackageRoot, + [ValidateSet("main", "feature/azure-ai-projects/vnext")] + [string]$BaseBranch, + [string]$AssetsRepositoryPath, + [switch]$SkipFetch +) + +$ErrorActionPreference = "Stop" +if ($PackageRoot) { + $packageRoot = (Get-Item -LiteralPath (Resolve-Path -LiteralPath $PackageRoot).Path).FullName +} else { + $packageRoot = (Get-Item -LiteralPath (Resolve-Path (Join-Path $PSScriptRoot "..\..\..\..")).Path).FullName +} + +function Invoke-Git { + param( + [string]$WorkingDirectory, + [string[]]$Arguments, + [switch]$AllowFailure + ) + + $output = @(& git -C $WorkingDirectory @Arguments 2>&1) + $exitCode = $LASTEXITCODE + if ($exitCode -ne 0 -and -not $AllowFailure) { + throw "git $($Arguments -join ' ') failed:`n$($output -join [Environment]::NewLine)" + } + [pscustomobject]@{ + ExitCode = $exitCode + Output = ($output -join [Environment]::NewLine).Trim() + } +} + +$repositoryRoot = (Invoke-Git $packageRoot @("rev-parse", "--show-toplevel")).Output +$repositoryRoot = (Get-Item -LiteralPath $repositoryRoot).FullName +$currentBranch = (Invoke-Git $repositoryRoot @("branch", "--show-current")).Output +if (-not $currentBranch) { + throw "Recording is blocked from a detached HEAD. Switch to a branch and rebase the target first." +} + +if (-not $BaseBranch) { + if ($currentBranch -in @("main", "feature/azure-ai-projects/vnext")) { + $BaseBranch = $currentBranch + } else { + throw "BaseBranch is required for topic branch '$currentBranch'. Choose main or feature/azure-ai-projects/vnext." + } +} + +$remoteExists = (Invoke-Git $repositoryRoot @("remote", "get-url", "origin") -AllowFailure).ExitCode -eq 0 +if ($remoteExists -and -not $SkipFetch) { + $refspec = "+refs/heads/$BaseBranch`:refs/remotes/origin/$BaseBranch" + $fetch = Invoke-Git $repositoryRoot @("fetch", "--quiet", "origin", $refspec) -AllowFailure + if ($fetch.ExitCode -ne 0) { + throw "Unable to refresh origin/$BaseBranch. Recording is blocked because base freshness cannot be verified." + } +} + +$remoteBaseRef = "refs/remotes/origin/$BaseBranch" +$localBaseRef = "refs/heads/$BaseBranch" +if ((Invoke-Git $repositoryRoot @("show-ref", "--verify", "--quiet", $remoteBaseRef) -AllowFailure).ExitCode -eq 0) { + $baseRef = "origin/$BaseBranch" +} elseif ((Invoke-Git $repositoryRoot @("show-ref", "--verify", "--quiet", $localBaseRef) -AllowFailure).ExitCode -eq 0) { + $baseRef = $BaseBranch +} else { + throw "Base branch '$BaseBranch' was not found locally or under origin." +} + +$sourceAncestor = Invoke-Git $repositoryRoot @("merge-base", "--is-ancestor", $baseRef, "HEAD") -AllowFailure +if ($sourceAncestor.ExitCode -ne 0) { + throw "Recording is blocked: HEAD does not contain the latest '$baseRef'. Rebase the target branch, then retry." +} + +$relativePackagePath = [System.IO.Path]::GetRelativePath($repositoryRoot, $packageRoot).Replace("\", "/") +$assetsRelativePath = "$relativePackagePath/assets.json" +$localAssetsPath = Join-Path $packageRoot "assets.json" +if (-not (Test-Path -LiteralPath $localAssetsPath -PathType Leaf)) { + throw "Recording is blocked: local assets.json was not found at '$localAssetsPath'." +} + +try { + $localAssets = Get-Content -LiteralPath $localAssetsPath -Raw | ConvertFrom-Json + $baseAssetsText = (Invoke-Git $repositoryRoot @("show", "$baseRef`:$assetsRelativePath")).Output + $baseAssets = $baseAssetsText | ConvertFrom-Json +} catch { + throw "Recording is blocked: unable to parse local or base assets.json. $($_.Exception.Message)" +} + +$localTag = [string]$localAssets.Tag +$baseTag = [string]$baseAssets.Tag +if (-not $localTag -or -not $baseTag) { + throw "Recording is blocked: local or base assets.json does not contain a Tag." +} + +$assetRelationship = "same" +$baseAssetCommit = $null +$localAssetCommit = $null +$baseAssetCommitDate = $null +$localAssetCommitDate = $null +if ($localTag -ne $baseTag) { + if (-not $AssetsRepositoryPath) { + $breadcrumbRoot = Join-Path $repositoryRoot ".assets\breadcrumb" + if (Test-Path -LiteralPath $breadcrumbRoot -PathType Container) { + $breadcrumb = Get-ChildItem -LiteralPath $breadcrumbRoot -File -Filter "*.breadcrumb" | + Where-Object { (Get-Content -LiteralPath $_.FullName -Raw).StartsWith("$assetsRelativePath;") } | + Select-Object -First 1 + if ($breadcrumb) { + $parts = (Get-Content -LiteralPath $breadcrumb.FullName -Raw).Trim().Split(";") + if ($parts.Count -ge 2) { + $AssetsRepositoryPath = Join-Path (Join-Path $repositoryRoot ".assets") $parts[1] + } + } + } + } + if (-not $AssetsRepositoryPath -or -not (Test-Path -LiteralPath (Join-Path $AssetsRepositoryPath ".git"))) { + throw "Recording is blocked: local assets tag differs from '$baseRef', but the assets Git cache is unavailable for ancestry validation." + } + + $baseAssetCommitResult = Invoke-Git $AssetsRepositoryPath @("rev-parse", "$baseTag`^{commit}") -AllowFailure + $localAssetCommitResult = Invoke-Git $AssetsRepositoryPath @("rev-parse", "$localTag`^{commit}") -AllowFailure + if ($baseAssetCommitResult.ExitCode -ne 0 -or $localAssetCommitResult.ExitCode -ne 0) { + throw "Recording is blocked: base or local asset tag is unavailable in the assets Git cache." + } + $baseAssetCommit = $baseAssetCommitResult.Output + $localAssetCommit = $localAssetCommitResult.Output + $assetAncestor = Invoke-Git $AssetsRepositoryPath @( + "merge-base", "--is-ancestor", $baseAssetCommit, $localAssetCommit + ) -AllowFailure + if ($assetAncestor.ExitCode -ne 0) { + throw "Recording is blocked: local asset tag '$localTag' is not descended from base tag '$baseTag'. Rebase the target branch before recording." + } + $assetRelationship = "descendant" + $baseAssetCommitDate = (Invoke-Git $AssetsRepositoryPath @("show", "-s", "--format=%cI", $baseAssetCommit)).Output + $localAssetCommitDate = (Invoke-Git $AssetsRepositoryPath @("show", "-s", "--format=%cI", $localAssetCommit)).Output +} + +[pscustomobject]@{ + CurrentBranch = $currentBranch + BaseBranch = $BaseBranch + BaseRef = $baseRef + LocalTag = $localTag + BaseTag = $baseTag + AssetRelationship = $assetRelationship + BaseAssetCommit = $baseAssetCommit + LocalAssetCommit = $localAssetCommit + BaseAssetCommitDate = $baseAssetCommitDate + LocalAssetCommitDate = $localAssetCommitDate + SafeToRecord = $true +} \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/GetEnvironmentFileVariables.Tests.ps1 b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/GetEnvironmentFileVariables.Tests.ps1 new file mode 100644 index 000000000000..e576179e5ad3 --- /dev/null +++ b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/GetEnvironmentFileVariables.Tests.ps1 @@ -0,0 +1,75 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +. (Join-Path $PSScriptRoot "TestHelpers.ps1") +$paths = Get-RecordSampleTestPaths $PSScriptRoot + +Describe "GetEnvironmentFileVariables.ps1" { + BeforeAll { + $script:envFile = Join-Path $TestDrive ".env" + @' +# ignored comment +FIRST=old-value +EMPTY= +export EXPORTED="quoted value" +MULTILINE="first line +second line" +FIRST=effective-value +BARE +'@ | Set-Content -LiteralPath $envFile -Encoding UTF8 + } + + It "returns names in bottom-to-top effective assignment order" { + $actual = @(& $paths.EnvironmentFileScanner -EnvFile $envFile -PythonExecutable $paths.PythonExecutable) + ($actual -join ",") | Should Be "BARE,FIRST,MULTILINE,EXPORTED,EMPTY" + } + + It "returns last duplicate values and source lines" { + $actual = @( + & $paths.EnvironmentFileScanner -EnvFile $envFile ` + -PythonExecutable $paths.PythonExecutable -IncludeValues + ) + $first = @($actual | Where-Object { $_.Name -eq "FIRST" }) + $multiline = @($actual | Where-Object { $_.Name -eq "MULTILINE" }) + $first.Count | Should Be 1 + $first[0].Value | Should Be "effective-value" + $first[0].LineNumber | Should Be 7 + $multiline[0].Value | Should Be ("first line", "second line" -join "`n") + } + + It "uses the package-root .env by default" { + $packageRoot = Join-Path $TestDrive "default-env-package" + New-Item -ItemType Directory -Path $packageRoot | Out-Null + "DEFAULT_NAME=default-value" | Set-Content -LiteralPath (Join-Path $packageRoot ".env") -Encoding UTF8 + $actual = @( + & $paths.EnvironmentFileScanner -PackageRoot $packageRoot ` + -PythonExecutable $paths.PythonExecutable + ) + ($actual -join ",") | Should Be "DEFAULT_NAME" + } + + It "returns no names for an empty environment file" { + $emptyEnv = Join-Path $TestDrive "empty.env" + "# no assignments" | Set-Content -LiteralPath $emptyEnv -Encoding UTF8 + $actual = @(& $paths.EnvironmentFileScanner -EnvFile $emptyEnv -PythonExecutable $paths.PythonExecutable) + $actual.Count | Should Be 0 + } + + It "rejects a missing environment file" { + $caught = $null + try { + & $paths.EnvironmentFileScanner -EnvFile (Join-Path $TestDrive "missing.env") ` + -PythonExecutable $paths.PythonExecutable + } catch { $caught = $_ } + $caught | Should Not BeNullOrEmpty + } + + It "reports a Python execution failure" { + $caught = $null + try { + & $paths.EnvironmentFileScanner -EnvFile $envFile ` + -PythonExecutable (Join-Path $TestDrive "missing-python.exe") + } catch { $caught = $_ } + $caught | Should Not BeNullOrEmpty + } +} \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/GetSampleRequiredEnvironmentVariables.Tests.ps1 b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/GetSampleRequiredEnvironmentVariables.Tests.ps1 new file mode 100644 index 000000000000..6a5098b5572f --- /dev/null +++ b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/GetSampleRequiredEnvironmentVariables.Tests.ps1 @@ -0,0 +1,49 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +. (Join-Path $PSScriptRoot "TestHelpers.ps1") +$paths = Get-RecordSampleTestPaths $PSScriptRoot + +Describe "GetSampleRequiredEnvironmentVariables.ps1" { + BeforeAll { + $script:packageRoot = Join-Path $TestDrive "scanner-package" + New-SyntheticPackage $packageRoot + } + + It "returns the required variables for a selected sample" { + $actual = @(& $paths.EnvironmentScanner -PackageRoot $packageRoot -SamplePath "sample_unique.py") + ($actual -join ",") | Should Be "DIRECT_REQUIRED,HELPER_REQUIRED" + } + + It "excludes writes, defaults, and fallbacks" { + $actual = @(& $paths.EnvironmentScanner -PackageRoot $packageRoot -SamplePath "sample_unique.py") + ($actual -join ",") | Should Not Match "ASSIGNED_ONLY|OPTIONAL_WITH_DEFAULT|OPTIONAL_WITH_FALLBACK" + } + + It "returns sorted unique names for the full sample tree" { + $actual = @(& $paths.EnvironmentScanner -PackageRoot $packageRoot) + $sortedUnique = @($actual | Sort-Object -Unique) + $actual.Count | Should Be 6 + ($actual -join "`n") | Should Be ($sortedUnique -join "`n") + } + + It "merges multiple selected samples" { + $actual = @( + & $paths.EnvironmentScanner -PackageRoot $packageRoot ` + -SamplePath "sample_unique", "sample_async.py" + ) + ($actual -join ",") | Should Be "ASYNC_REQUIRED,DIRECT_REQUIRED,HELPER_REQUIRED" + } + + It "rejects an ambiguous filename" { + $caught = $null + try { & $paths.EnvironmentScanner -PackageRoot $packageRoot -SamplePath "util.py" } catch { $caught = $_ } + $caught | Should Not BeNullOrEmpty + } + + It "rejects a missing sample" { + $caught = $null + try { & $paths.EnvironmentScanner -PackageRoot $packageRoot -SamplePath "missing.py" } catch { $caught = $_ } + $caught | Should Not BeNullOrEmpty + } +} \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/InvokeSampleTest.Integration.Tests.ps1 b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/InvokeSampleTest.Integration.Tests.ps1 new file mode 100644 index 000000000000..317a3d89ebf0 --- /dev/null +++ b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/InvokeSampleTest.Integration.Tests.ps1 @@ -0,0 +1,61 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +. (Join-Path $PSScriptRoot "TestHelpers.ps1") +$paths = Get-RecordSampleTestPaths $PSScriptRoot + +Describe "InvokeSampleTest.ps1 integration" { + BeforeAll { + $script:packageRoot = Join-Path $TestDrive "runner-integration-package" + New-SyntheticPackage $packageRoot + $script:conflictCheckScript = Join-Path $packageRoot "synthetic-recording-conflict-check.ps1" + $script:cleanupScript = Join-Path $packageRoot "synthetic-recording-cleanup.ps1" + } + + It "executes playback without live approval" { + $actual = @(& $paths.SampleTestRunner -PackageRoot $packageRoot -PythonExecutable $paths.PythonExecutable -SamplePath "sample_unique.py" -Mode "playback-only" -Run) + ($actual -join "`n") | Should Match "playback result: 0" + } + + It "executes record-only and live modes with approval" { + $cachePath = Join-Path $packageRoot ".pytest_cache" + New-Item -ItemType Directory -Path $cachePath -Force | Out-Null + $record = @(& $paths.SampleTestRunner -PackageRoot $packageRoot -PythonExecutable $paths.PythonExecutable -RecordingConflictCheckScript $conflictCheckScript -RecordingCleanupScript $cleanupScript -SamplePath "sample_unique.py" -Mode "record-only" -Run -ConfirmSelection -ConfirmRecording) + Remove-Item -LiteralPath (Join-Path $packageRoot "recording-conflict-check-called.txt") -Force + $live = @(& $paths.SampleTestRunner -PackageRoot $packageRoot -PythonExecutable $paths.PythonExecutable -SamplePath "sample_unique.py" -Mode "live-test-locally" -Run -ConfirmSelection -ConfirmLive) + ($record -join "`n") | Should Match "record result: 0" + ($live -join "`n") | Should Match "live result: 0" + (Test-Path -LiteralPath (Join-Path $packageRoot "recording-conflict-check-called.txt")) | Should Be $false + } + + It "executes record then playback in order" { + $actual = @(& $paths.SampleTestRunner -PackageRoot $packageRoot -PythonExecutable $paths.PythonExecutable -RecordingConflictCheckScript $conflictCheckScript -RecordingCleanupScript $cleanupScript -SamplePath "sample_unique.py" -Mode "record-and-playback" -Run -ConfirmSelection -ConfirmRecording) + $text = $actual -join "`n" + $text.IndexOf("record result: 0") | Should BeLessThan $text.IndexOf("playback result: 0") + } + + It "continues to playback when recording fails" { + $marker = Join-Path $packageRoot "playback-after-record-failure.txt" + $caught = $null + try { & $paths.SampleTestRunner -PackageRoot $packageRoot -PythonExecutable $paths.PythonExecutable -RecordingConflictCheckScript $conflictCheckScript -RecordingCleanupScript $cleanupScript -SamplePath "sample_record_failure.py" -Mode "record-and-playback" -Run -ConfirmSelection -ConfirmRecording } catch { $caught = $_ } + $caught.Exception.Message | Should Match "record=1" + (Test-Path -LiteralPath $marker) | Should Be $true + } + + It "propagates playback failures and restores process environment" { + $original = $env:FAILURE_PROCESS_VALUE + $env:FAILURE_PROCESS_VALUE = "before-run" + $caught = $null + try { & $paths.SampleTestRunner -PackageRoot $packageRoot -PythonExecutable $paths.PythonExecutable -SamplePath "sample_playback_failure.py" -Mode "playback-only" -Run } catch { $caught = $_ } finally { $restored = $env:FAILURE_PROCESS_VALUE; $env:FAILURE_PROCESS_VALUE = $original } + $caught.Exception.Message | Should Match "playback=1" + $restored | Should Be "before-run" + } + + It "repairs hosted-agent recordings before playback" { + $marker = Join-Path $packageRoot "tests\samples\repair-called.txt" + $actual = @(& $paths.SampleTestRunner -PackageRoot $packageRoot -PythonExecutable $paths.PythonExecutable -RecordingConflictCheckScript $conflictCheckScript -RecordingCleanupScript $cleanupScript -SamplePath "sample_hosted.py" -Mode "record-and-playback" -Run -ConfirmSelection -ConfirmRecording) + (Test-Path -LiteralPath $marker) | Should Be $true + ($actual -join "`n") | Should Match "repair result: 0" + ($actual -join "`n") | Should Match "playback result: 0" + } +} \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/InvokeSampleTest.Tests.ps1 b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/InvokeSampleTest.Tests.ps1 new file mode 100644 index 000000000000..315169a3865f --- /dev/null +++ b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/InvokeSampleTest.Tests.ps1 @@ -0,0 +1,99 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +. (Join-Path $PSScriptRoot "TestHelpers.ps1") +$paths = Get-RecordSampleTestPaths $PSScriptRoot + +Describe "InvokeSampleTest.ps1 plan and guards" { + BeforeAll { + $script:packageRoot = Join-Path $TestDrive "runner-unit-package" + New-SyntheticPackage $packageRoot + $script:conflictCheckScript = Join-Path $packageRoot "synthetic-recording-conflict-check.ps1" + $script:recordAndPlaybackPlan = @(& $paths.SampleTestRunner -PackageRoot $packageRoot -PythonExecutable $paths.PythonExecutable -RecordingConflictCheckScript $conflictCheckScript -SamplePath "sample_unique.py" -Mode "record-and-playback") + $script:recordOnlyPlan = @(& $paths.SampleTestRunner -PackageRoot $packageRoot -PythonExecutable $paths.PythonExecutable -RecordingConflictCheckScript $conflictCheckScript -SamplePath "sample_unique.py" -Mode "record-only") + $script:playbackOnlyPlan = @(& $paths.SampleTestRunner -PackageRoot $packageRoot -PythonExecutable $paths.PythonExecutable -SamplePath "sample_unique.py" -Mode "playback-only") + $script:livePlan = @(& $paths.SampleTestRunner -PackageRoot $packageRoot -PythonExecutable $paths.PythonExecutable -SamplePath "sample_unique.py" -Mode "live-test-locally") + } + + It "plans record followed by playback when explicitly selected" { + ($recordAndPlaybackPlan -join "`n") | Should Match "Mode: record-and-playback" + ($recordAndPlaybackPlan -join "`n") | Should Match "Steps: record, playback" + } + + It "rejects an omitted mode" { + $caught = $null + try { + & $paths.SampleTestRunner -PackageRoot $packageRoot -PythonExecutable $paths.PythonExecutable ` + -SamplePath "sample_unique.py" + } catch { $caught = $_ } + $caught.Exception.Message | Should Match "Mode is required" + } + + It "rejects the retired live-without-recording mode name" { + $caught = $null + try { + & $paths.SampleTestRunner -PackageRoot $packageRoot -PythonExecutable $paths.PythonExecutable ` + -SamplePath "sample_unique.py" -Mode "live-without-recording" + } catch { $caught = $_ } + $caught | Should Not BeNullOrEmpty + } + + It "maps explicit modes to exact flags" { + ($recordOnlyPlan -join "`n") | Should Match "--azure_test_run_live=true --azure_skip_live_recording=false" + ($playbackOnlyPlan -join "`n") | Should Match "--azure_test_run_live=false --azure_skip_live_recording=true" + ($livePlan -join "`n") | Should Match "--azure_test_run_live=true --azure_skip_live_recording=true" + } + + It "displays effective values while redacting command arguments" { + $text = $recordAndPlaybackPlan -join "`n" + $text | Should Match "Harness-supplied: HARNESS_VALUE" + $text | Should Match "Required: DIRECT_REQUIRED, HELPER_REQUIRED, LLM_VALIDATION_PROJECT_ENDPOINT" + $text | Should Match "DIRECT_REQUIRED=real-direct-value" + $text | Should Match "HARNESS_VALUE=real-harness-value" + $text | Should Match "HELPER_REQUIRED=real-helper-value" + $text | Should Match "LLM_VALIDATION_PROJECT_ENDPOINT=https://validation.example.test/api/projects/example" + $text | Should Match "CLI values loaded: 2; process values loaded: 2" + $commandPreview = @($recordAndPlaybackPlan | Where-Object { $_ -like "* command: *" }) -join "`n" + $commandPreview | Should Not Match "real-direct-value|real-helper-value|real-harness-value" + $commandPreview | Should Match "--direct_required=" + } + + It "requires selection and action confirmations for recording and live execution" { + $recordSelectionError = $null + $liveSelectionError = $null + $recordError = $null + $liveError = $null + try { & $paths.SampleTestRunner -PackageRoot $packageRoot -PythonExecutable $paths.PythonExecutable -RecordingConflictCheckScript $conflictCheckScript -SamplePath "sample_unique.py" -Mode "record-only" -Run } catch { $recordSelectionError = $_ } + try { & $paths.SampleTestRunner -PackageRoot $packageRoot -PythonExecutable $paths.PythonExecutable -SamplePath "sample_unique.py" -Mode "live-test-locally" -Run } catch { $liveSelectionError = $_ } + try { & $paths.SampleTestRunner -PackageRoot $packageRoot -PythonExecutable $paths.PythonExecutable -RecordingConflictCheckScript $conflictCheckScript -SamplePath "sample_unique.py" -Mode "record-only" -Run -ConfirmSelection } catch { $recordError = $_ } + try { & $paths.SampleTestRunner -PackageRoot $packageRoot -PythonExecutable $paths.PythonExecutable -SamplePath "sample_unique.py" -Mode "live-test-locally" -Run -ConfirmSelection } catch { $liveError = $_ } + $recordSelectionError.Exception.Message | Should Match "selection was not confirmed" + $liveSelectionError.Exception.Message | Should Match "selection was not confirmed" + $recordError.Exception.Message | Should Match "Recording may modify files" + $liveError.Exception.Message | Should Match "Live execution contacts Azure" + } + + It "selects a valid explicit node and rejects missing selection" { + $actual = @(& $paths.SampleTestRunner -PackageRoot $packageRoot -PythonExecutable $paths.PythonExecutable -SamplePath "sample_multiple.py" -NodeId "tests/samples/test_samples.py::test_multiple[variant-one]" -Mode "playback-only") + ($actual -join "`n") | Should Match "variant-one" + $caught = $null + try { & $paths.SampleTestRunner -PackageRoot $packageRoot -PythonExecutable $paths.PythonExecutable -SamplePath "sample_multiple.py" -Mode "playback-only" } catch { $caught = $_ } + $caught.Exception.Message | Should Match "Multiple pytest nodes" + } + + It "rejects an invalid explicit node" { + $caught = $null + try { & $paths.SampleTestRunner -PackageRoot $packageRoot -PythonExecutable $paths.PythonExecutable -SamplePath "sample_multiple.py" -NodeId "tests/samples/test_samples.py::missing[node]" -Mode "playback-only" } catch { $caught = $_ } + $caught.Exception.Message | Should Match "requested node id does not execute" + } + + It "reports missing and empty required values" { + $incompleteEnv = Join-Path $TestDrive "incomplete.env" + "DIRECT_REQUIRED=" | Set-Content -LiteralPath $incompleteEnv -Encoding UTF8 + $actual = @(& $paths.SampleTestRunner -PackageRoot $packageRoot -PythonExecutable $paths.PythonExecutable -EnvFile $incompleteEnv -SamplePath "sample_unique.py" -Mode "playback-only") + $text = $actual -join "`n" + $text | Should Match "Missing: HELPER_REQUIRED, LLM_VALIDATION_PROJECT_ENDPOINT" + $text | Should Match "Empty: DIRECT_REQUIRED" + $text | Should Match "Environment variables used: " + } +} \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/ResetRecordingState.Tests.ps1 b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/ResetRecordingState.Tests.ps1 new file mode 100644 index 000000000000..0614af7d5b74 --- /dev/null +++ b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/ResetRecordingState.Tests.ps1 @@ -0,0 +1,45 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +. (Join-Path $PSScriptRoot "TestHelpers.ps1") +$paths = Get-RecordSampleTestPaths $PSScriptRoot + +Describe "ResetRecordingState.ps1" { + It "stops only test proxy processes and deletes pytest cache" { + $packageRoot = Join-Path $TestDrive "cleanup-package" + $cachePath = Join-Path $packageRoot ".pytest_cache" + New-Item -ItemType Directory -Path $cachePath -Force | Out-Null + "cache" | Set-Content -LiteralPath (Join-Path $cachePath "marker.txt") -Encoding UTF8 + + $stoppedNames = [System.Collections.Generic.List[string]]::new() + $provider = { + @( + [pscustomobject]@{ ProcessName = "testproxy" }, + [pscustomobject]@{ ProcessName = "prefix-testproxy-child" }, + [pscustomobject]@{ ProcessName = "python" } + ) + }.GetNewClosure() + $stopper = { + param($Processes) + foreach ($process in $Processes) { + $stoppedNames.Add($process.ProcessName) + } + }.GetNewClosure() + + & $paths.RecordingStateReset -PackageRoot $packageRoot ` + -ProcessProvider $provider -ProcessStopper $stopper + + ($stoppedNames -join ",") | Should Be "testproxy,prefix-testproxy-child" + (Test-Path -LiteralPath $cachePath) | Should Be $false + } + + It "succeeds when there are no matching processes or cache" { + $packageRoot = Join-Path $TestDrive "empty-cleanup-package" + New-Item -ItemType Directory -Path $packageRoot -Force | Out-Null + $provider = { @([pscustomobject]@{ ProcessName = "python" }) }.GetNewClosure() + $stopper = { param($Processes) throw "Process stopper should not be called." } + + & $paths.RecordingStateReset -PackageRoot $packageRoot ` + -ProcessProvider $provider -ProcessStopper $stopper + } +} \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/ResolveSampleTest.Tests.ps1 b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/ResolveSampleTest.Tests.ps1 new file mode 100644 index 000000000000..c2cd3c6e0751 --- /dev/null +++ b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/ResolveSampleTest.Tests.ps1 @@ -0,0 +1,75 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +. (Join-Path $PSScriptRoot "TestHelpers.ps1") +$paths = Get-RecordSampleTestPaths $PSScriptRoot + +Describe "ResolveSampleTest.ps1" { + BeforeAll { + $script:packageRoot = Join-Path $TestDrive "resolver-package" + New-SyntheticPackage $packageRoot + $script:uniqueResult = @( + & $paths.SampleResolver -PackageRoot $packageRoot ` + -PythonExecutable $paths.PythonExecutable -SamplePath "sample_unique.py" + ) + $script:multipleResults = @( + & $paths.SampleResolver -PackageRoot $packageRoot ` + -PythonExecutable $paths.PythonExecutable -SamplePath "sample_multiple.py" + ) + $script:asyncResult = @( + & $paths.SampleResolver -PackageRoot $packageRoot ` + -PythonExecutable $paths.PythonExecutable -SamplePath "sample_async.py" + ) + $script:evaluationResult = @( + & $paths.SampleResolver -PackageRoot $packageRoot ` + -PythonExecutable $paths.PythonExecutable -SamplePath "sample_evaluation.py" + ) + } + + It "resolves a filename to one synchronous pytest node" { + $uniqueResult.Count | Should Be 1 + $uniqueResult[0].SamplePath | Should Be "samples\unique\sample_unique.py" + $uniqueResult[0].NodeId | Should Match "test_samples.py::test_unique\[unique-case\]$" + } + + It "returns every collected node for a sample" { + $multipleResults.Count | Should Be 2 + ($multipleResults.NodeId -join "`n") | Should Match "variant-one\]" + ($multipleResults.NodeId -join "`n") | Should Match "variant-two\]" + } + + It "resolves async and evaluation harnesses" { + $asyncResult[0].NodeId | Should Match "test_samples_async.py::test_async\[async-case\]$" + $evaluationResult[0].NodeId | Should Match "test_samples_evaluations.py::test_evaluation\[evaluation-case\]$" + } + + It "rejects ambiguous and missing filenames" { + $ambiguous = $null + $missing = $null + try { & $paths.SampleResolver -PackageRoot $packageRoot -PythonExecutable $paths.PythonExecutable -SamplePath "util.py" } catch { $ambiguous = $_ } + try { & $paths.SampleResolver -PackageRoot $packageRoot -PythonExecutable $paths.PythonExecutable -SamplePath "missing.py" } catch { $missing = $_ } + $ambiguous | Should Not BeNullOrEmpty + $missing | Should Not BeNullOrEmpty + } + + It "rejects a sample absent from the pytest harness" { + $caught = $null + try { + & $paths.SampleResolver -PackageRoot $packageRoot ` + -PythonExecutable $paths.PythonExecutable -SamplePath "sample_uncollected.py" + } catch { $caught = $_ } + $caught | Should Not BeNullOrEmpty + } + + It "reports pytest collection failures" { + $brokenRoot = Join-Path $TestDrive "broken-resolver-package" + New-SyntheticPackage $brokenRoot + "this is not valid python !!!" | Set-Content -LiteralPath (Join-Path $brokenRoot "tests\samples\test_samples.py") -Encoding UTF8 + $caught = $null + try { + & $paths.SampleResolver -PackageRoot $brokenRoot ` + -PythonExecutable $paths.PythonExecutable -SamplePath "sample_unique.py" + } catch { $caught = $_ } + $caught.Exception.Message | Should Match "pytest collection failed" + } +} \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/TestHelpers.ps1 b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/TestHelpers.ps1 new file mode 100644 index 000000000000..3d1998419f3f --- /dev/null +++ b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/TestHelpers.ps1 @@ -0,0 +1,214 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +function Get-RecordSampleTestPaths { + param([string]$TestScriptRoot) + + $skillRoot = (Resolve-Path (Join-Path $TestScriptRoot "..")).Path + $repositoryPackageRoot = (Resolve-Path (Join-Path $TestScriptRoot "..\..\..\..")).Path + [pscustomobject]@{ + EnvironmentScanner = Join-Path $skillRoot "scripts\GetSampleRequiredEnvironmentVariables.ps1" + EnvironmentFileScanner = Join-Path $skillRoot "scripts\GetEnvironmentFileVariables.ps1" + SampleResolver = Join-Path $skillRoot "scripts\ResolveSampleTest.ps1" + SampleTestRunner = Join-Path $skillRoot "scripts\InvokeSampleTest.ps1" + RecordingConflictCheck = Join-Path $skillRoot "scripts\TestRecordingGitConflicts.ps1" + RecordingStateReset = Join-Path $skillRoot "scripts\ResetRecordingState.ps1" + PythonExecutable = Join-Path $repositoryPackageRoot ".venv\Scripts\python.exe" + } +} + +function New-SyntheticPackage { + param([string]$Root) + + $directories = @( + "samples\unique", + "samples\multiple", + "samples\async", + "samples\evaluations", + "samples\failures", + "samples\first", + "samples\hosted_agents", + "samples\second", + "samples\uncollected", + "tests\samples" + ) + foreach ($directory in $directories) { + New-Item -ItemType Directory -Path (Join-Path $Root $directory) -Force | Out-Null + } + + @' +import os + +direct = os.environ["DIRECT_REQUIRED"] +helper = get_required_env_var("HELPER_REQUIRED") +os.environ["ASSIGNED_ONLY"] = "value" +optional = os.environ.get("OPTIONAL_WITH_DEFAULT", "default") +fallback = os.getenv("OPTIONAL_WITH_FALLBACK") or "default" +'@ | Set-Content -LiteralPath (Join-Path $Root "samples\unique\sample_unique.py") -Encoding UTF8 + + 'import os; value = os.environ["MULTIPLE_REQUIRED"]' | + Set-Content -LiteralPath (Join-Path $Root "samples\multiple\sample_multiple.py") -Encoding UTF8 + 'import os; value = os.environ["ASYNC_REQUIRED"]' | + Set-Content -LiteralPath (Join-Path $Root "samples\async\sample_async.py") -Encoding UTF8 + 'import os; value = os.environ["EVALUATION_REQUIRED"]' | + Set-Content -LiteralPath (Join-Path $Root "samples\evaluations\sample_evaluation.py") -Encoding UTF8 + '# synthetic record failure sample' | + Set-Content -LiteralPath (Join-Path $Root "samples\failures\sample_record_failure.py") -Encoding UTF8 + 'import os; value = os.environ["FAILURE_PROCESS_VALUE"]' | + Set-Content -LiteralPath (Join-Path $Root "samples\failures\sample_playback_failure.py") -Encoding UTF8 + '# synthetic hosted-agent sample' | + Set-Content -LiteralPath (Join-Path $Root "samples\hosted_agents\sample_hosted.py") -Encoding UTF8 + '# intentionally absent from pytest collection' | + Set-Content -LiteralPath (Join-Path $Root "samples\uncollected\sample_uncollected.py") -Encoding UTF8 + '# duplicate filename fixture' | + Set-Content -LiteralPath (Join-Path $Root "samples\first\util.py") -Encoding UTF8 + '# duplicate filename fixture' | + Set-Content -LiteralPath (Join-Path $Root "samples\second\util.py") -Encoding UTF8 + + @' +def pytest_addoption(parser): + parser.addoption("--azure_test_run_live") + parser.addoption("--azure_skip_live_recording") + parser.addoption("--direct_required") + parser.addoption("--llm_validation_project_endpoint") +'@ | Set-Content -LiteralPath (Join-Path $Root "conftest.py") -Encoding UTF8 + + @' +[CmdletBinding()] +param([string]$PackageRoot) + +if (-not (Test-Path -LiteralPath (Join-Path $PackageRoot "recording-conflict-check-called.txt"))) { + throw "Recording conflict check did not run before cleanup." +} +New-Item -ItemType File -Path (Join-Path $PackageRoot "recording-cleanup-called.txt") -Force | Out-Null +Remove-Item -Recurse -Force (Join-Path $PackageRoot ".pytest_cache") -ErrorAction SilentlyContinue +'@ | Set-Content -LiteralPath (Join-Path $Root "synthetic-recording-cleanup.ps1") -Encoding UTF8 + + @' +[CmdletBinding()] +param([string]$PackageRoot, [string]$BaseBranch) + +New-Item -ItemType File -Path (Join-Path $PackageRoot "recording-conflict-check-called.txt") -Force | Out-Null +[pscustomobject]@{ AssetRelationship = "synthetic"; SafeToRecord = $true } +'@ | Set-Content -LiteralPath (Join-Path $Root "synthetic-recording-conflict-check.ps1") -Encoding UTF8 + + @' +def loader(**kwargs): + return kwargs + + +servicePreparer = loader( + direct_required="sanitized-direct", + llm_validation_project_endpoint="sanitized-validation-endpoint", +) +'@ | Set-Content -LiteralPath (Join-Path $Root "tests\test_base.py") -Encoding UTF8 + + @' +DIRECT_REQUIRED=real-direct-value +HELPER_REQUIRED=real-helper-value +LLM_VALIDATION_PROJECT_ENDPOINT=https://validation.example.test/api/projects/example +HARNESS_VALUE=real-harness-value +FAILURE_PROCESS_VALUE=real-failure-process-value +'@ | Set-Content -LiteralPath (Join-Path $Root ".env") -Encoding UTF8 + + @' +from pathlib import Path +import pytest + +ROOT = Path(__file__).resolve().parents[2] +UNIQUE = str(ROOT / "samples" / "unique" / "sample_unique.py") +MULTIPLE = str(ROOT / "samples" / "multiple" / "sample_multiple.py") +RECORD_FAILURE = str(ROOT / "samples" / "failures" / "sample_record_failure.py") +PLAYBACK_FAILURE = str(ROOT / "samples" / "failures" / "sample_playback_failure.py") +HOSTED = str(ROOT / "samples" / "hosted_agents" / "sample_hosted.py") + + +@pytest.mark.parametrize("sample_path", [pytest.param(UNIQUE, id="unique-case")]) +def test_unique(sample_path, pytestconfig): + live = pytestconfig.getoption("azure_test_run_live") == "true" + skip_recording = pytestconfig.getoption("azure_skip_live_recording") == "true" + if live and not skip_recording: + assert (ROOT / "recording-conflict-check-called.txt").is_file() + assert (ROOT / "recording-cleanup-called.txt").is_file() + assert not (ROOT / ".pytest_cache").exists() + if False: + executor.validate_print_calls_by_llm() + + +if False: + AdditionalSampleTestDetail( + test_id="unique-case", + sample_filename="sample_unique.py", + env_vars={"HARNESS_VALUE": "sanitized-harness-value"}, + ) + + +@pytest.mark.parametrize( + "sample_path", + [ + pytest.param(MULTIPLE, id="variant-one"), + pytest.param(MULTIPLE, id="variant-two"), + ], +) +def test_multiple(sample_path): + pass + + +@pytest.mark.parametrize("sample_path", [pytest.param(RECORD_FAILURE, id="record-failure")]) +def test_record_failure(sample_path, pytestconfig): + live = pytestconfig.getoption("azure_test_run_live") == "true" + skip_recording = pytestconfig.getoption("azure_skip_live_recording") == "true" + if live and not skip_recording: + pytest.fail("synthetic recording failure") + (ROOT / "playback-after-record-failure.txt").write_text("played", encoding="utf-8") + + +@pytest.mark.parametrize("sample_path", [pytest.param(PLAYBACK_FAILURE, id="playback-failure")]) +def test_playback_failure(sample_path, pytestconfig): + live = pytestconfig.getoption("azure_test_run_live") == "true" + skip_recording = pytestconfig.getoption("azure_skip_live_recording") == "true" + if not live and skip_recording: + pytest.fail("synthetic playback failure") + + +@pytest.mark.parametrize("sample_path", [pytest.param(HOSTED, id="hosted-case")]) +def test_hosted(sample_path, pytestconfig): + live = pytestconfig.getoption("azure_test_run_live") == "true" + if not live: + assert (ROOT / "tests" / "samples" / "repair-called.txt").is_file() +'@ | Set-Content -LiteralPath (Join-Path $Root "tests\samples\test_samples.py") -Encoding UTF8 + + @' +from pathlib import Path +import sys + +Path(__file__).with_name("repair-called.txt").write_text(sys.argv[1], encoding="utf-8") +print("synthetic repair completed") +'@ | Set-Content -LiteralPath (Join-Path $Root "tests\samples\repair_hosted_agent_sample_recording.py") -Encoding UTF8 + + @' +from pathlib import Path +import pytest + +ROOT = Path(__file__).resolve().parents[2] +ASYNC_SAMPLE = str(ROOT / "samples" / "async" / "sample_async.py") + + +@pytest.mark.parametrize("sample_path", [pytest.param(ASYNC_SAMPLE, id="async-case")]) +async def test_async(sample_path): + pass +'@ | Set-Content -LiteralPath (Join-Path $Root "tests\samples\test_samples_async.py") -Encoding UTF8 + + @' +from pathlib import Path +import pytest + +ROOT = Path(__file__).resolve().parents[2] +EVALUATION_SAMPLE = str(ROOT / "samples" / "evaluations" / "sample_evaluation.py") + + +@pytest.mark.parametrize("sample_path", [pytest.param(EVALUATION_SAMPLE, id="evaluation-case")]) +def test_evaluation(sample_path): + pass +'@ | Set-Content -LiteralPath (Join-Path $Root "tests\samples\test_samples_evaluations.py") -Encoding UTF8 +} \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/TestRecordingGitConflicts.Tests.ps1 b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/TestRecordingGitConflicts.Tests.ps1 new file mode 100644 index 000000000000..d0401817c6a7 --- /dev/null +++ b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/TestRecordingGitConflicts.Tests.ps1 @@ -0,0 +1,149 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +. (Join-Path $PSScriptRoot "TestHelpers.ps1") +$paths = Get-RecordSampleTestPaths $PSScriptRoot + +function Invoke-TestGit { + param([string]$Root, [Parameter(ValueFromRemainingArguments = $true)][string[]]$Arguments) + $output = @(& git -C $Root @Arguments 2>&1) + if ($LASTEXITCODE -ne 0) { + throw "git $($Arguments -join ' ') failed: $($output -join [Environment]::NewLine)" + } + ($output -join [Environment]::NewLine).Trim() +} + +function Initialize-TestRepository { + param([string]$Root) + New-Item -ItemType Directory -Path $Root -Force | Out-Null + Invoke-TestGit $Root init --initial-branch=main | Out-Null + Invoke-TestGit $Root config user.email test@example.com | Out-Null + Invoke-TestGit $Root config user.name "Recording Guard Tests" | Out-Null +} + +function Write-TestAssetsFile { + param([string]$PackageRoot, [string]$Tag) + [ordered]@{ + AssetsRepo = "Test/assets" + AssetsRepoPrefixPath = "python" + TagPrefix = "python/ai/azure-ai-projects" + Tag = $Tag + } | ConvertTo-Json | Set-Content -LiteralPath (Join-Path $PackageRoot "assets.json") -Encoding UTF8 +} + +function New-GuardRepositories { + param([string]$Root) + + $sourceRoot = Join-Path $Root "source" + $packageRoot = Join-Path $sourceRoot "sdk\ai\azure-ai-projects" + $assetsRoot = Join-Path $Root "assets" + Initialize-TestRepository $sourceRoot + New-Item -ItemType Directory -Path $packageRoot -Force | Out-Null + Write-TestAssetsFile $packageRoot "asset-base" + Invoke-TestGit $sourceRoot add . | Out-Null + Invoke-TestGit $sourceRoot commit -m "base assets" | Out-Null + + Initialize-TestRepository $assetsRoot + "base" | Set-Content -LiteralPath (Join-Path $assetsRoot "recording.txt") -Encoding UTF8 + Invoke-TestGit $assetsRoot add . | Out-Null + Invoke-TestGit $assetsRoot commit -m "base recording" | Out-Null + Invoke-TestGit $assetsRoot tag asset-base | Out-Null + + [pscustomobject]@{ + SourceRoot = $sourceRoot + PackageRoot = $packageRoot + AssetsRoot = $assetsRoot + } +} + +Describe "TestRecordingGitConflicts.ps1" { + It "allows recording on a current base branch with the same asset tag" { + $repos = New-GuardRepositories (Join-Path $TestDrive "equal-base") + $actual = & $paths.RecordingConflictCheck -PackageRoot $repos.PackageRoot -BaseBranch main ` + -AssetsRepositoryPath $repos.AssetsRoot -SkipFetch + + $actual.SafeToRecord | Should Be $true + $actual.AssetRelationship | Should Be "same" + } + + It "allows a topic branch rebased onto the base with the same asset tag" { + $repos = New-GuardRepositories (Join-Path $TestDrive "topic-equal") + Invoke-TestGit $repos.SourceRoot checkout -b topic | Out-Null + "topic" | Set-Content -LiteralPath (Join-Path $repos.SourceRoot "topic.txt") -Encoding UTF8 + Invoke-TestGit $repos.SourceRoot add . | Out-Null + Invoke-TestGit $repos.SourceRoot commit -m "topic work" | Out-Null + + $actual = & $paths.RecordingConflictCheck -PackageRoot $repos.PackageRoot -BaseBranch main ` + -AssetsRepositoryPath $repos.AssetsRoot -SkipFetch + + $actual.SafeToRecord | Should Be $true + $actual.AssetRelationship | Should Be "same" + } + + It "allows a descendant local asset tag on the base branch" { + $repos = New-GuardRepositories (Join-Path $TestDrive "asset-descendant") + "new" | Set-Content -LiteralPath (Join-Path $repos.AssetsRoot "recording.txt") -Encoding UTF8 + Invoke-TestGit $repos.AssetsRoot add . | Out-Null + Invoke-TestGit $repos.AssetsRoot commit -m "new recording" | Out-Null + Invoke-TestGit $repos.AssetsRoot tag asset-new | Out-Null + Write-TestAssetsFile $repos.PackageRoot "asset-new" + + $actual = & $paths.RecordingConflictCheck -PackageRoot $repos.PackageRoot -BaseBranch main ` + -AssetsRepositoryPath $repos.AssetsRoot -SkipFetch + + $actual.SafeToRecord | Should Be $true + $actual.AssetRelationship | Should Be "descendant" + $actual.BaseAssetCommitDate | Should Not BeNullOrEmpty + $actual.LocalAssetCommitDate | Should Not BeNullOrEmpty + } + + It "blocks a divergent local asset tag" { + $repos = New-GuardRepositories (Join-Path $TestDrive "asset-divergent") + Invoke-TestGit $repos.AssetsRoot checkout --orphan divergent | Out-Null + Invoke-TestGit $repos.AssetsRoot rm -rf . | Out-Null + "divergent" | Set-Content -LiteralPath (Join-Path $repos.AssetsRoot "recording.txt") -Encoding UTF8 + Invoke-TestGit $repos.AssetsRoot add . | Out-Null + Invoke-TestGit $repos.AssetsRoot commit -m "divergent recording" | Out-Null + Invoke-TestGit $repos.AssetsRoot tag asset-divergent | Out-Null + Write-TestAssetsFile $repos.PackageRoot "asset-divergent" + $caught = $null + try { + & $paths.RecordingConflictCheck -PackageRoot $repos.PackageRoot -BaseBranch main ` + -AssetsRepositoryPath $repos.AssetsRoot -SkipFetch + } catch { $caught = $_ } + + $caught.Exception.Message | Should Match "not descended from base tag" + } + + It "blocks a topic branch that does not contain the selected base" { + $repos = New-GuardRepositories (Join-Path $TestDrive "stale-topic") + Invoke-TestGit $repos.SourceRoot checkout -b topic | Out-Null + "topic" | Set-Content -LiteralPath (Join-Path $repos.SourceRoot "topic.txt") -Encoding UTF8 + Invoke-TestGit $repos.SourceRoot add . | Out-Null + Invoke-TestGit $repos.SourceRoot commit -m "topic work" | Out-Null + Invoke-TestGit $repos.SourceRoot checkout main | Out-Null + "new base" | Set-Content -LiteralPath (Join-Path $repos.SourceRoot "base.txt") -Encoding UTF8 + Invoke-TestGit $repos.SourceRoot add . | Out-Null + Invoke-TestGit $repos.SourceRoot commit -m "advance base" | Out-Null + Invoke-TestGit $repos.SourceRoot checkout topic | Out-Null + $caught = $null + try { + & $paths.RecordingConflictCheck -PackageRoot $repos.PackageRoot -BaseBranch main ` + -AssetsRepositoryPath $repos.AssetsRoot -SkipFetch + } catch { $caught = $_ } + + $caught.Exception.Message | Should Match "does not contain the latest 'main'" + } + + It "requires explicit base selection on a topic branch" { + $repos = New-GuardRepositories (Join-Path $TestDrive "missing-base") + Invoke-TestGit $repos.SourceRoot checkout -b topic | Out-Null + $caught = $null + try { + & $paths.RecordingConflictCheck -PackageRoot $repos.PackageRoot ` + -AssetsRepositoryPath $repos.AssetsRoot -SkipFetch + } catch { $caught = $_ } + + $caught.Exception.Message | Should Match "BaseBranch is required" + } +} \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/CHANGELOG.md b/sdk/ai/azure-ai-projects/CHANGELOG.md index a96f51c3578f..b8a243b78285 100644 --- a/sdk/ai/azure-ai-projects/CHANGELOG.md +++ b/sdk/ai/azure-ai-projects/CHANGELOG.md @@ -1,5 +1,29 @@ # Release History +## 2.10.0 (2026-10-30) + +### Features Added + +* Added optional `VoiceAgentDefinition.soundscape` for built-in background ambience and event cues in telephony calls, with `VoiceAgentSoundscapeConfig`, `VoiceAgentSoundscapeSourceConfig`, `VoiceAgentSoundscapeTrackConfig`, `VoiceAgentSoundscapeWorkingTrackConfig`, and `VoiceAgentSoundscapeSound`. +* Added optional `VoiceAgentInputTranscription.profanity_filter` and `VoiceAgentProfanityFilterMode` for configuring Azure Speech input-transcript filtering before a session starts. +* Added `VoiceAgentInputTranscriptionModel.AZURE_SPEECH_STREAMING` for Azure Speech streaming transcription in cascaded text-model conversations. This model requires a nonempty `VoiceAgentInputTranscription.language` and is not supported with realtime speech-to-speech models. +* Added `VoiceAgentNoiseReductionType.AZURE_DEEP_NOISE_SUPPRESSION_HEADSET` and `VoiceAgentNoiseReductionType.AZURE_PERSONAL_NOISE_SUPPRESSION` for local voice activity detection without changing recognition audio. +* Added `AgentEndpointProtocol.VOICE_CONVERSATION_ENGINE` for hosted text agents used as Voice Agent conversation engines. Hosted agents must declare this protocol with version `1.0.0`; `invocations_ws` does not substitute for it. +* Added optional `HostedAgentDefinition.enable_memory_snapshot` to start hosted-agent sessions from a snapshot of the initialized process instead of starting the process from its image. +* Added image-generation model options `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, with `xhigh` and `max` quality options for these models. +* Added generated GPT Live configuration and event models from OpenAI TypeSpec 1.32, including Decisions, expanded Responses tools, and audio fixtures. +* Added `VoiceAgentLiveSessionResource` and `VoiceAgentLiveDelegationItem` so Live lifecycle and delegation events preserve effective Foundry-managed ownership and resolved agent versions. +* Added persisted Live conversation, item, and audio REST operations under `beta.voice_agents.live_conversations`. + +### Breaking Changes + +* Renamed preview Live transport event models from `LiveTransportAnswered`, `LiveTransportFailed`, and `LiveTransportRinging` to `LiveServerEventLiveTransportAnswered`, `LiveServerEventLiveTransportFailed`, and `LiveServerEventLiveTransportRinging`. Their wire event types are unchanged. +* OpenAI TypeSpec 1.32 generates `Tool`-prefixed names for several existing tool classes. Use `ToolMcpTool` and `ToolCustomToolParam` where a `Tool` subtype is required; `MCPTool` and `CustomToolParam` are now standalone models. + +### Bugs Fixed + +* Fixed tracing to record `temperature=0` and `top_p=0` instead of omitting these valid values. + ## 2.9.0 (2026-10-16) ### Features Added diff --git a/sdk/ai/azure-ai-projects/PostEmitter.ps1 b/sdk/ai/azure-ai-projects/PostEmitter.ps1 index ee2644b22ca3..4aeeae8a3c55 100644 --- a/sdk/ai/azure-ai-projects/PostEmitter.ps1 +++ b/sdk/ai/azure-ai-projects/PostEmitter.ps1 @@ -26,6 +26,39 @@ git restore pyproject.toml # recursive-include samples *.py *.md git restore MANIFEST.in +# The optional OpenAPI-only voice selector cannot use a required TypeSpec discriminator. +# Mirror the emitter's per-member override exceptions without widening the public Literal types. +# Upstream follow-up: report optional-selector handling in http-client-python; remove after regeneration passes unpatched. +$f = 'azure\ai\projects\models\_models.py' +$c = Get-Content $f -Raw +$newline = if ($c.Contains("`r`n")) { "`r`n" } else { "`n" } +$voiceSelectorFixes = @( + @{ + Class = 'VoiceAgentDefinition' + Pattern = '(?m)^( sub_protocol: Optional\[Literal\["realtime"\]\] = rest_field\()([^\r\n]+)\)(\r?)$' + Patched = '(?m)^ sub_protocol: Optional\[Literal\["realtime"\]\] = rest_field\( # pyright: ignore\[reportIncompatibleVariableOverride\]\r?$' + Replacement = '$1 # pyright: ignore[reportIncompatibleVariableOverride]' + $newline + ' $2' + $newline + ' )$3' + }, + @{ + Class = 'VoiceAgentLiveDefinition' + Pattern = '(?m)^( self\.sub_protocol: Literal\["live"\] = "live")(\r?)$' + Patched = '(?m)^ self\.sub_protocol: Literal\["live"\] = "live" # pyright: ignore\[reportIncompatibleVariableOverride\]\r?$' + Replacement = '$1 # pyright: ignore[reportIncompatibleVariableOverride]$2' + } +) +foreach ($fix in $voiceSelectorFixes) { + $classes = [regex]::Matches($c, '(?ms)^class ' + $fix.Class + '\b.*?(?=^class |\z)') + if ($classes.Count -ne 1) { throw "Expected one generated $($fix.Class) class." } + $class = $classes[0] + if ([regex]::IsMatch($class.Value, $fix.Patched)) { continue } + if ([regex]::Matches($class.Value, $fix.Pattern).Count -ne 1) { + throw "Generated $($fix.Class).sub_protocol changed; review the optional-selector typing fix." + } + $updated = [regex]::Replace($class.Value, $fix.Pattern, $fix.Replacement) + $c = $c.Remove($class.Index, $class.Length).Insert($class.Index, $updated) +} +Set-Content $f $c -NoNewline + # Force streaming in get_session_log_stream for both sync and async operations. $files = 'azure\ai\projects\operations\_operations.py', 'azure\ai\projects\aio\operations\_operations.py' foreach ($f in $files) { diff --git a/sdk/ai/azure-ai-projects/api.md b/sdk/ai/azure-ai-projects/api.md index 65eafd3d828d..d66b30081f2a 100644 --- a/sdk/ai/azure-ai-projects/api.md +++ b/sdk/ai/azure-ai-projects/api.md @@ -3516,6 +3516,7 @@ namespace azure.ai.projects.models MCP = "mcp" RESPONSES = "responses" VOICE = "voice" + VOICE_CONVERSATION_ENGINE = "voice_conversation_engine" class azure.ai.projects.models.AgentEvaluatorGenerationJobSource(EvaluatorGenerationJobSource, discriminator='agent'): @@ -4952,6 +4953,101 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.AnswerResource(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AnswerResourceChoice(AnswerResource, discriminator='choice'): + choice: ChoiceValueResource + confidence: float + name: str + probabilities: list[ChoiceProbabilityResource] + type: Literal[AnswerResourceType.CHOICE] + + @overload + def __init__( + self, + *, + choice: ChoiceValueResource, + confidence: float, + name: str, + probabilities: list[ChoiceProbabilityResource] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AnswerResourcePredicate(AnswerResource, discriminator='predicate'): + name: str + probability: float + type: Literal[AnswerResourceType.PREDICATE] + + @overload + def __init__( + self, + *, + name: str, + probability: float + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AnswerResourceRefusal(AnswerResource, discriminator='refusal'): + name: str + type: Literal[AnswerResourceType.REFUSAL] + + @overload + def __init__( + self, + *, + name: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AnswerResourceScore(AnswerResource, discriminator='score'): + confidence: float + name: str + probabilities: list[ScoreProbabilityResource] + score: float + type: Literal[AnswerResourceType.SCORE] + + @overload + def __init__( + self, + *, + confidence: float, + name: str, + probabilities: list[ScoreProbabilityResource], + score: float + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AnswerResourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CHOICE = "choice" + PREDICATE = "predicate" + REFUSAL = "refusal" + SCORE = "score" + + class azure.ai.projects.models.ApiError(_Model): additional_info: Optional[dict[str, Any]] code: str @@ -5005,21 +5101,6 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ApplyPatchToolParam(Tool, discriminator='apply_patch'): - allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] - type: Literal[ToolType.APPLY_PATCH] - - @overload - def __init__( - self, - *, - allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.ai.projects.models.ApproximateLocation(_Model): city: Optional[str] country: Optional[str] @@ -5825,6 +5906,38 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.ChoiceOptionParam(_Model): + description: Optional[str] + value: ChoiceValueParam + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + value: ChoiceValueParam + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ChoiceProbabilityResource(_Model): + probability: float + value: ChoiceValueResource + + @overload + def __init__( + self, + *, + probability: float, + value: ChoiceValueResource + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + class azure.ai.projects.models.ClusterInsightResult(_Model): clusters: list[InsightCluster] coordinates: Optional[dict[str, ChartCoordinate]] @@ -5912,29 +6025,6 @@ namespace azure.ai.projects.models REMOTE_BUILD = "remote_build" - class azure.ai.projects.models.CodeInterpreterTool(Tool, discriminator='code_interpreter'): - allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] - container: Optional[Union[str, AutoCodeInterpreterToolParam]] - description: Optional[str] - name: Optional[str] - tool_configs: Optional[dict[str, ToolConfig]] - type: Literal[ToolType.CODE_INTERPRETER] - - @overload - def __init__( - self, - *, - allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ..., - container: Optional[Union[str, AutoCodeInterpreterToolParam]] = ..., - description: Optional[str] = ..., - name: Optional[str] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.ai.projects.models.CodeInterpreterToolboxTool(ToolboxTool, discriminator='code_interpreter'): allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] container: Optional[Union[str, AutoCodeInterpreterToolParam]] @@ -5977,14 +6067,14 @@ namespace azure.ai.projects.models class azure.ai.projects.models.CompoundFilter(_Model): - filters: list[Union[ComparisonFilter, Any]] + filters: list[Union[ComparisonFilter, CompoundFilter]] type: Literal["and", "or"] @overload def __init__( self, *, - filters: list[Union[ComparisonFilter, Any]], + filters: list[Union[ComparisonFilter, CompoundFilter]], type: Literal["and", "or"] ) -> None: ... @@ -6000,35 +6090,6 @@ namespace azure.ai.projects.models WINDOWS = "windows" - class azure.ai.projects.models.ComputerTool(Tool, discriminator='computer'): - type: Literal[ToolType.COMPUTER] - - @overload - def __init__(self) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.ComputerUsePreviewTool(Tool, discriminator='computer_use_preview'): - display_height: int - display_width: int - environment: Union[str, ComputerEnvironment] - type: Literal[ToolType.COMPUTER_USE_PREVIEW] - - @overload - def __init__( - self, - *, - display_height: int, - display_width: int, - environment: Union[str, ComputerEnvironment] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.ai.projects.models.Connection(_Model): credentials: BaseCredentials id: str @@ -6452,14 +6513,14 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.CustomToolParam(Tool, discriminator='custom'): + class azure.ai.projects.models.CustomToolParam(_Model): allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] async_property: Optional[bool] defer_loading: Optional[bool] description: Optional[str] format: Optional[CustomToolParamFormat] name: str - type: Literal[ToolType.CUSTOM] + type: Literal["custom"] @overload def __init__( @@ -6798,6 +6859,43 @@ namespace azure.ai.projects.models WEDNESDAY = "Wednesday" + class azure.ai.projects.models.DecisionResponse(_Model): + answers: list[AnswerResource] + model: str + usage: ResponseUsageResource + + @overload + def __init__( + self, + *, + answers: list[AnswerResource], + model: str, + usage: ResponseUsageResource + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.Delegation(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.DelegationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CLIENT = "client" + RESPONSES = "responses" + + class azure.ai.projects.models.DeleteAgentResponse(_Model): deleted: bool name: str @@ -7891,33 +7989,6 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.FileSearchTool(Tool, discriminator='file_search'): - description: Optional[str] - filters: Optional[Filters] - max_num_results: Optional[int] - name: Optional[str] - ranking_options: Optional[RankingOptions] - tool_configs: Optional[dict[str, ToolConfig]] - type: Literal[ToolType.FILE_SEARCH] - vector_store_ids: list[str] - - @overload - def __init__( - self, - *, - description: Optional[str] = ..., - filters: Optional[Filters] = ..., - max_num_results: Optional[int] = ..., - name: Optional[str] = ..., - ranking_options: Optional[RankingOptions] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ..., - vector_store_ids: list[str] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.ai.projects.models.FileSearchToolboxTool(ToolboxTool, discriminator='file_search'): description: str filters: Optional[Filters] @@ -8056,29 +8127,6 @@ namespace azure.ai.projects.models class azure.ai.projects.models.FunctionParameters(_Model): - class azure.ai.projects.models.FunctionShellToolParam(Tool, discriminator='shell'): - allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] - description: Optional[str] - environment: Optional[FunctionShellToolParamEnvironment] - name: Optional[str] - tool_configs: Optional[dict[str, ToolConfig]] - type: Literal[ToolType.SHELL] - - @overload - def __init__( - self, - *, - allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ..., - description: Optional[str] = ..., - environment: Optional[FunctionShellToolParamEnvironment] = ..., - name: Optional[str] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.ai.projects.models.FunctionShellToolParamEnvironment(_Model): type: str @@ -8129,16 +8177,16 @@ namespace azure.ai.projects.models LOCAL = "local" - class azure.ai.projects.models.FunctionTool(Tool, discriminator='function'): + class azure.ai.projects.models.FunctionToolParam(_Model): allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] async_property: Optional[bool] defer_loading: Optional[bool] description: Optional[str] name: str output_schema: Optional[dict[str, Any]] - parameters: dict[str, Any] - strict: bool - type: Literal[ToolType.FUNCTION] + parameters: Optional[EmptyModelParam] + strict: Optional[bool] + type: Literal["function"] @overload def __init__( @@ -8150,50 +8198,21 @@ namespace azure.ai.projects.models description: Optional[str] = ..., name: str, output_schema: Optional[dict[str, Any]] = ..., - parameters: dict[str, Any], - strict: bool + parameters: Optional[EmptyModelParam] = ..., + strict: Optional[bool] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.FunctionToolParam(_Model): - allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] - async_property: Optional[bool] - defer_loading: Optional[bool] + class azure.ai.projects.models.GenerateVoiceAgentRequest(_Model): description: Optional[str] - name: str - output_schema: Optional[dict[str, Any]] - parameters: Optional[EmptyModelParam] - strict: Optional[bool] - type: Literal["function"] - - @overload - def __init__( - self, - *, - allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ..., - async_property: Optional[bool] = ..., - defer_loading: Optional[bool] = ..., - description: Optional[str] = ..., - name: str, - output_schema: Optional[dict[str, Any]] = ..., - parameters: Optional[EmptyModelParam] = ..., - strict: Optional[bool] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.GenerateVoiceAgentRequest(_Model): - description: Optional[str] - draft: Optional[bool] - goal: Optional[str] - kind: Literal[AgentKind.VOICE] - model: Optional[str] - model_type: Optional[Union[str, VoiceModelType]] + draft: Optional[bool] + goal: Optional[str] + kind: Literal[AgentKind.VOICE] + model: Optional[str] + model_type: Optional[Union[str, VoiceModelType]] name: str tools: Optional[list[VoiceAgentTool]] use_case: Optional[str] @@ -8340,6 +8359,7 @@ namespace azure.ai.projects.models code_configuration: Optional[CodeConfiguration] container_configuration: Optional[ContainerConfiguration] cpu: str + enable_memory_snapshot: Optional[bool] environment_variables: Optional[dict[str, str]] kind: Literal[AgentKind.HOSTED] memory: str @@ -8355,6 +8375,7 @@ namespace azure.ai.projects.models code_configuration: Optional[CodeConfiguration] = ..., container_configuration: Optional[ContainerConfiguration] = ..., cpu: str, + enable_memory_snapshot: Optional[bool] = ..., environment_variables: Optional[dict[str, str]] = ..., memory: str, protocol_versions: Optional[list[ProtocolVersionRecord]] = ..., @@ -8414,47 +8435,6 @@ namespace azure.ai.projects.models GENERATE = "generate" - class azure.ai.projects.models.ImageGenTool(Tool, discriminator='image_generation'): - action: Optional[Union[str, ImageGenAction]] - background: Optional[Literal["transparent", "opaque", "auto"]] - description: Optional[str] - input_fidelity: Optional[Union[str, InputFidelity]] - input_image_mask: Optional[ImageGenToolInputImageMask] - model: Optional[Union[Literal["gpt-image-1"], Literal["gpt-image-1-mini"], Literal["gpt-image-5"], Literal["gpt-image-2"], Literal["gpt-image-2-2026-04-21"], str]] - moderation: Optional[Literal["auto", "low"]] - name: Optional[str] - output_compression: Optional[int] - output_format: Optional[Literal["png", "webp", "jpeg"]] - partial_images: Optional[int] - quality: Optional[Literal["low", "medium", "high", "auto"]] - size: Optional[Union[Literal["1024x1024"], Literal["1024x1536"], Literal["1536x1024"], Literal["auto"], str]] - tool_configs: Optional[dict[str, ToolConfig]] - type: Literal[ToolType.IMAGE_GENERATION] - - @overload - def __init__( - self, - *, - action: Optional[Union[str, ImageGenAction]] = ..., - background: Optional[Literal[transparent, opaque, auto]] = ..., - description: Optional[str] = ..., - input_fidelity: Optional[Union[str, InputFidelity]] = ..., - input_image_mask: Optional[ImageGenToolInputImageMask] = ..., - model: Optional[Union[Literal[gpt-image-1], Literal[gpt-image-1-mini], Literal[gpt-image-5], Literal[gpt-image-2], Literal[gpt-image-2-2026-04-21], str]] = ..., - moderation: Optional[Literal[auto, low]] = ..., - name: Optional[str] = ..., - output_compression: Optional[int] = ..., - output_format: Optional[Literal[png, webp, jpeg]] = ..., - partial_images: Optional[int] = ..., - quality: Optional[Literal[low, medium, high, auto]] = ..., - size: Optional[Union[Literal[1024x1024], Literal[1024x1536], Literal[1536x1024], Literal[auto], str]] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.ai.projects.models.ImageGenToolInputImageMask(_Model): file_id: Optional[str] image_url: Optional[str] @@ -8538,6 +8518,22 @@ namespace azure.ai.projects.models LOW = "low" + class azure.ai.projects.models.InputTokensDetailsResource(_Model): + cache_write_tokens: int + cached_tokens: int + + @overload + def __init__( + self, + *, + cache_write_tokens: int, + cached_tokens: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + class azure.ai.projects.models.Insight(_Model): display_name: str insight_id: str @@ -8795,3742 +8791,3543 @@ namespace azure.ai.projects.models SUCCEEDED = "succeeded" - class azure.ai.projects.models.LocalShellToolParam(Tool, discriminator='local_shell'): - description: Optional[str] - name: Optional[str] - tool_configs: Optional[dict[str, ToolConfig]] - type: Literal[ToolType.LOCAL_SHELL] + class azure.ai.projects.models.LiveAllowedServerEventParam(_Model): + response_event: Optional[str] + type: str @overload def __init__( self, *, - description: Optional[str] = ..., - name: Optional[str] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ... + response_event: Optional[str] = ..., + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.LocalSkillParam(_Model): - description: str - name: str - path: str + class azure.ai.projects.models.LiveAllowedToolsChoiceParam(_Model): + mode: Optional[Union[str, LiveToolChoiceValueEnum]] + tools: list[Union[LiveFunctionToolChoiceParam, LiveMCPToolChoiceParam, LiveSpecificFileSearchParam, LiveSpecificWebSearchParam, LiveSpecificWebSearchPreviewParam, LiveSpecificImageGenParam, LiveSpecificComputerParam, LiveSpecificCodeInterpreterParam, LiveSpecificProgrammaticToolCallingParam, LiveSpecificFunctionShellParam, LiveSpecificCustomToolParam, LiveSpecificApplyPatchParam]] + type: Literal["allowed_tools"] @overload def __init__( self, *, - description: str, - name: str, - path: str + mode: Optional[Union[str, LiveToolChoiceValueEnum]] = ..., + tools: list[Union[LiveFunctionToolChoiceParam, LiveMCPToolChoiceParam, LiveSpecificFileSearchParam, LiveSpecificWebSearchParam, LiveSpecificWebSearchPreviewParam, LiveSpecificImageGenParam, LiveSpecificComputerParam, LiveSpecificCodeInterpreterParam, LiveSpecificProgrammaticToolCallingParam, LiveSpecificFunctionShellParam, LiveSpecificCustomToolParam, LiveSpecificApplyPatchParam]] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.LogProbProperties(_Model): - bytes: list[int] - logprob: float - token: str + class azure.ai.projects.models.LiveApplyPatchToolInputParam(_Model): + type: Literal["apply_patch"] - @overload def __init__( self, - *, - bytes: list[int], - logprob: float, - token: str + *args: Any, + **kwargs: Any ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.ai.projects.models.LoraConfig(_Model): - alpha: Optional[int] - dropout: Optional[float] - rank: Optional[int] - target_modules: Optional[list[str]] + class azure.ai.projects.models.LiveAudioFormat(_Model): + type: str @overload def __init__( self, *, - alpha: Optional[int] = ..., - dropout: Optional[float] = ..., - rank: Optional[int] = ..., - target_modules: Optional[list[str]] = ... + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MCPListToolsTool(_Model): - annotations: Optional[MCPListToolsToolAnnotations] - description: Optional[str] - input_schema: MCPListToolsToolInputSchema - name: str + class azure.ai.projects.models.LiveAudioFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AUDIO_PCM = "audio/pcm" + AUDIO_PCMA = "audio/pcma" + AUDIO_PCMU = "audio/pcmu" + + + class azure.ai.projects.models.LiveClientConfigParam(_Model): + data_channel: LiveDataChannelConfigParam @overload def __init__( self, *, - annotations: Optional[MCPListToolsToolAnnotations] = ..., - description: Optional[str] = ..., - input_schema: MCPListToolsToolInputSchema, - name: str + data_channel: LiveDataChannelConfigParam ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MCPListToolsToolAnnotations(_Model): + class azure.ai.projects.models.LiveClientDelegationParam(Delegation, discriminator='client'): + type: Literal[DelegationType.CLIENT] + @overload + def __init__(self) -> None: ... - class azure.ai.projects.models.MCPListToolsToolInputSchema(_Model): + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MCPTool(Tool, discriminator='mcp'): - allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] - allowed_tools: Optional[Union[list[str], MCPToolFilter]] - authorization: Optional[str] - connector_id: Optional[Literal["connector_dropbox", "connector_gmail", "connector_googlecalendar", "connector_googledrive", "connector_microsoftteams", "connector_outlookcalendar", "connector_outlookemail", "connector_sharepoint"]] - defer_loading: Optional[bool] - headers: Optional[dict[str, str]] - project_connection_id: Optional[str] - require_approval: Optional[Union[MCPToolRequireApproval, Literal["always"], Literal["never"]]] - server_description: Optional[str] - server_label: str - server_url: Optional[str] - tool_configs: Optional[dict[str, ToolConfig]] - tunnel_id: Optional[str] - type: Literal[ToolType.MCP] + class azure.ai.projects.models.LiveClientEvent(_Model): + type: str @overload def __init__( self, *, - allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ..., - allowed_tools: Optional[Union[list[str], MCPToolFilter]] = ..., - authorization: Optional[str] = ..., - connector_id: Optional[Literal[connector_dropbox, connector_gmail, connector_googlecalendar, connector_googledrive, connector_microsoftteams, connector_outlookcalendar, connector_outlookemail, connector_sharepoint]] = ..., - defer_loading: Optional[bool] = ..., - headers: Optional[dict[str, str]] = ..., - project_connection_id: Optional[str] = ..., - require_approval: Optional[Union[MCPToolRequireApproval, Literal[always], Literal[never]]] = ..., - server_description: Optional[str] = ..., - server_label: str, - server_url: Optional[str] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ..., - tunnel_id: Optional[str] = ... + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MCPToolFilter(_Model): - read_only: Optional[bool] - tool_names: Optional[list[str]] + class azure.ai.projects.models.LiveClientEventLiveCommentaryAppendParam(LiveClientEvent, discriminator='session.commentary.append'): + content: str + delegation_id: str + event_id: Optional[str] + type: Literal[LiveClientEventType.SESSION_COMMENTARY_APPEND] @overload def __init__( self, *, - read_only: Optional[bool] = ..., - tool_names: Optional[list[str]] = ... + content: str, + delegation_id: str, + event_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MCPToolRequireApproval(_Model): - always: Optional[MCPToolFilter] - never: Optional[MCPToolFilter] + class azure.ai.projects.models.LiveClientEventLiveDecisionCreateParam(LiveClientEvent, discriminator='decision.create'): + event_id: str + type: Literal[LiveClientEventType.DECISION_CREATE] @overload def __init__( self, *, - always: Optional[MCPToolFilter] = ..., - never: Optional[MCPToolFilter] = ... + event_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MCPToolboxTool(ToolboxTool, discriminator='mcp'): - allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] - allowed_tools: Optional[Union[list[str], MCPToolFilter]] - authorization: Optional[str] - connector_id: Optional[Literal["connector_dropbox", "connector_gmail", "connector_googlecalendar", "connector_googledrive", "connector_microsoftteams", "connector_outlookcalendar", "connector_outlookemail", "connector_sharepoint"]] - defer_loading: Optional[bool] - description: str - headers: Optional[dict[str, str]] - name: str - project_connection_id: Optional[str] - require_approval: Optional[Union[MCPToolRequireApproval, Literal["always"], Literal["never"]]] - server_description: Optional[str] - server_label: str - server_url: Optional[str] - tool_configs: dict[str, ToolConfig] - tunnel_id: Optional[str] - type: Literal[ToolboxToolType.MCP] + class azure.ai.projects.models.LiveClientEventLiveDecisionItemCreateParam(LiveClientEvent, discriminator='decision.item.create'): + event_id: Optional[str] + item: LiveDecisionInputItemParam + type: Literal[LiveClientEventType.DECISION_ITEM_CREATE] @overload def __init__( self, *, - allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ..., - allowed_tools: Optional[Union[list[str], MCPToolFilter]] = ..., - authorization: Optional[str] = ..., - connector_id: Optional[Literal[connector_dropbox, connector_gmail, connector_googlecalendar, connector_googledrive, connector_microsoftteams, connector_outlookcalendar, connector_outlookemail, connector_sharepoint]] = ..., - defer_loading: Optional[bool] = ..., - description: Optional[str] = ..., - headers: Optional[dict[str, str]] = ..., - name: Optional[str] = ..., - project_connection_id: Optional[str] = ..., - require_approval: Optional[Union[MCPToolRequireApproval, Literal[always], Literal[never]]] = ..., - server_description: Optional[str] = ..., - server_label: str, - server_url: Optional[str] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ..., - tunnel_id: Optional[str] = ... + event_id: Optional[str] = ..., + item: LiveDecisionInputItemParam ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ManagedAgentIdentityBlueprintReference(AgentBlueprintReference, discriminator='ManagedAgentIdentityBlueprint'): - blueprint_id: str - type: Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT] + class azure.ai.projects.models.LiveClientEventLiveDecisionItemDeleteParam(LiveClientEvent, discriminator='decision.item.delete'): + event_id: Optional[str] + item_id: str + type: Literal[LiveClientEventType.DECISION_ITEM_DELETE] @overload def __init__( self, *, - blueprint_id: str + event_id: Optional[str] = ..., + item_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ManagedAzureAISearchIndex(Index, discriminator='ManagedAzureSearch'): - description: str - id: str - name: str - tags: dict[str, str] - type: Literal[IndexType.MANAGED_AZURE_SEARCH] - vector_store_id: str - version: str + class azure.ai.projects.models.LiveClientEventLiveInputAudioAppendEvent(LiveClientEvent, discriminator='session.input_audio.append'): + audio: str + event_id: Optional[str] + type: Literal[LiveClientEventType.SESSION_INPUT_AUDIO_APPEND] @overload def __init__( self, *, - description: Optional[str] = ..., - tags: Optional[dict[str, str]] = ..., - vector_store_id: str + audio: str, + event_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.McpProtocolConfiguration(_Model): - - - class azure.ai.projects.models.MemoryItem(_Model): - content: str - kind: str - memory_id: str - scope: str - updated_at: datetime + class azure.ai.projects.models.LiveClientEventLiveInputAudioMuteParam(LiveClientEvent, discriminator='session.input_audio.mute'): + event_id: Optional[str] + type: Literal[LiveClientEventType.SESSION_INPUT_AUDIO_MUTE] @overload def __init__( self, *, - content: str, - kind: str, - memory_id: str, - scope: str, - updated_at: datetime + event_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MemoryItemKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CHAT_SUMMARY = "chat_summary" - PROCEDURAL = "procedural" - USER_PROFILE = "user_profile" - - - class azure.ai.projects.models.MemoryOperation(_Model): - kind: Union[str, MemoryOperationKind] - memory_item: MemoryItem + class azure.ai.projects.models.LiveClientEventLiveInputAudioUnmuteParam(LiveClientEvent, discriminator='session.input_audio.unmute'): + event_id: Optional[str] + type: Literal[LiveClientEventType.SESSION_INPUT_AUDIO_UNMUTE] @overload def __init__( self, *, - kind: Union[str, MemoryOperationKind], - memory_item: MemoryItem + event_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MemoryOperationKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CREATE = "create" - DELETE = "delete" - UPDATE = "update" - - - class azure.ai.projects.models.MemorySearchItem(_Model): - memory_item: MemoryItem + class azure.ai.projects.models.LiveClientEventLiveInstructionsAppendParam(LiveClientEvent, discriminator='session.instructions.append'): + content: str + delegation_id: str + event_id: Optional[str] + type: Literal[LiveClientEventType.SESSION_INSTRUCTIONS_APPEND] @overload def __init__( self, *, - memory_item: MemoryItem + content: str, + delegation_id: str, + event_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MemorySearchOptions(_Model): - max_memories: Optional[int] + class azure.ai.projects.models.LiveClientEventLiveOutputAudioFixturePlayParam(LiveClientEvent, discriminator='session.output_audio.fixture.play'): + audio: str + event_id: Optional[str] + type: Literal[LiveClientEventType.SESSION_OUTPUT_AUDIO_FIXTURE_PLAY] @overload def __init__( self, *, - max_memories: Optional[int] = ... + audio: str, + event_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MemorySearchPreviewTool(Tool, discriminator='memory_search_preview'): - memory_store_name: str - scope: str - search_options: Optional[MemorySearchOptions] - type: Literal[ToolType.MEMORY_SEARCH_PREVIEW] - update_delay: Optional[int] + class azure.ai.projects.models.LiveClientEventLiveResponseCreateParam(LiveClientEvent, discriminator='response.create'): + event_id: Optional[str] + type: Literal[LiveClientEventType.RESPONSE_CREATE] @overload def __init__( self, *, - memory_store_name: str, - scope: str, - search_options: Optional[MemorySearchOptions] = ..., - update_delay: Optional[int] = ... + event_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MemoryStoreDefaultDefinition(MemoryStoreDefinition, discriminator='default'): - chat_model: str - embedding_model: str - kind: Literal[MemoryStoreKind.DEFAULT] - options: Optional[MemoryStoreDefaultOptions] + class azure.ai.projects.models.LiveClientEventLiveResponseItemCreateParam(LiveClientEvent, discriminator='response.item.create'): + event_id: Optional[str] + item: dict[str, Any] + type: Literal[LiveClientEventType.RESPONSE_ITEM_CREATE] @overload def __init__( self, *, - chat_model: str, - embedding_model: str, - options: Optional[MemoryStoreDefaultOptions] = ... + event_id: Optional[str] = ..., + item: dict[str, Any] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MemoryStoreDefaultOptions(_Model): - chat_summary_enabled: bool - default_ttl_seconds: Optional[timedelta] - procedural_memory_enabled: Optional[bool] - user_profile_details: Optional[str] - user_profile_enabled: bool + class azure.ai.projects.models.LiveClientEventLiveSessionCloseParam(LiveClientEvent, discriminator='session.close'): + event_id: Optional[str] + type: Literal[LiveClientEventType.SESSION_CLOSE] @overload def __init__( self, *, - chat_summary_enabled: bool, - default_ttl_seconds: Optional[timedelta] = ..., - procedural_memory_enabled: Optional[bool] = ..., - user_profile_details: Optional[str] = ..., - user_profile_enabled: bool + event_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MemoryStoreDefinition(_Model): - kind: str + class azure.ai.projects.models.LiveClientEventLiveSessionUpdateParam(LiveClientEvent, discriminator='session.update'): + event_id: Optional[str] + session: LiveSessionUpdateParams + type: Literal[LiveClientEventType.SESSION_UPDATE] @overload def __init__( self, *, - kind: str + event_id: Optional[str] = ..., + session: LiveSessionUpdateParams ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MemoryStoreDeleteScopeResult(_Model): - deleted: bool - name: str - object: Literal[MemoryStoreObjectType.MEMORY_STORE_SCOPE_DELETED] - scope: str + class azure.ai.projects.models.LiveClientEventLiveThinkingAppendParam(LiveClientEvent, discriminator='session.thinking.append'): + content: str + delegation_id: str + event_id: Optional[str] + type: Literal[LiveClientEventType.SESSION_THINKING_APPEND] @overload def __init__( self, *, - deleted: bool, - name: str, - object: Literal[MemoryStoreObjectType.MEMORY_STORE_SCOPE_DELETED], - scope: str + content: str, + delegation_id: str, + event_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MemoryStoreDetails(_Model): - created_at: datetime - definition: MemoryStoreDefinition - description: Optional[str] - id: str - metadata: Optional[dict[str, str]] - name: str - object: Literal[MemoryStoreObjectType.MEMORY_STORE] - updated_at: datetime + class azure.ai.projects.models.LiveClientEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DECISION_CREATE = "decision.create" + DECISION_ITEM_CREATE = "decision.item.create" + DECISION_ITEM_DELETE = "decision.item.delete" + RESPONSE_CREATE = "response.create" + RESPONSE_ITEM_CREATE = "response.item.create" + SESSION_CLOSE = "session.close" + SESSION_COMMENTARY_APPEND = "session.commentary.append" + SESSION_INPUT_AUDIO_APPEND = "session.input_audio.append" + SESSION_INPUT_AUDIO_MUTE = "session.input_audio.mute" + SESSION_INPUT_AUDIO_UNMUTE = "session.input_audio.unmute" + SESSION_INSTRUCTIONS_APPEND = "session.instructions.append" + SESSION_OUTPUT_AUDIO_FIXTURE_PLAY = "session.output_audio.fixture.play" + SESSION_START = "session.start" + SESSION_THINKING_APPEND = "session.thinking.append" + SESSION_UPDATE = "session.update" + + + class azure.ai.projects.models.LiveCodeInterpreterToolInputParam(_Model): + type: Literal["code_interpreter"] - @overload def __init__( self, - *, - created_at: datetime, - definition: MemoryStoreDefinition, - description: Optional[str] = ..., - id: str, - metadata: Optional[dict[str, str]] = ..., - name: str, - object: Literal[MemoryStoreObjectType.MEMORY_STORE], - updated_at: datetime + *args: Any, + **kwargs: Any ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.LiveComputerToolInputParam(_Model): + type: Literal["computer"] - class azure.ai.projects.models.MemoryStoreKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DEFAULT = "default" + def __init__( + self, + *args: Any, + **kwargs: Any + ) -> None: ... - class azure.ai.projects.models.MemoryStoreObjectType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - MEMORY_DELETED = "memory_store.item.deleted" - MEMORY_STORE = "memory_store" - MEMORY_STORE_DELETED = "memory_store.deleted" - MEMORY_STORE_SCOPE_DELETED = "memory_store.scope.deleted" + class azure.ai.projects.models.LiveContainerMemoryLimit(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ENUM_16_G = "16g" + ENUM_1_G = "1g" + ENUM_4_G = "4g" + ENUM_64_G = "64g" - class azure.ai.projects.models.MemoryStoreOperationUsage(_Model): - embedding_tokens: int - input_tokens: int - input_tokens_details: ResponseUsageInputTokensDetails - output_tokens: int - output_tokens_details: ResponseUsageOutputTokensDetails - total_tokens: int + class azure.ai.projects.models.LiveContainerNetworkPolicyDisabledParam(_Model): + type: Literal["disabled"] + + def __init__( + self, + *args: Any, + **kwargs: Any + ) -> None: ... + + + class azure.ai.projects.models.LiveContainerReferenceParam(_Model): + container_id: str + type: Literal["container_reference"] @overload def __init__( self, *, - embedding_tokens: int, - input_tokens: int, - input_tokens_details: ResponseUsageInputTokensDetails, - output_tokens: int, - output_tokens_details: ResponseUsageOutputTokensDetails, - total_tokens: int + container_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MemoryStoreSearchResult(_Model): - memories: list[MemorySearchItem] - search_id: str - usage: MemoryStoreOperationUsage + class azure.ai.projects.models.LiveContextWindowUsage(_Model): + usage_ratio: float @overload def __init__( self, *, - memories: list[MemorySearchItem], - search_id: str, - usage: MemoryStoreOperationUsage + usage_ratio: float ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MemoryStoreUpdateCompletedResult(_Model): - memory_operations: list[MemoryOperation] - usage: MemoryStoreOperationUsage + class azure.ai.projects.models.LiveCustomToolInputParam(_Model): + type: Literal["custom"] + + def __init__( + self, + *args: Any, + **kwargs: Any + ) -> None: ... + + + class azure.ai.projects.models.LiveCustomVoiceParam(_Model): + id: str @overload def __init__( self, *, - memory_operations: list[MemoryOperation], - usage: MemoryStoreOperationUsage + id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MemoryStoreUpdateResult(_Model): - error: Optional[ApiError] - result: Optional[MemoryStoreUpdateCompletedResult] - status: Union[str, MemoryStoreUpdateStatus] - superseded_by: Optional[str] - update_id: str + class azure.ai.projects.models.LiveDataChannelConfigParam(_Model): + allowed_client_events: Optional[Union[Literal["all"], list[str]]] + allowed_server_events: Optional[Union[Literal["all"], list[LiveAllowedServerEventParam]]] @overload def __init__( self, *, - error: Optional[ApiError] = ..., - result: Optional[MemoryStoreUpdateCompletedResult] = ..., - status: Union[str, MemoryStoreUpdateStatus], - superseded_by: Optional[str] = ..., - update_id: str + allowed_client_events: Optional[Union[Literal[all], list[str]]] = ..., + allowed_server_events: Optional[Union[Literal[all], list[LiveAllowedServerEventParam]]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MemoryStoreUpdateStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - COMPLETED = "completed" - FAILED = "failed" - IN_PROGRESS = "in_progress" - QUEUED = "queued" - SUPERSEDED = "superseded" + class azure.ai.projects.models.LiveDecisionCompleted(_Model): + decision: DecisionResponse + type: Literal["completed"] + @overload + def __init__( + self, + *, + decision: DecisionResponse + ) -> None: ... - class azure.ai.projects.models.Metadata(_Model): + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.Microsoft365PermissionScopes(_Model): - resource_app_id: str - scopes: list[str] + class azure.ai.projects.models.LiveDecisionInputImageParam(_Model): + detail: Optional[Union[str, LiveDetailEnum]] + image_url: str + type: Literal["input_image"] @overload def __init__( self, *, - resource_app_id: str, - scopes: list[str] + detail: Optional[Union[str, LiveDetailEnum]] = ..., + image_url: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.Microsoft365PublishDefaults(_Model): - agent_display_name: Optional[str] - agent_name: Optional[str] - app_publish_scope: Optional[Union[str, Microsoft365PublishScope]] - app_registration_client_id: Optional[str] - app_version: Optional[str] - bot_service_arm_id: Optional[str] - developer_name: Optional[str] - developer_website_url: Optional[str] - full_description: Optional[str] - privacy_url: Optional[str] - recommended_next_app_version: Optional[str] - short_description: Optional[str] - teams_app_id: Optional[str] - terms_of_use_url: Optional[str] - title_id: Optional[str] + class azure.ai.projects.models.LiveDecisionInputItemParam(_Model): + content: Union[str, list[Union[LiveDecisionInputTextParam, LiveDecisionInputImageParam]]] + id: Optional[str] + role: Literal["user"] + type: Optional[Literal["message"]] @overload def __init__( self, *, - agent_display_name: Optional[str] = ..., - agent_name: Optional[str] = ..., - app_publish_scope: Optional[Union[str, Microsoft365PublishScope]] = ..., - app_registration_client_id: Optional[str] = ..., - app_version: Optional[str] = ..., - bot_service_arm_id: Optional[str] = ..., - developer_name: Optional[str] = ..., - developer_website_url: Optional[str] = ..., - full_description: Optional[str] = ..., - privacy_url: Optional[str] = ..., - recommended_next_app_version: Optional[str] = ..., - short_description: Optional[str] = ..., - teams_app_id: Optional[str] = ..., - terms_of_use_url: Optional[str] = ..., - title_id: Optional[str] = ... + content: Union[str, list[Union[LiveDecisionInputTextParam, LiveDecisionInputImageParam]]], + id: Optional[str] = ..., + type: Optional[Literal[message]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.Microsoft365PublishResult(_Model): - teams_app_id: Optional[str] - title_id: Optional[str] + class azure.ai.projects.models.LiveDecisionInputTextParam(_Model): + text: str + type: Literal["input_text"] @overload def __init__( self, *, - teams_app_id: Optional[str] = ..., - title_id: Optional[str] = ... + text: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.Microsoft365PublishScope(str, Enum, metaclass=CaseInsensitiveEnumMeta): - PERSONAL = "Personal" - SHARED = "Shared" - TENANT = "Tenant" + class azure.ai.projects.models.LiveDecisionQuestionsInputParam_2(_Model): + questions: list[QuestionParam] + @overload + def __init__( + self, + *, + questions: list[QuestionParam] + ) -> None: ... - class azure.ai.projects.models.MicrosoftCopilotBuiltInTool(str, Enum, metaclass=CaseInsensitiveEnumMeta): - FILESYSTEM_READ = "filesystem_read" - FILESYSTEM_WRITE = "filesystem_write" - SHELL = "shell" - SUBAGENTS = "subagents" - WEB = "web" + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MicrosoftCopilotHarness(AgentHarness, discriminator='microsoft_copilot_preview'): - type: Literal["microsoft_copilot_preview"] + class azure.ai.projects.models.LiveDecisionStoredInputItemParam(_Model): + content: Union[str, list[Union[LiveDecisionInputTextParam, LiveDecisionInputImageParam]]] + id: str + role: Literal["user"] + type: Optional[Literal["message"]] @overload - def __init__(self) -> None: ... + def __init__( + self, + *, + content: Union[str, list[Union[LiveDecisionInputTextParam, LiveDecisionInputImageParam]]], + id: str, + type: Optional[Literal[message]] = ... + ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MicrosoftCopilotToolsetConfig(_Model): - enabled: Optional[bool] - name: Union[str, MicrosoftCopilotBuiltInTool] + class azure.ai.projects.models.LiveDecisionTriggerInputParam_2(_Model): + decisions: LiveDecisionQuestionsInputParam_2 + event_type: Literal["delta", "delta"] + type: Literal["decisions"] @overload def __init__( self, *, - enabled: Optional[bool] = ..., - name: Union[str, MicrosoftCopilotBuiltInTool] + decisions: LiveDecisionQuestionsInputParam_2, + event_type: Literal["delta", "delta"] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MicrosoftCopilotToolsetDefaultConfig(_Model): - enabled: Optional[bool] + class azure.ai.projects.models.LiveDecisionsDelegationParam_2(_Model): + decisions: LiveDecisionsSettingsInputParam_2 + type: Literal["decisions"] @overload def __init__( self, *, - enabled: Optional[bool] = ... + decisions: LiveDecisionsSettingsInputParam_2 ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MicrosoftCopilotToolsetPreview(Tool, discriminator='microsoft_copilot_toolset_preview'): - configs: Optional[list[MicrosoftCopilotToolsetConfig]] - default_config: Optional[MicrosoftCopilotToolsetDefaultConfig] - type: Literal[ToolType.MICROSOFT_COPILOT_TOOLSET_PREVIEW] + class azure.ai.projects.models.LiveDecisionsDelegationUpdateParam(_Model): + decisions: Optional[LiveDecisionsSettingsUpdateParam] + type: Literal["decisions"] @overload def __init__( self, *, - configs: Optional[list[MicrosoftCopilotToolsetConfig]] = ..., - default_config: Optional[MicrosoftCopilotToolsetDefaultConfig] = ... + decisions: Optional[LiveDecisionsSettingsUpdateParam] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MicrosoftFabricPreviewTool(Tool, discriminator='fabric_dataagent_preview'): - fabric_dataagent_preview: FabricDataAgentToolParameters - type: Literal[ToolType.FABRIC_DATAAGENT_PREVIEW] + class azure.ai.projects.models.LiveDecisionsSettingsInputParam_2(_Model): + model: str + questions: list[QuestionParam] @overload def __init__( self, *, - fabric_dataagent_preview: FabricDataAgentToolParameters + model: str, + questions: list[QuestionParam] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MisalignmentErrorDetailsResource(_Model): - detailed_explanation: Optional[str] - error_type: Optional[Union[str, MisalignmentErrorType]] - steer: Optional[MisalignmentSteer] + class azure.ai.projects.models.LiveDecisionsSettingsUpdateParam(_Model): + model: Optional[str] + questions: Optional[list[QuestionParam]] @overload def __init__( self, *, - detailed_explanation: Optional[str] = ..., - error_type: Optional[Union[str, MisalignmentErrorType]] = ..., - steer: Optional[MisalignmentSteer] = ... + model: Optional[str] = ..., + questions: Optional[list[QuestionParam]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MisalignmentErrorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - OTHER = "other" - POTENTIALLY_UNINTENDED_DATA_ACCESS = "potentially_unintended_data_access" - POTENTIALLY_UNINTENDED_DATA_TRANSFER = "potentially_unintended_data_transfer" - POTENTIALLY_UNINTENDED_DESTRUCTIVE_ACTIVITY = "potentially_unintended_destructive_activity" - - - class azure.ai.projects.models.MisalignmentSteer(_Model): - message: str + class azure.ai.projects.models.LiveDelegationReasoningInputParam(_Model): + effort: Optional[Union[str, LiveReasoningEffort]] + summary: Optional[Union[str, LiveReasoningSummary]] @overload def __init__( self, *, - message: str + effort: Optional[Union[str, LiveReasoningEffort]] = ..., + summary: Optional[Union[str, LiveReasoningSummary]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ModelCredentialRequest(_Model): - blob_uri: str + class azure.ai.projects.models.LiveDelegationTextInputParam(_Model): + verbosity: Optional[Union[str, LiveTextVerbosity]] @overload def __init__( self, *, - blob_uri: str + verbosity: Optional[Union[str, LiveTextVerbosity]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ModelDeployment(Deployment, discriminator='ModelDeployment'): - capabilities: dict[str, str] - connection_name: Optional[str] - model_name: str - model_publisher: str - model_version: str - name: str - sku: ModelDeploymentSku - type: Literal[DeploymentType.MODEL_DEPLOYMENT] + class azure.ai.projects.models.LiveDetailEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AUTO = "auto" + HIGH = "high" + LOW = "low" + ORIGINAL = "original" - @overload - def __init__(self) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.LiveFileSearchToolInputParam(_Model): + type: Literal["file_search"] + def __init__( + self, + *args: Any, + **kwargs: Any + ) -> None: ... - class azure.ai.projects.models.ModelDeploymentSku(_Model): - capacity: int - family: str + + class azure.ai.projects.models.LiveFunctionToolChoiceParam(_Model): name: str - size: str - tier: str + type: Literal["function"] @overload def __init__( self, *, - capacity: int, - family: str, - name: str, - size: str, - tier: str + name: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ModelPendingUploadRequest(_Model): - connection_name: Optional[str] - pending_upload_id: Optional[str] - pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE] + class azure.ai.projects.models.LiveFunctionToolInputParam(_Model): + description: Optional[str] + name: str + parameters: Optional[dict[str, Any]] + strict: Optional[bool] + type: Literal["function"] @overload def __init__( self, *, - connection_name: Optional[str] = ..., - pending_upload_id: Optional[str] = ..., - pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE] + description: Optional[str] = ..., + name: str, + parameters: Optional[dict[str, Any]] = ..., + strict: Optional[bool] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ModelPendingUploadResponse(_Model): - blob_reference: BlobReference - pending_upload_id: str - pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE] - version: Optional[str] + class azure.ai.projects.models.LiveHostedShellContainerAutoParam(_Model): + file_ids: Optional[list[str]] + memory_limit: Optional[Union[str, LiveContainerMemoryLimit]] + network_policy: Optional[Union[LiveContainerNetworkPolicyDisabledParam, LiveHostedShellNetworkPolicyAllowlistParam]] + skills: Optional[list[Union[LiveSkillReferenceParam, LiveInlineSkillParam]]] + type: Literal["container_auto"] @overload def __init__( self, *, - blob_reference: BlobReference, - pending_upload_id: str, - pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE], - version: Optional[str] = ... + file_ids: Optional[list[str]] = ..., + memory_limit: Optional[Union[str, LiveContainerMemoryLimit]] = ..., + network_policy: Optional[Union[LiveContainerNetworkPolicyDisabledParam, LiveHostedShellNetworkPolicyAllowlistParam]] = ..., + skills: Optional[list[Union[LiveSkillReferenceParam, LiveInlineSkillParam]]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ModelSamplingConfigParam(TypedDict, total=False): - key "max_completion_tokens": int - key "seed": int - key "temperature": float - key "top_p": float - - - class azure.ai.projects.models.ModelSamplingParams(_Model): - max_completion_tokens: Optional[int] - seed: Optional[int] - temperature: Optional[float] - top_p: Optional[float] + class azure.ai.projects.models.LiveHostedShellNetworkPolicyAllowlistParam(_Model): + allowed_domains: list[str] + type: Literal["allowlist"] @overload def __init__( self, *, - max_completion_tokens: Optional[int] = ..., - seed: Optional[int] = ..., - temperature: Optional[float] = ..., - top_p: Optional[float] = ... + allowed_domains: list[str] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ModelSourceData(_Model): - job_id: Optional[str] - source_type: Optional[Union[str, FoundryModelSourceType]] + class azure.ai.projects.models.LiveHostedShellToolInputParam(_Model): + environment: Optional[Union[LiveHostedShellContainerAutoParam, LiveContainerReferenceParam, LiveLocalEnvironmentParam]] + type: Literal["shell"] @overload def __init__( self, *, - job_id: Optional[str] = ..., - source_type: Optional[Union[str, FoundryModelSourceType]] = ... + environment: Optional[Union[LiveHostedShellContainerAutoParam, LiveContainerReferenceParam, LiveLocalEnvironmentParam]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ModelVersion(_Model): - artifact_profile: Optional[ArtifactProfile] - base_model: Optional[str] - blob_uri: str - description: Optional[str] - id: Optional[str] - lora_config: Optional[LoraConfig] - name: str - source: Optional[ModelSourceData] - tags: Optional[dict[str, str]] - version: str - warnings: Optional[list[FoundryModelWarning]] - weight_type: Optional[Union[str, FoundryModelWeightType]] + class azure.ai.projects.models.LiveImageGenerationToolInputParam(_Model): + type: Literal["image_generation"] - @overload def __init__( self, - *, - base_model: Optional[str] = ..., - blob_uri: str, - description: Optional[str] = ..., - lora_config: Optional[LoraConfig] = ..., - source: Optional[ModelSourceData] = ..., - tags: Optional[dict[str, str]] = ..., - weight_type: Optional[Union[str, FoundryModelWeightType]] = ... + *args: Any, + **kwargs: Any ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.ai.projects.models.MonthlyRecurrenceSchedule(RecurrenceSchedule, discriminator='Monthly'): - days_of_month: list[int] - type: Literal[RecurrenceType.MONTHLY] + class azure.ai.projects.models.LiveInitialAssistantMessageItemParam(LiveInitialItem, discriminator='assistant'): + content: list[Union[LiveInitialTextContentPartParam, LiveInitialOutputTextContentPartParam]] + id: Optional[str] + role: Literal[LiveInitialItemType.ASSISTANT] + status: Optional[Union[str, LiveInitialMessageStatus]] + type: Optional[Literal["message"]] @overload def __init__( self, *, - days_of_month: list[int] + content: list[Union[LiveInitialTextContentPartParam, LiveInitialOutputTextContentPartParam]], + id: Optional[str] = ..., + status: Optional[Union[str, LiveInitialMessageStatus]] = ..., + type: Optional[Literal[message]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.NamespaceToolParam(Tool, discriminator='namespace'): - description: str - name: str - tools: list[Union[FunctionToolParam, CustomToolParam]] - type: Literal[ToolType.NAMESPACE] + class azure.ai.projects.models.LiveInitialDeveloperMessageItemParam(LiveInitialItem, discriminator='developer'): + content: list[LiveInitialInputTextContentPartParam] + id: Optional[str] + role: Literal[LiveInitialItemType.DEVELOPER] + status: Optional[Union[str, LiveInitialMessageStatus]] + type: Optional[Literal["message"]] @overload def __init__( self, *, - description: str, - name: str, - tools: list[Union[FunctionToolParam, CustomToolParam]] + content: list[LiveInitialInputTextContentPartParam], + id: Optional[str] = ..., + status: Optional[Union[str, LiveInitialMessageStatus]] = ..., + type: Optional[Literal[message]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.NoAuthenticationCredentials(BaseCredentials, discriminator='None'): - type: Literal[CredentialType.NONE] + class azure.ai.projects.models.LiveInitialInputTextContentPartParam(_Model): + text: str + type: Optional[Literal["input_text"]] @overload - def __init__(self) -> None: ... + def __init__( + self, + *, + text: str, + type: Optional[Literal[input_text]] = ... + ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.OneTimeTrigger(Trigger, discriminator='OneTime'): - time_zone: Optional[str] - trigger_at: datetime - type: Literal[TriggerType.ONE_TIME] + class azure.ai.projects.models.LiveInitialItem(_Model): + role: str @overload def __init__( self, *, - time_zone: Optional[str] = ..., - trigger_at: datetime + role: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.OpenApiAnonymousAuthDetails(OpenApiAuthDetails, discriminator='anonymous'): - type: Literal[OpenApiAuthType.ANONYMOUS] + class azure.ai.projects.models.LiveInitialItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ASSISTANT = "assistant" + DEVELOPER = "developer" + USER = "user" - @overload - def __init__(self) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.LiveInitialMessageStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + COMPLETED = "completed" + INCOMPLETE = "incomplete" - class azure.ai.projects.models.OpenApiAuthDetails(_Model): - type: str + class azure.ai.projects.models.LiveInitialOutputTextContentPartParam(_Model): + text: str + type: Literal["output_text"] @overload def __init__( self, *, - type: str + text: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.OpenApiAuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ANONYMOUS = "anonymous" - MANAGED_IDENTITY = "managed_identity" - PROJECT_CONNECTION = "project_connection" - - - class azure.ai.projects.models.OpenApiFunctionDefinition(_Model): - auth: OpenApiAuthDetails - default_params: Optional[list[str]] - description: Optional[str] - functions: Optional[list[OpenApiFunctionDefinitionFunction]] - name: str - spec: dict[str, Any] + class azure.ai.projects.models.LiveInitialSessionAudioOutputParam(_Model): + voice: Optional[Union[str, Literal["alloy"], Literal["ash"], Literal["ballad"], Literal["beacon"], Literal["bossa"], Literal["brise"], Literal["cedar"], Literal["cinder"], Literal["coral"], Literal["delta"], Literal["echo"], Literal["flitz"], Literal["gleam"], Literal["harema"], Literal["juni"], Literal["marin"], Literal["meridian"], Literal["nira"], Literal["noeul"], Literal["nuri"], Literal["quartz"], Literal["ripple"], Literal["sage"], Literal["shida"], Literal["shimmer"], Literal["sillage"], Literal["stone"], Literal["tempo"], Literal["verse"], Literal["vesper"], Literal["willow"], LiveCustomVoiceParam]] @overload def __init__( self, *, - auth: OpenApiAuthDetails, - default_params: Optional[list[str]] = ..., - description: Optional[str] = ..., - name: str, - spec: dict[str, Any] + voice: Optional[Union[str, Literal[alloy], Literal[ash], Literal[ballad], Literal[beacon], Literal[bossa], Literal[brise], Literal[cedar], Literal[cinder], Literal[coral], Literal[delta], Literal[echo], Literal[flitz], Literal[gleam], Literal[harema], Literal[juni], Literal[marin], Literal[meridian], Literal[nira], Literal[noeul], Literal[nuri], Literal[quartz], Literal[ripple], Literal[sage], Literal[shida], Literal[shimmer], Literal[sillage], Literal[stone], Literal[tempo], Literal[verse], Literal[vesper], Literal[willow], LiveCustomVoiceParam]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.OpenApiFunctionDefinitionFunction(_Model): - description: Optional[str] - name: str - parameters: dict[str, Any] + class azure.ai.projects.models.LiveInitialSessionAudioParam(_Model): + format: Optional[LiveAudioFormat] + output: Optional[LiveInitialSessionAudioOutputParam] @overload def __init__( self, *, - description: Optional[str] = ..., - name: str, - parameters: dict[str, Any] + format: Optional[LiveAudioFormat] = ..., + output: Optional[LiveInitialSessionAudioOutputParam] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.OpenApiManagedAuthDetails(OpenApiAuthDetails, discriminator='managed_identity'): - security_scheme: OpenApiManagedSecurityScheme - type: Literal[OpenApiAuthType.MANAGED_IDENTITY] + class azure.ai.projects.models.LiveInitialTextContentPartParam(_Model): + text: str + type: Optional[Literal["text"]] @overload def __init__( self, *, - security_scheme: OpenApiManagedSecurityScheme + text: str, + type: Optional[Literal[text]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.OpenApiManagedSecurityScheme(_Model): - audience: str + class azure.ai.projects.models.LiveInitialUserMessageItemParam(LiveInitialItem, discriminator='user'): + content: list[LiveInitialInputTextContentPartParam] + id: Optional[str] + role: Literal[LiveInitialItemType.USER] + status: Optional[Union[str, LiveInitialMessageStatus]] + type: Optional[Literal["message"]] @overload def __init__( self, *, - audience: str + content: list[LiveInitialInputTextContentPartParam], + id: Optional[str] = ..., + status: Optional[Union[str, LiveInitialMessageStatus]] = ..., + type: Optional[Literal[message]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.OpenApiProjectConnectionAuthDetails(OpenApiAuthDetails, discriminator='project_connection'): - security_scheme: OpenApiProjectConnectionSecurityScheme - type: Literal[OpenApiAuthType.PROJECT_CONNECTION] - + class azure.ai.projects.models.LiveInlineSkillParam(_Model): + description: str + name: str + source: LiveInlineSkillSourceParam + type: Literal["inline"] + @overload def __init__( self, *, - security_scheme: OpenApiProjectConnectionSecurityScheme + description: str, + name: str, + source: LiveInlineSkillSourceParam ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.OpenApiProjectConnectionSecurityScheme(_Model): - project_connection_id: str + class azure.ai.projects.models.LiveInlineSkillSourceParam(_Model): + data: str + media_type: Literal["application/zip"] + type: Literal["base64"] @overload def __init__( self, *, - project_connection_id: str + data: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.OpenApiTool(Tool, discriminator='openapi'): - openapi: OpenApiFunctionDefinition - tool_configs: Optional[dict[str, ToolConfig]] - type: Literal[ToolType.OPENAPI] + class azure.ai.projects.models.LiveInputAudioAppend(LiveServerEvent, discriminator='session.input_audio.append'): + audio: str + type: Literal[LiveServerEventType.SESSION_INPUT_AUDIO_APPEND] @overload def __init__( self, *, - openapi: OpenApiFunctionDefinition, - tool_configs: Optional[dict[str, ToolConfig]] = ... + audio: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.OpenApiToolboxTool(ToolboxTool, discriminator='openapi'): - description: str - name: str - openapi: OpenApiFunctionDefinition - tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.OPENAPI] + class azure.ai.projects.models.LiveLiveError(_Model): + client_event_id: Optional[str] + code: str + message: str + param: Optional[str] + type: str @overload def __init__( self, *, - description: Optional[str] = ..., - name: Optional[str] = ..., - openapi: OpenApiFunctionDefinition, - tool_configs: Optional[dict[str, ToolConfig]] = ... + client_event_id: Optional[str] = ..., + code: str, + message: str, + param: Optional[str] = ..., + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.OperationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CANCELED = "Canceled" - FAILED = "Failed" - NOT_STARTED = "NotStarted" - RUNNING = "Running" - SUCCEEDED = "Succeeded" - - - class azure.ai.projects.models.OptimizationContext(_Model): - type: str + class azure.ai.projects.models.LiveLocalEnvironmentParam(_Model): + skills: Optional[list[LiveLocalSkillParam]] + type: Literal["local"] @overload def __init__( self, *, - type: str + skills: Optional[list[LiveLocalSkillParam]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.OptimizationContextType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - STEERING_PROMPT = "steering_prompt" - - - class azure.ai.projects.models.OtlpTelemetryEndpoint(TelemetryEndpoint, discriminator='OTLP'): - auth: TelemetryEndpointAuth - data: Union[list[str, TelemetryDataKind]] - endpoint: str - kind: Literal[TelemetryEndpointKind.OTLP] - protocol: Union[str, TelemetryTransportProtocol] + class azure.ai.projects.models.LiveLocalSkillParam(_Model): + description: str + name: str + path: str @overload def __init__( self, *, - auth: Optional[TelemetryEndpointAuth] = ..., - data: list[Union[str, TelemetryDataKind]], - endpoint: str, - protocol: Union[str, TelemetryTransportProtocol] + description: str, + name: str, + path: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.PSTNTelephonyTransferDestination(TelephonyTransferDestination, discriminator='pstn'): - kind: Literal[TelephonyTransferDestinationKind.PSTN] - value: str + class azure.ai.projects.models.LiveMCPToolChoiceParam(_Model): + name: Optional[str] + server_label: str + type: Literal["mcp"] @overload def __init__( self, *, - value: str + name: Optional[str] = ..., + server_label: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.PageOrder(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ASC = "asc" - DESC = "desc" + class azure.ai.projects.models.LiveMCPToolInputParam(_Model): + type: Literal["mcp"] + def __init__( + self, + *args: Any, + **kwargs: Any + ) -> None: ... - class azure.ai.projects.models.PendingUploadRequest(_Model): - connection_name: Optional[str] - pending_upload_id: Optional[str] - pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE] + + class azure.ai.projects.models.LiveNamespaceToolInputParam(_Model): + type: Literal["namespace"] + + def __init__( + self, + *args: Any, + **kwargs: Any + ) -> None: ... + + + class azure.ai.projects.models.LiveOutputAudioDelta(LiveServerEvent, discriminator='session.output_audio.delta'): + delta: str + end_ms: Optional[int] + start_ms: Optional[int] + type: Literal[LiveServerEventType.SESSION_OUTPUT_AUDIO_DELTA] @overload def __init__( self, *, - connection_name: Optional[str] = ..., - pending_upload_id: Optional[str] = ..., - pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE] + delta: str, + end_ms: Optional[int] = ..., + start_ms: Optional[int] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.PendingUploadResponse(_Model): - blob_reference: BlobReference - pending_upload_id: str - pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE] - version: Optional[str] + class azure.ai.projects.models.LiveProgrammaticToolInputParam(_Model): + type: Literal["programmatic_tool_calling"] - @overload def __init__( self, - *, - blob_reference: BlobReference, - pending_upload_id: str, - pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE], - version: Optional[str] = ... + *args: Any, + **kwargs: Any ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.LiveReasoningEffort(str, Enum, metaclass=CaseInsensitiveEnumMeta): + HIGH = "high" + LOW = "low" + MEDIUM = "medium" + MINIMAL = "minimal" + NONE = "none" + XHIGH = "xhigh" - class azure.ai.projects.models.PendingUploadType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - BLOB_REFERENCE = "BlobReference" - NONE = "None" - TEMPORARY_BLOB_REFERENCE = "TemporaryBlobReference" + class azure.ai.projects.models.LiveReasoningSummary(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AUTO = "auto" + CONCISE = "concise" + DETAILED = "detailed" - class azure.ai.projects.models.PickPropertiesVoiceAgentAudioConfig(_Model): - output: Optional[VoiceAgentAudioOutputConfig] + + class azure.ai.projects.models.LiveResponsesDelegationParam(Delegation, discriminator='responses'): + responses: LiveResponsesDelegationSettingsInputParam + type: Literal[DelegationType.RESPONSES] @overload def __init__( self, *, - output: Optional[VoiceAgentAudioOutputConfig] = ... + responses: LiveResponsesDelegationSettingsInputParam ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ProceduralMemoryItem(MemoryItem, discriminator='procedural'): - content: str - kind: Literal[MemoryItemKind.PROCEDURAL] - memory_id: str - scope: str - updated_at: datetime + class azure.ai.projects.models.LiveResponsesDelegationSettingsInputParam(_Model): + instructions: Optional[str] + max_output_tokens: Optional[int] + model: str + parallel_tool_calls: Optional[bool] + reasoning: Optional[LiveDelegationReasoningInputParam] + service_tier: Optional[Union[str, LiveResponsesServiceTier]] + text: Optional[LiveDelegationTextInputParam] + tool_choice: Optional[Union[str, LiveToolChoiceEnum, LiveFunctionToolChoiceParam, LiveMCPToolChoiceParam, LiveSpecificFileSearchParam, LiveSpecificWebSearchParam, LiveSpecificWebSearchPreviewParam, LiveSpecificImageGenParam, LiveSpecificComputerParam, LiveSpecificCodeInterpreterParam, LiveSpecificProgrammaticToolCallingParam, LiveSpecificFunctionShellParam, LiveSpecificCustomToolParam, LiveSpecificApplyPatchParam, LiveAllowedToolsChoiceParam]] + tools: Optional[list[Union[LiveFunctionToolInputParam, LiveWebSearchToolInputParam, LiveFileSearchToolInputParam, LiveCodeInterpreterToolInputParam, LiveHostedShellToolInputParam, LiveImageGenerationToolInputParam, LiveMCPToolInputParam, LiveCustomToolInputParam, LiveNamespaceToolInputParam, LiveToolSearchToolInputParam, LiveProgrammaticToolInputParam, LiveComputerToolInputParam, LiveApplyPatchToolInputParam]]] @overload def __init__( self, *, - content: str, - memory_id: str, - scope: str, - updated_at: datetime + instructions: Optional[str] = ..., + max_output_tokens: Optional[int] = ..., + model: str, + parallel_tool_calls: Optional[bool] = ..., + reasoning: Optional[LiveDelegationReasoningInputParam] = ..., + service_tier: Optional[Union[str, LiveResponsesServiceTier]] = ..., + text: Optional[LiveDelegationTextInputParam] = ..., + tool_choice: Optional[Union[str, LiveToolChoiceEnum, LiveFunctionToolChoiceParam, LiveMCPToolChoiceParam, LiveSpecificFileSearchParam, LiveSpecificWebSearchParam, LiveSpecificWebSearchPreviewParam, LiveSpecificImageGenParam, LiveSpecificComputerParam, LiveSpecificCodeInterpreterParam, LiveSpecificProgrammaticToolCallingParam, LiveSpecificFunctionShellParam, LiveSpecificCustomToolParam, LiveSpecificApplyPatchParam, LiveAllowedToolsChoiceParam]] = ..., + tools: Optional[list[Union[LiveFunctionToolInputParam, LiveWebSearchToolInputParam, LiveFileSearchToolInputParam, LiveCodeInterpreterToolInputParam, LiveHostedShellToolInputParam, LiveImageGenerationToolInputParam, LiveMCPToolInputParam, LiveCustomToolInputParam, LiveNamespaceToolInputParam, LiveToolSearchToolInputParam, LiveProgrammaticToolInputParam, LiveComputerToolInputParam, LiveApplyPatchToolInputParam]]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ProgrammaticToolCallingParam(Tool, discriminator='programmatic_tool_calling'): - type: Literal[ToolType.PROGRAMMATIC_TOOL_CALLING] + class azure.ai.projects.models.LiveResponsesDelegationSettingsUpdateInputParam(_Model): + instructions: Optional[str] + max_output_tokens: Optional[int] + model: Optional[str] + parallel_tool_calls: Optional[bool] + reasoning: Optional[LiveDelegationReasoningInputParam] + service_tier: Optional[Union[str, LiveResponsesServiceTier]] + text: Optional[LiveDelegationTextInputParam] + tool_choice: Optional[Union[str, LiveToolChoiceEnum, LiveFunctionToolChoiceParam, LiveMCPToolChoiceParam, LiveSpecificFileSearchParam, LiveSpecificWebSearchParam, LiveSpecificWebSearchPreviewParam, LiveSpecificImageGenParam, LiveSpecificComputerParam, LiveSpecificCodeInterpreterParam, LiveSpecificProgrammaticToolCallingParam, LiveSpecificFunctionShellParam, LiveSpecificCustomToolParam, LiveSpecificApplyPatchParam, LiveAllowedToolsChoiceParam]] + tools: Optional[list[Union[LiveFunctionToolInputParam, LiveWebSearchToolInputParam, LiveFileSearchToolInputParam, LiveCodeInterpreterToolInputParam, LiveHostedShellToolInputParam, LiveImageGenerationToolInputParam, LiveMCPToolInputParam, LiveCustomToolInputParam, LiveNamespaceToolInputParam, LiveToolSearchToolInputParam, LiveProgrammaticToolInputParam, LiveComputerToolInputParam, LiveApplyPatchToolInputParam]]] @overload - def __init__(self) -> None: ... + def __init__( + self, + *, + instructions: Optional[str] = ..., + max_output_tokens: Optional[int] = ..., + model: Optional[str] = ..., + parallel_tool_calls: Optional[bool] = ..., + reasoning: Optional[LiveDelegationReasoningInputParam] = ..., + service_tier: Optional[Union[str, LiveResponsesServiceTier]] = ..., + text: Optional[LiveDelegationTextInputParam] = ..., + tool_choice: Optional[Union[str, LiveToolChoiceEnum, LiveFunctionToolChoiceParam, LiveMCPToolChoiceParam, LiveSpecificFileSearchParam, LiveSpecificWebSearchParam, LiveSpecificWebSearchPreviewParam, LiveSpecificImageGenParam, LiveSpecificComputerParam, LiveSpecificCodeInterpreterParam, LiveSpecificProgrammaticToolCallingParam, LiveSpecificFunctionShellParam, LiveSpecificCustomToolParam, LiveSpecificApplyPatchParam, LiveAllowedToolsChoiceParam]] = ..., + tools: Optional[list[Union[LiveFunctionToolInputParam, LiveWebSearchToolInputParam, LiveFileSearchToolInputParam, LiveCodeInterpreterToolInputParam, LiveHostedShellToolInputParam, LiveImageGenerationToolInputParam, LiveMCPToolInputParam, LiveCustomToolInputParam, LiveNamespaceToolInputParam, LiveToolSearchToolInputParam, LiveProgrammaticToolInputParam, LiveComputerToolInputParam, LiveApplyPatchToolInputParam]]] = ... + ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.PromptAgentDefinition(AgentDefinition, discriminator='prompt'): - harness: Optional[AgentHarness] - instructions: Optional[str] - kind: Literal[AgentKind.PROMPT] - model: str - rai_config: RaiConfig - reasoning: Optional[Reasoning] - skills: Optional[list[SkillReference]] - structured_inputs: Optional[dict[str, StructuredInputDefinition]] - temperature: Optional[float] - text: Optional[PromptAgentDefinitionTextOptions] - tool_choice: Optional[Union[str, ToolChoiceParam]] - tools: Optional[list[Tool]] - top_p: Optional[float] + class azure.ai.projects.models.LiveResponsesDelegationUpdateParam(_Model): + responses: Optional[LiveResponsesDelegationSettingsUpdateInputParam] + type: Literal["responses"] @overload def __init__( self, *, - harness: Optional[AgentHarness] = ..., - instructions: Optional[str] = ..., - model: str, - rai_config: Optional[RaiConfig] = ..., - reasoning: Optional[Reasoning] = ..., - skills: Optional[list[SkillReference]] = ..., - structured_inputs: Optional[dict[str, StructuredInputDefinition]] = ..., - temperature: Optional[float] = ..., - text: Optional[PromptAgentDefinitionTextOptions] = ..., - tool_choice: Optional[Union[str, ToolChoiceParam]] = ..., - tools: Optional[list[Tool]] = ..., - top_p: Optional[float] = ... + responses: Optional[LiveResponsesDelegationSettingsUpdateInputParam] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.PromptAgentDefinitionTextOptions(_Model): - format: Optional[TextResponseFormat] + class azure.ai.projects.models.LiveResponsesServiceTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AUTO = "auto" + DEFAULT = "default" + FAST_TIER_TEMP_PILOT = "fast_tier_temp_pilot" + FLEX = "flex" + PRIORITY = "priority" + ULTRAFAST = "ultrafast" + + + class azure.ai.projects.models.LiveServerEvent(_Model): + type: str @overload def __init__( self, *, - format: Optional[TextResponseFormat] = ... + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.PromptBasedEvaluatorDefinition(EvaluatorDefinition, discriminator='prompt'): - data_schema: dict[str, any] - init_parameters: dict[str, any] - metrics: dict[str, EvaluatorMetric] - prompt_text: str - type: Literal[EvaluatorDefinitionType.PROMPT] + class azure.ai.projects.models.LiveServerEventLiveCommentaryAppended(LiveServerEvent, discriminator='session.commentary.appended'): + client_event_id: Optional[str] + end_ms: int + event_id: str + start_ms: int + type: Literal[LiveServerEventType.SESSION_COMMENTARY_APPENDED] @overload def __init__( self, *, - data_schema: Optional[dict[str, Any]] = ..., - init_parameters: Optional[dict[str, Any]] = ..., - metrics: Optional[dict[str, EvaluatorMetric]] = ..., - prompt_text: str + client_event_id: Optional[str] = ..., + end_ms: int, + event_id: str, + start_ms: int ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.PromptDataGenerationJobSource(DataGenerationJobSource, discriminator='prompt'): - description: str - prompt: str - type: Literal[DataGenerationJobSourceType.PROMPT] + class azure.ai.projects.models.LiveServerEventLiveDecisionEvent(LiveServerEvent, discriminator='decision.event'): + delegation_id: str + event: LiveDecisionCompleted + event_id: str + source_event_id: str + source_event_type: Literal["delta", "delta"] + trigger_id: str + type: Literal[LiveServerEventType.DECISION_EVENT] @overload def __init__( self, *, - description: Optional[str] = ..., - prompt: str + delegation_id: str, + event: LiveDecisionCompleted, + event_id: str, + source_event_id: str, + source_event_type: Literal["delta", "delta"], + trigger_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.PromptEvaluatorGenerationJobSource(EvaluatorGenerationJobSource, discriminator='prompt'): - description: Optional[str] - prompt: str - type: Literal[EvaluatorGenerationJobSourceType.PROMPT] + class azure.ai.projects.models.LiveServerEventLiveDecisionItemCreated(LiveServerEvent, discriminator='decision.item.created'): + client_event_id: Optional[str] + event_id: str + item: LiveDecisionStoredInputItemParam + type: Literal[LiveServerEventType.DECISION_ITEM_CREATED] @overload def __init__( self, *, - description: Optional[str] = ..., - prompt: str + client_event_id: Optional[str] = ..., + event_id: str, + item: LiveDecisionStoredInputItemParam ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.PromptOptimizationConfiguration(AgentOptimizationConfigurationBase, discriminator='prompt_optimization'): - context: Optional[list[OptimizationContext]] - type: Literal[AgentOptimizationConfigurationType.PROMPT_OPTIMIZATION] + class azure.ai.projects.models.LiveServerEventLiveDecisionItemDeleted(LiveServerEvent, discriminator='decision.item.deleted'): + client_event_id: Optional[str] + event_id: str + item_id: str + type: Literal[LiveServerEventType.DECISION_ITEM_DELETED] @overload def __init__( self, *, - context: Optional[list[OptimizationContext]] = ... + client_event_id: Optional[str] = ..., + event_id: str, + item_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ProtocolConfiguration(_Model): - a2a: Optional[A2AProtocolConfiguration] - activity: Optional[ActivityProtocolConfiguration] - invocations: Optional[InvocationsProtocolConfiguration] - invocations_ws: Optional[InvocationsWsProtocolConfiguration] - mcp: Optional[McpProtocolConfiguration] - responses: Optional[ResponsesProtocolConfiguration] + class azure.ai.projects.models.LiveServerEventLiveDelegationCreated(LiveServerEvent, discriminator='session.delegation.created'): + client_event_id: Optional[str] + delegation: VoiceAgentLiveDelegationItem + event_id: str + offset_ms: int + type: Literal[LiveServerEventType.SESSION_DELEGATION_CREATED] @overload def __init__( self, *, - a2a: Optional[A2AProtocolConfiguration] = ..., - activity: Optional[ActivityProtocolConfiguration] = ..., - invocations: Optional[InvocationsProtocolConfiguration] = ..., - invocations_ws: Optional[InvocationsWsProtocolConfiguration] = ..., - mcp: Optional[McpProtocolConfiguration] = ..., - responses: Optional[ResponsesProtocolConfiguration] = ... + client_event_id: Optional[str] = ..., + delegation: VoiceAgentLiveDelegationItem, + event_id: str, + offset_ms: int ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ProtocolVersionRecord(_Model): - protocol: Union[str, AgentEndpointProtocol] - version: str + class azure.ai.projects.models.LiveServerEventLiveErrorEvent(LiveServerEvent, discriminator='error'): + client_event_id: Optional[str] + error: LiveLiveError + event_id: str + type: Literal[LiveServerEventType.ERROR] @overload def __init__( self, *, - protocol: Union[str, AgentEndpointProtocol], - version: str + client_event_id: Optional[str] = ..., + error: LiveLiveError, + event_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.PublishApprovalStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - APPROVED = "approved" - NOT_PUBLISHED = "not_published" - NO_APPROVAL_NEEDED = "no_approval_needed" - PENDING = "pending" - REJECTED = "rejected" - - - class azure.ai.projects.models.RaiConfig(_Model): - invocations_moderation: Optional[RaiInvocationModeration] - rai_policy_name: str + class azure.ai.projects.models.LiveServerEventLiveInfoEvent(LiveServerEvent, discriminator='info'): + client_event_id: Optional[str] + code: str + event_id: str + message: str + type: Literal[LiveServerEventType.INFO] @overload def __init__( self, *, - invocations_moderation: Optional[RaiInvocationModeration] = ..., - rai_policy_name: str + client_event_id: Optional[str] = ..., + code: str, + event_id: str, + message: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RaiInvocationContentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - JSON = "json" - TEXT = "text" + class azure.ai.projects.models.LiveServerEventLiveInputAudioMuted(LiveServerEvent, discriminator='session.input_audio.muted'): + client_event_id: Optional[str] + event_id: str + type: Literal[LiveServerEventType.SESSION_INPUT_AUDIO_MUTED] + @overload + def __init__( + self, + *, + client_event_id: Optional[str] = ..., + event_id: str + ) -> None: ... - class azure.ai.projects.models.RaiInvocationMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - BOTH = "both" - NON_STREAMING = "non_streaming" - STREAMING = "streaming" + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RaiInvocationModeration(_Model): - input_content_type: Optional[Union[str, RaiInvocationContentType]] - input_paths: Optional[list[str]] - output_content_type: Optional[Union[str, RaiInvocationContentType]] - output_paths: Optional[list[str]] - response_mode: Union[str, RaiInvocationMode] - stream_selectors: Optional[list[RaiSseTextSelector]] + class azure.ai.projects.models.LiveServerEventLiveInputAudioUnmuted(LiveServerEvent, discriminator='session.input_audio.unmuted'): + client_event_id: Optional[str] + event_id: str + type: Literal[LiveServerEventType.SESSION_INPUT_AUDIO_UNMUTED] @overload def __init__( self, *, - input_content_type: Optional[Union[str, RaiInvocationContentType]] = ..., - input_paths: Optional[list[str]] = ..., - output_content_type: Optional[Union[str, RaiInvocationContentType]] = ..., - output_paths: Optional[list[str]] = ..., - response_mode: Union[str, RaiInvocationMode], - stream_selectors: Optional[list[RaiSseTextSelector]] = ... + client_event_id: Optional[str] = ..., + event_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RaiSseTextSelector(_Model): - event_type: str - text_field: Optional[str] + class azure.ai.projects.models.LiveServerEventLiveInputTranscriptDelta(LiveServerEvent, discriminator='session.input_transcript.delta'): + client_event_id: Optional[str] + delta: str + end_ms: int + event_id: str + start_ms: int + type: Literal[LiveServerEventType.SESSION_INPUT_TRANSCRIPT_DELTA] @overload def __init__( self, *, - event_type: str, - text_field: Optional[str] = ... + client_event_id: Optional[str] = ..., + delta: str, + end_ms: int, + event_id: str, + start_ms: int ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RankerVersionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AUTO = "auto" - DEFAULT_2024_11_15 = "default-2024-11-15" - - - class azure.ai.projects.models.RankingOptions(_Model): - hybrid_search: Optional[HybridSearchOptions] - ranker: Optional[Union[str, RankerVersionType]] - score_threshold: Optional[float] + class azure.ai.projects.models.LiveServerEventLiveInstructionsAppended(LiveServerEvent, discriminator='session.instructions.appended'): + client_event_id: Optional[str] + end_ms: int + event_id: str + start_ms: int + type: Literal[LiveServerEventType.SESSION_INSTRUCTIONS_APPENDED] @overload def __init__( self, *, - hybrid_search: Optional[HybridSearchOptions] = ..., - ranker: Optional[Union[str, RankerVersionType]] = ..., - score_threshold: Optional[float] = ... + client_event_id: Optional[str] = ..., + end_ms: int, + event_id: str, + start_ms: int ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeAudioFormats(_Model): - type: str + class azure.ai.projects.models.LiveServerEventLiveOutputAudioFixturePlayed(LiveServerEvent, discriminator='session.output_audio.fixture.played'): + client_event_id: Optional[str] + event_id: str + type: Literal[LiveServerEventType.SESSION_OUTPUT_AUDIO_FIXTURE_PLAYED] @overload def __init__( self, *, - type: str + client_event_id: Optional[str] = ..., + event_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeAudioFormatsAudioPcm(RealtimeAudioFormats, discriminator='audio/pcm'): - rate: Optional[Literal[24000]] - type: Literal[RealtimeAudioFormatsType.AUDIO_PCM] + class azure.ai.projects.models.LiveServerEventLiveOutputAudioFixturePlaying(LiveServerEvent, discriminator='session.output_audio.fixture.playing'): + client_event_id: Optional[str] + event_id: str + type: Literal[LiveServerEventType.SESSION_OUTPUT_AUDIO_FIXTURE_PLAYING] @overload def __init__( self, *, - rate: Optional[Literal[24000]] = ... + client_event_id: Optional[str] = ..., + event_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeAudioFormatsAudioPcma(RealtimeAudioFormats, discriminator='audio/pcma'): - type: Literal[RealtimeAudioFormatsType.AUDIO_PCMA] + class azure.ai.projects.models.LiveServerEventLiveOutputTranscriptDelta(LiveServerEvent, discriminator='session.output_transcript.delta'): + client_event_id: Optional[str] + delta: str + end_ms: int + event_id: str + start_ms: int + type: Literal[LiveServerEventType.SESSION_OUTPUT_TRANSCRIPT_DELTA] @overload - def __init__(self) -> None: ... + def __init__( + self, + *, + client_event_id: Optional[str] = ..., + delta: str, + end_ms: int, + event_id: str, + start_ms: int + ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeAudioFormatsAudioPcmu(RealtimeAudioFormats, discriminator='audio/pcmu'): - type: Literal[RealtimeAudioFormatsType.AUDIO_PCMU] + class azure.ai.projects.models.LiveServerEventLiveResponseEvent(LiveServerEvent, discriminator='response.event'): + client_event_id: Optional[str] + delegation_id: Optional[str] + event: dict[str, Any] + event_id: str + type: Literal[LiveServerEventType.RESPONSE_EVENT] @overload - def __init__(self) -> None: ... + def __init__( + self, + *, + client_event_id: Optional[str] = ..., + delegation_id: Optional[str] = ..., + event: dict[str, Any], + event_id: str + ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeAudioFormatsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AUDIO_PCM = "audio/pcm" - AUDIO_PCMA = "audio/pcma" - AUDIO_PCMU = "audio/pcmu" - - - class azure.ai.projects.models.RealtimeClientEvent(_Model): - type: str + class azure.ai.projects.models.LiveServerEventLiveSessionClosed(LiveServerEvent, discriminator='session.closed'): + client_event_id: Optional[str] + event_id: str + reason: Literal["close_requested", "expired", "content", "remote_hangup", "connection_lost"] + session: VoiceAgentLiveSessionResource + type: Literal[LiveServerEventType.SESSION_CLOSED] + usage: LiveSessionUsage @overload def __init__( self, *, - type: str + client_event_id: Optional[str] = ..., + event_id: str, + reason: Literal["close_requested", "expired", "content", "remote_hangup", "connection_lost"], + session: VoiceAgentLiveSessionResource, + usage: LiveSessionUsage ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeClientEventConversationItemCreate(RealtimeClientEvent, discriminator='conversation.item.create'): - event_id: Optional[str] - item: RealtimeConversationItem - previous_item_id: Optional[str] - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_CREATE] + class azure.ai.projects.models.LiveServerEventLiveSessionStarted(LiveServerEvent, discriminator='session.started'): + client_event_id: Optional[str] + conversation_id: Optional[str] + event_id: str + session: VoiceAgentLiveSessionResource + type: Literal[LiveServerEventType.SESSION_STARTED] @overload def __init__( self, *, - event_id: Optional[str] = ..., - item: RealtimeConversationItem, - previous_item_id: Optional[str] = ... + client_event_id: Optional[str] = ..., + conversation_id: Optional[str] = ..., + event_id: str, + session: VoiceAgentLiveSessionResource ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeClientEventConversationItemDelete(RealtimeClientEvent, discriminator='conversation.item.delete'): - event_id: Optional[str] - item_id: str - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_DELETE] + class azure.ai.projects.models.LiveServerEventLiveSessionUpdated(LiveServerEvent, discriminator='session.updated'): + client_event_id: Optional[str] + event_id: str + session: VoiceAgentLiveSessionResource + type: Literal[LiveServerEventType.SESSION_UPDATED] @overload def __init__( self, *, - event_id: Optional[str] = ..., - item_id: str + client_event_id: Optional[str] = ..., + event_id: str, + session: VoiceAgentLiveSessionResource ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeClientEventConversationItemRetrieve(RealtimeClientEvent, discriminator='conversation.item.retrieve'): - event_id: Optional[str] - item_id: str - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE] + class azure.ai.projects.models.LiveServerEventLiveSessionUsageUpdated(LiveServerEvent, discriminator='session.usage.updated'): + client_event_id: Optional[str] + context_window: Optional[LiveContextWindowUsage] + event_id: str + type: Literal[LiveServerEventType.SESSION_USAGE_UPDATED] + usage: LiveSessionUsage @overload def __init__( self, *, - event_id: Optional[str] = ..., - item_id: str + client_event_id: Optional[str] = ..., + context_window: Optional[LiveContextWindowUsage] = ..., + event_id: str, + usage: LiveSessionUsage ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeClientEventConversationItemTruncate(RealtimeClientEvent, discriminator='conversation.item.truncate'): - audio_end_ms: int - content_index: int - event_id: Optional[str] - item_id: str - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_TRUNCATE] + class azure.ai.projects.models.LiveServerEventLiveThinkingAppended(LiveServerEvent, discriminator='session.thinking.appended'): + client_event_id: Optional[str] + end_ms: int + event_id: str + start_ms: int + type: Literal[LiveServerEventType.SESSION_THINKING_APPENDED] @overload def __init__( self, *, - audio_end_ms: int, - content_index: int, - event_id: Optional[str] = ..., - item_id: str + client_event_id: Optional[str] = ..., + end_ms: int, + event_id: str, + start_ms: int ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeClientEventInputAudioBufferAppend(RealtimeClientEvent, discriminator='input_audio_buffer.append'): - audio: str - event_id: Optional[str] - type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_APPEND] + class azure.ai.projects.models.LiveServerEventLiveTransportAnswered(LiveServerEvent, discriminator='transport.answered'): + event_id: str + session_id: str + type: Literal[LiveServerEventType.TRANSPORT_ANSWERED] @overload def __init__( self, *, - audio: str, - event_id: Optional[str] = ... + event_id: str, + session_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeClientEventInputAudioBufferClear(RealtimeClientEvent, discriminator='input_audio_buffer.clear'): - event_id: Optional[str] - type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR] + class azure.ai.projects.models.LiveServerEventLiveTransportFailed(LiveServerEvent, discriminator='transport.failed'): + error: LiveTransportCallError + event_id: str + session_id: str + type: Literal[LiveServerEventType.TRANSPORT_FAILED] @overload def __init__( self, *, - event_id: Optional[str] = ... + error: LiveTransportCallError, + event_id: str, + session_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeClientEventInputAudioBufferCommit(RealtimeClientEvent, discriminator='input_audio_buffer.commit'): - event_id: Optional[str] - type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT] + class azure.ai.projects.models.LiveServerEventLiveTransportRinging(LiveServerEvent, discriminator='transport.ringing'): + event_id: str + session_id: str + type: Literal[LiveServerEventType.TRANSPORT_RINGING] @overload def __init__( self, *, - event_id: Optional[str] = ... + event_id: str, + session_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeClientEventOutputAudioBufferClear(RealtimeClientEvent, discriminator='output_audio_buffer.clear'): - event_id: Optional[str] - type: Literal[RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR] + class azure.ai.projects.models.LiveServerEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DECISION_EVENT = "decision.event" + DECISION_ITEM_CREATED = "decision.item.created" + DECISION_ITEM_DELETED = "decision.item.deleted" + ERROR = "error" + INFO = "info" + RESPONSE_EVENT = "response.event" + SESSION_CLOSED = "session.closed" + SESSION_COMMENTARY_APPENDED = "session.commentary.appended" + SESSION_DELEGATION_CREATED = "session.delegation.created" + SESSION_INPUT_AUDIO_APPEND = "session.input_audio.append" + SESSION_INPUT_AUDIO_MUTED = "session.input_audio.muted" + SESSION_INPUT_AUDIO_UNMUTED = "session.input_audio.unmuted" + SESSION_INPUT_TRANSCRIPT_DELTA = "session.input_transcript.delta" + SESSION_INSTRUCTIONS_APPENDED = "session.instructions.appended" + SESSION_OUTPUT_AUDIO_DELTA = "session.output_audio.delta" + SESSION_OUTPUT_AUDIO_FIXTURE_PLAYED = "session.output_audio.fixture.played" + SESSION_OUTPUT_AUDIO_FIXTURE_PLAYING = "session.output_audio.fixture.playing" + SESSION_OUTPUT_TRANSCRIPT_DELTA = "session.output_transcript.delta" + SESSION_STARTED = "session.started" + SESSION_THINKING_APPENDED = "session.thinking.appended" + SESSION_UPDATED = "session.updated" + SESSION_USAGE_UPDATED = "session.usage.updated" + TRANSPORT_ANSWERED = "transport.answered" + TRANSPORT_DTMF_RECEIVED = "transport.dtmf.received" + TRANSPORT_DTMF_SEND = "transport.dtmf.send" + TRANSPORT_FAILED = "transport.failed" + TRANSPORT_RINGING = "transport.ringing" + + + class azure.ai.projects.models.LiveSessionAudioFormatPCMAParam(LiveAudioFormat, discriminator='audio/pcma'): + rate: int + type: Literal[LiveAudioFormatType.AUDIO_PCMA] @overload def __init__( self, *, - event_id: Optional[str] = ... + rate: int ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeClientEventResponseCancel(RealtimeClientEvent, discriminator='response.cancel'): - event_id: Optional[str] - response_id: Optional[str] - type: Literal[RealtimeClientEventType.RESPONSE_CANCEL] + class azure.ai.projects.models.LiveSessionAudioFormatPCMParam(LiveAudioFormat, discriminator='audio/pcm'): + rate: Literal[16000, 24000] + type: Literal[LiveAudioFormatType.AUDIO_PCM] @overload def __init__( self, *, - event_id: Optional[str] = ..., - response_id: Optional[str] = ... + rate: Literal[16000, 24000] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeClientEventResponseCreate(RealtimeClientEvent, discriminator='response.create'): - event_id: Optional[str] - response: Optional[VoiceAgentResponseCreateParams] - type: Literal[RealtimeClientEventType.RESPONSE_CREATE] + class azure.ai.projects.models.LiveSessionAudioFormatPCMUParam(LiveAudioFormat, discriminator='audio/pcmu'): + rate: int + type: Literal[LiveAudioFormatType.AUDIO_PCMU] @overload def __init__( self, *, - event_id: Optional[str] = ..., - response: Optional[VoiceAgentResponseCreateParams] = ... + rate: int ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeClientEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CONVERSATION_ITEM_CREATE = "conversation.item.create" - CONVERSATION_ITEM_DELETE = "conversation.item.delete" - CONVERSATION_ITEM_RETRIEVE = "conversation.item.retrieve" - CONVERSATION_ITEM_TRUNCATE = "conversation.item.truncate" - INPUT_AUDIO_BUFFER_APPEND = "input_audio_buffer.append" - INPUT_AUDIO_BUFFER_CLEAR = "input_audio_buffer.clear" - INPUT_AUDIO_BUFFER_COMMIT = "input_audio_buffer.commit" - OUTPUT_AUDIO_BUFFER_CLEAR = "output_audio_buffer.clear" - RESPONSE_CANCEL = "response.cancel" - RESPONSE_CREATE = "response.create" - RTC_CALL_SDP_CREATE = "rtc.call.sdp.create" - SESSION_AVATAR_CONNECT = "session.avatar.connect" - SESSION_UPDATE = "session.update" - - - class azure.ai.projects.models.RealtimeConversationItem(_Model): - type: str + class azure.ai.projects.models.LiveSessionCreateParams(_Model): + audio: Optional[LiveInitialSessionAudioParam] + client: Optional[LiveClientConfigParam] + delegation: Optional[Union[LiveClientDelegationParam, LiveResponsesDelegationParam, LiveDecisionsDelegationParam_2]] + input: Optional[list[LiveInitialItem]] + instructions: Optional[str] + model: Union[str, ModelIdsLive] + store: Optional[bool] + triggers: Optional[list[LiveDecisionTriggerInputParam_2]] @overload def __init__( self, *, - type: str + audio: Optional[LiveInitialSessionAudioParam] = ..., + client: Optional[LiveClientConfigParam] = ..., + delegation: Optional[Union[LiveClientDelegationParam, LiveResponsesDelegationParam, LiveDecisionsDelegationParam_2]] = ..., + input: Optional[list[LiveInitialItem]] = ..., + instructions: Optional[str] = ..., + model: Union[str, ModelIdsLive], + store: Optional[bool] = ..., + triggers: Optional[list[LiveDecisionTriggerInputParam_2]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeConversationItemFunctionCall(RealtimeConversationItem, discriminator='function_call'): - arguments: str - call_id: Optional[str] - created_at: Optional[datetime] - id: Optional[str] - name: str - object: Optional[Literal["item"]] - response_id: Optional[str] - status: Optional[Literal["completed", "incomplete", "in_progress"]] - type: Literal[RealtimeConversationItemType.FUNCTION_CALL] + class azure.ai.projects.models.LiveSessionStartEvent(LiveClientEvent, discriminator='session.start'): + event_id: Optional[str] + session: LiveSessionCreateParams + type: Literal[LiveClientEventType.SESSION_START] @overload def __init__( self, *, - arguments: str, - call_id: Optional[str] = ..., - id: Optional[str] = ..., - name: str, - object: Optional[Literal[item]] = ..., - status: Optional[Literal[completed, incomplete, in_progress]] = ... + event_id: Optional[str] = ..., + session: LiveSessionCreateParams ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeConversationItemFunctionCallOutput(RealtimeConversationItem, discriminator='function_call_output'): - call_id: str - created_at: Optional[datetime] - id: Optional[str] - name: Optional[str] - object: Optional[Literal["item"]] - output: str - response_id: Optional[str] - status: Optional[Literal["completed", "incomplete", "in_progress"]] - type: Literal[RealtimeConversationItemType.FUNCTION_CALL_OUTPUT] + class azure.ai.projects.models.LiveSessionUpdateParams(_Model): + delegation: Optional[Union[LiveClientDelegationParam, LiveResponsesDelegationUpdateParam, LiveDecisionsDelegationUpdateParam]] + triggers: Optional[list[LiveDecisionTriggerInputParam_2]] @overload def __init__( self, *, - call_id: str, - id: Optional[str] = ..., - name: Optional[str] = ..., - object: Optional[Literal[item]] = ..., - output: str, - status: Optional[Literal[completed, incomplete, in_progress]] = ... + delegation: Optional[Union[LiveClientDelegationParam, LiveResponsesDelegationUpdateParam, LiveDecisionsDelegationUpdateParam]] = ..., + triggers: Optional[list[LiveDecisionTriggerInputParam_2]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeConversationItemMessage(RealtimeConversationItem, discriminator='message'): - role: str - type: Literal[RealtimeConversationItemType.MESSAGE] + class azure.ai.projects.models.LiveSessionUsage(_Model): + seconds: float @overload def __init__( self, *, - role: str + seconds: float ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeConversationItemMessageAssistant(RealtimeConversationItemMessage, discriminator='assistant'): - content: list[RealtimeConversationItemMessageAssistantContent] - created_at: Optional[datetime] - id: Optional[str] - object: Optional[Literal["item"]] - response_id: Optional[str] - role: Literal[RealtimeConversationItemMessageType.ASSISTANT] - status: Optional[Literal["completed", "incomplete", "in_progress"]] - type: Union[str, azure.ai.projects.models.MESSAGE] + class azure.ai.projects.models.LiveSkillReferenceParam(_Model): + skill_id: str + type: Literal["skill_reference"] + version: Optional[str] @overload def __init__( self, *, - content: list[RealtimeConversationItemMessageAssistantContent], - id: Optional[str] = ..., - object: Optional[Literal[item]] = ..., - status: Optional[Literal[completed, incomplete, in_progress]] = ..., - type: Literal[RealtimeConversationItemType.MESSAGE] + skill_id: str, + version: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeConversationItemMessageAssistantContent(_Model): - audio: Optional[str] - text: Optional[str] - transcript: Optional[str] - type: Optional[Literal["output_text", "output_audio"]] + class azure.ai.projects.models.LiveSpecificApplyPatchParam(_Model): + type: Literal["apply_patch"] - @overload def __init__( self, - *, - audio: Optional[str] = ..., - text: Optional[str] = ..., - transcript: Optional[str] = ..., - type: Optional[Literal[output_text, output_audio]] = ... + *args: Any, + **kwargs: Any ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.LiveSpecificCodeInterpreterParam(_Model): + type: Literal["code_interpreter"] - class azure.ai.projects.models.RealtimeConversationItemMessageSystem(RealtimeConversationItemMessage, discriminator='system'): - content: list[RealtimeConversationItemMessageSystemContent] - created_at: Optional[datetime] - id: Optional[str] - object: Optional[Literal["item"]] - response_id: Optional[str] - role: Literal[RealtimeConversationItemMessageType.SYSTEM] - status: Optional[Literal["completed", "incomplete", "in_progress"]] - type: Union[str, azure.ai.projects.models.MESSAGE] - - @overload def __init__( self, - *, - content: list[RealtimeConversationItemMessageSystemContent], - id: Optional[str] = ..., - object: Optional[Literal[item]] = ..., - status: Optional[Literal[completed, incomplete, in_progress]] = ..., - type: Literal[RealtimeConversationItemType.MESSAGE] + *args: Any, + **kwargs: Any ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.LiveSpecificComputerParam(_Model): + type: Literal["computer"] + + def __init__( + self, + *args: Any, + **kwargs: Any + ) -> None: ... - class azure.ai.projects.models.RealtimeConversationItemMessageSystemContent(_Model): - text: Optional[str] - type: Optional[Literal["input_text"]] + + class azure.ai.projects.models.LiveSpecificCustomToolParam(_Model): + name: str + type: Literal["custom"] @overload def __init__( self, *, - text: Optional[str] = ..., - type: Optional[Literal[input_text]] = ... + name: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeConversationItemMessageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ASSISTANT = "assistant" - SYSTEM = "system" - USER = "user" + class azure.ai.projects.models.LiveSpecificFileSearchParam(_Model): + type: Literal["file_search"] + def __init__( + self, + *args: Any, + **kwargs: Any + ) -> None: ... - class azure.ai.projects.models.RealtimeConversationItemMessageUser(RealtimeConversationItemMessage, discriminator='user'): - content: list[RealtimeConversationItemMessageUserContent] - created_at: Optional[datetime] - id: Optional[str] - object: Optional[Literal["item"]] - response_id: Optional[str] - role: Literal[RealtimeConversationItemMessageType.USER] - status: Optional[Literal["completed", "incomplete", "in_progress"]] - type: Union[str, azure.ai.projects.models.MESSAGE] - @overload + class azure.ai.projects.models.LiveSpecificFunctionShellParam(_Model): + type: Literal["shell"] + def __init__( self, - *, - content: list[RealtimeConversationItemMessageUserContent], - id: Optional[str] = ..., - object: Optional[Literal[item]] = ..., - status: Optional[Literal[completed, incomplete, in_progress]] = ..., - type: Literal[RealtimeConversationItemType.MESSAGE] + *args: Any, + **kwargs: Any ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.LiveSpecificImageGenParam(_Model): + type: Literal["image_generation"] - class azure.ai.projects.models.RealtimeConversationItemMessageUserContent(_Model): - audio: Optional[str] - detail: Optional[Literal["auto", "low", "high"]] - image_url: Optional[str] - text: Optional[str] - transcript: Optional[str] - type: Optional[Literal["input_text", "input_audio", "input_image"]] + def __init__( + self, + *args: Any, + **kwargs: Any + ) -> None: ... + + + class azure.ai.projects.models.LiveSpecificProgrammaticToolCallingParam(_Model): + type: Literal["programmatic_tool_calling"] - @overload def __init__( self, - *, - audio: Optional[str] = ..., - detail: Optional[Literal[auto, low, high]] = ..., - image_url: Optional[str] = ..., - text: Optional[str] = ..., - transcript: Optional[str] = ..., - type: Optional[Literal[input_text, input_audio, input_image]] = ... + *args: Any, + **kwargs: Any ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.LiveSpecificWebSearchParam(_Model): + type: Literal["web_search"] - class azure.ai.projects.models.RealtimeConversationItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - FUNCTION_CALL = "function_call" - FUNCTION_CALL_OUTPUT = "function_call_output" - MCP_APPROVAL_REQUEST = "mcp_approval_request" - MCP_APPROVAL_RESPONSE = "mcp_approval_response" - MCP_CALL = "mcp_call" - MCP_LIST_TOOLS = "mcp_list_tools" - MESSAGE = "message" + def __init__( + self, + *args: Any, + **kwargs: Any + ) -> None: ... - class azure.ai.projects.models.RealtimeFunctionTool(_Model): - description: Optional[str] - name: Optional[str] - parameters: Optional[RealtimeFunctionToolParameters] - type: Optional[Literal["function"]] + class azure.ai.projects.models.LiveSpecificWebSearchPreviewParam(_Model): + type: Literal["web_search_preview"] - @overload def __init__( self, - *, - description: Optional[str] = ..., - name: Optional[str] = ..., - parameters: Optional[RealtimeFunctionToolParameters] = ..., - type: Optional[Literal[function]] = ... + *args: Any, + **kwargs: Any ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + class azure.ai.projects.models.LiveTextVerbosity(str, Enum, metaclass=CaseInsensitiveEnumMeta): + HIGH = "high" + LOW = "low" + MEDIUM = "medium" - class azure.ai.projects.models.RealtimeFunctionToolParameters(_Model): + class azure.ai.projects.models.LiveToolChoiceEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AUTO = "auto" + NONE = "none" + REQUIRED = "required" - class azure.ai.projects.models.RealtimeMCPApprovalRequest(RealtimeConversationItem, discriminator='mcp_approval_request'): - arguments: str - created_at: Optional[datetime] - id: str - name: str - response_id: Optional[str] - server_label: str - type: Literal[RealtimeConversationItemType.MCP_APPROVAL_REQUEST] + class azure.ai.projects.models.LiveToolChoiceValueEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AUTO = "auto" + NONE = "none" + REQUIRED = "required" + + + class azure.ai.projects.models.LiveToolSearchToolInputParam(_Model): + type: Literal["tool_search"] - @overload def __init__( self, - *, - arguments: str, - id: str, - name: str, - server_label: str + *args: Any, + **kwargs: Any ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.ai.projects.models.RealtimeMCPApprovalResponse(RealtimeConversationItem, discriminator='mcp_approval_response'): - approval_request_id: str - approve: bool - created_at: Optional[datetime] - id: str - reason: Optional[str] - response_id: Optional[str] - type: Literal[RealtimeConversationItemType.MCP_APPROVAL_RESPONSE] + class azure.ai.projects.models.LiveTransportCallError(_Model): + code: str + message: str + param: Optional[str] + type: Literal["call_error"] @overload def __init__( self, *, - approval_request_id: str, - approve: bool, - id: str, - reason: Optional[str] = ... + code: str, + message: str, + param: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeMCPError(_Model): - type: str + class azure.ai.projects.models.LiveTransportDTMFReceived(LiveServerEvent, discriminator='transport.dtmf.received'): + event: str + event_id: str + type: Literal[LiveServerEventType.TRANSPORT_DTMF_RECEIVED] @overload def __init__( self, *, - type: str + event: str, + event_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeMCPHTTPError(RealtimeMCPError, discriminator='http_error'): - code: int - message: str - type: Literal[RealtimeMcpErrorType.HTTP_ERROR] + class azure.ai.projects.models.LiveTransportDTMFSend(LiveServerEvent, discriminator='transport.dtmf.send'): + client_event_id: Optional[str] + event: str + event_id: str + type: Literal[LiveServerEventType.TRANSPORT_DTMF_SEND] @overload def __init__( self, *, - code: int, - message: str + client_event_id: Optional[str] = ..., + event: str, + event_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeMCPListTools(RealtimeConversationItem, discriminator='mcp_list_tools'): - created_at: Optional[datetime] - id: Optional[str] - response_id: Optional[str] - server_label: str - tools: list[MCPListToolsTool] - type: Literal[RealtimeConversationItemType.MCP_LIST_TOOLS] + class azure.ai.projects.models.LiveWebSearchToolInputParam(_Model): + type: Literal["web_search"] + + def __init__( + self, + *args: Any, + **kwargs: Any + ) -> None: ... + + + class azure.ai.projects.models.LocalSkillParam(_Model): + description: str + name: str + path: str @overload def __init__( self, *, - id: Optional[str] = ..., - server_label: str, - tools: list[MCPListToolsTool] + description: str, + name: str, + path: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeMCPProtocolError(RealtimeMCPError, discriminator='protocol_error'): - code: int - message: str - type: Literal[RealtimeMcpErrorType.PROTOCOL_ERROR] + class azure.ai.projects.models.LogProbProperties(_Model): + bytes: list[int] + logprob: float + token: str @overload def __init__( self, *, - code: int, - message: str + bytes: list[int], + logprob: float, + token: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeMCPToolCall(RealtimeConversationItem, discriminator='mcp_call'): - approval_request_id: Optional[str] - arguments: str - created_at: Optional[datetime] - error: Optional[RealtimeMCPError] - id: str - name: str - output: Optional[str] - response_id: Optional[str] - server_label: str - type: Literal[RealtimeConversationItemType.MCP_CALL] + class azure.ai.projects.models.LoraConfig(_Model): + alpha: Optional[int] + dropout: Optional[float] + rank: Optional[int] + target_modules: Optional[list[str]] @overload def __init__( self, *, - approval_request_id: Optional[str] = ..., - arguments: str, - error: Optional[RealtimeMCPError] = ..., - id: str, - name: str, - output: Optional[str] = ..., - server_label: str + alpha: Optional[int] = ..., + dropout: Optional[float] = ..., + rank: Optional[int] = ..., + target_modules: Optional[list[str]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeMCPToolExecutionError(RealtimeMCPError, discriminator='tool_execution_error'): - message: str - type: Literal[RealtimeMcpErrorType.TOOL_EXECUTION_ERROR] + class azure.ai.projects.models.MCPListToolsTool(_Model): + annotations: Optional[MCPListToolsToolAnnotations] + description: Optional[str] + input_schema: MCPListToolsToolInputSchema + name: str @overload def __init__( self, *, - message: str + annotations: Optional[MCPListToolsToolAnnotations] = ..., + description: Optional[str] = ..., + input_schema: MCPListToolsToolInputSchema, + name: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeMcpErrorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - HTTP_ERROR = "http_error" - PROTOCOL_ERROR = "protocol_error" - TOOL_EXECUTION_ERROR = "tool_execution_error" + class azure.ai.projects.models.MCPListToolsToolAnnotations(_Model): - class azure.ai.projects.models.RealtimeReasoning(_Model): - effort: Optional[Union[str, RealtimeReasoningEffort]] + class azure.ai.projects.models.MCPListToolsToolInputSchema(_Model): + + + class azure.ai.projects.models.MCPTool(_Model): + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] + allowed_tools: Optional[Union[list[str], MCPToolFilter]] + authorization: Optional[str] + connector_id: Optional[Literal["connector_dropbox", "connector_gmail", "connector_googlecalendar", "connector_googledrive", "connector_microsoftteams", "connector_outlookcalendar", "connector_outlookemail", "connector_sharepoint"]] + defer_loading: Optional[bool] + headers: Optional[dict[str, str]] + project_connection_id: Optional[str] + require_approval: Optional[Union[MCPToolRequireApproval, Literal["always"], Literal["never"]]] + server_description: Optional[str] + server_label: str + server_url: Optional[str] + tool_configs: Optional[dict[str, ToolConfig]] + tunnel_id: Optional[str] + type: Literal["mcp"] @overload def __init__( self, *, - effort: Optional[Union[str, RealtimeReasoningEffort]] = ... + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ..., + allowed_tools: Optional[Union[list[str], MCPToolFilter]] = ..., + authorization: Optional[str] = ..., + connector_id: Optional[Literal[connector_dropbox, connector_gmail, connector_googlecalendar, connector_googledrive, connector_microsoftteams, connector_outlookcalendar, connector_outlookemail, connector_sharepoint]] = ..., + defer_loading: Optional[bool] = ..., + headers: Optional[dict[str, str]] = ..., + project_connection_id: Optional[str] = ..., + require_approval: Optional[Union[MCPToolRequireApproval, Literal[always], Literal[never]]] = ..., + server_description: Optional[str] = ..., + server_label: str, + server_url: Optional[str] = ..., + tool_configs: Optional[dict[str, ToolConfig]] = ..., + tunnel_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeReasoningEffort(str, Enum, metaclass=CaseInsensitiveEnumMeta): - HIGH = "high" - LOW = "low" - MEDIUM = "medium" - MINIMAL = "minimal" - XHIGH = "xhigh" - - - class azure.ai.projects.models.RealtimeResponseStatusDetails(_Model): - error: Optional[RealtimeResponseStatusDetailsError] - reason: Optional[Literal["turn_detected", "client_cancelled", "max_output_tokens", "content_filter"]] - type: Optional[Literal["completed", "cancelled", "failed", "incomplete"]] + class azure.ai.projects.models.MCPToolFilter(_Model): + read_only: Optional[bool] + tool_names: Optional[list[str]] @overload def __init__( self, *, - error: Optional[RealtimeResponseStatusDetailsError] = ..., - reason: Optional[Literal[turn_detected, client_cancelled, max_output_tokens, content_filter]] = ..., - type: Optional[Literal[completed, cancelled, failed, incomplete]] = ... + read_only: Optional[bool] = ..., + tool_names: Optional[list[str]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeResponseStatusDetailsError(_Model): - code: Optional[str] - type: Optional[str] + class azure.ai.projects.models.MCPToolRequireApproval(_Model): + always: Optional[MCPToolFilter] + never: Optional[MCPToolFilter] @overload def __init__( self, *, - code: Optional[str] = ..., - type: Optional[str] = ... + always: Optional[MCPToolFilter] = ..., + never: Optional[MCPToolFilter] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeResponseUsage(_Model): - input_token_details: Optional[RealtimeResponseUsageInputTokenDetails] - input_tokens: Optional[int] - output_token_details: Optional[RealtimeResponseUsageOutputTokenDetails] - output_tokens: Optional[int] - total_tokens: Optional[int] + class azure.ai.projects.models.MCPToolboxTool(ToolboxTool, discriminator='mcp'): + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] + allowed_tools: Optional[Union[list[str], MCPToolFilter]] + authorization: Optional[str] + connector_id: Optional[Literal["connector_dropbox", "connector_gmail", "connector_googlecalendar", "connector_googledrive", "connector_microsoftteams", "connector_outlookcalendar", "connector_outlookemail", "connector_sharepoint"]] + defer_loading: Optional[bool] + description: str + headers: Optional[dict[str, str]] + name: str + project_connection_id: Optional[str] + require_approval: Optional[Union[MCPToolRequireApproval, Literal["always"], Literal["never"]]] + server_description: Optional[str] + server_label: str + server_url: Optional[str] + tool_configs: dict[str, ToolConfig] + tunnel_id: Optional[str] + type: Literal[ToolboxToolType.MCP] @overload def __init__( self, *, - input_token_details: Optional[RealtimeResponseUsageInputTokenDetails] = ..., - input_tokens: Optional[int] = ..., - output_token_details: Optional[RealtimeResponseUsageOutputTokenDetails] = ..., - output_tokens: Optional[int] = ..., - total_tokens: Optional[int] = ... + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ..., + allowed_tools: Optional[Union[list[str], MCPToolFilter]] = ..., + authorization: Optional[str] = ..., + connector_id: Optional[Literal[connector_dropbox, connector_gmail, connector_googlecalendar, connector_googledrive, connector_microsoftteams, connector_outlookcalendar, connector_outlookemail, connector_sharepoint]] = ..., + defer_loading: Optional[bool] = ..., + description: Optional[str] = ..., + headers: Optional[dict[str, str]] = ..., + name: Optional[str] = ..., + project_connection_id: Optional[str] = ..., + require_approval: Optional[Union[MCPToolRequireApproval, Literal[always], Literal[never]]] = ..., + server_description: Optional[str] = ..., + server_label: str, + server_url: Optional[str] = ..., + tool_configs: Optional[dict[str, ToolConfig]] = ..., + tunnel_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeResponseUsageInputTokenDetails(_Model): - audio_tokens: Optional[int] - cached_tokens: Optional[int] - cached_tokens_details: Optional[RealtimeResponseUsageInputTokenDetailsCachedTokensDetails] - image_tokens: Optional[int] - text_tokens: Optional[int] + class azure.ai.projects.models.ManagedAgentIdentityBlueprintReference(AgentBlueprintReference, discriminator='ManagedAgentIdentityBlueprint'): + blueprint_id: str + type: Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT] @overload def __init__( self, *, - audio_tokens: Optional[int] = ..., - cached_tokens: Optional[int] = ..., - cached_tokens_details: Optional[RealtimeResponseUsageInputTokenDetailsCachedTokensDetails] = ..., - image_tokens: Optional[int] = ..., - text_tokens: Optional[int] = ... + blueprint_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeResponseUsageInputTokenDetailsCachedTokensDetails(_Model): - audio_tokens: Optional[int] - image_tokens: Optional[int] - text_tokens: Optional[int] + class azure.ai.projects.models.ManagedAzureAISearchIndex(Index, discriminator='ManagedAzureSearch'): + description: str + id: str + name: str + tags: dict[str, str] + type: Literal[IndexType.MANAGED_AZURE_SEARCH] + vector_store_id: str + version: str @overload def __init__( self, *, - audio_tokens: Optional[int] = ..., - image_tokens: Optional[int] = ..., - text_tokens: Optional[int] = ... + description: Optional[str] = ..., + tags: Optional[dict[str, str]] = ..., + vector_store_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeResponseUsageOutputTokenDetails(_Model): - audio_tokens: Optional[int] - text_tokens: Optional[int] + class azure.ai.projects.models.McpProtocolConfiguration(_Model): + + + class azure.ai.projects.models.MemoryItem(_Model): + content: str + kind: str + memory_id: str + scope: str + updated_at: datetime @overload def __init__( self, *, - audio_tokens: Optional[int] = ..., - text_tokens: Optional[int] = ... + content: str, + kind: str, + memory_id: str, + scope: str, + updated_at: datetime ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEvent(_Model): - type: str + class azure.ai.projects.models.MemoryItemKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CHAT_SUMMARY = "chat_summary" + PROCEDURAL = "procedural" + USER_PROFILE = "user_profile" + + + class azure.ai.projects.models.MemoryOperation(_Model): + kind: Union[str, MemoryOperationKind] + memory_item: MemoryItem @overload def __init__( self, *, - type: str + kind: Union[str, MemoryOperationKind], + memory_item: MemoryItem ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventConversationItemAdded(RealtimeServerEvent, discriminator='conversation.item.added'): - event_id: str - item: RealtimeConversationItem - previous_item_id: Optional[str] - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED] + class azure.ai.projects.models.MemoryOperationKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CREATE = "create" + DELETE = "delete" + UPDATE = "update" + + + class azure.ai.projects.models.MemorySearchItem(_Model): + memory_item: MemoryItem @overload def __init__( self, *, - event_id: str, - item: RealtimeConversationItem, - previous_item_id: Optional[str] = ... + memory_item: MemoryItem ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventConversationItemCreated(RealtimeServerEvent, discriminator='conversation.item.created'): - event_id: str - item: RealtimeConversationItem - previous_item_id: Optional[str] - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED] + class azure.ai.projects.models.MemorySearchOptions(_Model): + max_memories: Optional[int] @overload def __init__( self, *, - event_id: str, - item: RealtimeConversationItem, - previous_item_id: Optional[str] = ... + max_memories: Optional[int] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventConversationItemDeleted(RealtimeServerEvent, discriminator='conversation.item.deleted'): - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DELETED] + class azure.ai.projects.models.MemorySearchPreviewTool(Tool, discriminator='memory_search_preview'): + memory_store_name: str + scope: str + search_options: Optional[MemorySearchOptions] + type: Literal[ToolType.MEMORY_SEARCH_PREVIEW] + update_delay: Optional[int] @overload def __init__( self, *, - event_id: str, - item_id: str - ) -> None: ... + memory_store_name: str, + scope: str, + search_options: Optional[MemorySearchOptions] = ..., + update_delay: Optional[int] = ... + ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventConversationItemDone(RealtimeServerEvent, discriminator='conversation.item.done'): - event_id: str - item: RealtimeConversationItem - previous_item_id: Optional[str] - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE] + class azure.ai.projects.models.MemoryStoreDefaultDefinition(MemoryStoreDefinition, discriminator='default'): + chat_model: str + embedding_model: str + kind: Literal[MemoryStoreKind.DEFAULT] + options: Optional[MemoryStoreDefaultOptions] @overload def __init__( self, *, - event_id: str, - item: RealtimeConversationItem, - previous_item_id: Optional[str] = ... + chat_model: str, + embedding_model: str, + options: Optional[MemoryStoreDefaultOptions] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventConversationItemInputAudioTranscriptionCompleted(RealtimeServerEvent, discriminator='conversation.item.input_audio_transcription.completed'): - content_index: int - event_id: str - item_id: str - languages: Optional[list[TranscriptionLanguage]] - logprobs: Optional[list[LogProbProperties]] - phrases: Optional[list[VoiceAgentTranscriptionPhrase]] - transcript: str - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED] - usage: Union[TranscriptTextUsageTokens, TranscriptTextUsageDuration] + class azure.ai.projects.models.MemoryStoreDefaultOptions(_Model): + chat_summary_enabled: bool + default_ttl_seconds: Optional[timedelta] + procedural_memory_enabled: Optional[bool] + user_profile_details: Optional[str] + user_profile_enabled: bool @overload def __init__( self, *, - content_index: int, - event_id: str, - item_id: str, - languages: Optional[list[TranscriptionLanguage]] = ..., - logprobs: Optional[list[LogProbProperties]] = ..., - phrases: Optional[list[VoiceAgentTranscriptionPhrase]] = ..., - transcript: str, - usage: Union[TranscriptTextUsageTokens, TranscriptTextUsageDuration] + chat_summary_enabled: bool, + default_ttl_seconds: Optional[timedelta] = ..., + procedural_memory_enabled: Optional[bool] = ..., + user_profile_details: Optional[str] = ..., + user_profile_enabled: bool ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventConversationItemInputAudioTranscriptionDelta(RealtimeServerEvent, discriminator='conversation.item.input_audio_transcription.delta'): - content_index: Optional[int] - delta: Optional[str] - event_id: str - item_id: str - logprobs: Optional[list[LogProbProperties]] - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA] + class azure.ai.projects.models.MemoryStoreDefinition(_Model): + kind: str @overload def __init__( self, *, - content_index: Optional[int] = ..., - delta: Optional[str] = ..., - event_id: str, - item_id: str, - logprobs: Optional[list[LogProbProperties]] = ... + kind: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventConversationItemInputAudioTranscriptionFailed(RealtimeServerEvent, discriminator='conversation.item.input_audio_transcription.failed'): - content_index: int - error: RealtimeServerEventConversationItemInputAudioTranscriptionFailedError - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED] + class azure.ai.projects.models.MemoryStoreDeleteScopeResult(_Model): + deleted: bool + name: str + object: Literal[MemoryStoreObjectType.MEMORY_STORE_SCOPE_DELETED] + scope: str @overload def __init__( self, *, - content_index: int, - error: RealtimeServerEventConversationItemInputAudioTranscriptionFailedError, - event_id: str, - item_id: str + deleted: bool, + name: str, + object: Literal[MemoryStoreObjectType.MEMORY_STORE_SCOPE_DELETED], + scope: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventConversationItemInputAudioTranscriptionFailedError(_Model): - code: Optional[str] - message: Optional[str] - param: Optional[str] - type: Optional[str] + class azure.ai.projects.models.MemoryStoreDetails(_Model): + created_at: datetime + definition: MemoryStoreDefinition + description: Optional[str] + id: str + metadata: Optional[dict[str, str]] + name: str + object: Literal[MemoryStoreObjectType.MEMORY_STORE] + updated_at: datetime @overload def __init__( self, *, - code: Optional[str] = ..., - message: Optional[str] = ..., - param: Optional[str] = ..., - type: Optional[str] = ... + created_at: datetime, + definition: MemoryStoreDefinition, + description: Optional[str] = ..., + id: str, + metadata: Optional[dict[str, str]] = ..., + name: str, + object: Literal[MemoryStoreObjectType.MEMORY_STORE], + updated_at: datetime ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventConversationItemInputAudioTranscriptionSegment(RealtimeServerEvent, discriminator='conversation.item.input_audio_transcription.segment'): - content_index: int - end: float - event_id: str - id: str - item_id: str - speaker: str - start: float - text: str - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT] + class azure.ai.projects.models.MemoryStoreKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DEFAULT = "default" - @overload - def __init__( - self, - *, - content_index: int, - end: float, - event_id: str, - id: str, - item_id: str, - speaker: str, - start: float, - text: str - ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.MemoryStoreObjectType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + MEMORY_DELETED = "memory_store.item.deleted" + MEMORY_STORE = "memory_store" + MEMORY_STORE_DELETED = "memory_store.deleted" + MEMORY_STORE_SCOPE_DELETED = "memory_store.scope.deleted" - class azure.ai.projects.models.RealtimeServerEventConversationItemRetrieved(RealtimeServerEvent, discriminator='conversation.item.retrieved'): - event_id: str - item: RealtimeConversationItem - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED] + class azure.ai.projects.models.MemoryStoreOperationUsage(_Model): + embedding_tokens: int + input_tokens: int + input_tokens_details: ResponseUsageInputTokensDetails + output_tokens: int + output_tokens_details: ResponseUsageOutputTokensDetails + total_tokens: int @overload def __init__( self, *, - event_id: str, - item: RealtimeConversationItem + embedding_tokens: int, + input_tokens: int, + input_tokens_details: ResponseUsageInputTokensDetails, + output_tokens: int, + output_tokens_details: ResponseUsageOutputTokensDetails, + total_tokens: int ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventConversationItemTruncated(RealtimeServerEvent, discriminator='conversation.item.truncated'): - audio_end_ms: int - content_index: int - event_id: str - item: Optional[RealtimeConversationItem] - item_id: str - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_TRUNCATED] + class azure.ai.projects.models.MemoryStoreSearchResult(_Model): + memories: list[MemorySearchItem] + search_id: str + usage: MemoryStoreOperationUsage @overload def __init__( self, *, - audio_end_ms: int, - content_index: int, - event_id: str, - item: Optional[RealtimeConversationItem] = ..., - item_id: str + memories: list[MemorySearchItem], + search_id: str, + usage: MemoryStoreOperationUsage ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventError(_Model): - error: RealtimeServerEventErrorError - event_id: str - type: Literal["error"] + class azure.ai.projects.models.MemoryStoreUpdateCompletedResult(_Model): + memory_operations: list[MemoryOperation] + usage: MemoryStoreOperationUsage @overload def __init__( self, *, - error: RealtimeServerEventErrorError, - event_id: str + memory_operations: list[MemoryOperation], + usage: MemoryStoreOperationUsage ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventErrorError(_Model): - code: Optional[str] - event_id: Optional[str] - message: str - param: Optional[str] - type: str + class azure.ai.projects.models.MemoryStoreUpdateResult(_Model): + error: Optional[ApiError] + result: Optional[MemoryStoreUpdateCompletedResult] + status: Union[str, MemoryStoreUpdateStatus] + superseded_by: Optional[str] + update_id: str @overload def __init__( self, *, - code: Optional[str] = ..., - event_id: Optional[str] = ..., - message: str, - param: Optional[str] = ..., - type: str + error: Optional[ApiError] = ..., + result: Optional[MemoryStoreUpdateCompletedResult] = ..., + status: Union[str, MemoryStoreUpdateStatus], + superseded_by: Optional[str] = ..., + update_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventInputAudioBufferCleared(RealtimeServerEvent, discriminator='input_audio_buffer.cleared'): - event_id: str - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_CLEARED] + class azure.ai.projects.models.MemoryStoreUpdateStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + COMPLETED = "completed" + FAILED = "failed" + IN_PROGRESS = "in_progress" + QUEUED = "queued" + SUPERSEDED = "superseded" + + + class azure.ai.projects.models.Metadata(_Model): + + + class azure.ai.projects.models.Microsoft365PermissionScopes(_Model): + resource_app_id: str + scopes: list[str] @overload def __init__( self, *, - event_id: str + resource_app_id: str, + scopes: list[str] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventInputAudioBufferCommitted(RealtimeServerEvent, discriminator='input_audio_buffer.committed'): - event_id: str - item_id: str - previous_item_id: Optional[str] - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_COMMITTED] + class azure.ai.projects.models.Microsoft365PublishDefaults(_Model): + agent_display_name: Optional[str] + agent_name: Optional[str] + app_publish_scope: Optional[Union[str, Microsoft365PublishScope]] + app_registration_client_id: Optional[str] + app_version: Optional[str] + bot_service_arm_id: Optional[str] + developer_name: Optional[str] + developer_website_url: Optional[str] + full_description: Optional[str] + privacy_url: Optional[str] + recommended_next_app_version: Optional[str] + short_description: Optional[str] + teams_app_id: Optional[str] + terms_of_use_url: Optional[str] + title_id: Optional[str] @overload def __init__( self, *, - event_id: str, - item_id: str, - previous_item_id: Optional[str] = ... + agent_display_name: Optional[str] = ..., + agent_name: Optional[str] = ..., + app_publish_scope: Optional[Union[str, Microsoft365PublishScope]] = ..., + app_registration_client_id: Optional[str] = ..., + app_version: Optional[str] = ..., + bot_service_arm_id: Optional[str] = ..., + developer_name: Optional[str] = ..., + developer_website_url: Optional[str] = ..., + full_description: Optional[str] = ..., + privacy_url: Optional[str] = ..., + recommended_next_app_version: Optional[str] = ..., + short_description: Optional[str] = ..., + teams_app_id: Optional[str] = ..., + terms_of_use_url: Optional[str] = ..., + title_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventInputAudioBufferSpeechStarted(RealtimeServerEvent, discriminator='input_audio_buffer.speech_started'): - audio_start_ms: int - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STARTED] + class azure.ai.projects.models.Microsoft365PublishResult(_Model): + teams_app_id: Optional[str] + title_id: Optional[str] @overload def __init__( self, *, - audio_start_ms: int, - event_id: str, - item_id: str + teams_app_id: Optional[str] = ..., + title_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventInputAudioBufferSpeechStopped(RealtimeServerEvent, discriminator='input_audio_buffer.speech_stopped'): - audio_end_ms: int - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STOPPED] + class azure.ai.projects.models.Microsoft365PublishScope(str, Enum, metaclass=CaseInsensitiveEnumMeta): + PERSONAL = "Personal" + SHARED = "Shared" + TENANT = "Tenant" + + + class azure.ai.projects.models.MicrosoftCopilotBuiltInTool(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FILESYSTEM_READ = "filesystem_read" + FILESYSTEM_WRITE = "filesystem_write" + SHELL = "shell" + SUBAGENTS = "subagents" + WEB = "web" + + + class azure.ai.projects.models.MicrosoftCopilotHarness(AgentHarness, discriminator='microsoft_copilot_preview'): + type: Literal["microsoft_copilot_preview"] @overload - def __init__( - self, - *, - audio_end_ms: int, - event_id: str, - item_id: str - ) -> None: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventInputAudioBufferTimeoutTriggered(RealtimeServerEvent, discriminator='input_audio_buffer.timeout_triggered'): - audio_end_ms: int - audio_start_ms: int - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED] + class azure.ai.projects.models.MicrosoftCopilotToolsetConfig(_Model): + enabled: Optional[bool] + name: Union[str, MicrosoftCopilotBuiltInTool] @overload def __init__( self, *, - audio_end_ms: int, - audio_start_ms: int, - event_id: str, - item_id: str + enabled: Optional[bool] = ..., + name: Union[str, MicrosoftCopilotBuiltInTool] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventMCPListToolsCompleted(RealtimeServerEvent, discriminator='mcp_list_tools.completed'): - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_COMPLETED] + class azure.ai.projects.models.MicrosoftCopilotToolsetDefaultConfig(_Model): + enabled: Optional[bool] @overload def __init__( self, *, - event_id: str, - item_id: str + enabled: Optional[bool] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventMCPListToolsFailed(RealtimeServerEvent, discriminator='mcp_list_tools.failed'): - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_FAILED] + class azure.ai.projects.models.MicrosoftCopilotToolsetPreview(Tool, discriminator='microsoft_copilot_toolset_preview'): + configs: Optional[list[MicrosoftCopilotToolsetConfig]] + default_config: Optional[MicrosoftCopilotToolsetDefaultConfig] + type: Literal[ToolType.MICROSOFT_COPILOT_TOOLSET_PREVIEW] @overload def __init__( self, *, - event_id: str, - item_id: str + configs: Optional[list[MicrosoftCopilotToolsetConfig]] = ..., + default_config: Optional[MicrosoftCopilotToolsetDefaultConfig] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventMCPListToolsInProgress(RealtimeServerEvent, discriminator='mcp_list_tools.in_progress'): - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_IN_PROGRESS] + class azure.ai.projects.models.MicrosoftFabricPreviewTool(Tool, discriminator='fabric_dataagent_preview'): + fabric_dataagent_preview: FabricDataAgentToolParameters + type: Literal[ToolType.FABRIC_DATAAGENT_PREVIEW] @overload def __init__( self, *, - event_id: str, - item_id: str + fabric_dataagent_preview: FabricDataAgentToolParameters ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventOutputAudioBufferCleared(RealtimeServerEvent, discriminator='output_audio_buffer.cleared'): - event_id: str - response_id: str - type: Literal[RealtimeServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED] + class azure.ai.projects.models.MisalignmentErrorDetailsResource(_Model): + detailed_explanation: Optional[str] + error_type: Optional[Union[str, MisalignmentErrorType]] + review_target: Optional[str] + steer: Optional[MisalignmentSteer] @overload def __init__( self, *, - event_id: str, - response_id: str + detailed_explanation: Optional[str] = ..., + error_type: Optional[Union[str, MisalignmentErrorType]] = ..., + review_target: Optional[str] = ..., + steer: Optional[MisalignmentSteer] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventRateLimitsUpdated(RealtimeServerEvent, discriminator='rate_limits.updated'): - event_id: str - rate_limits: list[RealtimeServerEventRateLimitsUpdatedRateLimits] - type: Literal[RealtimeServerEventType.RATE_LIMITS_UPDATED] + class azure.ai.projects.models.MisalignmentErrorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + OTHER = "other" + POTENTIALLY_UNINTENDED_DATA_ACCESS = "potentially_unintended_data_access" + POTENTIALLY_UNINTENDED_DATA_TRANSFER = "potentially_unintended_data_transfer" + POTENTIALLY_UNINTENDED_DESTRUCTIVE_ACTIVITY = "potentially_unintended_destructive_activity" + + + class azure.ai.projects.models.MisalignmentSteer(_Model): + message: str @overload def __init__( self, *, - event_id: str, - rate_limits: list[RealtimeServerEventRateLimitsUpdatedRateLimits] + message: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventRateLimitsUpdatedRateLimits(_Model): - limit: Optional[int] - name: Optional[Literal["requests", "tokens"]] - remaining: Optional[int] - reset_seconds: Optional[float] + class azure.ai.projects.models.ModelCredentialRequest(_Model): + blob_uri: str @overload def __init__( self, *, - limit: Optional[int] = ..., - name: Optional[Literal[requests, tokens]] = ..., - remaining: Optional[int] = ..., - reset_seconds: Optional[float] = ... + blob_uri: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventResponseAudioDelta(RealtimeServerEvent, discriminator='response.output_audio.delta'): - content_index: int - delta: bytes - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DELTA] + class azure.ai.projects.models.ModelDeployment(Deployment, discriminator='ModelDeployment'): + capabilities: dict[str, str] + connection_name: Optional[str] + model_name: str + model_publisher: str + model_version: str + name: str + sku: ModelDeploymentSku + type: Literal[DeploymentType.MODEL_DEPLOYMENT] @overload - def __init__( - self, - *, - content_index: int, - delta: bytes, - event_id: str, - item_id: str, - output_index: int, - response_id: str - ) -> None: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventResponseAudioDone(RealtimeServerEvent, discriminator='response.output_audio.done'): - content_index: int - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DONE] + class azure.ai.projects.models.ModelDeploymentSku(_Model): + capacity: int + family: str + name: str + size: str + tier: str @overload def __init__( self, *, - content_index: int, - event_id: str, - item_id: str, - output_index: int, - response_id: str + capacity: int, + family: str, + name: str, + size: str, + tier: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventResponseAudioTranscriptDelta(RealtimeServerEvent, discriminator='response.output_audio_transcript.delta'): - content_index: int - delta: str - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA] + class azure.ai.projects.models.ModelIdsLive(str, Enum, metaclass=CaseInsensitiveEnumMeta): + GPT_LIVE1 = "gpt-live-1" + + + class azure.ai.projects.models.ModelPendingUploadRequest(_Model): + connection_name: Optional[str] + pending_upload_id: Optional[str] + pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE] @overload def __init__( self, *, - content_index: int, - delta: str, - event_id: str, - item_id: str, - output_index: int, - response_id: str + connection_name: Optional[str] = ..., + pending_upload_id: Optional[str] = ..., + pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventResponseAudioTranscriptDone(RealtimeServerEvent, discriminator='response.output_audio_transcript.done'): - content_index: int - event_id: str - item_id: str - output_index: int - response_id: str - transcript: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE] + class azure.ai.projects.models.ModelPendingUploadResponse(_Model): + blob_reference: BlobReference + pending_upload_id: str + pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE] + version: Optional[str] @overload def __init__( self, *, - content_index: int, - event_id: str, - item_id: str, - output_index: int, - response_id: str, - transcript: str + blob_reference: BlobReference, + pending_upload_id: str, + pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE], + version: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventResponseContentPartAdded(RealtimeServerEvent, discriminator='response.content_part.added'): - content_index: int - event_id: str - item_id: str - output_index: int - part: RealtimeServerEventResponseContentPartAddedPart - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED] + class azure.ai.projects.models.ModelSamplingConfigParam(TypedDict, total=False): + key "max_completion_tokens": int + key "seed": int + key "temperature": float + key "top_p": float - @overload + + class azure.ai.projects.models.ModelSamplingParams(_Model): + max_completion_tokens: Optional[int] + seed: Optional[int] + temperature: Optional[float] + top_p: Optional[float] + + @overload def __init__( self, *, - content_index: int, - event_id: str, - item_id: str, - output_index: int, - part: RealtimeServerEventResponseContentPartAddedPart, - response_id: str + max_completion_tokens: Optional[int] = ..., + seed: Optional[int] = ..., + temperature: Optional[float] = ..., + top_p: Optional[float] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventResponseContentPartAddedPart(_Model): - audio: Optional[str] - text: Optional[str] - transcript: Optional[str] - type: Optional[Literal["audio", "text"]] + class azure.ai.projects.models.ModelSourceData(_Model): + job_id: Optional[str] + source_type: Optional[Union[str, FoundryModelSourceType]] @overload def __init__( self, *, - audio: Optional[str] = ..., - text: Optional[str] = ..., - transcript: Optional[str] = ..., - type: Optional[Literal[audio, text]] = ... + job_id: Optional[str] = ..., + source_type: Optional[Union[str, FoundryModelSourceType]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventResponseContentPartDone(RealtimeServerEvent, discriminator='response.content_part.done'): - content_index: int - event_id: str - item_id: str - output_index: int - part: RealtimeServerEventResponseContentPartDonePart - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_DONE] + class azure.ai.projects.models.ModelVersion(_Model): + artifact_profile: Optional[ArtifactProfile] + base_model: Optional[str] + blob_uri: str + description: Optional[str] + id: Optional[str] + lora_config: Optional[LoraConfig] + name: str + source: Optional[ModelSourceData] + tags: Optional[dict[str, str]] + version: str + warnings: Optional[list[FoundryModelWarning]] + weight_type: Optional[Union[str, FoundryModelWeightType]] @overload def __init__( self, *, - content_index: int, - event_id: str, - item_id: str, - output_index: int, - part: RealtimeServerEventResponseContentPartDonePart, - response_id: str + base_model: Optional[str] = ..., + blob_uri: str, + description: Optional[str] = ..., + lora_config: Optional[LoraConfig] = ..., + source: Optional[ModelSourceData] = ..., + tags: Optional[dict[str, str]] = ..., + weight_type: Optional[Union[str, FoundryModelWeightType]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventResponseContentPartDonePart(_Model): - audio: Optional[str] - format: Optional[RealtimeAudioFormats] - text: Optional[str] - transcript: Optional[str] - type: Optional[Literal["audio", "text"]] + class azure.ai.projects.models.MonthlyRecurrenceSchedule(RecurrenceSchedule, discriminator='Monthly'): + days_of_month: list[int] + type: Literal[RecurrenceType.MONTHLY] @overload def __init__( self, *, - audio: Optional[str] = ..., - format: Optional[RealtimeAudioFormats] = ..., - text: Optional[str] = ..., - transcript: Optional[str] = ..., - type: Optional[Literal[audio, text]] = ... + days_of_month: list[int] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventResponseCreated(RealtimeServerEvent, discriminator='response.created'): - event_id: str - response: VoiceAgentRealtimeResponse - type: Literal[RealtimeServerEventType.RESPONSE_CREATED] + class azure.ai.projects.models.NamespaceToolParam(Tool, discriminator='namespace'): + description: str + name: str + tools: list[Union[FunctionToolParam, CustomToolParam]] + type: Literal[ToolType.NAMESPACE] @overload def __init__( self, *, - event_id: str, - response: VoiceAgentRealtimeResponse + description: str, + name: str, + tools: list[Union[FunctionToolParam, CustomToolParam]] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventResponseDone(RealtimeServerEvent, discriminator='response.done'): - event_id: str - response: VoiceAgentRealtimeResponse - type: Literal[RealtimeServerEventType.RESPONSE_DONE] + class azure.ai.projects.models.NoAuthenticationCredentials(BaseCredentials, discriminator='None'): + type: Literal[CredentialType.NONE] @overload - def __init__( - self, - *, - event_id: str, - response: VoiceAgentRealtimeResponse - ) -> None: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventResponseFunctionCallArgumentsDelta(RealtimeServerEvent, discriminator='response.function_call_arguments.delta'): - call_id: str - delta: str - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA] + class azure.ai.projects.models.OneTimeTrigger(Trigger, discriminator='OneTime'): + time_zone: Optional[str] + trigger_at: datetime + type: Literal[TriggerType.ONE_TIME] @overload def __init__( self, *, - call_id: str, - delta: str, - event_id: str, - item_id: str, - output_index: int, - response_id: str + time_zone: Optional[str] = ..., + trigger_at: datetime ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventResponseFunctionCallArgumentsDone(RealtimeServerEvent, discriminator='response.function_call_arguments.done'): - arguments: str - call_id: str - event_id: str - item_id: str - name: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE] + class azure.ai.projects.models.OpenApiAnonymousAuthDetails(OpenApiAuthDetails, discriminator='anonymous'): + type: Literal[OpenApiAuthType.ANONYMOUS] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.OpenApiAuthDetails(_Model): + type: str @overload def __init__( self, *, - arguments: str, - call_id: str, - event_id: str, - item_id: str, - name: str, - output_index: int, - response_id: str + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventResponseMCPCallArgumentsDelta(RealtimeServerEvent, discriminator='response.mcp_call_arguments.delta'): - delta: str - event_id: str - item_id: str - obfuscation: Optional[str] - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DELTA] + class azure.ai.projects.models.OpenApiAuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ANONYMOUS = "anonymous" + MANAGED_IDENTITY = "managed_identity" + PROJECT_CONNECTION = "project_connection" + + + class azure.ai.projects.models.OpenApiFunctionDefinition(_Model): + auth: OpenApiAuthDetails + default_params: Optional[list[str]] + description: Optional[str] + functions: Optional[list[OpenApiFunctionDefinitionFunction]] + name: str + spec: dict[str, Any] @overload def __init__( self, *, - delta: str, - event_id: str, - item_id: str, - obfuscation: Optional[str] = ..., - output_index: int, - response_id: str + auth: OpenApiAuthDetails, + default_params: Optional[list[str]] = ..., + description: Optional[str] = ..., + name: str, + spec: dict[str, Any] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventResponseMCPCallArgumentsDone(RealtimeServerEvent, discriminator='response.mcp_call_arguments.done'): - arguments: str - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DONE] + class azure.ai.projects.models.OpenApiFunctionDefinitionFunction(_Model): + description: Optional[str] + name: str + parameters: dict[str, Any] @overload def __init__( self, *, - arguments: str, - event_id: str, - item_id: str, - output_index: int, - response_id: str + description: Optional[str] = ..., + name: str, + parameters: dict[str, Any] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventResponseMCPCallCompleted(RealtimeServerEvent, discriminator='response.mcp_call.completed'): - event_id: str - item_id: str - output_index: int - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_COMPLETED] + class azure.ai.projects.models.OpenApiManagedAuthDetails(OpenApiAuthDetails, discriminator='managed_identity'): + security_scheme: OpenApiManagedSecurityScheme + type: Literal[OpenApiAuthType.MANAGED_IDENTITY] @overload def __init__( self, *, - event_id: str, - item_id: str, - output_index: int + security_scheme: OpenApiManagedSecurityScheme ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventResponseMCPCallFailed(RealtimeServerEvent, discriminator='response.mcp_call.failed'): - event_id: str - item_id: str - output_index: int - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_FAILED] + class azure.ai.projects.models.OpenApiManagedSecurityScheme(_Model): + audience: str @overload def __init__( self, *, - event_id: str, - item_id: str, - output_index: int + audience: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventResponseMCPCallInProgress(RealtimeServerEvent, discriminator='response.mcp_call.in_progress'): - event_id: str - item_id: str - output_index: int - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_IN_PROGRESS] + class azure.ai.projects.models.OpenApiProjectConnectionAuthDetails(OpenApiAuthDetails, discriminator='project_connection'): + security_scheme: OpenApiProjectConnectionSecurityScheme + type: Literal[OpenApiAuthType.PROJECT_CONNECTION] @overload def __init__( self, *, - event_id: str, - item_id: str, - output_index: int + security_scheme: OpenApiProjectConnectionSecurityScheme ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventResponseOutputItemAdded(RealtimeServerEvent, discriminator='response.output_item.added'): - event_id: str - item: RealtimeConversationItem - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_ADDED] + class azure.ai.projects.models.OpenApiProjectConnectionSecurityScheme(_Model): + project_connection_id: str @overload def __init__( self, *, - event_id: str, - item: RealtimeConversationItem, - output_index: int, - response_id: str + project_connection_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventResponseOutputItemDone(RealtimeServerEvent, discriminator='response.output_item.done'): - event_id: str - item: RealtimeConversationItem - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_DONE] + class azure.ai.projects.models.OpenApiTool(Tool, discriminator='openapi'): + openapi: OpenApiFunctionDefinition + tool_configs: Optional[dict[str, ToolConfig]] + type: Literal[ToolType.OPENAPI] @overload def __init__( self, *, - event_id: str, - item: RealtimeConversationItem, - output_index: int, - response_id: str + openapi: OpenApiFunctionDefinition, + tool_configs: Optional[dict[str, ToolConfig]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventResponseTextDelta(RealtimeServerEvent, discriminator='response.output_text.delta'): - content_index: int - delta: str - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DELTA] + class azure.ai.projects.models.OpenApiToolboxTool(ToolboxTool, discriminator='openapi'): + description: str + name: str + openapi: OpenApiFunctionDefinition + tool_configs: dict[str, ToolConfig] + type: Literal[ToolboxToolType.OPENAPI] @overload def __init__( self, *, - content_index: int, - delta: str, - event_id: str, - item_id: str, - output_index: int, - response_id: str + description: Optional[str] = ..., + name: Optional[str] = ..., + openapi: OpenApiFunctionDefinition, + tool_configs: Optional[dict[str, ToolConfig]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventResponseTextDone(RealtimeServerEvent, discriminator='response.output_text.done'): - content_index: int - event_id: str - item_id: str - output_index: int - response_id: str - text: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DONE] + class azure.ai.projects.models.OperationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CANCELED = "Canceled" + FAILED = "Failed" + NOT_STARTED = "NotStarted" + RUNNING = "Running" + SUCCEEDED = "Succeeded" + + + class azure.ai.projects.models.OptimizationContext(_Model): + type: str @overload def __init__( self, *, - content_index: int, - event_id: str, - item_id: str, - output_index: int, - response_id: str, - text: str + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventSessionCreated(RealtimeServerEvent, discriminator='session.created'): - conversation_id: Optional[str] - event_id: str - session: VoiceAgentSessionResponse - type: Literal[RealtimeServerEventType.SESSION_CREATED] + class azure.ai.projects.models.OptimizationContextType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + STEERING_PROMPT = "steering_prompt" + + + class azure.ai.projects.models.OtlpTelemetryEndpoint(TelemetryEndpoint, discriminator='OTLP'): + auth: TelemetryEndpointAuth + data: Union[list[str, TelemetryDataKind]] + endpoint: str + kind: Literal[TelemetryEndpointKind.OTLP] + protocol: Union[str, TelemetryTransportProtocol] @overload def __init__( self, *, - conversation_id: Optional[str] = ..., - event_id: str, - session: VoiceAgentSessionResponse + auth: Optional[TelemetryEndpointAuth] = ..., + data: list[Union[str, TelemetryDataKind]], + endpoint: str, + protocol: Union[str, TelemetryTransportProtocol] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventSessionUpdated(RealtimeServerEvent, discriminator='session.updated'): - event_id: str - session: VoiceAgentSessionResponse - type: Literal[RealtimeServerEventType.SESSION_UPDATED] + class azure.ai.projects.models.OutputTokensDetailsResource(_Model): + reasoning_tokens: int @overload def __init__( self, *, - event_id: str, - session: VoiceAgentSessionResponse + reasoning_tokens: int ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CONVERSATION_CREATED = "conversation.created" - CONVERSATION_ITEM_ADDED = "conversation.item.added" - CONVERSATION_ITEM_CREATED = "conversation.item.created" - CONVERSATION_ITEM_DELETED = "conversation.item.deleted" - CONVERSATION_ITEM_DONE = "conversation.item.done" - CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED = "conversation.item.input_audio_transcription.completed" - CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA = "conversation.item.input_audio_transcription.delta" - CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED = "conversation.item.input_audio_transcription.failed" - CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT = "conversation.item.input_audio_transcription.segment" - CONVERSATION_ITEM_RETRIEVED = "conversation.item.retrieved" - CONVERSATION_ITEM_TRUNCATED = "conversation.item.truncated" - ERROR = "error" - INPUT_AUDIO_BUFFER_CLEARED = "input_audio_buffer.cleared" - INPUT_AUDIO_BUFFER_COMMITTED = "input_audio_buffer.committed" - INPUT_AUDIO_BUFFER_DTMF_EVENT_RECEIVED = "input_audio_buffer.dtmf_event_received" - INPUT_AUDIO_BUFFER_SPEECH_STARTED = "input_audio_buffer.speech_started" - INPUT_AUDIO_BUFFER_SPEECH_STOPPED = "input_audio_buffer.speech_stopped" - INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED = "input_audio_buffer.timeout_triggered" - MCP_LIST_TOOLS_COMPLETED = "mcp_list_tools.completed" - MCP_LIST_TOOLS_FAILED = "mcp_list_tools.failed" - MCP_LIST_TOOLS_IN_PROGRESS = "mcp_list_tools.in_progress" - OUTPUT_AUDIO_BUFFER_CLEARED = "output_audio_buffer.cleared" - OUTPUT_AUDIO_BUFFER_STARTED = "output_audio_buffer.started" - OUTPUT_AUDIO_BUFFER_STOPPED = "output_audio_buffer.stopped" - RATE_LIMITS_UPDATED = "rate_limits.updated" - RESPONSE_ANIMATION_BLENDSHAPES_DELTA = "response.animation_blendshapes.delta" - RESPONSE_ANIMATION_BLENDSHAPES_DONE = "response.animation_blendshapes.done" - RESPONSE_ANIMATION_VISEME_DELTA = "response.animation_viseme.delta" - RESPONSE_ANIMATION_VISEME_DONE = "response.animation_viseme.done" - RESPONSE_AUDIO_TIMESTAMP_DELTA = "response.audio_timestamp.delta" - RESPONSE_AUDIO_TIMESTAMP_DONE = "response.audio_timestamp.done" - RESPONSE_CONTENT_PART_ADDED = "response.content_part.added" - RESPONSE_CONTENT_PART_DONE = "response.content_part.done" - RESPONSE_CREATED = "response.created" - RESPONSE_DONE = "response.done" - RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA = "response.function_call_arguments.delta" - RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE = "response.function_call_arguments.done" - RESPONSE_MCP_CALL_ARGUMENTS_DELTA = "response.mcp_call_arguments.delta" - RESPONSE_MCP_CALL_ARGUMENTS_DONE = "response.mcp_call_arguments.done" - RESPONSE_MCP_CALL_COMPLETED = "response.mcp_call.completed" - RESPONSE_MCP_CALL_FAILED = "response.mcp_call.failed" - RESPONSE_MCP_CALL_IN_PROGRESS = "response.mcp_call.in_progress" - RESPONSE_OUTPUT_AUDIO_DELTA = "response.output_audio.delta" - RESPONSE_OUTPUT_AUDIO_DONE = "response.output_audio.done" - RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA = "response.output_audio_transcript.delta" - RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE = "response.output_audio_transcript.done" - RESPONSE_OUTPUT_ITEM_ADDED = "response.output_item.added" - RESPONSE_OUTPUT_ITEM_DONE = "response.output_item.done" - RESPONSE_OUTPUT_TEXT_DELTA = "response.output_text.delta" - RESPONSE_OUTPUT_TEXT_DONE = "response.output_text.done" - RESPONSE_VIDEO_DELTA = "response.video.delta" - RTC_CALL_ERROR = "rtc.call.error" - RTC_CALL_SDP_CREATED = "rtc.call.sdp.created" - SESSION_AVATAR_CONNECTING = "session.avatar.connecting" - SESSION_AVATAR_SWITCH_TO_IDLE = "session.avatar.switch_to_idle" - SESSION_AVATAR_SWITCH_TO_SPEAKING = "session.avatar.switch_to_speaking" - SESSION_CREATED = "session.created" - SESSION_SUBAGENT_ABORTED = "session.subagent.aborted" - SESSION_SUBAGENT_COMPLETED = "session.subagent.completed" - SESSION_SUBAGENT_STARTED = "session.subagent.started" - SESSION_UPDATED = "session.updated" - WARNING = "warning" - - - class azure.ai.projects.models.Reasoning(_Model): - context: Optional[Literal["auto", "current_turn", "all_turns"]] - effort: Optional[Union[str, ReasoningEffort]] - generate_summary: Optional[Literal["auto", "concise", "detailed"]] - mode: Optional[Union[str, ReasoningModeEnum]] - summary: Optional[Literal["auto", "concise", "detailed"]] + class azure.ai.projects.models.PSTNTelephonyTransferDestination(TelephonyTransferDestination, discriminator='pstn'): + kind: Literal[TelephonyTransferDestinationKind.PSTN] + value: str @overload def __init__( self, *, - context: Optional[Literal[auto, current_turn, all_turns]] = ..., - effort: Optional[Union[str, ReasoningEffort]] = ..., - generate_summary: Optional[Literal[auto, concise, detailed]] = ..., - mode: Optional[Union[str, ReasoningModeEnum]] = ..., - summary: Optional[Literal[auto, concise, detailed]] = ... + value: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ReasoningEffort(str, Enum, metaclass=CaseInsensitiveEnumMeta): - HIGH = "high" - LOW = "low" - MAX = "max" - MEDIUM = "medium" - MINIMAL = "minimal" - NONE = "none" - XHIGH = "xhigh" - - - class azure.ai.projects.models.ReasoningModeEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): - PRO = "pro" - STANDARD = "standard" + class azure.ai.projects.models.PageOrder(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ASC = "asc" + DESC = "desc" - class azure.ai.projects.models.RecurrenceSchedule(_Model): - type: str + class azure.ai.projects.models.PendingUploadRequest(_Model): + connection_name: Optional[str] + pending_upload_id: Optional[str] + pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE] @overload def __init__( self, *, - type: str + connection_name: Optional[str] = ..., + pending_upload_id: Optional[str] = ..., + pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RecurrenceTrigger(Trigger, discriminator='Recurrence'): - end_time: Optional[datetime] - interval: int - schedule: RecurrenceSchedule - start_time: Optional[datetime] - time_zone: Optional[str] - type: Literal[TriggerType.RECURRENCE] + class azure.ai.projects.models.PendingUploadResponse(_Model): + blob_reference: BlobReference + pending_upload_id: str + pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE] + version: Optional[str] @overload def __init__( self, *, - end_time: Optional[datetime] = ..., - interval: int, - schedule: RecurrenceSchedule, - start_time: Optional[datetime] = ..., - time_zone: Optional[str] = ... + blob_reference: BlobReference, + pending_upload_id: str, + pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE], + version: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RecurrenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DAILY = "Daily" - HOURLY = "Hourly" - MONTHLY = "Monthly" - WEEKLY = "Weekly" + class azure.ai.projects.models.PendingUploadType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BLOB_REFERENCE = "BlobReference" + NONE = "None" + TEMPORARY_BLOB_REFERENCE = "TemporaryBlobReference" - class azure.ai.projects.models.RedTeam(_Model): - application_scenario: Optional[str] - attack_strategies: Optional[list[Union[str, AttackStrategy]]] - display_name: Optional[str] - name: str - num_turns: Optional[int] - properties: Optional[dict[str, str]] - risk_categories: Optional[list[Union[str, RiskCategory]]] - simulation_only: Optional[bool] - status: Optional[str] - tags: Optional[dict[str, str]] - target: RedTeamTargetConfig + class azure.ai.projects.models.PickPropertiesVoiceAgentAudioConfig(_Model): + output: Optional[VoiceAgentAudioOutputConfig] @overload def __init__( self, *, - application_scenario: Optional[str] = ..., - attack_strategies: Optional[list[Union[str, AttackStrategy]]] = ..., - display_name: Optional[str] = ..., - num_turns: Optional[int] = ..., - properties: Optional[dict[str, str]] = ..., - risk_categories: Optional[list[Union[str, RiskCategory]]] = ..., - simulation_only: Optional[bool] = ..., - tags: Optional[dict[str, str]] = ..., - target: RedTeamTargetConfig + output: Optional[VoiceAgentAudioOutputConfig] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RedTeamEvalRunDataSource(TypedDict, total=False): - key "item_generation_params": Required[Any] - key "target": Required[Union[AzureAIAgentTargetParam, AzureAIModelTargetParam, dict[str, Any]]] - key "type": Required[Literal["azure_ai_red_team"]] - - - class azure.ai.projects.models.RedTeamTargetConfig(_Model): - type: str + class azure.ai.projects.models.ProceduralMemoryItem(MemoryItem, discriminator='procedural'): + content: str + kind: Literal[MemoryItemKind.PROCEDURAL] + memory_id: str + scope: str + updated_at: datetime @overload def __init__( self, *, - type: str + content: str, + memory_id: str, + scope: str, + updated_at: datetime ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ReinforcementFineTuningDataGenerationJob(DataGenerationJob, discriminator='reinforcement_finetuning_preview'): - created_at: datetime - error: ApiError - finished_at: datetime - generation_configuration: DataGenerationJobConfiguration - id: str - name: str - output_configuration: Optional[ReinforcementFineTuningDataGenerationJobOutputConfiguration] - result: DataGenerationJobResult - scenario: Literal[DataGenerationJobScenario.REINFORCEMENT_FINETUNING_PREVIEW] - sources: list[DataGenerationJobSource] - status: Union[str, JobStatus] + class azure.ai.projects.models.PromptAgentDefinition(AgentDefinition, discriminator='prompt'): + harness: Optional[AgentHarness] + instructions: Optional[str] + kind: Literal[AgentKind.PROMPT] + model: str + rai_config: RaiConfig + reasoning: Optional[Reasoning] + skills: Optional[list[SkillReference]] + structured_inputs: Optional[dict[str, StructuredInputDefinition]] + temperature: Optional[float] + text: Optional[PromptAgentDefinitionTextOptions] + tool_choice: Optional[Union[str, ToolChoiceParam]] + tools: Optional[list[Tool]] + top_p: Optional[float] @overload def __init__( self, *, - generation_configuration: DataGenerationJobConfiguration, - name: str, - output_configuration: Optional[ReinforcementFineTuningDataGenerationJobOutputConfiguration] = ..., - sources: list[DataGenerationJobSource] + harness: Optional[AgentHarness] = ..., + instructions: Optional[str] = ..., + model: str, + rai_config: Optional[RaiConfig] = ..., + reasoning: Optional[Reasoning] = ..., + skills: Optional[list[SkillReference]] = ..., + structured_inputs: Optional[dict[str, StructuredInputDefinition]] = ..., + temperature: Optional[float] = ..., + text: Optional[PromptAgentDefinitionTextOptions] = ..., + tool_choice: Optional[Union[str, ToolChoiceParam]] = ..., + tools: Optional[list[Tool]] = ..., + top_p: Optional[float] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ReinforcementFineTuningDataGenerationJobInputs(DataGenerationJobInputs, discriminator='reinforcement_finetuning_preview'): - generation_configuration: DataGenerationJobConfiguration - name: str - output_configuration: Optional[ReinforcementFineTuningDataGenerationJobOutputConfiguration] - scenario: Literal[DataGenerationJobScenario.REINFORCEMENT_FINETUNING_PREVIEW] - sources: list[DataGenerationJobSource] + class azure.ai.projects.models.PromptAgentDefinitionTextOptions(_Model): + format: Optional[TextResponseFormat] @overload def __init__( self, *, - generation_configuration: DataGenerationJobConfiguration, - name: str, - output_configuration: Optional[ReinforcementFineTuningDataGenerationJobOutputConfiguration] = ..., - sources: list[DataGenerationJobSource] + format: Optional[TextResponseFormat] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ReinforcementFineTuningDataGenerationJobOutputConfiguration(_Model): - merge_file_id: Optional[str] - name: str - write_mode: Optional[Union[str, DataGenerationJobOutputWriteMode]] + class azure.ai.projects.models.PromptBasedEvaluatorDefinition(EvaluatorDefinition, discriminator='prompt'): + data_schema: dict[str, any] + init_parameters: dict[str, any] + metrics: dict[str, EvaluatorMetric] + prompt_text: str + type: Literal[EvaluatorDefinitionType.PROMPT] @overload def __init__( self, *, - merge_file_id: Optional[str] = ..., - name: str, - write_mode: Optional[Union[str, DataGenerationJobOutputWriteMode]] = ... + data_schema: Optional[dict[str, Any]] = ..., + init_parameters: Optional[dict[str, Any]] = ..., + metrics: Optional[dict[str, EvaluatorMetric]] = ..., + prompt_text: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ReminderPreviewToolboxTool(ToolboxTool, discriminator='reminder_preview'): + class azure.ai.projects.models.PromptDataGenerationJobSource(DataGenerationJobSource, discriminator='prompt'): description: str - name: str - tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.REMINDER_PREVIEW] + prompt: str + type: Literal[DataGenerationJobSourceType.PROMPT] @overload def __init__( self, *, description: Optional[str] = ..., - name: Optional[str] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ... + prompt: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ResponseRetrievalItemGenerationParams(TypedDict, total=False): - key "data_mapping": Required[Dict[str, str]] - key "max_num_turns": int - key "source": Required[Union[SourceFileContent, SourceFileID]] - key "type": Required[Literal["response_retrieval"]] - - - class azure.ai.projects.models.ResponseUsageInputTokensDetails(_Model): - cache_write_tokens: int - cached_tokens: int + class azure.ai.projects.models.PromptEvaluatorGenerationJobSource(EvaluatorGenerationJobSource, discriminator='prompt'): + description: Optional[str] + prompt: str + type: Literal[EvaluatorGenerationJobSourceType.PROMPT] @overload def __init__( self, *, - cache_write_tokens: int, - cached_tokens: int + description: Optional[str] = ..., + prompt: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ResponseUsageOutputTokensDetails(_Model): - reasoning_tokens: int + class azure.ai.projects.models.PromptOptimizationConfiguration(AgentOptimizationConfigurationBase, discriminator='prompt_optimization'): + context: Optional[list[OptimizationContext]] + type: Literal[AgentOptimizationConfigurationType.PROMPT_OPTIMIZATION] @overload def __init__( self, *, - reasoning_tokens: int + context: Optional[list[OptimizationContext]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ResponsesProtocolConfiguration(_Model): + class azure.ai.projects.models.ProtocolConfiguration(_Model): + a2a: Optional[A2AProtocolConfiguration] + activity: Optional[ActivityProtocolConfiguration] + invocations: Optional[InvocationsProtocolConfiguration] + invocations_ws: Optional[InvocationsWsProtocolConfiguration] + mcp: Optional[McpProtocolConfiguration] + responses: Optional[ResponsesProtocolConfiguration] + @overload + def __init__( + self, + *, + a2a: Optional[A2AProtocolConfiguration] = ..., + activity: Optional[ActivityProtocolConfiguration] = ..., + invocations: Optional[InvocationsProtocolConfiguration] = ..., + invocations_ws: Optional[InvocationsWsProtocolConfiguration] = ..., + mcp: Optional[McpProtocolConfiguration] = ..., + responses: Optional[ResponsesProtocolConfiguration] = ... + ) -> None: ... - class azure.ai.projects.models.RiskCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CODE_VULNERABILITY = "CodeVulnerability" - HATE_UNFAIRNESS = "HateUnfairness" - PROHIBITED_ACTIONS = "ProhibitedActions" - PROTECTED_MATERIAL = "ProtectedMaterial" - SELF_HARM = "SelfHarm" - SENSITIVE_DATA_LEAKAGE = "SensitiveDataLeakage" - SEXUAL = "Sexual" - TASK_ADHERENCE = "TaskAdherence" - UNGROUNDED_ATTRIBUTES = "UngroundedAttributes" - VIOLENCE = "Violence" + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.Routine(_Model): - action: Optional[RoutineAction] - created_at: Optional[datetime] - description: Optional[str] - enabled: bool - name: Optional[str] - triggers: Optional[dict[str, RoutineTrigger]] - updated_at: Optional[datetime] + class azure.ai.projects.models.ProtocolVersionRecord(_Model): + protocol: Union[str, AgentEndpointProtocol] + version: str @overload def __init__( self, *, - action: Optional[RoutineAction] = ..., - created_at: Optional[datetime] = ..., - description: Optional[str] = ..., - enabled: bool, - name: Optional[str] = ..., - triggers: Optional[dict[str, RoutineTrigger]] = ..., - updated_at: Optional[datetime] = ... + protocol: Union[str, AgentEndpointProtocol], + version: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RoutineAction(_Model): + class azure.ai.projects.models.PublishApprovalStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + APPROVED = "approved" + NOT_PUBLISHED = "not_published" + NO_APPROVAL_NEEDED = "no_approval_needed" + PENDING = "pending" + REJECTED = "rejected" + + + class azure.ai.projects.models.QuestionParam(_Model): type: str @overload @@ -12544,212 +12341,198 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RoutineActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - INVOKE_AGENT_INVOCATIONS_API = "invoke_agent_invocations_api" - INVOKE_AGENT_RESPONSES_API = "invoke_agent_responses_api" + class azure.ai.projects.models.QuestionParamChoice(QuestionParam, discriminator='choice'): + choices: list[ChoiceOptionParam] + instructions: str + name: Optional[str] + type: Literal[QuestionParamType.CHOICE] + @overload + def __init__( + self, + *, + choices: list[ChoiceOptionParam], + instructions: str, + name: Optional[str] = ... + ) -> None: ... - class azure.ai.projects.models.RoutineAttemptSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): - EVENT_FIRE = "event_fire" - MANUAL_DISPATCH = "manual_dispatch" - QUEUED_DISPATCH = "queued_dispatch" - SCHEDULE_DELIVERY = "schedule_delivery" - TIMER_DELIVERY = "timer_delivery" + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RoutineAuthorization(_Model): - identity: Optional[Union[str, RoutineDispatchIdentity]] + class azure.ai.projects.models.QuestionParamPredicate(QuestionParam, discriminator='predicate'): + instructions: str + name: Optional[str] + type: Literal[QuestionParamType.PREDICATE] @overload def __init__( self, *, - identity: Optional[Union[str, RoutineDispatchIdentity]] = ... + instructions: str, + name: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RoutineDispatchIdentity(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AGENT = "agent" - CREATOR = "creator" - - - class azure.ai.projects.models.RoutineDispatchPayload(_Model): - type: str + class azure.ai.projects.models.QuestionParamScore(QuestionParam, discriminator='score'): + instructions: str + levels: list[ScoreLevelParam] + name: Optional[str] + type: Literal[QuestionParamType.SCORE] @overload def __init__( self, *, - type: str + instructions: str, + levels: list[ScoreLevelParam], + name: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RoutineDispatchPayloadType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - INVOKE_AGENT_INVOCATIONS_API = "invoke_agent_invocations_api" - INVOKE_AGENT_RESPONSES_API = "invoke_agent_responses_api" + class azure.ai.projects.models.QuestionParamType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CHOICE = "choice" + PREDICATE = "predicate" + SCORE = "score" - class azure.ai.projects.models.RoutineRun(_Model): - action_correlation_id: Optional[str] - action_type: Optional[Union[str, RoutineActionType]] - agent_endpoint_id: Optional[str] - agent_id: Optional[str] - attempt_source: Optional[Union[str, RoutineAttemptSource]] - conversation_id: Optional[str] - dispatch_id: Optional[str] - ended_at: Optional[datetime] - error_message: Optional[str] - error_status_code: Optional[int] - error_type: Optional[str] - id: str - phase: Optional[Union[str, RoutineRunPhase]] - response_id: Optional[str] - scheduled_fire_at: Optional[datetime] - session_id: Optional[str] - started_at: Optional[datetime] - status: Optional[RoutineRunStatus] - task_id: Optional[str] - trigger_event_payload: Optional[dict[str, Any]] - trigger_name: Optional[str] - trigger_type: Optional[Union[str, RoutineTriggerType]] - triggered_at: Optional[datetime] + class azure.ai.projects.models.RaiConfig(_Model): + invocations_moderation: Optional[RaiInvocationModeration] + rai_policy_name: str @overload def __init__( self, *, - action_correlation_id: Optional[str] = ..., - action_type: Optional[Union[str, RoutineActionType]] = ..., - agent_endpoint_id: Optional[str] = ..., - agent_id: Optional[str] = ..., - attempt_source: Optional[Union[str, RoutineAttemptSource]] = ..., - conversation_id: Optional[str] = ..., - dispatch_id: Optional[str] = ..., - ended_at: Optional[datetime] = ..., - error_message: Optional[str] = ..., - error_status_code: Optional[int] = ..., - error_type: Optional[str] = ..., - phase: Optional[Union[str, RoutineRunPhase]] = ..., - response_id: Optional[str] = ..., - scheduled_fire_at: Optional[datetime] = ..., - session_id: Optional[str] = ..., - started_at: Optional[datetime] = ..., - status: Optional[RoutineRunStatus] = ..., - task_id: Optional[str] = ..., - trigger_event_payload: Optional[dict[str, Any]] = ..., - trigger_name: Optional[str] = ..., - trigger_type: Optional[Union[str, RoutineTriggerType]] = ..., - triggered_at: Optional[datetime] = ... + invocations_moderation: Optional[RaiInvocationModeration] = ..., + rai_policy_name: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RoutineRunPhase(str, Enum, metaclass=CaseInsensitiveEnumMeta): - COMPLETED = "completed" - DISPATCHING = "dispatching" - FAILED = "failed" - QUEUED = "queued" + class azure.ai.projects.models.RaiInvocationContentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + JSON = "json" + TEXT = "text" - class azure.ai.projects.models.RoutineTrigger(_Model): - type: str + class azure.ai.projects.models.RaiInvocationMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BOTH = "both" + NON_STREAMING = "non_streaming" + STREAMING = "streaming" + + + class azure.ai.projects.models.RaiInvocationModeration(_Model): + input_content_type: Optional[Union[str, RaiInvocationContentType]] + input_paths: Optional[list[str]] + output_content_type: Optional[Union[str, RaiInvocationContentType]] + output_paths: Optional[list[str]] + response_mode: Union[str, RaiInvocationMode] + stream_selectors: Optional[list[RaiSseTextSelector]] @overload def __init__( self, *, - type: str + input_content_type: Optional[Union[str, RaiInvocationContentType]] = ..., + input_paths: Optional[list[str]] = ..., + output_content_type: Optional[Union[str, RaiInvocationContentType]] = ..., + output_paths: Optional[list[str]] = ..., + response_mode: Union[str, RaiInvocationMode], + stream_selectors: Optional[list[RaiSseTextSelector]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RoutineTriggerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CUSTOM = "custom" - GITHUB_ISSUE = "github_issue" - SCHEDULE = "schedule" - TIMER = "timer" + class azure.ai.projects.models.RaiSseTextSelector(_Model): + event_type: str + text_field: Optional[str] + + @overload + def __init__( + self, + *, + event_type: str, + text_field: Optional[str] = ... + ) -> None: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RubricBasedEvaluatorDefinition(EvaluatorDefinition, discriminator='rubric'): - data_schema: dict[str, any] - dimensions: list[Dimension] - init_parameters: dict[str, any] - metrics: dict[str, EvaluatorMetric] - pass_threshold: Optional[float] - type: Literal[EvaluatorDefinitionType.RUBRIC] + + class azure.ai.projects.models.RankerVersionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AUTO = "auto" + DEFAULT_2024_11_15 = "default-2024-11-15" + + + class azure.ai.projects.models.RankingOptions(_Model): + hybrid_search: Optional[HybridSearchOptions] + ranker: Optional[Union[str, RankerVersionType]] + score_threshold: Optional[float] @overload def __init__( self, *, - data_schema: Optional[dict[str, Any]] = ..., - dimensions: list[Dimension], - init_parameters: Optional[dict[str, Any]] = ..., - metrics: Optional[dict[str, EvaluatorMetric]] = ..., - pass_threshold: Optional[float] = ... + hybrid_search: Optional[HybridSearchOptions] = ..., + ranker: Optional[Union[str, RankerVersionType]] = ..., + score_threshold: Optional[float] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RubricGenerationInputQualityWarning(_Model): - code: Union[str, RubricGenerationInputQualityWarningCode] - message: str - severity: Union[str, RubricGenerationInputQualityWarningSeverity] - source: Union[str, RubricGenerationInputQualityWarningSource] - source_index: Optional[int] + class azure.ai.projects.models.RealtimeAudioFormats(_Model): + type: str @overload def __init__( self, *, - code: Union[str, RubricGenerationInputQualityWarningCode], - message: str, - severity: Union[str, RubricGenerationInputQualityWarningSeverity], - source: Union[str, RubricGenerationInputQualityWarningSource], - source_index: Optional[int] = ... + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RubricGenerationInputQualityWarningCode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - EMPTY_AGENT_INSTRUCTIONS = "empty_agent_instructions" - EMPTY_DATASET_CONTENT = "empty_dataset_content" - EMPTY_PROMPT = "empty_prompt" - INSUFFICIENT_TOTAL_INPUT = "insufficient_total_input" - LOW_TRACE_COUNT = "low_trace_count" - SHORT_AGENT_INSTRUCTIONS = "short_agent_instructions" - SHORT_DATASET_CONTENT = "short_dataset_content" - SHORT_PROMPT = "short_prompt" + class azure.ai.projects.models.RealtimeAudioFormatsAudioPcm(RealtimeAudioFormats, discriminator='audio/pcm'): + rate: Optional[Literal[24000]] + type: Literal[RealtimeAudioFormatsType.AUDIO_PCM] + + @overload + def __init__( + self, + *, + rate: Optional[Literal[24000]] = ... + ) -> None: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RubricGenerationInputQualityWarningSeverity(str, Enum, metaclass=CaseInsensitiveEnumMeta): - WARNING = "warning" + class azure.ai.projects.models.RealtimeAudioFormatsAudioPcma(RealtimeAudioFormats, discriminator='audio/pcma'): + type: Literal[RealtimeAudioFormatsType.AUDIO_PCMA] - class azure.ai.projects.models.RubricGenerationInputQualityWarningSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AGENT = "agent" - AGGREGATE = "aggregate" - DATASET = "dataset" - PROMPT = "prompt" + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.SASCredentials(BaseCredentials, discriminator='SAS'): - sas_token: Optional[str] - type: Literal[CredentialType.SAS] + class azure.ai.projects.models.RealtimeAudioFormatsAudioPcmu(RealtimeAudioFormats, discriminator='audio/pcmu'): + type: Literal[RealtimeAudioFormatsType.AUDIO_PCMU] @overload def __init__(self) -> None: ... @@ -12758,1545 +12541,4659 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.SampleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - EVALUATION_RESULT_SAMPLE = "EvaluationResultSample" + class azure.ai.projects.models.RealtimeAudioFormatsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AUDIO_PCM = "audio/pcm" + AUDIO_PCMA = "audio/pcma" + AUDIO_PCMU = "audio/pcmu" - class azure.ai.projects.models.Schedule(_Model): - description: Optional[str] - display_name: Optional[str] - enabled: bool - properties: Optional[dict[str, str]] - provisioning_status: Optional[Union[str, ScheduleProvisioningStatus]] - schedule_id: str - system_data: dict[str, str] - tags: Optional[dict[str, str]] - task: ScheduleTask - trigger: Trigger + class azure.ai.projects.models.RealtimeClientEvent(_Model): + type: str @overload def __init__( self, *, - description: Optional[str] = ..., - display_name: Optional[str] = ..., - enabled: bool, - properties: Optional[dict[str, str]] = ..., - tags: Optional[dict[str, str]] = ..., - task: ScheduleTask, - trigger: Trigger + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ScheduleProvisioningStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CREATING = "Creating" - DELETING = "Deleting" - FAILED = "Failed" - SUCCEEDED = "Succeeded" - UPDATING = "Updating" - - - class azure.ai.projects.models.ScheduleRoutineTrigger(RoutineTrigger, discriminator='schedule'): - cron_expression: str - time_zone: str - type: Literal[RoutineTriggerType.SCHEDULE] + class azure.ai.projects.models.RealtimeClientEventConversationItemCreate(RealtimeClientEvent, discriminator='conversation.item.create'): + event_id: Optional[str] + item: RealtimeConversationItem + previous_item_id: Optional[str] + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_CREATE] @overload def __init__( self, *, - cron_expression: str, - time_zone: str + event_id: Optional[str] = ..., + item: RealtimeConversationItem, + previous_item_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ScheduleRun(_Model): - error: Optional[str] - properties: dict[str, str] - run_id: str - schedule_id: str - success: bool - trigger_time: Optional[datetime] + class azure.ai.projects.models.RealtimeClientEventConversationItemDelete(RealtimeClientEvent, discriminator='conversation.item.delete'): + event_id: Optional[str] + item_id: str + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_DELETE] @overload def __init__( self, *, - schedule_id: str, - trigger_time: Optional[datetime] = ... + event_id: Optional[str] = ..., + item_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ScheduleTask(_Model): - configuration: Optional[dict[str, str]] - type: str + class azure.ai.projects.models.RealtimeClientEventConversationItemRetrieve(RealtimeClientEvent, discriminator='conversation.item.retrieve'): + event_id: Optional[str] + item_id: str + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE] @overload def __init__( self, *, - configuration: Optional[dict[str, str]] = ..., - type: str + event_id: Optional[str] = ..., + item_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ScheduleTaskType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - EVALUATION = "Evaluation" - INSIGHT = "Insight" - - - class azure.ai.projects.models.SearchContentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - IMAGE = "image" - TEXT = "text" - - - class azure.ai.projects.models.SearchContextSize(str, Enum, metaclass=CaseInsensitiveEnumMeta): - HIGH = "high" - LOW = "low" - MEDIUM = "medium" - - - class azure.ai.projects.models.SessionConfiguration(_Model): - idle_timeout_seconds: Optional[timedelta] + class azure.ai.projects.models.RealtimeClientEventConversationItemTruncate(RealtimeClientEvent, discriminator='conversation.item.truncate'): + audio_end_ms: int + content_index: int + event_id: Optional[str] + item_id: str + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_TRUNCATE] @overload def __init__( self, *, - idle_timeout_seconds: Optional[timedelta] = ... + audio_end_ms: int, + content_index: int, + event_id: Optional[str] = ..., + item_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.SessionDirectoryEntry(_Model): - is_directory: bool - modified_time: datetime - name: str - size: int + class azure.ai.projects.models.RealtimeClientEventInputAudioBufferAppend(RealtimeClientEvent, discriminator='input_audio_buffer.append'): + audio: str + event_id: Optional[str] + type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_APPEND] @overload def __init__( self, *, - is_directory: bool, - modified_time: datetime, - name: str, - size: int + audio: str, + event_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.SessionFileWriteResult(_Model): - bytes_written: int - path: str + class azure.ai.projects.models.RealtimeClientEventInputAudioBufferClear(RealtimeClientEvent, discriminator='input_audio_buffer.clear'): + event_id: Optional[str] + type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR] @overload def __init__( self, *, - bytes_written: int, - path: str + event_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.SessionLogEvent(_Model): - data: str - event: Union[str, SessionLogEventType] + class azure.ai.projects.models.RealtimeClientEventInputAudioBufferCommit(RealtimeClientEvent, discriminator='input_audio_buffer.commit'): + event_id: Optional[str] + type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT] @overload def __init__( self, *, - data: str, - event: Union[str, SessionLogEventType] + event_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.SessionLogEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - LOG = "log" - - - class azure.ai.projects.models.SharepointGroundingToolParameters(_Model): - project_connections: Optional[list[ToolProjectConnection]] + class azure.ai.projects.models.RealtimeClientEventOutputAudioBufferClear(RealtimeClientEvent, discriminator='output_audio_buffer.clear'): + event_id: Optional[str] + type: Literal[RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR] @overload def __init__( self, *, - project_connections: Optional[list[ToolProjectConnection]] = ... + event_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.SharepointPreviewTool(Tool, discriminator='sharepoint_grounding_preview'): - sharepoint_grounding_preview: SharepointGroundingToolParameters - type: Literal[ToolType.SHAREPOINT_GROUNDING_PREVIEW] + class azure.ai.projects.models.RealtimeClientEventResponseCancel(RealtimeClientEvent, discriminator='response.cancel'): + event_id: Optional[str] + response_id: Optional[str] + type: Literal[RealtimeClientEventType.RESPONSE_CANCEL] @overload def __init__( self, *, - sharepoint_grounding_preview: SharepointGroundingToolParameters + event_id: Optional[str] = ..., + response_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ShellToolboxTool(ToolboxTool, discriminator='shell'): - allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] - description: str - environment: ToolboxShellEnvironment - name: str - tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.SHELL] + class azure.ai.projects.models.RealtimeClientEventResponseCreate(RealtimeClientEvent, discriminator='response.create'): + event_id: Optional[str] + response: Optional[VoiceAgentResponseCreateParams] + type: Literal[RealtimeClientEventType.RESPONSE_CREATE] @overload def __init__( self, *, - allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ..., - description: Optional[str] = ..., - environment: ToolboxShellEnvironment, - name: Optional[str] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ... + event_id: Optional[str] = ..., + response: Optional[VoiceAgentResponseCreateParams] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.SimpleQnADataGenerationJobConfiguration(DataGenerationJobConfiguration, discriminator='simple_qna'): - max_samples: int - model_options: DataGenerationModelOptions - question_types: Optional[list[Union[str, SimpleQnAFineTuningQuestionType]]] - train_split: float - type: Literal[DataGenerationJobType.SIMPLE_QNA] + class azure.ai.projects.models.RealtimeClientEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CONVERSATION_ITEM_CREATE = "conversation.item.create" + CONVERSATION_ITEM_DELETE = "conversation.item.delete" + CONVERSATION_ITEM_RETRIEVE = "conversation.item.retrieve" + CONVERSATION_ITEM_TRUNCATE = "conversation.item.truncate" + INPUT_AUDIO_BUFFER_APPEND = "input_audio_buffer.append" + INPUT_AUDIO_BUFFER_CLEAR = "input_audio_buffer.clear" + INPUT_AUDIO_BUFFER_COMMIT = "input_audio_buffer.commit" + OUTPUT_AUDIO_BUFFER_CLEAR = "output_audio_buffer.clear" + RESPONSE_CANCEL = "response.cancel" + RESPONSE_CREATE = "response.create" + RTC_CALL_SDP_CREATE = "rtc.call.sdp.create" + SESSION_AVATAR_CONNECT = "session.avatar.connect" + SESSION_UPDATE = "session.update" + + + class azure.ai.projects.models.RealtimeConversationItem(_Model): + type: str @overload def __init__( self, *, - max_samples: int, - model_options: Optional[DataGenerationModelOptions] = ..., - question_types: Optional[list[Union[str, SimpleQnAFineTuningQuestionType]]] = ..., - train_split: Optional[float] = ... + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.SimpleQnAFineTuningQuestionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - LONG_ANSWER = "long_answer" - SHORT_ANSWER = "short_answer" - - - class azure.ai.projects.models.SimulationSeedDataGenerationJobConfiguration(DataGenerationJobConfiguration, discriminator='simulation_seed'): - model_options: DataGenerationModelOptions - train_split: float - type: Literal[DataGenerationJobType.SIMULATION_SEED] + class azure.ai.projects.models.RealtimeConversationItemFunctionCall(RealtimeConversationItem, discriminator='function_call'): + arguments: str + call_id: Optional[str] + created_at: Optional[datetime] + id: Optional[str] + name: str + object: Optional[Literal["item"]] + response_id: Optional[str] + status: Optional[Literal["completed", "incomplete", "in_progress"]] + type: Literal[RealtimeConversationItemType.FUNCTION_CALL] @overload def __init__( self, *, - model_options: Optional[DataGenerationModelOptions] = ..., - train_split: Optional[float] = ... + arguments: str, + call_id: Optional[str] = ..., + id: Optional[str] = ..., + name: str, + object: Optional[Literal[item]] = ..., + status: Optional[Literal[completed, incomplete, in_progress]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.SipTelephonyTransferDestination(TelephonyTransferDestination, discriminator='sip'): - kind: Literal[TelephonyTransferDestinationKind.SIP] - value: str + class azure.ai.projects.models.RealtimeConversationItemFunctionCallOutput(RealtimeConversationItem, discriminator='function_call_output'): + call_id: str + created_at: Optional[datetime] + id: Optional[str] + name: Optional[str] + object: Optional[Literal["item"]] + output: str + response_id: Optional[str] + status: Optional[Literal["completed", "incomplete", "in_progress"]] + type: Literal[RealtimeConversationItemType.FUNCTION_CALL_OUTPUT] @overload def __init__( self, *, - value: str + call_id: str, + id: Optional[str] = ..., + name: Optional[str] = ..., + object: Optional[Literal[item]] = ..., + output: str, + status: Optional[Literal[completed, incomplete, in_progress]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.SkillDetails(_Model): - created_at: datetime - default_version: str - description: str - id: str - latest_version: str - name: str + class azure.ai.projects.models.RealtimeConversationItemMessage(RealtimeConversationItem, discriminator='message'): + role: str + type: Literal[RealtimeConversationItemType.MESSAGE] @overload def __init__( self, *, - created_at: datetime, - default_version: str, - description: str, - id: str, - latest_version: str, - name: str + role: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.SkillInlineContent(_Model): - allowed_tools: Optional[list[str]] - compatibility: Optional[str] - description: str - instructions: str - license: Optional[str] - metadata: Optional[dict[str, str]] + class azure.ai.projects.models.RealtimeConversationItemMessageAssistant(RealtimeConversationItemMessage, discriminator='assistant'): + content: list[RealtimeConversationItemMessageAssistantContent] + created_at: Optional[datetime] + id: Optional[str] + object: Optional[Literal["item"]] + response_id: Optional[str] + role: Literal[RealtimeConversationItemMessageType.ASSISTANT] + status: Optional[Literal["completed", "incomplete", "in_progress"]] + type: Union[str, azure.ai.projects.models.MESSAGE] @overload def __init__( self, *, - allowed_tools: Optional[list[str]] = ..., - compatibility: Optional[str] = ..., - description: str, - instructions: str, - license: Optional[str] = ..., - metadata: Optional[dict[str, str]] = ... + content: list[RealtimeConversationItemMessageAssistantContent], + id: Optional[str] = ..., + object: Optional[Literal[item]] = ..., + status: Optional[Literal[completed, incomplete, in_progress]] = ..., + type: Literal[RealtimeConversationItemType.MESSAGE] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.SkillReference(_Model): - name: str - version: Optional[str] + class azure.ai.projects.models.RealtimeConversationItemMessageAssistantContent(_Model): + audio: Optional[str] + text: Optional[str] + transcript: Optional[str] + type: Optional[Literal["output_text", "output_audio"]] @overload def __init__( self, *, - name: str, - version: Optional[str] = ... + audio: Optional[str] = ..., + text: Optional[str] = ..., + transcript: Optional[str] = ..., + type: Optional[Literal[output_text, output_audio]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.SkillReferenceParam(ContainerSkill, discriminator='skill_reference'): - skill_id: str - type: Literal[ContainerSkillType.SKILL_REFERENCE] - version: Optional[str] + class azure.ai.projects.models.RealtimeConversationItemMessageSystem(RealtimeConversationItemMessage, discriminator='system'): + content: list[RealtimeConversationItemMessageSystemContent] + created_at: Optional[datetime] + id: Optional[str] + object: Optional[Literal["item"]] + response_id: Optional[str] + role: Literal[RealtimeConversationItemMessageType.SYSTEM] + status: Optional[Literal["completed", "incomplete", "in_progress"]] + type: Union[str, azure.ai.projects.models.MESSAGE] @overload def __init__( self, *, - skill_id: str, - version: Optional[str] = ... + content: list[RealtimeConversationItemMessageSystemContent], + id: Optional[str] = ..., + object: Optional[Literal[item]] = ..., + status: Optional[Literal[completed, incomplete, in_progress]] = ..., + type: Literal[RealtimeConversationItemType.MESSAGE] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.SkillVersion(_Model): - created_at: datetime - description: str - id: str - name: str - skill_id: str - version: str + class azure.ai.projects.models.RealtimeConversationItemMessageSystemContent(_Model): + text: Optional[str] + type: Optional[Literal["input_text"]] @overload def __init__( self, *, - created_at: datetime, - description: str, - id: str, - name: str, - skill_id: str, - version: str + text: Optional[str] = ..., + type: Optional[Literal[input_text]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.SpecificApplyPatchParam(ToolChoiceParam, discriminator='apply_patch'): - type: Literal[ToolChoiceParamType.APPLY_PATCH] - - @overload - def __init__(self) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.RealtimeConversationItemMessageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ASSISTANT = "assistant" + SYSTEM = "system" + USER = "user" - class azure.ai.projects.models.SpecificFunctionShellParam(ToolChoiceParam, discriminator='shell'): - type: Literal[ToolChoiceParamType.SHELL] - - @overload - def __init__(self) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.SpecificProgrammaticToolCallingParam(ToolChoiceParam, discriminator='programmatic_tool_calling'): - type: Literal[ToolChoiceParamType.PROGRAMMATIC_TOOL_CALLING] + class azure.ai.projects.models.RealtimeConversationItemMessageUser(RealtimeConversationItemMessage, discriminator='user'): + content: list[RealtimeConversationItemMessageUserContent] + created_at: Optional[datetime] + id: Optional[str] + object: Optional[Literal["item"]] + response_id: Optional[str] + role: Literal[RealtimeConversationItemMessageType.USER] + status: Optional[Literal["completed", "incomplete", "in_progress"]] + type: Union[str, azure.ai.projects.models.MESSAGE] @overload - def __init__(self) -> None: ... + def __init__( + self, + *, + content: list[RealtimeConversationItemMessageUserContent], + id: Optional[str] = ..., + object: Optional[Literal[item]] = ..., + status: Optional[Literal[completed, incomplete, in_progress]] = ..., + type: Literal[RealtimeConversationItemType.MESSAGE] + ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.SteeringPromptOptimizationContext(OptimizationContext, discriminator='steering_prompt'): - prompt: str - type: Literal[OptimizationContextType.STEERING_PROMPT] + class azure.ai.projects.models.RealtimeConversationItemMessageUserContent(_Model): + audio: Optional[str] + detail: Optional[Literal["auto", "low", "high"]] + image_url: Optional[str] + text: Optional[str] + transcript: Optional[str] + type: Optional[Literal["input_text", "input_audio", "input_image"]] @overload def __init__( self, *, - prompt: str + audio: Optional[str] = ..., + detail: Optional[Literal[auto, low, high]] = ..., + image_url: Optional[str] = ..., + text: Optional[str] = ..., + transcript: Optional[str] = ..., + type: Optional[Literal[input_text, input_audio, input_image]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.StructuredInputDefinition(_Model): - default_value: Optional[Any] + class azure.ai.projects.models.RealtimeConversationItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FUNCTION_CALL = "function_call" + FUNCTION_CALL_OUTPUT = "function_call_output" + MCP_APPROVAL_REQUEST = "mcp_approval_request" + MCP_APPROVAL_RESPONSE = "mcp_approval_response" + MCP_CALL = "mcp_call" + MCP_LIST_TOOLS = "mcp_list_tools" + MESSAGE = "message" + + + class azure.ai.projects.models.RealtimeFunctionTool(_Model): description: Optional[str] - required: Optional[bool] - schema: Optional[dict[str, Any]] + name: Optional[str] + parameters: Optional[RealtimeFunctionToolParameters] + type: Optional[Literal["function"]] @overload def __init__( self, *, - default_value: Optional[Any] = ..., description: Optional[str] = ..., - required: Optional[bool] = ..., - schema: Optional[dict[str, Any]] = ... + name: Optional[str] = ..., + parameters: Optional[RealtimeFunctionToolParameters] = ..., + type: Optional[Literal[function]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.StructuredOutputDefinition(_Model): - description: str + class azure.ai.projects.models.RealtimeFunctionToolParameters(_Model): + + + class azure.ai.projects.models.RealtimeMCPApprovalRequest(RealtimeConversationItem, discriminator='mcp_approval_request'): + arguments: str + created_at: Optional[datetime] + id: str name: str - schema: dict[str, Any] - strict: bool + response_id: Optional[str] + server_label: str + type: Literal[RealtimeConversationItemType.MCP_APPROVAL_REQUEST] @overload def __init__( self, *, - description: str, + arguments: str, + id: str, name: str, - schema: dict[str, Any], - strict: bool + server_label: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.SupervisedFineTuningDataGenerationJob(DataGenerationJob, discriminator='supervised_finetuning_preview'): - created_at: datetime - error: ApiError - finished_at: datetime - generation_configuration: DataGenerationJobConfiguration + class azure.ai.projects.models.RealtimeMCPApprovalResponse(RealtimeConversationItem, discriminator='mcp_approval_response'): + approval_request_id: str + approve: bool + created_at: Optional[datetime] id: str - name: str - output_configuration: Optional[SupervisedFineTuningDataGenerationJobOutputConfiguration] - result: DataGenerationJobResult - scenario: Literal[DataGenerationJobScenario.SUPERVISED_FINETUNING_PREVIEW] - sources: list[DataGenerationJobSource] - status: Union[str, JobStatus] + reason: Optional[str] + response_id: Optional[str] + type: Literal[RealtimeConversationItemType.MCP_APPROVAL_RESPONSE] @overload def __init__( self, *, - generation_configuration: DataGenerationJobConfiguration, - name: str, - output_configuration: Optional[SupervisedFineTuningDataGenerationJobOutputConfiguration] = ..., - sources: list[DataGenerationJobSource] + approval_request_id: str, + approve: bool, + id: str, + reason: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.SupervisedFineTuningDataGenerationJobInputs(DataGenerationJobInputs, discriminator='supervised_finetuning_preview'): - generation_configuration: DataGenerationJobConfiguration - name: str - output_configuration: Optional[SupervisedFineTuningDataGenerationJobOutputConfiguration] - scenario: Literal[DataGenerationJobScenario.SUPERVISED_FINETUNING_PREVIEW] - sources: list[DataGenerationJobSource] + class azure.ai.projects.models.RealtimeMCPError(_Model): + type: str @overload def __init__( self, *, - generation_configuration: DataGenerationJobConfiguration, - name: str, - output_configuration: Optional[SupervisedFineTuningDataGenerationJobOutputConfiguration] = ..., - sources: list[DataGenerationJobSource] + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.SupervisedFineTuningDataGenerationJobOutputConfiguration(_Model): - merge_file_id: Optional[str] - name: str - write_mode: Optional[Union[str, DataGenerationJobOutputWriteMode]] + class azure.ai.projects.models.RealtimeMCPHTTPError(RealtimeMCPError, discriminator='http_error'): + code: int + message: str + type: Literal[RealtimeMcpErrorType.HTTP_ERROR] @overload def __init__( self, *, - merge_file_id: Optional[str] = ..., - name: str, - write_mode: Optional[Union[str, DataGenerationJobOutputWriteMode]] = ... + code: int, + message: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TargetAttribute(str, Enum, metaclass=CaseInsensitiveEnumMeta): - INSTRUCTIONS = "instructions" - MODEL = "model" - SKILLS = "skills" - TOOLS = "tools" + class azure.ai.projects.models.RealtimeMCPListTools(RealtimeConversationItem, discriminator='mcp_list_tools'): + created_at: Optional[datetime] + id: Optional[str] + response_id: Optional[str] + server_label: str + tools: list[MCPListToolsTool] + type: Literal[RealtimeConversationItemType.MCP_LIST_TOOLS] + @overload + def __init__( + self, + *, + id: Optional[str] = ..., + server_label: str, + tools: list[MCPListToolsTool] + ) -> None: ... - class azure.ai.projects.models.TargetCompletionEvalRunDataSource(TypedDict, total=False): - key "input_messages": Required[InputMessagesItemReference] - key "source": Required[Union[SourceFileContent, SourceFileID]] - key "target": Required[Union[AzureAIAgentTargetParam, AzureAIModelTargetParam, dict[str, Any]]] - key "type": Required[Literal["azure_ai_target_completions"]] + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TaxonomyCategory(_Model): - description: Optional[str] - id: str - name: str - properties: Optional[dict[str, str]] - risk_category: Union[str, RiskCategory] - sub_categories: list[TaxonomySubCategory] + class azure.ai.projects.models.RealtimeMCPProtocolError(RealtimeMCPError, discriminator='protocol_error'): + code: int + message: str + type: Literal[RealtimeMcpErrorType.PROTOCOL_ERROR] @overload def __init__( self, *, - description: Optional[str] = ..., - id: str, - name: str, - properties: Optional[dict[str, str]] = ..., - risk_category: Union[str, RiskCategory], - sub_categories: list[TaxonomySubCategory] + code: int, + message: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TaxonomySubCategory(_Model): - description: Optional[str] - enabled: bool + class azure.ai.projects.models.RealtimeMCPToolCall(RealtimeConversationItem, discriminator='mcp_call'): + approval_request_id: Optional[str] + arguments: str + created_at: Optional[datetime] + error: Optional[RealtimeMCPError] id: str name: str - properties: Optional[dict[str, str]] + output: Optional[str] + response_id: Optional[str] + server_label: str + type: Literal[RealtimeConversationItemType.MCP_CALL] @overload def __init__( self, *, - description: Optional[str] = ..., - enabled: bool, + approval_request_id: Optional[str] = ..., + arguments: str, + error: Optional[RealtimeMCPError] = ..., id: str, name: str, - properties: Optional[dict[str, str]] = ... + output: Optional[str] = ..., + server_label: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TeamsPhoneExtensibilityTelephonyBinding(TelephonyBinding, discriminator='teams_phone_extensibility'): - connection_name: str - id: str - incoming_call_url: str - label: str - phone_number: Optional[str] - provider: Literal[TelephonyProvider.TEAMS_PHONE_EXTENSIBILITY] - resource_account_object_id: str - status: Union[str, TelephonyBindingStatus] + class azure.ai.projects.models.RealtimeMCPToolExecutionError(RealtimeMCPError, discriminator='tool_execution_error'): + message: str + type: Literal[RealtimeMcpErrorType.TOOL_EXECUTION_ERROR] @overload def __init__( self, *, - connection_name: str, - id: str, - incoming_call_url: str, - label: Optional[str] = ..., - phone_number: Optional[str] = ..., - resource_account_object_id: str, - status: Union[str, TelephonyBindingStatus] + message: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TeamsPhoneExtensibilityTelephonyBindingListItem(TelephonyBindingListItem, discriminator='teams_phone_extensibility'): - connection_name: str - etag: str - id: str - incoming_call_url: str - label: str - phone_number: Optional[str] - provider: Literal[TelephonyProvider.TEAMS_PHONE_EXTENSIBILITY] - resource_account_object_id: str - status: Union[str, TelephonyBindingStatus] + class azure.ai.projects.models.RealtimeMcpErrorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + HTTP_ERROR = "http_error" + PROTOCOL_ERROR = "protocol_error" + TOOL_EXECUTION_ERROR = "tool_execution_error" + + + class azure.ai.projects.models.RealtimeReasoning(_Model): + effort: Optional[Union[str, RealtimeReasoningEffort]] @overload def __init__( self, *, - connection_name: str, - id: str, - incoming_call_url: str, - label: Optional[str] = ..., - phone_number: Optional[str] = ..., - resource_account_object_id: str, - status: Union[str, TelephonyBindingStatus] + effort: Optional[Union[str, RealtimeReasoningEffort]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TeamsTelephonyTransferDestination(TelephonyTransferDestination, discriminator='teams'): - kind: Literal[TelephonyTransferDestinationKind.TEAMS] - value: str + class azure.ai.projects.models.RealtimeReasoningEffort(str, Enum, metaclass=CaseInsensitiveEnumMeta): + HIGH = "high" + LOW = "low" + MEDIUM = "medium" + MINIMAL = "minimal" + XHIGH = "xhigh" + + + class azure.ai.projects.models.RealtimeResponseStatusDetails(_Model): + error: Optional[RealtimeResponseStatusDetailsError] + reason: Optional[Literal["turn_detected", "client_cancelled", "max_output_tokens", "content_filter"]] + type: Optional[Literal["completed", "cancelled", "failed", "incomplete"]] @overload def __init__( self, *, - value: str + error: Optional[RealtimeResponseStatusDetailsError] = ..., + reason: Optional[Literal[turn_detected, client_cancelled, max_output_tokens, content_filter]] = ..., + type: Optional[Literal[completed, cancelled, failed, incomplete]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TelemetryConfig(_Model): - endpoints: list[TelemetryEndpoint] + class azure.ai.projects.models.RealtimeResponseStatusDetailsError(_Model): + code: Optional[str] + message: Optional[str] + type: Optional[str] @overload def __init__( self, *, - endpoints: list[TelemetryEndpoint] + code: Optional[str] = ..., + message: Optional[str] = ..., + type: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TelemetryDataKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CONTAINER_OTEL = "ContainerOtel" - CONTAINER_STDOUT_STDERR = "ContainerStdoutStderr" - METRICS = "Metrics" - - - class azure.ai.projects.models.TelemetryEndpoint(_Model): - auth: Optional[TelemetryEndpointAuth] - data: list[Union[str, TelemetryDataKind]] - kind: str + class azure.ai.projects.models.RealtimeResponseUsage(_Model): + input_token_details: Optional[RealtimeResponseUsageInputTokenDetails] + input_tokens: Optional[int] + output_token_details: Optional[RealtimeResponseUsageOutputTokenDetails] + output_tokens: Optional[int] + total_tokens: Optional[int] @overload def __init__( self, *, - auth: Optional[TelemetryEndpointAuth] = ..., - data: list[Union[str, TelemetryDataKind]], - kind: str + input_token_details: Optional[RealtimeResponseUsageInputTokenDetails] = ..., + input_tokens: Optional[int] = ..., + output_token_details: Optional[RealtimeResponseUsageOutputTokenDetails] = ..., + output_tokens: Optional[int] = ..., + total_tokens: Optional[int] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TelemetryEndpointAuth(_Model): - type: str + class azure.ai.projects.models.RealtimeResponseUsageInputTokenDetails(_Model): + audio_tokens: Optional[int] + cached_tokens: Optional[int] + cached_tokens_details: Optional[RealtimeResponseUsageInputTokenDetailsCachedTokensDetails] + image_tokens: Optional[int] + text_tokens: Optional[int] @overload def __init__( self, *, - type: str + audio_tokens: Optional[int] = ..., + cached_tokens: Optional[int] = ..., + cached_tokens_details: Optional[RealtimeResponseUsageInputTokenDetailsCachedTokensDetails] = ..., + image_tokens: Optional[int] = ..., + text_tokens: Optional[int] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TelemetryEndpointAuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - HEADER = "header" - - - class azure.ai.projects.models.TelemetryEndpointKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): - OTLP = "OTLP" + class azure.ai.projects.models.RealtimeResponseUsageInputTokenDetailsCachedTokensDetails(_Model): + audio_tokens: Optional[int] + image_tokens: Optional[int] + text_tokens: Optional[int] + @overload + def __init__( + self, + *, + audio_tokens: Optional[int] = ..., + image_tokens: Optional[int] = ..., + text_tokens: Optional[int] = ... + ) -> None: ... - class azure.ai.projects.models.TelemetryTransportProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): - GRPC = "Grpc" - HTTP = "Http" + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TelephonyBinding(_Model): - connection_name: str - id: str - incoming_call_url: str - label: Optional[str] - provider: str - status: Union[str, TelephonyBindingStatus] + class azure.ai.projects.models.RealtimeResponseUsageOutputTokenDetails(_Model): + audio_tokens: Optional[int] + text_tokens: Optional[int] @overload def __init__( self, *, - connection_name: str, - id: str, - incoming_call_url: str, - label: Optional[str] = ..., - provider: str, - status: Union[str, TelephonyBindingStatus] + audio_tokens: Optional[int] = ..., + text_tokens: Optional[int] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TelephonyBindingListItem(_Model): - connection_name: str - etag: str - id: str - incoming_call_url: str - label: Optional[str] - provider: str - status: Union[str, TelephonyBindingStatus] + class azure.ai.projects.models.RealtimeServerEvent(_Model): + type: str @overload def __init__( self, *, - connection_name: str, - id: str, - incoming_call_url: str, - label: Optional[str] = ..., - provider: str, - status: Union[str, TelephonyBindingStatus] + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TelephonyBindingStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ACTIVE = "active" - SUSPENDED = "suspended" - - - class azure.ai.projects.models.TelephonyCallDurationBasis(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ANSWERED = "answered" - RECEIVED = "received" + class azure.ai.projects.models.RealtimeServerEventConversationItemAdded(RealtimeServerEvent, discriminator='conversation.item.added'): + event_id: str + item: RealtimeConversationItem + previous_item_id: Optional[str] + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED] + @overload + def __init__( + self, + *, + event_id: str, + item: RealtimeConversationItem, + previous_item_id: Optional[str] = ... + ) -> None: ... - class azure.ai.projects.models.TelephonyCallEndReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ADMISSION_CHECK_FAILED = "admission_check_failed" - ADMISSION_REJECTED = "admission_rejected" - AGENT_SESSION_CONNECT_FAILED = "agent_session_connect_failed" - ANSWER_FAILED = "answer_failed" - BINDING_NOT_FOUND = "binding_not_found" - BINDING_SUSPENDED = "binding_suspended" - BRIDGE_CANCELLED = "bridge_cancelled" - BRIDGE_FAILED = "bridge_failed" - CREDENTIAL_RESOLUTION_FAILED = "credential_resolution_failed" - ENDPOINT_RESOLUTION_FAILED = "endpoint_resolution_failed" - INGRESS_SETUP_FAILED = "ingress_setup_failed" - INVALID_BINDING_CONFIGURATION = "invalid_binding_configuration" - INVALID_WEBHOOK_PAYLOAD = "invalid_webhook_payload" - LIVE_CALL_CONFLICT = "live_call_conflict" - LIVE_CALL_PERSISTENCE_FAILED = "live_call_persistence_failed" - MANAGED_HANGUP = "managed_hangup" - MANAGED_TRANSFER = "managed_transfer" - MANAGE_HANGUP_FAILED = "manage_hangup_failed" - MANAGE_TRANSFER_FAILED = "manage_transfer_failed" - MEDIA_STREAM_ENDED = "media_stream_ended" - PROVIDER_BUSY = "provider_busy" - PROVIDER_CANCELLED = "provider_cancelled" - PROVIDER_DISCONNECTED = "provider_disconnected" - PROVIDER_FAILED = "provider_failed" - PROVIDER_NO_ANSWER = "provider_no_answer" - PROVIDER_RESOURCE_MISMATCH = "provider_resource_mismatch" - PROVIDER_STREAM_ERROR = "provider_stream_error" - PROVIDER_STREAM_STOPPED = "provider_stream_stopped" - ROUTE_AGENT_MISMATCH = "route_agent_mismatch" - WEBHOOK_VALIDATION_FAILED = "webhook_validation_failed" + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TelephonyCallJob(_Model): - agent_name: str - attempt_count: int - cancellation: Optional[TelephonyCallJobCancellation] - connection_name: str - created_at: datetime - destination: TelephonyOutboundDestination - id: str - next_attempt_at: Optional[datetime] - object: Literal["call_job"] - purpose: Optional[str] - retry_policy: TelephonyOutboundRetryPolicy - revision: int - schedule: Optional[TelephonyCallJobSchedule] - source: str - status: Union[str, TelephonyCallJobStatus] - structured_inputs: Optional[dict[str, Any]] - terminal_reason: Optional[Union[str, TelephonyCallJobTerminalReason]] - updated_at: datetime + class azure.ai.projects.models.RealtimeServerEventConversationItemCreated(RealtimeServerEvent, discriminator='conversation.item.created'): + event_id: str + item: RealtimeConversationItem + previous_item_id: Optional[str] + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED] @overload def __init__( self, *, - agent_name: str, - attempt_count: int, - cancellation: Optional[TelephonyCallJobCancellation] = ..., - connection_name: str, - created_at: datetime, - destination: TelephonyOutboundDestination, - id: str, - next_attempt_at: Optional[datetime] = ..., - purpose: Optional[str] = ..., - retry_policy: TelephonyOutboundRetryPolicy, - revision: int, - schedule: Optional[TelephonyCallJobSchedule] = ..., - source: str, - status: Union[str, TelephonyCallJobStatus], - structured_inputs: Optional[dict[str, Any]] = ..., - terminal_reason: Optional[Union[str, TelephonyCallJobTerminalReason]] = ..., - updated_at: datetime + event_id: str, + item: RealtimeConversationItem, + previous_item_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TelephonyCallJobCancellation(_Model): - mode: str - requested_at: datetime - requested_by: str - revision: int + class azure.ai.projects.models.RealtimeServerEventConversationItemDeleted(RealtimeServerEvent, discriminator='conversation.item.deleted'): + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DELETED] @overload def __init__( self, *, - mode: str, - requested_at: datetime, - requested_by: str, - revision: int + event_id: str, + item_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TelephonyCallJobSchedule(_Model): - expires_at: Optional[datetime] - not_before: Optional[datetime] + class azure.ai.projects.models.RealtimeServerEventConversationItemDone(RealtimeServerEvent, discriminator='conversation.item.done'): + event_id: str + item: RealtimeConversationItem + previous_item_id: Optional[str] + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE] @overload def __init__( self, *, - expires_at: Optional[datetime] = ..., - not_before: Optional[datetime] = ... + event_id: str, + item: RealtimeConversationItem, + previous_item_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TelephonyCallJobStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ACCEPTED = "accepted" - BLOCKED = "blocked" - CANCELLATION_REQUESTED = "cancellation_requested" - CANCELLED = "cancelled" - COMPLETED = "completed" + class azure.ai.projects.models.RealtimeServerEventConversationItemInputAudioTranscriptionCompleted(RealtimeServerEvent, discriminator='conversation.item.input_audio_transcription.completed'): + content_index: int + event_id: str + item_id: str + languages: Optional[list[TranscriptionLanguage]] + logprobs: Optional[list[LogProbProperties]] + phrases: Optional[list[VoiceAgentTranscriptionPhrase]] + transcript: str + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED] + usage: Union[TranscriptTextUsageTokens, TranscriptTextUsageDuration] + + @overload + def __init__( + self, + *, + content_index: int, + event_id: str, + item_id: str, + languages: Optional[list[TranscriptionLanguage]] = ..., + logprobs: Optional[list[LogProbProperties]] = ..., + phrases: Optional[list[VoiceAgentTranscriptionPhrase]] = ..., + transcript: str, + usage: Union[TranscriptTextUsageTokens, TranscriptTextUsageDuration] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RealtimeServerEventConversationItemInputAudioTranscriptionDelta(RealtimeServerEvent, discriminator='conversation.item.input_audio_transcription.delta'): + content_index: Optional[int] + delta: Optional[str] + event_id: str + item_id: str + logprobs: Optional[list[LogProbProperties]] + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA] + + @overload + def __init__( + self, + *, + content_index: Optional[int] = ..., + delta: Optional[str] = ..., + event_id: str, + item_id: str, + logprobs: Optional[list[LogProbProperties]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RealtimeServerEventConversationItemInputAudioTranscriptionFailed(RealtimeServerEvent, discriminator='conversation.item.input_audio_transcription.failed'): + content_index: int + error: RealtimeServerEventConversationItemInputAudioTranscriptionFailedError + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED] + + @overload + def __init__( + self, + *, + content_index: int, + error: RealtimeServerEventConversationItemInputAudioTranscriptionFailedError, + event_id: str, + item_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RealtimeServerEventConversationItemInputAudioTranscriptionFailedError(_Model): + code: Optional[str] + message: Optional[str] + param: Optional[str] + type: Optional[str] + + @overload + def __init__( + self, + *, + code: Optional[str] = ..., + message: Optional[str] = ..., + param: Optional[str] = ..., + type: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RealtimeServerEventConversationItemInputAudioTranscriptionSegment(RealtimeServerEvent, discriminator='conversation.item.input_audio_transcription.segment'): + content_index: int + end: float + event_id: str + id: str + item_id: str + speaker: str + start: float + text: str + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT] + + @overload + def __init__( + self, + *, + content_index: int, + end: float, + event_id: str, + id: str, + item_id: str, + speaker: str, + start: float, + text: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RealtimeServerEventConversationItemRetrieved(RealtimeServerEvent, discriminator='conversation.item.retrieved'): + event_id: str + item: RealtimeConversationItem + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED] + + @overload + def __init__( + self, + *, + event_id: str, + item: RealtimeConversationItem + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RealtimeServerEventConversationItemTruncated(RealtimeServerEvent, discriminator='conversation.item.truncated'): + audio_end_ms: int + content_index: int + event_id: str + item: Optional[RealtimeConversationItem] + item_id: str + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_TRUNCATED] + + @overload + def __init__( + self, + *, + audio_end_ms: int, + content_index: int, + event_id: str, + item: Optional[RealtimeConversationItem] = ..., + item_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RealtimeServerEventError(_Model): + error: RealtimeServerEventErrorError + event_id: str + type: Literal["error"] + + @overload + def __init__( + self, + *, + error: RealtimeServerEventErrorError, + event_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RealtimeServerEventErrorError(_Model): + code: Optional[str] + event_id: Optional[str] + message: str + param: Optional[str] + type: str + + @overload + def __init__( + self, + *, + code: Optional[str] = ..., + event_id: Optional[str] = ..., + message: str, + param: Optional[str] = ..., + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RealtimeServerEventInputAudioBufferCleared(RealtimeServerEvent, discriminator='input_audio_buffer.cleared'): + event_id: str + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_CLEARED] + + @overload + def __init__( + self, + *, + event_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RealtimeServerEventInputAudioBufferCommitted(RealtimeServerEvent, discriminator='input_audio_buffer.committed'): + event_id: str + item_id: str + previous_item_id: Optional[str] + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_COMMITTED] + + @overload + def __init__( + self, + *, + event_id: str, + item_id: str, + previous_item_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RealtimeServerEventInputAudioBufferSpeechStarted(RealtimeServerEvent, discriminator='input_audio_buffer.speech_started'): + audio_start_ms: int + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STARTED] + + @overload + def __init__( + self, + *, + audio_start_ms: int, + event_id: str, + item_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RealtimeServerEventInputAudioBufferSpeechStopped(RealtimeServerEvent, discriminator='input_audio_buffer.speech_stopped'): + audio_end_ms: int + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STOPPED] + + @overload + def __init__( + self, + *, + audio_end_ms: int, + event_id: str, + item_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RealtimeServerEventInputAudioBufferTimeoutTriggered(RealtimeServerEvent, discriminator='input_audio_buffer.timeout_triggered'): + audio_end_ms: int + audio_start_ms: int + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED] + + @overload + def __init__( + self, + *, + audio_end_ms: int, + audio_start_ms: int, + event_id: str, + item_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RealtimeServerEventMCPListToolsCompleted(RealtimeServerEvent, discriminator='mcp_list_tools.completed'): + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_COMPLETED] + + @overload + def __init__( + self, + *, + event_id: str, + item_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RealtimeServerEventMCPListToolsFailed(RealtimeServerEvent, discriminator='mcp_list_tools.failed'): + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_FAILED] + + @overload + def __init__( + self, + *, + event_id: str, + item_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RealtimeServerEventMCPListToolsInProgress(RealtimeServerEvent, discriminator='mcp_list_tools.in_progress'): + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_IN_PROGRESS] + + @overload + def __init__( + self, + *, + event_id: str, + item_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RealtimeServerEventOutputAudioBufferCleared(RealtimeServerEvent, discriminator='output_audio_buffer.cleared'): + event_id: str + response_id: str + type: Literal[RealtimeServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED] + + @overload + def __init__( + self, + *, + event_id: str, + response_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RealtimeServerEventRateLimitsUpdated(RealtimeServerEvent, discriminator='rate_limits.updated'): + event_id: str + rate_limits: list[RealtimeServerEventRateLimitsUpdatedRateLimits] + type: Literal[RealtimeServerEventType.RATE_LIMITS_UPDATED] + + @overload + def __init__( + self, + *, + event_id: str, + rate_limits: list[RealtimeServerEventRateLimitsUpdatedRateLimits] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RealtimeServerEventRateLimitsUpdatedRateLimits(_Model): + limit: Optional[int] + name: Optional[Literal["requests", "tokens"]] + remaining: Optional[int] + reset_seconds: Optional[float] + + @overload + def __init__( + self, + *, + limit: Optional[int] = ..., + name: Optional[Literal[requests, tokens]] = ..., + remaining: Optional[int] = ..., + reset_seconds: Optional[float] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RealtimeServerEventResponseAudioDelta(RealtimeServerEvent, discriminator='response.output_audio.delta'): + content_index: int + delta: bytes + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DELTA] + + @overload + def __init__( + self, + *, + content_index: int, + delta: bytes, + event_id: str, + item_id: str, + output_index: int, + response_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RealtimeServerEventResponseAudioDone(RealtimeServerEvent, discriminator='response.output_audio.done'): + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DONE] + + @overload + def __init__( + self, + *, + content_index: int, + event_id: str, + item_id: str, + output_index: int, + response_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RealtimeServerEventResponseAudioTranscriptDelta(RealtimeServerEvent, discriminator='response.output_audio_transcript.delta'): + content_index: int + delta: str + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA] + + @overload + def __init__( + self, + *, + content_index: int, + delta: str, + event_id: str, + item_id: str, + output_index: int, + response_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RealtimeServerEventResponseAudioTranscriptDone(RealtimeServerEvent, discriminator='response.output_audio_transcript.done'): + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + transcript: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE] + + @overload + def __init__( + self, + *, + content_index: int, + event_id: str, + item_id: str, + output_index: int, + response_id: str, + transcript: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RealtimeServerEventResponseContentPartAdded(RealtimeServerEvent, discriminator='response.content_part.added'): + content_index: int + event_id: str + item_id: str + output_index: int + part: RealtimeServerEventResponseContentPartAddedPart + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED] + + @overload + def __init__( + self, + *, + content_index: int, + event_id: str, + item_id: str, + output_index: int, + part: RealtimeServerEventResponseContentPartAddedPart, + response_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RealtimeServerEventResponseContentPartAddedPart(_Model): + audio: Optional[str] + text: Optional[str] + transcript: Optional[str] + type: Optional[Literal["audio", "text"]] + + @overload + def __init__( + self, + *, + audio: Optional[str] = ..., + text: Optional[str] = ..., + transcript: Optional[str] = ..., + type: Optional[Literal[audio, text]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RealtimeServerEventResponseContentPartDone(RealtimeServerEvent, discriminator='response.content_part.done'): + content_index: int + event_id: str + item_id: str + output_index: int + part: RealtimeServerEventResponseContentPartDonePart + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_DONE] + + @overload + def __init__( + self, + *, + content_index: int, + event_id: str, + item_id: str, + output_index: int, + part: RealtimeServerEventResponseContentPartDonePart, + response_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RealtimeServerEventResponseContentPartDonePart(_Model): + audio: Optional[str] + format: Optional[RealtimeAudioFormats] + text: Optional[str] + transcript: Optional[str] + type: Optional[Literal["audio", "text"]] + + @overload + def __init__( + self, + *, + audio: Optional[str] = ..., + format: Optional[RealtimeAudioFormats] = ..., + text: Optional[str] = ..., + transcript: Optional[str] = ..., + type: Optional[Literal[audio, text]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RealtimeServerEventResponseCreated(RealtimeServerEvent, discriminator='response.created'): + event_id: str + response: VoiceAgentRealtimeResponse + type: Literal[RealtimeServerEventType.RESPONSE_CREATED] + + @overload + def __init__( + self, + *, + event_id: str, + response: VoiceAgentRealtimeResponse + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RealtimeServerEventResponseDone(RealtimeServerEvent, discriminator='response.done'): + event_id: str + response: VoiceAgentRealtimeResponse + type: Literal[RealtimeServerEventType.RESPONSE_DONE] + + @overload + def __init__( + self, + *, + event_id: str, + response: VoiceAgentRealtimeResponse + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RealtimeServerEventResponseFunctionCallArgumentsDelta(RealtimeServerEvent, discriminator='response.function_call_arguments.delta'): + call_id: str + delta: str + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA] + + @overload + def __init__( + self, + *, + call_id: str, + delta: str, + event_id: str, + item_id: str, + output_index: int, + response_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RealtimeServerEventResponseFunctionCallArgumentsDone(RealtimeServerEvent, discriminator='response.function_call_arguments.done'): + arguments: str + call_id: str + event_id: str + item_id: str + name: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE] + + @overload + def __init__( + self, + *, + arguments: str, + call_id: str, + event_id: str, + item_id: str, + name: str, + output_index: int, + response_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RealtimeServerEventResponseMCPCallArgumentsDelta(RealtimeServerEvent, discriminator='response.mcp_call_arguments.delta'): + delta: str + event_id: str + item_id: str + obfuscation: Optional[str] + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DELTA] + + @overload + def __init__( + self, + *, + delta: str, + event_id: str, + item_id: str, + obfuscation: Optional[str] = ..., + output_index: int, + response_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RealtimeServerEventResponseMCPCallArgumentsDone(RealtimeServerEvent, discriminator='response.mcp_call_arguments.done'): + arguments: str + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DONE] + + @overload + def __init__( + self, + *, + arguments: str, + event_id: str, + item_id: str, + output_index: int, + response_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RealtimeServerEventResponseMCPCallCompleted(RealtimeServerEvent, discriminator='response.mcp_call.completed'): + event_id: str + item_id: str + output_index: int + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_COMPLETED] + + @overload + def __init__( + self, + *, + event_id: str, + item_id: str, + output_index: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RealtimeServerEventResponseMCPCallFailed(RealtimeServerEvent, discriminator='response.mcp_call.failed'): + event_id: str + item_id: str + output_index: int + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_FAILED] + + @overload + def __init__( + self, + *, + event_id: str, + item_id: str, + output_index: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RealtimeServerEventResponseMCPCallInProgress(RealtimeServerEvent, discriminator='response.mcp_call.in_progress'): + event_id: str + item_id: str + output_index: int + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_IN_PROGRESS] + + @overload + def __init__( + self, + *, + event_id: str, + item_id: str, + output_index: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RealtimeServerEventResponseOutputItemAdded(RealtimeServerEvent, discriminator='response.output_item.added'): + event_id: str + item: RealtimeConversationItem + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_ADDED] + + @overload + def __init__( + self, + *, + event_id: str, + item: RealtimeConversationItem, + output_index: int, + response_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RealtimeServerEventResponseOutputItemDone(RealtimeServerEvent, discriminator='response.output_item.done'): + event_id: str + item: RealtimeConversationItem + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_DONE] + + @overload + def __init__( + self, + *, + event_id: str, + item: RealtimeConversationItem, + output_index: int, + response_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RealtimeServerEventResponseTextDelta(RealtimeServerEvent, discriminator='response.output_text.delta'): + content_index: int + delta: str + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DELTA] + + @overload + def __init__( + self, + *, + content_index: int, + delta: str, + event_id: str, + item_id: str, + output_index: int, + response_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RealtimeServerEventResponseTextDone(RealtimeServerEvent, discriminator='response.output_text.done'): + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + text: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DONE] + + @overload + def __init__( + self, + *, + content_index: int, + event_id: str, + item_id: str, + output_index: int, + response_id: str, + text: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RealtimeServerEventSessionCreated(RealtimeServerEvent, discriminator='session.created'): + conversation_id: Optional[str] + event_id: str + session: VoiceAgentSessionResponse + type: Literal[RealtimeServerEventType.SESSION_CREATED] + + @overload + def __init__( + self, + *, + conversation_id: Optional[str] = ..., + event_id: str, + session: VoiceAgentSessionResponse + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RealtimeServerEventSessionUpdated(RealtimeServerEvent, discriminator='session.updated'): + event_id: str + session: VoiceAgentSessionResponse + type: Literal[RealtimeServerEventType.SESSION_UPDATED] + + @overload + def __init__( + self, + *, + event_id: str, + session: VoiceAgentSessionResponse + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RealtimeServerEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CONVERSATION_CREATED = "conversation.created" + CONVERSATION_ITEM_ADDED = "conversation.item.added" + CONVERSATION_ITEM_CREATED = "conversation.item.created" + CONVERSATION_ITEM_DELETED = "conversation.item.deleted" + CONVERSATION_ITEM_DONE = "conversation.item.done" + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED = "conversation.item.input_audio_transcription.completed" + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA = "conversation.item.input_audio_transcription.delta" + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED = "conversation.item.input_audio_transcription.failed" + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT = "conversation.item.input_audio_transcription.segment" + CONVERSATION_ITEM_RETRIEVED = "conversation.item.retrieved" + CONVERSATION_ITEM_TRUNCATED = "conversation.item.truncated" + ERROR = "error" + INPUT_AUDIO_BUFFER_CLEARED = "input_audio_buffer.cleared" + INPUT_AUDIO_BUFFER_COMMITTED = "input_audio_buffer.committed" + INPUT_AUDIO_BUFFER_DTMF_EVENT_RECEIVED = "input_audio_buffer.dtmf_event_received" + INPUT_AUDIO_BUFFER_SPEECH_STARTED = "input_audio_buffer.speech_started" + INPUT_AUDIO_BUFFER_SPEECH_STOPPED = "input_audio_buffer.speech_stopped" + INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED = "input_audio_buffer.timeout_triggered" + MCP_LIST_TOOLS_COMPLETED = "mcp_list_tools.completed" + MCP_LIST_TOOLS_FAILED = "mcp_list_tools.failed" + MCP_LIST_TOOLS_IN_PROGRESS = "mcp_list_tools.in_progress" + OUTPUT_AUDIO_BUFFER_CLEARED = "output_audio_buffer.cleared" + OUTPUT_AUDIO_BUFFER_STARTED = "output_audio_buffer.started" + OUTPUT_AUDIO_BUFFER_STOPPED = "output_audio_buffer.stopped" + RATE_LIMITS_UPDATED = "rate_limits.updated" + RESPONSE_ANIMATION_BLENDSHAPES_DELTA = "response.animation_blendshapes.delta" + RESPONSE_ANIMATION_BLENDSHAPES_DONE = "response.animation_blendshapes.done" + RESPONSE_ANIMATION_VISEME_DELTA = "response.animation_viseme.delta" + RESPONSE_ANIMATION_VISEME_DONE = "response.animation_viseme.done" + RESPONSE_AUDIO_TIMESTAMP_DELTA = "response.audio_timestamp.delta" + RESPONSE_AUDIO_TIMESTAMP_DONE = "response.audio_timestamp.done" + RESPONSE_CONTENT_PART_ADDED = "response.content_part.added" + RESPONSE_CONTENT_PART_DONE = "response.content_part.done" + RESPONSE_CREATED = "response.created" + RESPONSE_DONE = "response.done" + RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA = "response.function_call_arguments.delta" + RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE = "response.function_call_arguments.done" + RESPONSE_MCP_CALL_ARGUMENTS_DELTA = "response.mcp_call_arguments.delta" + RESPONSE_MCP_CALL_ARGUMENTS_DONE = "response.mcp_call_arguments.done" + RESPONSE_MCP_CALL_COMPLETED = "response.mcp_call.completed" + RESPONSE_MCP_CALL_FAILED = "response.mcp_call.failed" + RESPONSE_MCP_CALL_IN_PROGRESS = "response.mcp_call.in_progress" + RESPONSE_OUTPUT_AUDIO_DELTA = "response.output_audio.delta" + RESPONSE_OUTPUT_AUDIO_DONE = "response.output_audio.done" + RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA = "response.output_audio_transcript.delta" + RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE = "response.output_audio_transcript.done" + RESPONSE_OUTPUT_ITEM_ADDED = "response.output_item.added" + RESPONSE_OUTPUT_ITEM_DONE = "response.output_item.done" + RESPONSE_OUTPUT_TEXT_DELTA = "response.output_text.delta" + RESPONSE_OUTPUT_TEXT_DONE = "response.output_text.done" + RESPONSE_VIDEO_DELTA = "response.video.delta" + RTC_CALL_ERROR = "rtc.call.error" + RTC_CALL_SDP_CREATED = "rtc.call.sdp.created" + SESSION_AVATAR_CONNECTING = "session.avatar.connecting" + SESSION_AVATAR_SWITCH_TO_IDLE = "session.avatar.switch_to_idle" + SESSION_AVATAR_SWITCH_TO_SPEAKING = "session.avatar.switch_to_speaking" + SESSION_CREATED = "session.created" + SESSION_SUBAGENT_ABORTED = "session.subagent.aborted" + SESSION_SUBAGENT_COMPLETED = "session.subagent.completed" + SESSION_SUBAGENT_STARTED = "session.subagent.started" + SESSION_UPDATED = "session.updated" + WARNING = "warning" + + + class azure.ai.projects.models.Reasoning(_Model): + context: Optional[Literal["auto", "current_turn", "all_turns"]] + effort: Optional[Union[str, ReasoningEffort]] + generate_summary: Optional[Literal["auto", "concise", "detailed"]] + mode: Optional[Union[str, ReasoningModeEnum]] + summary: Optional[Literal["auto", "concise", "detailed"]] + + @overload + def __init__( + self, + *, + context: Optional[Literal[auto, current_turn, all_turns]] = ..., + effort: Optional[Union[str, ReasoningEffort]] = ..., + generate_summary: Optional[Literal[auto, concise, detailed]] = ..., + mode: Optional[Union[str, ReasoningModeEnum]] = ..., + summary: Optional[Literal[auto, concise, detailed]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ReasoningEffort(str, Enum, metaclass=CaseInsensitiveEnumMeta): + HIGH = "high" + LOW = "low" + MAX = "max" + MEDIUM = "medium" + MINIMAL = "minimal" + NONE = "none" + XHIGH = "xhigh" + + + class azure.ai.projects.models.ReasoningModeEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): + PRO = "pro" + STANDARD = "standard" + + + class azure.ai.projects.models.RecurrenceSchedule(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RecurrenceTrigger(Trigger, discriminator='Recurrence'): + end_time: Optional[datetime] + interval: int + schedule: RecurrenceSchedule + start_time: Optional[datetime] + time_zone: Optional[str] + type: Literal[TriggerType.RECURRENCE] + + @overload + def __init__( + self, + *, + end_time: Optional[datetime] = ..., + interval: int, + schedule: RecurrenceSchedule, + start_time: Optional[datetime] = ..., + time_zone: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RecurrenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DAILY = "Daily" + HOURLY = "Hourly" + MONTHLY = "Monthly" + WEEKLY = "Weekly" + + + class azure.ai.projects.models.RedTeam(_Model): + application_scenario: Optional[str] + attack_strategies: Optional[list[Union[str, AttackStrategy]]] + display_name: Optional[str] + name: str + num_turns: Optional[int] + properties: Optional[dict[str, str]] + risk_categories: Optional[list[Union[str, RiskCategory]]] + simulation_only: Optional[bool] + status: Optional[str] + tags: Optional[dict[str, str]] + target: RedTeamTargetConfig + + @overload + def __init__( + self, + *, + application_scenario: Optional[str] = ..., + attack_strategies: Optional[list[Union[str, AttackStrategy]]] = ..., + display_name: Optional[str] = ..., + num_turns: Optional[int] = ..., + properties: Optional[dict[str, str]] = ..., + risk_categories: Optional[list[Union[str, RiskCategory]]] = ..., + simulation_only: Optional[bool] = ..., + tags: Optional[dict[str, str]] = ..., + target: RedTeamTargetConfig + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RedTeamEvalRunDataSource(TypedDict, total=False): + key "item_generation_params": Required[Any] + key "target": Required[Union[AzureAIAgentTargetParam, AzureAIModelTargetParam, dict[str, Any]]] + key "type": Required[Literal["azure_ai_red_team"]] + + + class azure.ai.projects.models.RedTeamTargetConfig(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ReinforcementFineTuningDataGenerationJob(DataGenerationJob, discriminator='reinforcement_finetuning_preview'): + created_at: datetime + error: ApiError + finished_at: datetime + generation_configuration: DataGenerationJobConfiguration + id: str + name: str + output_configuration: Optional[ReinforcementFineTuningDataGenerationJobOutputConfiguration] + result: DataGenerationJobResult + scenario: Literal[DataGenerationJobScenario.REINFORCEMENT_FINETUNING_PREVIEW] + sources: list[DataGenerationJobSource] + status: Union[str, JobStatus] + + @overload + def __init__( + self, + *, + generation_configuration: DataGenerationJobConfiguration, + name: str, + output_configuration: Optional[ReinforcementFineTuningDataGenerationJobOutputConfiguration] = ..., + sources: list[DataGenerationJobSource] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ReinforcementFineTuningDataGenerationJobInputs(DataGenerationJobInputs, discriminator='reinforcement_finetuning_preview'): + generation_configuration: DataGenerationJobConfiguration + name: str + output_configuration: Optional[ReinforcementFineTuningDataGenerationJobOutputConfiguration] + scenario: Literal[DataGenerationJobScenario.REINFORCEMENT_FINETUNING_PREVIEW] + sources: list[DataGenerationJobSource] + + @overload + def __init__( + self, + *, + generation_configuration: DataGenerationJobConfiguration, + name: str, + output_configuration: Optional[ReinforcementFineTuningDataGenerationJobOutputConfiguration] = ..., + sources: list[DataGenerationJobSource] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ReinforcementFineTuningDataGenerationJobOutputConfiguration(_Model): + merge_file_id: Optional[str] + name: str + write_mode: Optional[Union[str, DataGenerationJobOutputWriteMode]] + + @overload + def __init__( + self, + *, + merge_file_id: Optional[str] = ..., + name: str, + write_mode: Optional[Union[str, DataGenerationJobOutputWriteMode]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ReminderPreviewToolboxTool(ToolboxTool, discriminator='reminder_preview'): + description: str + name: str + tool_configs: dict[str, ToolConfig] + type: Literal[ToolboxToolType.REMINDER_PREVIEW] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + name: Optional[str] = ..., + tool_configs: Optional[dict[str, ToolConfig]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ResponseRetrievalItemGenerationParams(TypedDict, total=False): + key "data_mapping": Required[Dict[str, str]] + key "max_num_turns": int + key "source": Required[Union[SourceFileContent, SourceFileID]] + key "type": Required[Literal["response_retrieval"]] + + + class azure.ai.projects.models.ResponseUsageInputTokensDetails(_Model): + cache_write_tokens: int + cached_tokens: int + + @overload + def __init__( + self, + *, + cache_write_tokens: int, + cached_tokens: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ResponseUsageOutputTokensDetails(_Model): + reasoning_tokens: int + + @overload + def __init__( + self, + *, + reasoning_tokens: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ResponseUsageResource(_Model): + input_tokens: int + input_tokens_details: InputTokensDetailsResource + output_tokens: int + output_tokens_details: OutputTokensDetailsResource + total_tokens: int + + @overload + def __init__( + self, + *, + input_tokens: int, + input_tokens_details: InputTokensDetailsResource, + output_tokens: int, + output_tokens_details: OutputTokensDetailsResource, + total_tokens: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ResponsesProtocolConfiguration(_Model): + + + class azure.ai.projects.models.RiskCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CODE_VULNERABILITY = "CodeVulnerability" + HATE_UNFAIRNESS = "HateUnfairness" + PROHIBITED_ACTIONS = "ProhibitedActions" + PROTECTED_MATERIAL = "ProtectedMaterial" + SELF_HARM = "SelfHarm" + SENSITIVE_DATA_LEAKAGE = "SensitiveDataLeakage" + SEXUAL = "Sexual" + TASK_ADHERENCE = "TaskAdherence" + UNGROUNDED_ATTRIBUTES = "UngroundedAttributes" + VIOLENCE = "Violence" + + + class azure.ai.projects.models.Routine(_Model): + action: Optional[RoutineAction] + created_at: Optional[datetime] + description: Optional[str] + enabled: bool + name: Optional[str] + triggers: Optional[dict[str, RoutineTrigger]] + updated_at: Optional[datetime] + + @overload + def __init__( + self, + *, + action: Optional[RoutineAction] = ..., + created_at: Optional[datetime] = ..., + description: Optional[str] = ..., + enabled: bool, + name: Optional[str] = ..., + triggers: Optional[dict[str, RoutineTrigger]] = ..., + updated_at: Optional[datetime] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RoutineAction(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RoutineActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + INVOKE_AGENT_INVOCATIONS_API = "invoke_agent_invocations_api" + INVOKE_AGENT_RESPONSES_API = "invoke_agent_responses_api" + + + class azure.ai.projects.models.RoutineAttemptSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): + EVENT_FIRE = "event_fire" + MANUAL_DISPATCH = "manual_dispatch" + QUEUED_DISPATCH = "queued_dispatch" + SCHEDULE_DELIVERY = "schedule_delivery" + TIMER_DELIVERY = "timer_delivery" + + + class azure.ai.projects.models.RoutineAuthorization(_Model): + identity: Optional[Union[str, RoutineDispatchIdentity]] + + @overload + def __init__( + self, + *, + identity: Optional[Union[str, RoutineDispatchIdentity]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RoutineDispatchIdentity(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AGENT = "agent" + CREATOR = "creator" + + + class azure.ai.projects.models.RoutineDispatchPayload(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RoutineDispatchPayloadType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + INVOKE_AGENT_INVOCATIONS_API = "invoke_agent_invocations_api" + INVOKE_AGENT_RESPONSES_API = "invoke_agent_responses_api" + + + class azure.ai.projects.models.RoutineRun(_Model): + action_correlation_id: Optional[str] + action_type: Optional[Union[str, RoutineActionType]] + agent_endpoint_id: Optional[str] + agent_id: Optional[str] + attempt_source: Optional[Union[str, RoutineAttemptSource]] + conversation_id: Optional[str] + dispatch_id: Optional[str] + ended_at: Optional[datetime] + error_message: Optional[str] + error_status_code: Optional[int] + error_type: Optional[str] + id: str + phase: Optional[Union[str, RoutineRunPhase]] + response_id: Optional[str] + scheduled_fire_at: Optional[datetime] + session_id: Optional[str] + started_at: Optional[datetime] + status: Optional[RoutineRunStatus] + task_id: Optional[str] + trigger_event_payload: Optional[dict[str, Any]] + trigger_name: Optional[str] + trigger_type: Optional[Union[str, RoutineTriggerType]] + triggered_at: Optional[datetime] + + @overload + def __init__( + self, + *, + action_correlation_id: Optional[str] = ..., + action_type: Optional[Union[str, RoutineActionType]] = ..., + agent_endpoint_id: Optional[str] = ..., + agent_id: Optional[str] = ..., + attempt_source: Optional[Union[str, RoutineAttemptSource]] = ..., + conversation_id: Optional[str] = ..., + dispatch_id: Optional[str] = ..., + ended_at: Optional[datetime] = ..., + error_message: Optional[str] = ..., + error_status_code: Optional[int] = ..., + error_type: Optional[str] = ..., + phase: Optional[Union[str, RoutineRunPhase]] = ..., + response_id: Optional[str] = ..., + scheduled_fire_at: Optional[datetime] = ..., + session_id: Optional[str] = ..., + started_at: Optional[datetime] = ..., + status: Optional[RoutineRunStatus] = ..., + task_id: Optional[str] = ..., + trigger_event_payload: Optional[dict[str, Any]] = ..., + trigger_name: Optional[str] = ..., + trigger_type: Optional[Union[str, RoutineTriggerType]] = ..., + triggered_at: Optional[datetime] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RoutineRunPhase(str, Enum, metaclass=CaseInsensitiveEnumMeta): + COMPLETED = "completed" + DISPATCHING = "dispatching" + FAILED = "failed" + QUEUED = "queued" + + + class azure.ai.projects.models.RoutineTrigger(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RoutineTriggerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CUSTOM = "custom" + GITHUB_ISSUE = "github_issue" + SCHEDULE = "schedule" + TIMER = "timer" + + + class azure.ai.projects.models.RubricBasedEvaluatorDefinition(EvaluatorDefinition, discriminator='rubric'): + data_schema: dict[str, any] + dimensions: list[Dimension] + init_parameters: dict[str, any] + metrics: dict[str, EvaluatorMetric] + pass_threshold: Optional[float] + type: Literal[EvaluatorDefinitionType.RUBRIC] + + @overload + def __init__( + self, + *, + data_schema: Optional[dict[str, Any]] = ..., + dimensions: list[Dimension], + init_parameters: Optional[dict[str, Any]] = ..., + metrics: Optional[dict[str, EvaluatorMetric]] = ..., + pass_threshold: Optional[float] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RubricGenerationInputQualityWarning(_Model): + code: Union[str, RubricGenerationInputQualityWarningCode] + message: str + severity: Union[str, RubricGenerationInputQualityWarningSeverity] + source: Union[str, RubricGenerationInputQualityWarningSource] + source_index: Optional[int] + + @overload + def __init__( + self, + *, + code: Union[str, RubricGenerationInputQualityWarningCode], + message: str, + severity: Union[str, RubricGenerationInputQualityWarningSeverity], + source: Union[str, RubricGenerationInputQualityWarningSource], + source_index: Optional[int] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RubricGenerationInputQualityWarningCode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + EMPTY_AGENT_INSTRUCTIONS = "empty_agent_instructions" + EMPTY_DATASET_CONTENT = "empty_dataset_content" + EMPTY_PROMPT = "empty_prompt" + INSUFFICIENT_TOTAL_INPUT = "insufficient_total_input" + LOW_TRACE_COUNT = "low_trace_count" + SHORT_AGENT_INSTRUCTIONS = "short_agent_instructions" + SHORT_DATASET_CONTENT = "short_dataset_content" + SHORT_PROMPT = "short_prompt" + + + class azure.ai.projects.models.RubricGenerationInputQualityWarningSeverity(str, Enum, metaclass=CaseInsensitiveEnumMeta): + WARNING = "warning" + + + class azure.ai.projects.models.RubricGenerationInputQualityWarningSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AGENT = "agent" + AGGREGATE = "aggregate" + DATASET = "dataset" + PROMPT = "prompt" + + + class azure.ai.projects.models.SASCredentials(BaseCredentials, discriminator='SAS'): + sas_token: Optional[str] + type: Literal[CredentialType.SAS] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.SampleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + EVALUATION_RESULT_SAMPLE = "EvaluationResultSample" + + + class azure.ai.projects.models.Schedule(_Model): + description: Optional[str] + display_name: Optional[str] + enabled: bool + properties: Optional[dict[str, str]] + provisioning_status: Optional[Union[str, ScheduleProvisioningStatus]] + schedule_id: str + system_data: dict[str, str] + tags: Optional[dict[str, str]] + task: ScheduleTask + trigger: Trigger + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + display_name: Optional[str] = ..., + enabled: bool, + properties: Optional[dict[str, str]] = ..., + tags: Optional[dict[str, str]] = ..., + task: ScheduleTask, + trigger: Trigger + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ScheduleProvisioningStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CREATING = "Creating" + DELETING = "Deleting" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + UPDATING = "Updating" + + + class azure.ai.projects.models.ScheduleRoutineTrigger(RoutineTrigger, discriminator='schedule'): + cron_expression: str + time_zone: str + type: Literal[RoutineTriggerType.SCHEDULE] + + @overload + def __init__( + self, + *, + cron_expression: str, + time_zone: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ScheduleRun(_Model): + error: Optional[str] + properties: dict[str, str] + run_id: str + schedule_id: str + success: bool + trigger_time: Optional[datetime] + + @overload + def __init__( + self, + *, + schedule_id: str, + trigger_time: Optional[datetime] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ScheduleTask(_Model): + configuration: Optional[dict[str, str]] + type: str + + @overload + def __init__( + self, + *, + configuration: Optional[dict[str, str]] = ..., + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ScheduleTaskType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + EVALUATION = "Evaluation" + INSIGHT = "Insight" + + + class azure.ai.projects.models.ScoreLevelParam(_Model): + description: Optional[str] + label: str + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + label: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ScoreProbabilityResource(_Model): + label: str + probability: float + value: int + + @overload + def __init__( + self, + *, + label: str, + probability: float, + value: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.SearchContentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + IMAGE = "image" + TEXT = "text" + + + class azure.ai.projects.models.SearchContextSize(str, Enum, metaclass=CaseInsensitiveEnumMeta): + HIGH = "high" + LOW = "low" + MEDIUM = "medium" + + + class azure.ai.projects.models.SessionConfiguration(_Model): + idle_timeout_seconds: Optional[timedelta] + + @overload + def __init__( + self, + *, + idle_timeout_seconds: Optional[timedelta] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.SessionDirectoryEntry(_Model): + is_directory: bool + modified_time: datetime + name: str + size: int + + @overload + def __init__( + self, + *, + is_directory: bool, + modified_time: datetime, + name: str, + size: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.SessionFileWriteResult(_Model): + bytes_written: int + path: str + + @overload + def __init__( + self, + *, + bytes_written: int, + path: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.SessionLogEvent(_Model): + data: str + event: Union[str, SessionLogEventType] + + @overload + def __init__( + self, + *, + data: str, + event: Union[str, SessionLogEventType] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.SessionLogEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + LOG = "log" + + + class azure.ai.projects.models.SharepointGroundingToolParameters(_Model): + project_connections: Optional[list[ToolProjectConnection]] + + @overload + def __init__( + self, + *, + project_connections: Optional[list[ToolProjectConnection]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.SharepointPreviewTool(Tool, discriminator='sharepoint_grounding_preview'): + sharepoint_grounding_preview: SharepointGroundingToolParameters + type: Literal[ToolType.SHAREPOINT_GROUNDING_PREVIEW] + + @overload + def __init__( + self, + *, + sharepoint_grounding_preview: SharepointGroundingToolParameters + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ShellToolboxTool(ToolboxTool, discriminator='shell'): + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] + description: str + environment: ToolboxShellEnvironment + name: str + tool_configs: dict[str, ToolConfig] + type: Literal[ToolboxToolType.SHELL] + + @overload + def __init__( + self, + *, + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ..., + description: Optional[str] = ..., + environment: ToolboxShellEnvironment, + name: Optional[str] = ..., + tool_configs: Optional[dict[str, ToolConfig]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.SimpleQnADataGenerationJobConfiguration(DataGenerationJobConfiguration, discriminator='simple_qna'): + max_samples: int + model_options: DataGenerationModelOptions + question_types: Optional[list[Union[str, SimpleQnAFineTuningQuestionType]]] + train_split: float + type: Literal[DataGenerationJobType.SIMPLE_QNA] + + @overload + def __init__( + self, + *, + max_samples: int, + model_options: Optional[DataGenerationModelOptions] = ..., + question_types: Optional[list[Union[str, SimpleQnAFineTuningQuestionType]]] = ..., + train_split: Optional[float] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.SimpleQnAFineTuningQuestionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + LONG_ANSWER = "long_answer" + SHORT_ANSWER = "short_answer" + + + class azure.ai.projects.models.SimulationSeedDataGenerationJobConfiguration(DataGenerationJobConfiguration, discriminator='simulation_seed'): + model_options: DataGenerationModelOptions + train_split: float + type: Literal[DataGenerationJobType.SIMULATION_SEED] + + @overload + def __init__( + self, + *, + model_options: Optional[DataGenerationModelOptions] = ..., + train_split: Optional[float] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.SipTelephonyTransferDestination(TelephonyTransferDestination, discriminator='sip'): + kind: Literal[TelephonyTransferDestinationKind.SIP] + value: str + + @overload + def __init__( + self, + *, + value: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.SkillDetails(_Model): + created_at: datetime + default_version: str + description: str + id: str + latest_version: str + name: str + + @overload + def __init__( + self, + *, + created_at: datetime, + default_version: str, + description: str, + id: str, + latest_version: str, + name: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.SkillInlineContent(_Model): + allowed_tools: Optional[list[str]] + compatibility: Optional[str] + description: str + instructions: str + license: Optional[str] + metadata: Optional[dict[str, str]] + + @overload + def __init__( + self, + *, + allowed_tools: Optional[list[str]] = ..., + compatibility: Optional[str] = ..., + description: str, + instructions: str, + license: Optional[str] = ..., + metadata: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.SkillReference(_Model): + name: str + version: Optional[str] + + @overload + def __init__( + self, + *, + name: str, + version: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.SkillReferenceParam(ContainerSkill, discriminator='skill_reference'): + skill_id: str + type: Literal[ContainerSkillType.SKILL_REFERENCE] + version: Optional[str] + + @overload + def __init__( + self, + *, + skill_id: str, + version: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.SkillVersion(_Model): + created_at: datetime + description: str + id: str + name: str + skill_id: str + version: str + + @overload + def __init__( + self, + *, + created_at: datetime, + description: str, + id: str, + name: str, + skill_id: str, + version: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.SpecificApplyPatchParam(ToolChoiceParam, discriminator='apply_patch'): + type: Literal[ToolChoiceParamType.APPLY_PATCH] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.SpecificFunctionShellParam(ToolChoiceParam, discriminator='shell'): + type: Literal[ToolChoiceParamType.SHELL] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.SpecificProgrammaticToolCallingParam(ToolChoiceParam, discriminator='programmatic_tool_calling'): + type: Literal[ToolChoiceParamType.PROGRAMMATIC_TOOL_CALLING] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.SteeringPromptOptimizationContext(OptimizationContext, discriminator='steering_prompt'): + prompt: str + type: Literal[OptimizationContextType.STEERING_PROMPT] + + @overload + def __init__( + self, + *, + prompt: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.StructuredInputDefinition(_Model): + default_value: Optional[Any] + description: Optional[str] + required: Optional[bool] + schema: Optional[dict[str, Any]] + + @overload + def __init__( + self, + *, + default_value: Optional[Any] = ..., + description: Optional[str] = ..., + required: Optional[bool] = ..., + schema: Optional[dict[str, Any]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.StructuredOutputDefinition(_Model): + description: str + name: str + schema: dict[str, Any] + strict: bool + + @overload + def __init__( + self, + *, + description: str, + name: str, + schema: dict[str, Any], + strict: bool + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.SupervisedFineTuningDataGenerationJob(DataGenerationJob, discriminator='supervised_finetuning_preview'): + created_at: datetime + error: ApiError + finished_at: datetime + generation_configuration: DataGenerationJobConfiguration + id: str + name: str + output_configuration: Optional[SupervisedFineTuningDataGenerationJobOutputConfiguration] + result: DataGenerationJobResult + scenario: Literal[DataGenerationJobScenario.SUPERVISED_FINETUNING_PREVIEW] + sources: list[DataGenerationJobSource] + status: Union[str, JobStatus] + + @overload + def __init__( + self, + *, + generation_configuration: DataGenerationJobConfiguration, + name: str, + output_configuration: Optional[SupervisedFineTuningDataGenerationJobOutputConfiguration] = ..., + sources: list[DataGenerationJobSource] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.SupervisedFineTuningDataGenerationJobInputs(DataGenerationJobInputs, discriminator='supervised_finetuning_preview'): + generation_configuration: DataGenerationJobConfiguration + name: str + output_configuration: Optional[SupervisedFineTuningDataGenerationJobOutputConfiguration] + scenario: Literal[DataGenerationJobScenario.SUPERVISED_FINETUNING_PREVIEW] + sources: list[DataGenerationJobSource] + + @overload + def __init__( + self, + *, + generation_configuration: DataGenerationJobConfiguration, + name: str, + output_configuration: Optional[SupervisedFineTuningDataGenerationJobOutputConfiguration] = ..., + sources: list[DataGenerationJobSource] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.SupervisedFineTuningDataGenerationJobOutputConfiguration(_Model): + merge_file_id: Optional[str] + name: str + write_mode: Optional[Union[str, DataGenerationJobOutputWriteMode]] + + @overload + def __init__( + self, + *, + merge_file_id: Optional[str] = ..., + name: str, + write_mode: Optional[Union[str, DataGenerationJobOutputWriteMode]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TargetAttribute(str, Enum, metaclass=CaseInsensitiveEnumMeta): + INSTRUCTIONS = "instructions" + MODEL = "model" + SKILLS = "skills" + TOOLS = "tools" + + + class azure.ai.projects.models.TargetCompletionEvalRunDataSource(TypedDict, total=False): + key "input_messages": Required[InputMessagesItemReference] + key "source": Required[Union[SourceFileContent, SourceFileID]] + key "target": Required[Union[AzureAIAgentTargetParam, AzureAIModelTargetParam, dict[str, Any]]] + key "type": Required[Literal["azure_ai_target_completions"]] + + + class azure.ai.projects.models.TaxonomyCategory(_Model): + description: Optional[str] + id: str + name: str + properties: Optional[dict[str, str]] + risk_category: Union[str, RiskCategory] + sub_categories: list[TaxonomySubCategory] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + id: str, + name: str, + properties: Optional[dict[str, str]] = ..., + risk_category: Union[str, RiskCategory], + sub_categories: list[TaxonomySubCategory] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TaxonomySubCategory(_Model): + description: Optional[str] + enabled: bool + id: str + name: str + properties: Optional[dict[str, str]] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + enabled: bool, + id: str, + name: str, + properties: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TeamsPhoneExtensibilityTelephonyBinding(TelephonyBinding, discriminator='teams_phone_extensibility'): + connection_name: str + id: str + incoming_call_url: str + label: str + phone_number: Optional[str] + provider: Literal[TelephonyProvider.TEAMS_PHONE_EXTENSIBILITY] + resource_account_object_id: str + status: Union[str, TelephonyBindingStatus] + + @overload + def __init__( + self, + *, + connection_name: str, + id: str, + incoming_call_url: str, + label: Optional[str] = ..., + phone_number: Optional[str] = ..., + resource_account_object_id: str, + status: Union[str, TelephonyBindingStatus] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TeamsPhoneExtensibilityTelephonyBindingListItem(TelephonyBindingListItem, discriminator='teams_phone_extensibility'): + connection_name: str + etag: str + id: str + incoming_call_url: str + label: str + phone_number: Optional[str] + provider: Literal[TelephonyProvider.TEAMS_PHONE_EXTENSIBILITY] + resource_account_object_id: str + status: Union[str, TelephonyBindingStatus] + + @overload + def __init__( + self, + *, + connection_name: str, + id: str, + incoming_call_url: str, + label: Optional[str] = ..., + phone_number: Optional[str] = ..., + resource_account_object_id: str, + status: Union[str, TelephonyBindingStatus] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TeamsTelephonyTransferDestination(TelephonyTransferDestination, discriminator='teams'): + kind: Literal[TelephonyTransferDestinationKind.TEAMS] + value: str + + @overload + def __init__( + self, + *, + value: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TelemetryConfig(_Model): + endpoints: list[TelemetryEndpoint] + + @overload + def __init__( + self, + *, + endpoints: list[TelemetryEndpoint] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TelemetryDataKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CONTAINER_OTEL = "ContainerOtel" + CONTAINER_STDOUT_STDERR = "ContainerStdoutStderr" + METRICS = "Metrics" + + + class azure.ai.projects.models.TelemetryEndpoint(_Model): + auth: Optional[TelemetryEndpointAuth] + data: list[Union[str, TelemetryDataKind]] + kind: str + + @overload + def __init__( + self, + *, + auth: Optional[TelemetryEndpointAuth] = ..., + data: list[Union[str, TelemetryDataKind]], + kind: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TelemetryEndpointAuth(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TelemetryEndpointAuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + HEADER = "header" + + + class azure.ai.projects.models.TelemetryEndpointKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + OTLP = "OTLP" + + + class azure.ai.projects.models.TelemetryTransportProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + GRPC = "Grpc" + HTTP = "Http" + + + class azure.ai.projects.models.TelephonyBinding(_Model): + connection_name: str + id: str + incoming_call_url: str + label: Optional[str] + provider: str + status: Union[str, TelephonyBindingStatus] + + @overload + def __init__( + self, + *, + connection_name: str, + id: str, + incoming_call_url: str, + label: Optional[str] = ..., + provider: str, + status: Union[str, TelephonyBindingStatus] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TelephonyBindingListItem(_Model): + connection_name: str + etag: str + id: str + incoming_call_url: str + label: Optional[str] + provider: str + status: Union[str, TelephonyBindingStatus] + + @overload + def __init__( + self, + *, + connection_name: str, + id: str, + incoming_call_url: str, + label: Optional[str] = ..., + provider: str, + status: Union[str, TelephonyBindingStatus] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TelephonyBindingStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ACTIVE = "active" + SUSPENDED = "suspended" + + + class azure.ai.projects.models.TelephonyCallDurationBasis(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ANSWERED = "answered" + RECEIVED = "received" + + + class azure.ai.projects.models.TelephonyCallEndReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ADMISSION_CHECK_FAILED = "admission_check_failed" + ADMISSION_REJECTED = "admission_rejected" + AGENT_SESSION_CONNECT_FAILED = "agent_session_connect_failed" + ANSWER_FAILED = "answer_failed" + BINDING_NOT_FOUND = "binding_not_found" + BINDING_SUSPENDED = "binding_suspended" + BRIDGE_CANCELLED = "bridge_cancelled" + BRIDGE_FAILED = "bridge_failed" + CREDENTIAL_RESOLUTION_FAILED = "credential_resolution_failed" + ENDPOINT_RESOLUTION_FAILED = "endpoint_resolution_failed" + INGRESS_SETUP_FAILED = "ingress_setup_failed" + INVALID_BINDING_CONFIGURATION = "invalid_binding_configuration" + INVALID_WEBHOOK_PAYLOAD = "invalid_webhook_payload" + LIVE_CALL_CONFLICT = "live_call_conflict" + LIVE_CALL_PERSISTENCE_FAILED = "live_call_persistence_failed" + MANAGED_HANGUP = "managed_hangup" + MANAGED_TRANSFER = "managed_transfer" + MANAGE_HANGUP_FAILED = "manage_hangup_failed" + MANAGE_TRANSFER_FAILED = "manage_transfer_failed" + MEDIA_STREAM_ENDED = "media_stream_ended" + PROVIDER_BUSY = "provider_busy" + PROVIDER_CANCELLED = "provider_cancelled" + PROVIDER_DISCONNECTED = "provider_disconnected" + PROVIDER_FAILED = "provider_failed" + PROVIDER_NO_ANSWER = "provider_no_answer" + PROVIDER_RESOURCE_MISMATCH = "provider_resource_mismatch" + PROVIDER_STREAM_ERROR = "provider_stream_error" + PROVIDER_STREAM_STOPPED = "provider_stream_stopped" + ROUTE_AGENT_MISMATCH = "route_agent_mismatch" + WEBHOOK_VALIDATION_FAILED = "webhook_validation_failed" + + + class azure.ai.projects.models.TelephonyCallJob(_Model): + agent_name: str + attempt_count: int + cancellation: Optional[TelephonyCallJobCancellation] + connection_name: str + created_at: datetime + destination: TelephonyOutboundDestination + id: str + next_attempt_at: Optional[datetime] + object: Literal["call_job"] + purpose: Optional[str] + retry_policy: TelephonyOutboundRetryPolicy + revision: int + schedule: Optional[TelephonyCallJobSchedule] + source: str + status: Union[str, TelephonyCallJobStatus] + structured_inputs: Optional[dict[str, Any]] + terminal_reason: Optional[Union[str, TelephonyCallJobTerminalReason]] + updated_at: datetime + + @overload + def __init__( + self, + *, + agent_name: str, + attempt_count: int, + cancellation: Optional[TelephonyCallJobCancellation] = ..., + connection_name: str, + created_at: datetime, + destination: TelephonyOutboundDestination, + id: str, + next_attempt_at: Optional[datetime] = ..., + purpose: Optional[str] = ..., + retry_policy: TelephonyOutboundRetryPolicy, + revision: int, + schedule: Optional[TelephonyCallJobSchedule] = ..., + source: str, + status: Union[str, TelephonyCallJobStatus], + structured_inputs: Optional[dict[str, Any]] = ..., + terminal_reason: Optional[Union[str, TelephonyCallJobTerminalReason]] = ..., + updated_at: datetime + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TelephonyCallJobCancellation(_Model): + mode: str + requested_at: datetime + requested_by: str + revision: int + + @overload + def __init__( + self, + *, + mode: str, + requested_at: datetime, + requested_by: str, + revision: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TelephonyCallJobSchedule(_Model): + expires_at: Optional[datetime] + not_before: Optional[datetime] + + @overload + def __init__( + self, + *, + expires_at: Optional[datetime] = ..., + not_before: Optional[datetime] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TelephonyCallJobStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ACCEPTED = "accepted" + BLOCKED = "blocked" + CANCELLATION_REQUESTED = "cancellation_requested" + CANCELLED = "cancelled" + COMPLETED = "completed" DISPATCHING = "dispatching" EXPIRED = "expired" FAILED = "failed" - IN_PROGRESS = "in_progress" - QUEUED = "queued" - WAITING_FOR_RETRY = "waiting_for_retry" - WAITING_FOR_SCHEDULE = "waiting_for_schedule" + IN_PROGRESS = "in_progress" + QUEUED = "queued" + WAITING_FOR_RETRY = "waiting_for_retry" + WAITING_FOR_SCHEDULE = "waiting_for_schedule" + + + class azure.ai.projects.models.TelephonyCallJobTerminalReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ANSWER_FAILED = "answer_failed" + BRIDGE_CANCELLED = "bridge_cancelled" + BRIDGE_FAILED = "bridge_failed" + CAMPAIGN_CANCELLED = "campaign_cancelled" + CAMPAIGN_COMPLETED = "campaign_completed" + CAMPAIGN_FAILED = "campaign_failed" + CAMPAIGN_NOT_FOUND = "campaign_not_found" + CANCELLATION_RECONCILIATION_TIMEOUT = "cancellation_reconciliation_timeout" + CONNECTION_PROJECT_MISMATCH = "connection_project_mismatch" + NO_ANSWER = "no_answer" + NO_ANSWER_TIMEOUT = "no_answer_timeout" + ORIGINATION_FENCE_NOT_RECORDED = "origination_fence_not_recorded" + ORIGINATION_RECONCILIATION_TIMEOUT = "origination_reconciliation_timeout" + OUTBOUND_CONNECTION_CHANGED = "outbound_connection_changed" + OUTBOUND_CONNECTION_UNAVAILABLE = "outbound_connection_unavailable" + PROVIDER_CALLBACK_TIMEOUT_CANCELLATION_RECONCILIATION_TIMEOUT = "provider_callback_timeout_cancellation_reconciliation_timeout" + TELEPHONY_BINDING_CHANGED = "telephony_binding_changed" + TELEPHONY_BINDING_INACTIVE = "telephony_binding_inactive" + TELEPHONY_BINDING_INVALID = "telephony_binding_invalid" + TELEPHONY_BINDING_NOT_FOUND = "telephony_binding_not_found" + VOICE_SESSION_CONFIGURATION_INVALID = "voice_session_configuration_invalid" + + + class azure.ai.projects.models.TelephonyCallLifecycleEvent(_Model): + name: Union[str, TelephonyCallLifecycleEventName] + observed_at: datetime + occurred_at: Optional[datetime] + outcome: Union[str, TelephonyCallLifecycleEventOutcome] + provider_event_id: Optional[str] + provider_sequence: Optional[int] + provider_status_code: Optional[int] + provider_sub_code: Optional[int] + reason: Optional[Union[str, TelephonyCallLifecycleEventReason]] + sequence: int + source: Union[str, TelephonyCallLifecycleEventSource] + timestamp_source: Union[str, TelephonyCallTimestampSource] + + @overload + def __init__( + self, + *, + name: Union[str, TelephonyCallLifecycleEventName], + observed_at: datetime, + occurred_at: Optional[datetime] = ..., + outcome: Union[str, TelephonyCallLifecycleEventOutcome], + provider_event_id: Optional[str] = ..., + provider_sequence: Optional[int] = ..., + provider_status_code: Optional[int] = ..., + provider_sub_code: Optional[int] = ..., + reason: Optional[Union[str, TelephonyCallLifecycleEventReason]] = ..., + source: Union[str, TelephonyCallLifecycleEventSource], + timestamp_source: Union[str, TelephonyCallTimestampSource] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TelephonyCallLifecycleEventName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AGENT_SESSION_CONNECT = "telephony.agent_session.connect" + BINDING_RESOLVE = "telephony.binding.resolve" + CALL_DISCONNECT = "telephony.call.disconnect" + CALL_HANGUP = "telephony.call.hangup" + CALL_TRANSFER = "telephony.call.transfer" + FIRST_AGENT_AUDIO = "telephony.media.first_agent_audio" + FIRST_CALLER_AUDIO = "telephony.media.first_caller_audio" + MEDIA_CONNECT = "telephony.media.connect" + PROVIDER_ANSWER = "telephony.provider.answer" + WEBHOOK_RECEIVED = "telephony.webhook.received" + WEBHOOK_VALIDATION = "telephony.webhook.validation" + + + class azure.ai.projects.models.TelephonyCallLifecycleEventOutcome(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CANCELLED = "cancelled" + FAILED = "failed" + OBSERVED = "observed" + REJECTED = "rejected" + STARTED = "started" + SUCCEEDED = "succeeded" + + + class azure.ai.projects.models.TelephonyCallLifecycleEventReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ADMISSION_CHECK_FAILED = "admission_check_failed" + ADMISSION_REJECTED = "admission_rejected" + AGENT_SESSION_CONNECT_FAILED = "agent_session_connect_failed" + ANSWER_FAILED = "answer_failed" + BINDING_NOT_FOUND = "binding_not_found" + BINDING_SUSPENDED = "binding_suspended" + BRIDGE_CANCELLED = "bridge_cancelled" + BRIDGE_FAILED = "bridge_failed" + CREDENTIAL_RESOLUTION_FAILED = "credential_resolution_failed" + ENDPOINT_RESOLUTION_FAILED = "endpoint_resolution_failed" + INGRESS_SETUP_FAILED = "ingress_setup_failed" + INVALID_BINDING_CONFIGURATION = "invalid_binding_configuration" + INVALID_WEBHOOK_PAYLOAD = "invalid_webhook_payload" + LIVE_CALL_CONFLICT = "live_call_conflict" + LIVE_CALL_PERSISTENCE_FAILED = "live_call_persistence_failed" + MANAGED_HANGUP = "managed_hangup" + MANAGED_TRANSFER = "managed_transfer" + MANAGE_HANGUP_FAILED = "manage_hangup_failed" + MANAGE_TRANSFER_FAILED = "manage_transfer_failed" + MEDIA_STREAM_ENDED = "media_stream_ended" + PROVIDER_BUSY = "provider_busy" + PROVIDER_CANCELLED = "provider_cancelled" + PROVIDER_DISCONNECTED = "provider_disconnected" + PROVIDER_FAILED = "provider_failed" + PROVIDER_NO_ANSWER = "provider_no_answer" + PROVIDER_RESOURCE_MISMATCH = "provider_resource_mismatch" + PROVIDER_STREAM_ERROR = "provider_stream_error" + PROVIDER_STREAM_STOPPED = "provider_stream_stopped" + ROUTE_AGENT_MISMATCH = "route_agent_mismatch" + WEBHOOK_VALIDATION_FAILED = "webhook_validation_failed" + + + class azure.ai.projects.models.TelephonyCallLifecycleEventSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): + GATEWAY = "gateway" + TEAMS_PHONE_EXTENSIBILITY = "teams_phone_extensibility" + TWILIO = "twilio" + VOICE_AGENT = "voice_agent" + + + class azure.ai.projects.models.TelephonyCallPhase(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ADMITTED = "admitted" + AGENT_SESSION_READY = "agent_session_ready" + ANSWERED = "answered" + ANSWERING = "answering" + BRIDGING = "bridging" + COMPLETED = "completed" + FAILED = "failed" + MANAGING = "managing" + MEDIA_CONNECTED = "media_connected" + RECEIVED = "received" + REJECTED = "rejected" + VALIDATED = "validated" + + + class azure.ai.projects.models.TelephonyCallRecord(_Model): + agent_session_ready_at: Optional[datetime] + answered_at: Optional[datetime] + caller_number: Optional[str] + duration_ms: Optional[timedelta] + end_reason: Optional[Union[str, TelephonyCallEndReason]] + ended_at: Optional[datetime] + events: list[TelephonyCallLifecycleEvent] + events_truncated: bool + id: str + media_connected_at: Optional[datetime] + phase: Union[str, TelephonyCallPhase] + provider: Union[str, TelephonyProvider] + provider_call_id: Optional[str] + provider_message: Optional[str] + provider_number: Optional[str] + provider_status_code: Optional[int] + provider_sub_code: Optional[int] + started_at: datetime + status: Union[str, TelephonyCallStatus] + timing: TelephonyCallTiming + trace: Optional[TelephonyCallTrace] + + @overload + def __init__( + self, + *, + agent_session_ready_at: Optional[datetime] = ..., + answered_at: Optional[datetime] = ..., + caller_number: Optional[str] = ..., + duration_ms: Optional[timedelta] = ..., + end_reason: Optional[Union[str, TelephonyCallEndReason]] = ..., + ended_at: Optional[datetime] = ..., + events: list[TelephonyCallLifecycleEvent], + events_truncated: bool, + id: str, + media_connected_at: Optional[datetime] = ..., + phase: Union[str, TelephonyCallPhase], + provider: Union[str, TelephonyProvider], + provider_call_id: Optional[str] = ..., + provider_message: Optional[str] = ..., + provider_number: Optional[str] = ..., + provider_status_code: Optional[int] = ..., + provider_sub_code: Optional[int] = ..., + started_at: datetime, + status: Union[str, TelephonyCallStatus], + timing: TelephonyCallTiming, + trace: Optional[TelephonyCallTrace] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TelephonyCallStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FAILED = "failed" + IN_PROGRESS = "in_progress" + SUCCESS = "success" + + + class azure.ai.projects.models.TelephonyCallSummary(_Model): + agent_session_ready_at: Optional[datetime] + answered_at: Optional[datetime] + caller_number: Optional[str] + duration_ms: Optional[timedelta] + end_reason: Optional[Union[str, TelephonyCallEndReason]] + ended_at: Optional[datetime] + id: str + media_connected_at: Optional[datetime] + phase: Union[str, TelephonyCallPhase] + provider: Union[str, TelephonyProvider] + provider_call_id: Optional[str] + provider_message: Optional[str] + provider_number: Optional[str] + provider_status_code: Optional[int] + provider_sub_code: Optional[int] + started_at: datetime + status: Union[str, TelephonyCallStatus] + + @overload + def __init__( + self, + *, + agent_session_ready_at: Optional[datetime] = ..., + answered_at: Optional[datetime] = ..., + caller_number: Optional[str] = ..., + duration_ms: Optional[timedelta] = ..., + end_reason: Optional[Union[str, TelephonyCallEndReason]] = ..., + ended_at: Optional[datetime] = ..., + id: str, + media_connected_at: Optional[datetime] = ..., + phase: Union[str, TelephonyCallPhase], + provider: Union[str, TelephonyProvider], + provider_call_id: Optional[str] = ..., + provider_message: Optional[str] = ..., + provider_number: Optional[str] = ..., + provider_status_code: Optional[int] = ..., + provider_sub_code: Optional[int] = ..., + started_at: datetime, + status: Union[str, TelephonyCallStatus] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TelephonyCallTimestampSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DERIVED = "derived" + GATEWAY = "gateway" + PROVIDER = "provider" + + + class azure.ai.projects.models.TelephonyCallTiming(_Model): + admitted_at: Optional[datetime] + agent_session_ready_at: Optional[datetime] + answer_requested_at: Optional[datetime] + answered_at: Optional[datetime] + duration_basis: Optional[Union[str, TelephonyCallDurationBasis]] + ended_at: Optional[datetime] + first_agent_audio_at: Optional[datetime] + first_caller_audio_at: Optional[datetime] + media_connected_at: Optional[datetime] + received_at: Optional[datetime] + timestamp_source: Union[str, TelephonyCallTimestampSource] + validated_at: Optional[datetime] + + @overload + def __init__( + self, + *, + admitted_at: Optional[datetime] = ..., + agent_session_ready_at: Optional[datetime] = ..., + answer_requested_at: Optional[datetime] = ..., + answered_at: Optional[datetime] = ..., + duration_basis: Optional[Union[str, TelephonyCallDurationBasis]] = ..., + ended_at: Optional[datetime] = ..., + first_agent_audio_at: Optional[datetime] = ..., + first_caller_audio_at: Optional[datetime] = ..., + media_connected_at: Optional[datetime] = ..., + received_at: Optional[datetime] = ..., + timestamp_source: Union[str, TelephonyCallTimestampSource], + validated_at: Optional[datetime] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TelephonyCallTrace(_Model): + conversation_id: Optional[str] + mode: Optional[Union[str, TelephonyCallTraceMode]] + root_span_id: Optional[str] + status: Union[str, TelephonyCallTraceStatus] + trace_id: Optional[str] + + @overload + def __init__( + self, + *, + conversation_id: Optional[str] = ..., + mode: Optional[Union[str, TelephonyCallTraceMode]] = ..., + root_span_id: Optional[str] = ..., + status: Union[str, TelephonyCallTraceStatus], + trace_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TelephonyCallTraceMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + LIVE = "live" + POST_CALL = "post_call" + + + class azure.ai.projects.models.TelephonyCallTraceStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AVAILABLE = "available" + EMITTING = "emitting" + FAILED = "failed" + NOT_APPLICABLE = "not_applicable" + NOT_RECORDED = "not_recorded" + PENDING = "pending" + + + class azure.ai.projects.models.TelephonyOutboundDestination(_Model): + type: Union[str, TelephonyOutboundDestinationType] + value: str + + @overload + def __init__( + self, + *, + type: Union[str, TelephonyOutboundDestinationType], + value: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TelephonyOutboundDestinationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + PHONE_NUMBER = "phone_number" + + + class azure.ai.projects.models.TelephonyOutboundFixedIntervalRetryPolicy(TelephonyOutboundRetryPolicy, discriminator='fixed_interval'): + interval: timedelta + max_attempts: int + type: Literal[TelephonyOutboundRetryPolicyType.FIXED_INTERVAL] + + @overload + def __init__( + self, + *, + interval: timedelta, + max_attempts: Optional[int] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TelephonyOutboundRetryPolicy(_Model): + max_attempts: Optional[int] + type: str + + @overload + def __init__( + self, + *, + max_attempts: Optional[int] = ..., + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TelephonyOutboundRetryPolicyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FIXED_INTERVAL = "fixed_interval" + + + class azure.ai.projects.models.TelephonyProvider(str, Enum, metaclass=CaseInsensitiveEnumMeta): + TEAMS_PHONE_EXTENSIBILITY = "teams_phone_extensibility" + TWILIO = "twilio" + + + class azure.ai.projects.models.TelephonyTransferDestination(_Model): + kind: str + + @overload + def __init__( + self, + *, + kind: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TelephonyTransferDestinationKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + PSTN = "pstn" + SIP = "sip" + TEAMS = "teams" + + + class azure.ai.projects.models.TelephonyTransferTarget(_Model): + description: str + destination: TelephonyTransferDestination + name: str + + @overload + def __init__( + self, + *, + description: str, + destination: TelephonyTransferDestination, + name: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TelephonyTransferTargets(_Model): + transfer_targets: list[TelephonyTransferTarget] + + @overload + def __init__( + self, + *, + transfer_targets: list[TelephonyTransferTarget] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TestingCriterionAzureAIEvaluator(TypedDict, total=False): + key "data_mapping": Dict[str, str] + key "evaluator_name": Required[str] + key "evaluator_version": str + key "initialization_parameters": Dict[str, Any] + key "name": Required[str] + key "type": Required[Literal["azure_ai_evaluator"]] + + + class azure.ai.projects.models.TextResponseFormat(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TextResponseFormatConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + JSON_OBJECT = "json_object" + JSON_SCHEMA = "json_schema" + TEXT = "text" + + + class azure.ai.projects.models.TextResponseFormatJsonObject(TextResponseFormat, discriminator='json_object'): + type: Literal[TextResponseFormatConfigurationType.JSON_OBJECT] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TextResponseFormatJsonSchema(TextResponseFormat, discriminator='json_schema'): + description: Optional[str] + name: str + schema: dict[str, Any] + strict: Optional[bool] + type: Literal[TextResponseFormatConfigurationType.JSON_SCHEMA] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + name: str, + schema: dict[str, Any], + strict: Optional[bool] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TextResponseFormatText(TextResponseFormat, discriminator='text'): + type: Literal[TextResponseFormatConfigurationType.TEXT] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TimerRoutineTrigger(RoutineTrigger, discriminator='timer'): + at: Optional[datetime] + type: Literal[RoutineTriggerType.TIMER] + + @overload + def __init__( + self, + *, + at: Optional[datetime] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TelephonyCallJobTerminalReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ANSWER_FAILED = "answer_failed" - BRIDGE_CANCELLED = "bridge_cancelled" - BRIDGE_FAILED = "bridge_failed" - CAMPAIGN_CANCELLED = "campaign_cancelled" - CAMPAIGN_COMPLETED = "campaign_completed" - CAMPAIGN_FAILED = "campaign_failed" - CAMPAIGN_NOT_FOUND = "campaign_not_found" - CANCELLATION_RECONCILIATION_TIMEOUT = "cancellation_reconciliation_timeout" - CONNECTION_PROJECT_MISMATCH = "connection_project_mismatch" - NO_ANSWER = "no_answer" - NO_ANSWER_TIMEOUT = "no_answer_timeout" - ORIGINATION_FENCE_NOT_RECORDED = "origination_fence_not_recorded" - ORIGINATION_RECONCILIATION_TIMEOUT = "origination_reconciliation_timeout" - OUTBOUND_CONNECTION_CHANGED = "outbound_connection_changed" - OUTBOUND_CONNECTION_UNAVAILABLE = "outbound_connection_unavailable" - PROVIDER_CALLBACK_TIMEOUT_CANCELLATION_RECONCILIATION_TIMEOUT = "provider_callback_timeout_cancellation_reconciliation_timeout" - TELEPHONY_BINDING_CHANGED = "telephony_binding_changed" - TELEPHONY_BINDING_INACTIVE = "telephony_binding_inactive" - TELEPHONY_BINDING_INVALID = "telephony_binding_invalid" - TELEPHONY_BINDING_NOT_FOUND = "telephony_binding_not_found" - VOICE_SESSION_CONFIGURATION_INVALID = "voice_session_configuration_invalid" + class azure.ai.projects.models.Tool(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TelephonyCallLifecycleEvent(_Model): - name: Union[str, TelephonyCallLifecycleEventName] - observed_at: datetime - occurred_at: Optional[datetime] - outcome: Union[str, TelephonyCallLifecycleEventOutcome] - provider_event_id: Optional[str] - provider_sequence: Optional[int] - provider_status_code: Optional[int] - provider_sub_code: Optional[int] - reason: Optional[Union[str, TelephonyCallLifecycleEventReason]] - sequence: int - source: Union[str, TelephonyCallLifecycleEventSource] - timestamp_source: Union[str, TelephonyCallTimestampSource] + + class azure.ai.projects.models.ToolApplyPatchToolParam(Tool, discriminator='apply_patch'): + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] + type: Literal[ToolType.APPLY_PATCH] @overload def __init__( self, *, - name: Union[str, TelephonyCallLifecycleEventName], - observed_at: datetime, - occurred_at: Optional[datetime] = ..., - outcome: Union[str, TelephonyCallLifecycleEventOutcome], - provider_event_id: Optional[str] = ..., - provider_sequence: Optional[int] = ..., - provider_status_code: Optional[int] = ..., - provider_sub_code: Optional[int] = ..., - reason: Optional[Union[str, TelephonyCallLifecycleEventReason]] = ..., - source: Union[str, TelephonyCallLifecycleEventSource], - timestamp_source: Union[str, TelephonyCallTimestampSource] + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolChoiceAllowed(ToolChoiceParam, discriminator='allowed_tools'): + mode: Literal["auto", "required"] + tools: list[dict[str, Any]] + type: Literal[ToolChoiceParamType.ALLOWED_TOOLS] + + @overload + def __init__( + self, + *, + mode: Literal["auto", "required"], + tools: list[dict[str, Any]] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolChoiceCodeInterpreter(ToolChoiceParam, discriminator='code_interpreter'): + type: Literal[ToolChoiceParamType.CODE_INTERPRETER] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolChoiceComputer(ToolChoiceParam, discriminator='computer'): + type: Literal[ToolChoiceParamType.COMPUTER] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolChoiceComputerUse(ToolChoiceParam, discriminator='computer_use'): + type: Literal[ToolChoiceParamType.COMPUTER_USE] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolChoiceComputerUsePreview(ToolChoiceParam, discriminator='computer_use_preview'): + type: Literal[ToolChoiceParamType.COMPUTER_USE_PREVIEW] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolChoiceCustom(ToolChoiceParam, discriminator='custom'): + name: str + type: Literal[ToolChoiceParamType.CUSTOM] + + @overload + def __init__( + self, + *, + name: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolChoiceFileSearch(ToolChoiceParam, discriminator='file_search'): + type: Literal[ToolChoiceParamType.FILE_SEARCH] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolChoiceFunction(ToolChoiceParam, discriminator='function'): + name: str + type: Literal[ToolChoiceParamType.FUNCTION] + + @overload + def __init__( + self, + *, + name: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolChoiceImageGeneration(ToolChoiceParam, discriminator='image_generation'): + type: Literal[ToolChoiceParamType.IMAGE_GENERATION] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolChoiceMCP(ToolChoiceParam, discriminator='mcp'): + name: Optional[str] + server_label: str + type: Literal[ToolChoiceParamType.MCP] + + @overload + def __init__( + self, + *, + name: Optional[str] = ..., + server_label: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolChoiceOptions(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AUTO = "auto" + NONE = "none" + REQUIRED = "required" + + + class azure.ai.projects.models.ToolChoiceParam(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolChoiceParamType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ALLOWED_TOOLS = "allowed_tools" + APPLY_PATCH = "apply_patch" + CODE_INTERPRETER = "code_interpreter" + COMPUTER = "computer" + COMPUTER_USE = "computer_use" + COMPUTER_USE_PREVIEW = "computer_use_preview" + CUSTOM = "custom" + FILE_SEARCH = "file_search" + FUNCTION = "function" + IMAGE_GENERATION = "image_generation" + MCP = "mcp" + PROGRAMMATIC_TOOL_CALLING = "programmatic_tool_calling" + SHELL = "shell" + WEB_SEARCH_PREVIEW = "web_search_preview" + WEB_SEARCH_PREVIEW_2025_03_11 = "web_search_preview_2025_03_11" + + + class azure.ai.projects.models.ToolChoiceWebSearchPreview(ToolChoiceParam, discriminator='web_search_preview'): + type: Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolChoiceWebSearchPreview20250311(ToolChoiceParam, discriminator='web_search_preview_2025_03_11'): + type: Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW_2025_03_11] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolCodeInterpreterTool(Tool, discriminator='code_interpreter'): + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] + container: Optional[Union[str, AutoCodeInterpreterToolParam]] + description: Optional[str] + name: Optional[str] + tool_configs: Optional[dict[str, ToolConfig]] + type: Literal[ToolType.CODE_INTERPRETER] + + @overload + def __init__( + self, + *, + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ..., + container: Optional[Union[str, AutoCodeInterpreterToolParam]] = ..., + description: Optional[str] = ..., + name: Optional[str] = ..., + tool_configs: Optional[dict[str, ToolConfig]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TelephonyCallLifecycleEventName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AGENT_SESSION_CONNECT = "telephony.agent_session.connect" - BINDING_RESOLVE = "telephony.binding.resolve" - CALL_DISCONNECT = "telephony.call.disconnect" - CALL_HANGUP = "telephony.call.hangup" - CALL_TRANSFER = "telephony.call.transfer" - FIRST_AGENT_AUDIO = "telephony.media.first_agent_audio" - FIRST_CALLER_AUDIO = "telephony.media.first_caller_audio" - MEDIA_CONNECT = "telephony.media.connect" - PROVIDER_ANSWER = "telephony.provider.answer" - WEBHOOK_RECEIVED = "telephony.webhook.received" - WEBHOOK_VALIDATION = "telephony.webhook.validation" - - - class azure.ai.projects.models.TelephonyCallLifecycleEventOutcome(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CANCELLED = "cancelled" - FAILED = "failed" - OBSERVED = "observed" - REJECTED = "rejected" - STARTED = "started" - SUCCEEDED = "succeeded" + class azure.ai.projects.models.ToolComputerTool(Tool, discriminator='computer'): + type: Literal[ToolType.COMPUTER] + @overload + def __init__(self) -> None: ... - class azure.ai.projects.models.TelephonyCallLifecycleEventReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ADMISSION_CHECK_FAILED = "admission_check_failed" - ADMISSION_REJECTED = "admission_rejected" - AGENT_SESSION_CONNECT_FAILED = "agent_session_connect_failed" - ANSWER_FAILED = "answer_failed" - BINDING_NOT_FOUND = "binding_not_found" - BINDING_SUSPENDED = "binding_suspended" - BRIDGE_CANCELLED = "bridge_cancelled" - BRIDGE_FAILED = "bridge_failed" - CREDENTIAL_RESOLUTION_FAILED = "credential_resolution_failed" - ENDPOINT_RESOLUTION_FAILED = "endpoint_resolution_failed" - INGRESS_SETUP_FAILED = "ingress_setup_failed" - INVALID_BINDING_CONFIGURATION = "invalid_binding_configuration" - INVALID_WEBHOOK_PAYLOAD = "invalid_webhook_payload" - LIVE_CALL_CONFLICT = "live_call_conflict" - LIVE_CALL_PERSISTENCE_FAILED = "live_call_persistence_failed" - MANAGED_HANGUP = "managed_hangup" - MANAGED_TRANSFER = "managed_transfer" - MANAGE_HANGUP_FAILED = "manage_hangup_failed" - MANAGE_TRANSFER_FAILED = "manage_transfer_failed" - MEDIA_STREAM_ENDED = "media_stream_ended" - PROVIDER_BUSY = "provider_busy" - PROVIDER_CANCELLED = "provider_cancelled" - PROVIDER_DISCONNECTED = "provider_disconnected" - PROVIDER_FAILED = "provider_failed" - PROVIDER_NO_ANSWER = "provider_no_answer" - PROVIDER_RESOURCE_MISMATCH = "provider_resource_mismatch" - PROVIDER_STREAM_ERROR = "provider_stream_error" - PROVIDER_STREAM_STOPPED = "provider_stream_stopped" - ROUTE_AGENT_MISMATCH = "route_agent_mismatch" - WEBHOOK_VALIDATION_FAILED = "webhook_validation_failed" + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TelephonyCallLifecycleEventSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): - GATEWAY = "gateway" - TEAMS_PHONE_EXTENSIBILITY = "teams_phone_extensibility" - TWILIO = "twilio" - VOICE_AGENT = "voice_agent" + class azure.ai.projects.models.ToolComputerUsePreviewTool(Tool, discriminator='computer_use_preview'): + display_height: int + display_width: int + environment: Union[str, ComputerEnvironment] + type: Literal[ToolType.COMPUTER_USE_PREVIEW] + @overload + def __init__( + self, + *, + display_height: int, + display_width: int, + environment: Union[str, ComputerEnvironment] + ) -> None: ... - class azure.ai.projects.models.TelephonyCallPhase(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ADMITTED = "admitted" - AGENT_SESSION_READY = "agent_session_ready" - ANSWERED = "answered" - ANSWERING = "answering" - BRIDGING = "bridging" - COMPLETED = "completed" - FAILED = "failed" - MANAGING = "managing" - MEDIA_CONNECTED = "media_connected" - RECEIVED = "received" - REJECTED = "rejected" - VALIDATED = "validated" + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TelephonyCallRecord(_Model): - agent_session_ready_at: Optional[datetime] - answered_at: Optional[datetime] - caller_number: Optional[str] - duration_ms: Optional[timedelta] - end_reason: Optional[Union[str, TelephonyCallEndReason]] - ended_at: Optional[datetime] - events: list[TelephonyCallLifecycleEvent] - events_truncated: bool - id: str - media_connected_at: Optional[datetime] - phase: Union[str, TelephonyCallPhase] - provider: Union[str, TelephonyProvider] - provider_call_id: Optional[str] - provider_message: Optional[str] - provider_number: Optional[str] - provider_status_code: Optional[int] - provider_sub_code: Optional[int] - started_at: datetime - status: Union[str, TelephonyCallStatus] - timing: TelephonyCallTiming - trace: Optional[TelephonyCallTrace] + class azure.ai.projects.models.ToolConfig(_Model): + additional_search_text: Optional[str] + pin: Optional[bool] @overload def __init__( self, *, - agent_session_ready_at: Optional[datetime] = ..., - answered_at: Optional[datetime] = ..., - caller_number: Optional[str] = ..., - duration_ms: Optional[timedelta] = ..., - end_reason: Optional[Union[str, TelephonyCallEndReason]] = ..., - ended_at: Optional[datetime] = ..., - events: list[TelephonyCallLifecycleEvent], - events_truncated: bool, - id: str, - media_connected_at: Optional[datetime] = ..., - phase: Union[str, TelephonyCallPhase], - provider: Union[str, TelephonyProvider], - provider_call_id: Optional[str] = ..., - provider_message: Optional[str] = ..., - provider_number: Optional[str] = ..., - provider_status_code: Optional[int] = ..., - provider_sub_code: Optional[int] = ..., - started_at: datetime, - status: Union[str, TelephonyCallStatus], - timing: TelephonyCallTiming, - trace: Optional[TelephonyCallTrace] = ... + additional_search_text: Optional[str] = ..., + pin: Optional[bool] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TelephonyCallStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - FAILED = "failed" - IN_PROGRESS = "in_progress" - SUCCESS = "success" - - - class azure.ai.projects.models.TelephonyCallSummary(_Model): - agent_session_ready_at: Optional[datetime] - answered_at: Optional[datetime] - caller_number: Optional[str] - duration_ms: Optional[timedelta] - end_reason: Optional[Union[str, TelephonyCallEndReason]] - ended_at: Optional[datetime] - id: str - media_connected_at: Optional[datetime] - phase: Union[str, TelephonyCallPhase] - provider: Union[str, TelephonyProvider] - provider_call_id: Optional[str] - provider_message: Optional[str] - provider_number: Optional[str] - provider_status_code: Optional[int] - provider_sub_code: Optional[int] - started_at: datetime - status: Union[str, TelephonyCallStatus] + class azure.ai.projects.models.ToolCustomToolParam(Tool, discriminator='custom'): + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] + async_property: Optional[bool] + defer_loading: Optional[bool] + description: Optional[str] + format: Optional[CustomToolParamFormat] + name: str + type: Literal[ToolType.CUSTOM] @overload def __init__( self, *, - agent_session_ready_at: Optional[datetime] = ..., - answered_at: Optional[datetime] = ..., - caller_number: Optional[str] = ..., - duration_ms: Optional[timedelta] = ..., - end_reason: Optional[Union[str, TelephonyCallEndReason]] = ..., - ended_at: Optional[datetime] = ..., - id: str, - media_connected_at: Optional[datetime] = ..., - phase: Union[str, TelephonyCallPhase], - provider: Union[str, TelephonyProvider], - provider_call_id: Optional[str] = ..., - provider_message: Optional[str] = ..., - provider_number: Optional[str] = ..., - provider_status_code: Optional[int] = ..., - provider_sub_code: Optional[int] = ..., - started_at: datetime, - status: Union[str, TelephonyCallStatus] + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ..., + async_property: Optional[bool] = ..., + defer_loading: Optional[bool] = ..., + description: Optional[str] = ..., + format: Optional[CustomToolParamFormat] = ..., + name: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TelephonyCallTimestampSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DERIVED = "derived" - GATEWAY = "gateway" - PROVIDER = "provider" - - - class azure.ai.projects.models.TelephonyCallTiming(_Model): - admitted_at: Optional[datetime] - agent_session_ready_at: Optional[datetime] - answer_requested_at: Optional[datetime] - answered_at: Optional[datetime] - duration_basis: Optional[Union[str, TelephonyCallDurationBasis]] - ended_at: Optional[datetime] - first_agent_audio_at: Optional[datetime] - first_caller_audio_at: Optional[datetime] - media_connected_at: Optional[datetime] - received_at: Optional[datetime] - timestamp_source: Union[str, TelephonyCallTimestampSource] - validated_at: Optional[datetime] + class azure.ai.projects.models.ToolDescription(_Model): + description: Optional[str] + name: Optional[str] @overload def __init__( self, *, - admitted_at: Optional[datetime] = ..., - agent_session_ready_at: Optional[datetime] = ..., - answer_requested_at: Optional[datetime] = ..., - answered_at: Optional[datetime] = ..., - duration_basis: Optional[Union[str, TelephonyCallDurationBasis]] = ..., - ended_at: Optional[datetime] = ..., - first_agent_audio_at: Optional[datetime] = ..., - first_caller_audio_at: Optional[datetime] = ..., - media_connected_at: Optional[datetime] = ..., - received_at: Optional[datetime] = ..., - timestamp_source: Union[str, TelephonyCallTimestampSource], - validated_at: Optional[datetime] = ... + description: Optional[str] = ..., + name: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolDescriptionParam(TypedDict, total=False): + key "description": str + key "name": str + + + class azure.ai.projects.models.ToolFileSearchTool(Tool, discriminator='file_search'): + description: Optional[str] + filters: Optional[Filters] + max_num_results: Optional[int] + name: Optional[str] + ranking_options: Optional[RankingOptions] + tool_configs: Optional[dict[str, ToolConfig]] + type: Literal[ToolType.FILE_SEARCH] + vector_store_ids: list[str] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + filters: Optional[Filters] = ..., + max_num_results: Optional[int] = ..., + name: Optional[str] = ..., + ranking_options: Optional[RankingOptions] = ..., + tool_configs: Optional[dict[str, ToolConfig]] = ..., + vector_store_ids: list[str] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TelephonyCallTrace(_Model): - conversation_id: Optional[str] - mode: Optional[Union[str, TelephonyCallTraceMode]] - root_span_id: Optional[str] - status: Union[str, TelephonyCallTraceStatus] - trace_id: Optional[str] + class azure.ai.projects.models.ToolFunctionShellToolParam(Tool, discriminator='shell'): + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] + description: Optional[str] + environment: Optional[FunctionShellToolParamEnvironment] + name: Optional[str] + tool_configs: Optional[dict[str, ToolConfig]] + type: Literal[ToolType.SHELL] @overload def __init__( self, *, - conversation_id: Optional[str] = ..., - mode: Optional[Union[str, TelephonyCallTraceMode]] = ..., - root_span_id: Optional[str] = ..., - status: Union[str, TelephonyCallTraceStatus], - trace_id: Optional[str] = ... + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ..., + description: Optional[str] = ..., + environment: Optional[FunctionShellToolParamEnvironment] = ..., + name: Optional[str] = ..., + tool_configs: Optional[dict[str, ToolConfig]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TelephonyCallTraceMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - LIVE = "live" - POST_CALL = "post_call" - - - class azure.ai.projects.models.TelephonyCallTraceStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AVAILABLE = "available" - EMITTING = "emitting" - FAILED = "failed" - NOT_APPLICABLE = "not_applicable" - NOT_RECORDED = "not_recorded" - PENDING = "pending" - - - class azure.ai.projects.models.TelephonyOutboundDestination(_Model): - type: Union[str, TelephonyOutboundDestinationType] - value: str + class azure.ai.projects.models.ToolFunctionTool(Tool, discriminator='function'): + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] + async_property: Optional[bool] + defer_loading: Optional[bool] + description: Optional[str] + name: str + output_schema: Optional[dict[str, Any]] + parameters: dict[str, Any] + strict: bool + type: Literal[ToolType.FUNCTION] @overload def __init__( self, *, - type: Union[str, TelephonyOutboundDestinationType], - value: str + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ..., + async_property: Optional[bool] = ..., + defer_loading: Optional[bool] = ..., + description: Optional[str] = ..., + name: str, + output_schema: Optional[dict[str, Any]] = ..., + parameters: dict[str, Any], + strict: bool ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TelephonyOutboundDestinationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - PHONE_NUMBER = "phone_number" - - - class azure.ai.projects.models.TelephonyOutboundFixedIntervalRetryPolicy(TelephonyOutboundRetryPolicy, discriminator='fixed_interval'): - interval: timedelta - max_attempts: int - type: Literal[TelephonyOutboundRetryPolicyType.FIXED_INTERVAL] + class azure.ai.projects.models.ToolImageGenTool(Tool, discriminator='image_generation'): + action: Optional[Union[str, ImageGenAction]] + background: Optional[Literal["transparent", "opaque", "auto"]] + description: Optional[str] + input_fidelity: Optional[Union[str, InputFidelity]] + input_image_mask: Optional[ImageGenToolInputImageMask] + model: Optional[Union[Literal["gpt-image-1"], Literal["gpt-image-1-mini"], Literal["gpt-image-5"], Literal["gpt-image-2"], Literal["gpt-image-2-2026-04-21"], Literal["gpt-image-5-sunburst"], Literal["gpt-image-5-sunburst-2026-09-08"], Literal["gpt-image-5-flare"], Literal["gpt-image-5-flare-2026-09-08"], str]] + moderation: Optional[Literal["auto", "low"]] + name: Optional[str] + output_compression: Optional[int] + output_format: Optional[Literal["png", "webp", "jpeg"]] + partial_images: Optional[int] + quality: Optional[Literal["low", "medium", "high", "xhigh", "max", "auto"]] + size: Optional[Union[Literal["1024x1024"], Literal["1024x1536"], Literal["1536x1024"], Literal["auto"], str]] + tool_configs: Optional[dict[str, ToolConfig]] + type: Literal[ToolType.IMAGE_GENERATION] @overload def __init__( self, *, - interval: timedelta, - max_attempts: Optional[int] = ... + action: Optional[Union[str, ImageGenAction]] = ..., + background: Optional[Literal[transparent, opaque, auto]] = ..., + description: Optional[str] = ..., + input_fidelity: Optional[Union[str, InputFidelity]] = ..., + input_image_mask: Optional[ImageGenToolInputImageMask] = ..., + model: Optional[Union[Literal[gpt-image-1], Literal[gpt-image-1-mini], Literal[gpt-image-5], Literal[gpt-image-2], Literal[gpt-image-2-2026-04-21], Literal[gpt-image-5-sunburst], Literal[gpt-image-5-sunburst-2026-09-08], Literal[gpt-image-5-flare], Literal[gpt-image-5-flare-2026-09-08], str]] = ..., + moderation: Optional[Literal[auto, low]] = ..., + name: Optional[str] = ..., + output_compression: Optional[int] = ..., + output_format: Optional[Literal[png, webp, jpeg]] = ..., + partial_images: Optional[int] = ..., + quality: Optional[Literal[low, medium, high, xhigh, max, auto]] = ..., + size: Optional[Union[Literal[1024x1024], Literal[1024x1536], Literal[1536x1024], Literal[auto], str]] = ..., + tool_configs: Optional[dict[str, ToolConfig]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TelephonyOutboundRetryPolicy(_Model): - max_attempts: Optional[int] - type: str + class azure.ai.projects.models.ToolLocalShellToolParam(Tool, discriminator='local_shell'): + description: Optional[str] + name: Optional[str] + tool_configs: Optional[dict[str, ToolConfig]] + type: Literal[ToolType.LOCAL_SHELL] @overload def __init__( self, *, - max_attempts: Optional[int] = ..., - type: str + description: Optional[str] = ..., + name: Optional[str] = ..., + tool_configs: Optional[dict[str, ToolConfig]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TelephonyOutboundRetryPolicyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - FIXED_INTERVAL = "fixed_interval" - - - class azure.ai.projects.models.TelephonyProvider(str, Enum, metaclass=CaseInsensitiveEnumMeta): - TEAMS_PHONE_EXTENSIBILITY = "teams_phone_extensibility" - TWILIO = "twilio" - - - class azure.ai.projects.models.TelephonyTransferDestination(_Model): - kind: str + class azure.ai.projects.models.ToolMcpTool(Tool, discriminator='mcp'): + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] + allowed_tools: Optional[Union[list[str], MCPToolFilter]] + authorization: Optional[str] + connector_id: Optional[Literal["connector_dropbox", "connector_gmail", "connector_googlecalendar", "connector_googledrive", "connector_microsoftteams", "connector_outlookcalendar", "connector_outlookemail", "connector_sharepoint"]] + defer_loading: Optional[bool] + headers: Optional[dict[str, str]] + project_connection_id: Optional[str] + require_approval: Optional[Union[MCPToolRequireApproval, Literal["always"], Literal["never"]]] + server_description: Optional[str] + server_label: str + server_url: Optional[str] + tool_configs: Optional[dict[str, ToolConfig]] + tunnel_id: Optional[str] + type: Literal[ToolType.MCP] @overload def __init__( self, *, - kind: str + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ..., + allowed_tools: Optional[Union[list[str], MCPToolFilter]] = ..., + authorization: Optional[str] = ..., + connector_id: Optional[Literal[connector_dropbox, connector_gmail, connector_googlecalendar, connector_googledrive, connector_microsoftteams, connector_outlookcalendar, connector_outlookemail, connector_sharepoint]] = ..., + defer_loading: Optional[bool] = ..., + headers: Optional[dict[str, str]] = ..., + project_connection_id: Optional[str] = ..., + require_approval: Optional[Union[MCPToolRequireApproval, Literal[always], Literal[never]]] = ..., + server_description: Optional[str] = ..., + server_label: str, + server_url: Optional[str] = ..., + tool_configs: Optional[dict[str, ToolConfig]] = ..., + tunnel_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TelephonyTransferDestinationKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): - PSTN = "pstn" - SIP = "sip" - TEAMS = "teams" - - - class azure.ai.projects.models.TelephonyTransferTarget(_Model): - description: str - destination: TelephonyTransferDestination - name: str + class azure.ai.projects.models.ToolProgrammaticToolCallingParam(Tool, discriminator='programmatic_tool_calling'): + type: Literal[ToolType.PROGRAMMATIC_TOOL_CALLING] @overload - def __init__( - self, - *, - description: str, - destination: TelephonyTransferDestination, - name: str - ) -> None: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TelephonyTransferTargets(_Model): - transfer_targets: list[TelephonyTransferTarget] + class azure.ai.projects.models.ToolProjectConnection(_Model): + project_connection_id: str @overload def __init__( self, *, - transfer_targets: list[TelephonyTransferTarget] + project_connection_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TestingCriterionAzureAIEvaluator(TypedDict, total=False): - key "data_mapping": Dict[str, str] - key "evaluator_name": Required[str] - key "evaluator_version": str - key "initialization_parameters": Dict[str, Any] - key "name": Required[str] - key "type": Required[Literal["azure_ai_evaluator"]] + class azure.ai.projects.models.ToolSearchExecutionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CLIENT = "client" + SERVER = "server" - class azure.ai.projects.models.TextResponseFormat(_Model): - type: str + class azure.ai.projects.models.ToolSearchToolboxTool(ToolboxTool, discriminator='toolbox_search'): + description: str + name: str + tool_configs: dict[str, ToolConfig] + type: Literal[ToolboxToolType.TOOLBOX_SEARCH] @overload def __init__( self, *, - type: str + description: Optional[str] = ..., + name: Optional[str] = ..., + tool_configs: Optional[dict[str, ToolConfig]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TextResponseFormatConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - JSON_OBJECT = "json_object" - JSON_SCHEMA = "json_schema" - TEXT = "text" - - - class azure.ai.projects.models.TextResponseFormatJsonObject(TextResponseFormat, discriminator='json_object'): - type: Literal[TextResponseFormatConfigurationType.JSON_OBJECT] + class azure.ai.projects.models.ToolToolSearchToolParam(Tool, discriminator='tool_search'): + description: Optional[str] + execution: Optional[Union[str, ToolSearchExecutionType]] + parameters: Optional[EmptyModelParam] + type: Literal[ToolType.TOOL_SEARCH] @overload - def __init__(self) -> None: ... + def __init__( + self, + *, + description: Optional[str] = ..., + execution: Optional[Union[str, ToolSearchExecutionType]] = ..., + parameters: Optional[EmptyModelParam] = ... + ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TextResponseFormatJsonSchema(TextResponseFormat, discriminator='json_schema'): - description: Optional[str] - name: str - schema: dict[str, Any] - strict: Optional[bool] - type: Literal[TextResponseFormatConfigurationType.JSON_SCHEMA] + class azure.ai.projects.models.ToolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + A2A_PREVIEW = "a2a_preview" + A2_A = "a2a" + APPLY_PATCH = "apply_patch" + AZURE_AI_SEARCH = "azure_ai_search" + AZURE_FUNCTION = "azure_function" + BING_CUSTOM_SEARCH_PREVIEW = "bing_custom_search_preview" + BING_GROUNDING = "bing_grounding" + BROWSER_AUTOMATION = "browser_automation" + BROWSER_AUTOMATION_PREVIEW = "browser_automation_preview" + CAPTURE_STRUCTURED_OUTPUTS = "capture_structured_outputs" + CODE_INTERPRETER = "code_interpreter" + COMPUTER = "computer" + COMPUTER_USE_PREVIEW = "computer_use_preview" + CUSTOM = "custom" + FABRIC_DATAAGENT_PREVIEW = "fabric_dataagent_preview" + FABRIC_IQ_PREVIEW = "fabric_iq_preview" + FILE_SEARCH = "file_search" + FUNCTION = "function" + GITHUB_COPILOT_TOOLSET_PREVIEW = "github_copilot_toolset_preview" + IMAGE_GENERATION = "image_generation" + LOCAL_SHELL = "local_shell" + MCP = "mcp" + MEMORY_SEARCH_PREVIEW = "memory_search_preview" + MICROSOFT_COPILOT_TOOLSET_PREVIEW = "microsoft_copilot_toolset_preview" + NAMESPACE = "namespace" + OPENAPI = "openapi" + PROGRAMMATIC_TOOL_CALLING = "programmatic_tool_calling" + SHAREPOINT_GROUNDING_PREVIEW = "sharepoint_grounding_preview" + SHELL = "shell" + TOOLBOX_SEARCH_PREVIEW = "toolbox_search_preview" + TOOL_SEARCH = "tool_search" + WEB_IQ_PREVIEW = "web_iq_preview" + WEB_SEARCH = "web_search" + WEB_SEARCH_PREVIEW = "web_search_preview" + WORK_IQ_PREVIEW = "work_iq_preview" + + + class azure.ai.projects.models.ToolUseFineTuningDataGenerationJobConfiguration(DataGenerationJobConfiguration, discriminator='tool_use'): + max_samples: int + model_options: DataGenerationModelOptions + train_split: float + type: Literal[DataGenerationJobType.TOOL_USE] @overload def __init__( self, *, - description: Optional[str] = ..., - name: str, - schema: dict[str, Any], - strict: Optional[bool] = ... + max_samples: int, + model_options: Optional[DataGenerationModelOptions] = ..., + train_split: Optional[float] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TextResponseFormatText(TextResponseFormat, discriminator='text'): - type: Literal[TextResponseFormatConfigurationType.TEXT] + class azure.ai.projects.models.ToolWebSearchPreviewTool(Tool, discriminator='web_search_preview'): + search_content_types: Optional[list[Union[str, SearchContentType]]] + search_context_size: Optional[Union[str, SearchContextSize]] + type: Literal[ToolType.WEB_SEARCH_PREVIEW] + user_location: Optional[ApproximateLocation] @overload - def __init__(self) -> None: ... + def __init__( + self, + *, + search_content_types: Optional[list[Union[str, SearchContentType]]] = ..., + search_context_size: Optional[Union[str, SearchContextSize]] = ..., + user_location: Optional[ApproximateLocation] = ... + ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TimerRoutineTrigger(RoutineTrigger, discriminator='timer'): - at: Optional[datetime] - type: Literal[RoutineTriggerType.TIMER] + class azure.ai.projects.models.ToolWebSearchTool(Tool, discriminator='web_search'): + custom_search_configuration: Optional[WebSearchConfiguration] + description: Optional[str] + external_web_access: Optional[bool] + filters: Optional[WebSearchToolFilters] + name: Optional[str] + search_context_size: Optional[Literal["low", "medium", "high"]] + tool_configs: Optional[dict[str, ToolConfig]] + type: Literal[ToolType.WEB_SEARCH] + user_location: Optional[WebSearchApproximateLocation] @overload def __init__( self, *, - at: Optional[datetime] = ... + custom_search_configuration: Optional[WebSearchConfiguration] = ..., + description: Optional[str] = ..., + external_web_access: Optional[bool] = ..., + filters: Optional[WebSearchToolFilters] = ..., + name: Optional[str] = ..., + search_context_size: Optional[Literal[low, medium, high]] = ..., + tool_configs: Optional[dict[str, ToolConfig]] = ..., + user_location: Optional[WebSearchApproximateLocation] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.Tool(_Model): - type: str + class azure.ai.projects.models.ToolboxObject(_Model): + default_version: str + id: str + name: str + updated_at: datetime + versions: ToolboxVersions @overload def __init__( self, *, - type: str + default_version: str, + id: str, + name: str, + updated_at: datetime, + versions: ToolboxVersions ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolChoiceAllowed(ToolChoiceParam, discriminator='allowed_tools'): - mode: Literal["auto", "required"] - tools: list[dict[str, Any]] - type: Literal[ToolChoiceParamType.ALLOWED_TOOLS] + class azure.ai.projects.models.ToolboxPolicies(_Model): + rai_config: Optional[RaiConfig] @overload def __init__( self, *, - mode: Literal["auto", "required"], - tools: list[dict[str, Any]] + rai_config: Optional[RaiConfig] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolChoiceCodeInterpreter(ToolChoiceParam, discriminator='code_interpreter'): - type: Literal[ToolChoiceParamType.CODE_INTERPRETER] + class azure.ai.projects.models.ToolboxSearchPreviewToolboxTool(ToolboxTool, discriminator='toolbox_search_preview'): + description: str + name: str + tool_configs: dict[str, ToolConfig] + type: Literal[ToolboxToolType.TOOLBOX_SEARCH_PREVIEW] @overload - def __init__(self) -> None: ... + def __init__( + self, + *, + description: Optional[str] = ..., + name: Optional[str] = ..., + tool_configs: Optional[dict[str, ToolConfig]] = ... + ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolChoiceComputer(ToolChoiceParam, discriminator='computer'): - type: Literal[ToolChoiceParamType.COMPUTER] + class azure.ai.projects.models.ToolboxShellContainerAutoEnvironment(ToolboxShellEnvironment, discriminator='container_auto'): + file_ids: Optional[list[str]] + memory_limit: Optional[Union[str, ContainerMemoryLimit]] + network_policy: Optional[ToolboxShellNetworkPolicy] + skills: Optional[list[ContainerSkill]] + type: Literal["container_auto"] @overload - def __init__(self) -> None: ... + def __init__( + self, + *, + file_ids: Optional[list[str]] = ..., + memory_limit: Optional[Union[str, ContainerMemoryLimit]] = ..., + network_policy: Optional[ToolboxShellNetworkPolicy] = ..., + skills: Optional[list[ContainerSkill]] = ... + ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolChoiceComputerUse(ToolChoiceParam, discriminator='computer_use'): - type: Literal[ToolChoiceParamType.COMPUTER_USE] + class azure.ai.projects.models.ToolboxShellContainerReferenceEnvironment(ToolboxShellEnvironment, discriminator='container_reference'): + container_id: str + type: Literal["container_reference"] @overload - def __init__(self) -> None: ... + def __init__( + self, + *, + container_id: str + ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolChoiceComputerUsePreview(ToolChoiceParam, discriminator='computer_use_preview'): - type: Literal[ToolChoiceParamType.COMPUTER_USE_PREVIEW] + class azure.ai.projects.models.ToolboxShellEnvironment(_Model): + type: str @overload - def __init__(self) -> None: ... + def __init__( + self, + *, + type: str + ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolChoiceCustom(ToolChoiceParam, discriminator='custom'): - name: str - type: Literal[ToolChoiceParamType.CUSTOM] + class azure.ai.projects.models.ToolboxShellNetworkPolicy(_Model): + type: str @overload def __init__( self, *, - name: str + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolChoiceFileSearch(ToolChoiceParam, discriminator='file_search'): - type: Literal[ToolChoiceParamType.FILE_SEARCH] + class azure.ai.projects.models.ToolboxShellNetworkPolicyDisabled(ToolboxShellNetworkPolicy, discriminator='disabled'): + type: Literal["disabled"] @overload def __init__(self) -> None: ... @@ -14305,61 +17202,50 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolChoiceFunction(ToolChoiceParam, discriminator='function'): - name: str - type: Literal[ToolChoiceParamType.FUNCTION] + class azure.ai.projects.models.ToolboxSkill(_Model): + type: str @overload def __init__( self, *, - name: str + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolChoiceImageGeneration(ToolChoiceParam, discriminator='image_generation'): - type: Literal[ToolChoiceParamType.IMAGE_GENERATION] - - @overload - def __init__(self) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.ToolChoiceMCP(ToolChoiceParam, discriminator='mcp'): - name: Optional[str] - server_label: str - type: Literal[ToolChoiceParamType.MCP] + class azure.ai.projects.models.ToolboxSkillReference(ToolboxSkill, discriminator='skill_reference'): + name: str + type: Literal["skill_reference"] + version: Optional[str] @overload def __init__( self, *, - name: Optional[str] = ..., - server_label: str + name: str, + version: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolChoiceOptions(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AUTO = "auto" - NONE = "none" - REQUIRED = "required" - - - class azure.ai.projects.models.ToolChoiceParam(_Model): + class azure.ai.projects.models.ToolboxTool(_Model): + description: Optional[str] + name: Optional[str] + tool_configs: Optional[dict[str, ToolConfig]] type: str @overload def __init__( self, *, + description: Optional[str] = ..., + name: Optional[str] = ..., + tool_configs: Optional[dict[str, ToolConfig]] = ..., type: str ) -> None: ... @@ -14367,604 +17253,529 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolChoiceParamType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ALLOWED_TOOLS = "allowed_tools" - APPLY_PATCH = "apply_patch" + class azure.ai.projects.models.ToolboxToolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + A2A_PREVIEW = "a2a_preview" + A2_A = "a2a" + AZURE_AI_SEARCH = "azure_ai_search" + BROWSER_AUTOMATION = "browser_automation" + BROWSER_AUTOMATION_PREVIEW = "browser_automation_preview" CODE_INTERPRETER = "code_interpreter" - COMPUTER = "computer" - COMPUTER_USE = "computer_use" - COMPUTER_USE_PREVIEW = "computer_use_preview" - CUSTOM = "custom" + FABRIC_IQ_PREVIEW = "fabric_iq_preview" FILE_SEARCH = "file_search" - FUNCTION = "function" - IMAGE_GENERATION = "image_generation" MCP = "mcp" - PROGRAMMATIC_TOOL_CALLING = "programmatic_tool_calling" + OPENAPI = "openapi" + REMINDER_PREVIEW = "reminder_preview" SHELL = "shell" - WEB_SEARCH_PREVIEW = "web_search_preview" - WEB_SEARCH_PREVIEW_2025_03_11 = "web_search_preview_2025_03_11" - - - class azure.ai.projects.models.ToolChoiceWebSearchPreview(ToolChoiceParam, discriminator='web_search_preview'): - type: Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW] - - @overload - def __init__(self) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.ToolChoiceWebSearchPreview20250311(ToolChoiceParam, discriminator='web_search_preview_2025_03_11'): - type: Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW_2025_03_11] - - @overload - def __init__(self) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.ToolConfig(_Model): - additional_search_text: Optional[str] - pin: Optional[bool] - - @overload - def __init__( - self, - *, - additional_search_text: Optional[str] = ..., - pin: Optional[bool] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + TOOLBOX_SEARCH = "toolbox_search" + TOOLBOX_SEARCH_PREVIEW = "toolbox_search_preview" + WEB_IQ_PREVIEW = "web_iq_preview" + WEB_SEARCH = "web_search" + WORK_IQ_PREVIEW = "work_iq_preview" - class azure.ai.projects.models.ToolDescription(_Model): + class azure.ai.projects.models.ToolboxVersionObject(_Model): + created_at: datetime description: Optional[str] - name: Optional[str] + id: str + metadata: dict[str, str] + name: str + policies: Optional[ToolboxPolicies] + skills: Optional[list[ToolboxSkill]] + tools: list[ToolboxTool] + version: str @overload def __init__( self, *, + created_at: datetime, description: Optional[str] = ..., - name: Optional[str] = ... + id: str, + metadata: dict[str, str], + name: str, + policies: Optional[ToolboxPolicies] = ..., + skills: Optional[list[ToolboxSkill]] = ..., + tools: list[ToolboxTool], + version: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolDescriptionParam(TypedDict, total=False): - key "description": str - key "name": str - - - class azure.ai.projects.models.ToolProjectConnection(_Model): - project_connection_id: str + class azure.ai.projects.models.ToolboxVersions(_Model): + latest: ToolboxVersionObject @overload def __init__( self, *, - project_connection_id: str + latest: ToolboxVersionObject ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolSearchExecutionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CLIENT = "client" - SERVER = "server" - - - class azure.ai.projects.models.ToolSearchToolParam(Tool, discriminator='tool_search'): - description: Optional[str] - execution: Optional[Union[str, ToolSearchExecutionType]] - parameters: Optional[EmptyModelParam] - type: Literal[ToolType.TOOL_SEARCH] + class azure.ai.projects.models.TracesDataGenerationJobConfiguration(DataGenerationJobConfiguration, discriminator='traces'): + max_samples: Optional[int] + model_options: DataGenerationModelOptions + redact_private_content: Optional[bool] + train_split: float + type: Literal[DataGenerationJobType.TRACES] @overload def __init__( self, *, - description: Optional[str] = ..., - execution: Optional[Union[str, ToolSearchExecutionType]] = ..., - parameters: Optional[EmptyModelParam] = ... + max_samples: Optional[int] = ..., + model_options: Optional[DataGenerationModelOptions] = ..., + redact_private_content: Optional[bool] = ..., + train_split: Optional[float] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolSearchToolboxTool(ToolboxTool, discriminator='toolbox_search'): + class azure.ai.projects.models.TracesDataGenerationJobSource(DataGenerationJobSource, discriminator='traces'): + agent_id: Optional[str] + agent_name: Optional[str] + agent_version: Optional[str] description: str - name: str - tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.TOOLBOX_SEARCH] + end_time: Optional[datetime] + start_time: datetime + trace_ids: Optional[list[str]] + type: Literal[DataGenerationJobSourceType.TRACES] @overload def __init__( self, *, + agent_id: Optional[str] = ..., + agent_name: Optional[str] = ..., + agent_version: Optional[str] = ..., description: Optional[str] = ..., - name: Optional[str] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ... + end_time: Optional[datetime] = ..., + start_time: datetime, + trace_ids: Optional[list[str]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - A2A_PREVIEW = "a2a_preview" - A2_A = "a2a" - APPLY_PATCH = "apply_patch" - AZURE_AI_SEARCH = "azure_ai_search" - AZURE_FUNCTION = "azure_function" - BING_CUSTOM_SEARCH_PREVIEW = "bing_custom_search_preview" - BING_GROUNDING = "bing_grounding" - BROWSER_AUTOMATION = "browser_automation" - BROWSER_AUTOMATION_PREVIEW = "browser_automation_preview" - CAPTURE_STRUCTURED_OUTPUTS = "capture_structured_outputs" - CODE_INTERPRETER = "code_interpreter" - COMPUTER = "computer" - COMPUTER_USE_PREVIEW = "computer_use_preview" - CUSTOM = "custom" - FABRIC_DATAAGENT_PREVIEW = "fabric_dataagent_preview" - FABRIC_IQ_PREVIEW = "fabric_iq_preview" - FILE_SEARCH = "file_search" - FUNCTION = "function" - GITHUB_COPILOT_TOOLSET_PREVIEW = "github_copilot_toolset_preview" - IMAGE_GENERATION = "image_generation" - LOCAL_SHELL = "local_shell" - MCP = "mcp" - MEMORY_SEARCH_PREVIEW = "memory_search_preview" - MICROSOFT_COPILOT_TOOLSET_PREVIEW = "microsoft_copilot_toolset_preview" - NAMESPACE = "namespace" - OPENAPI = "openapi" - PROGRAMMATIC_TOOL_CALLING = "programmatic_tool_calling" - SHAREPOINT_GROUNDING_PREVIEW = "sharepoint_grounding_preview" - SHELL = "shell" - TOOLBOX_SEARCH_PREVIEW = "toolbox_search_preview" - TOOL_SEARCH = "tool_search" - WEB_IQ_PREVIEW = "web_iq_preview" - WEB_SEARCH = "web_search" - WEB_SEARCH_PREVIEW = "web_search_preview" - WORK_IQ_PREVIEW = "work_iq_preview" - - - class azure.ai.projects.models.ToolUseFineTuningDataGenerationJobConfiguration(DataGenerationJobConfiguration, discriminator='tool_use'): - max_samples: int - model_options: DataGenerationModelOptions - train_split: float - type: Literal[DataGenerationJobType.TOOL_USE] + class azure.ai.projects.models.TracesEvaluatorGenerationJobSource(EvaluatorGenerationJobSource, discriminator='traces'): + agent_id: Optional[str] + agent_name: Optional[str] + agent_version: Optional[str] + description: Optional[str] + end_time: Optional[datetime] + start_time: datetime + type: Literal[EvaluatorGenerationJobSourceType.TRACES] @overload def __init__( self, *, - max_samples: int, - model_options: Optional[DataGenerationModelOptions] = ..., - train_split: Optional[float] = ... + agent_id: Optional[str] = ..., + agent_name: Optional[str] = ..., + agent_version: Optional[str] = ..., + description: Optional[str] = ..., + end_time: Optional[datetime] = ..., + start_time: datetime ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolboxObject(_Model): - default_version: str - id: str - name: str - updated_at: datetime - versions: ToolboxVersions + class azure.ai.projects.models.TracesPreviewEvalRunDataSource(TypedDict, total=False): + key "agent_id": str + key "agent_name": str + key "end_time": datetime + key "ingestion_delay_seconds": int + key "lookback_hours": int + key "max_traces": int + key "trace_ids": List[str] + key "type": Required[Literal["azure_ai_traces_preview"]] + + + class azure.ai.projects.models.TranscriptTextUsageDuration(CreateTranscriptionResponseJsonUsage, discriminator='duration'): + seconds: timedelta + type: Literal[CreateTranscriptionResponseJsonUsageType.DURATION] @overload def __init__( self, *, - default_version: str, - id: str, - name: str, - updated_at: datetime, - versions: ToolboxVersions + seconds: timedelta ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolboxPolicies(_Model): - rai_config: Optional[RaiConfig] + class azure.ai.projects.models.TranscriptTextUsageTokens(CreateTranscriptionResponseJsonUsage, discriminator='tokens'): + input_token_details: Optional[TranscriptTextUsageTokensInputTokenDetails] + input_tokens: int + output_tokens: int + total_tokens: int + type: Literal[CreateTranscriptionResponseJsonUsageType.TOKENS] @overload def __init__( self, *, - rai_config: Optional[RaiConfig] = ... + input_token_details: Optional[TranscriptTextUsageTokensInputTokenDetails] = ..., + input_tokens: int, + output_tokens: int, + total_tokens: int ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolboxSearchPreviewToolboxTool(ToolboxTool, discriminator='toolbox_search_preview'): - description: str - name: str - tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.TOOLBOX_SEARCH_PREVIEW] + class azure.ai.projects.models.TranscriptTextUsageTokensInputTokenDetails(_Model): + audio_tokens: Optional[int] + text_tokens: Optional[int] @overload def __init__( self, *, - description: Optional[str] = ..., - name: Optional[str] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ... + audio_tokens: Optional[int] = ..., + text_tokens: Optional[int] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolboxShellContainerAutoEnvironment(ToolboxShellEnvironment, discriminator='container_auto'): - file_ids: Optional[list[str]] - memory_limit: Optional[Union[str, ContainerMemoryLimit]] - network_policy: Optional[ToolboxShellNetworkPolicy] - skills: Optional[list[ContainerSkill]] - type: Literal["container_auto"] + class azure.ai.projects.models.TranscriptionLanguage(_Model): + code: str @overload def __init__( self, *, - file_ids: Optional[list[str]] = ..., - memory_limit: Optional[Union[str, ContainerMemoryLimit]] = ..., - network_policy: Optional[ToolboxShellNetworkPolicy] = ..., - skills: Optional[list[ContainerSkill]] = ... + code: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolboxShellContainerReferenceEnvironment(ToolboxShellEnvironment, discriminator='container_reference'): - container_id: str - type: Literal["container_reference"] + class azure.ai.projects.models.TreatmentEffectType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CHANGED = "Changed" + DEGRADED = "Degraded" + IMPROVED = "Improved" + INCONCLUSIVE = "Inconclusive" + TOO_FEW_SAMPLES = "TooFewSamples" + + + class azure.ai.projects.models.Trigger(_Model): + type: str @overload def __init__( self, *, - container_id: str + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolboxShellEnvironment(_Model): - type: str + class azure.ai.projects.models.TriggerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CRON = "Cron" + ONE_TIME = "OneTime" + RECURRENCE = "Recurrence" + + + class azure.ai.projects.models.TwilioTelephonyBinding(TelephonyBinding, discriminator='twilio'): + connection_name: str + id: str + incoming_call_url: str + label: str + phone_number: str + provider: Literal[TelephonyProvider.TWILIO] + status: Union[str, TelephonyBindingStatus] @overload def __init__( self, *, - type: str + connection_name: str, + id: str, + incoming_call_url: str, + label: Optional[str] = ..., + phone_number: str, + status: Union[str, TelephonyBindingStatus] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolboxShellNetworkPolicy(_Model): - type: str + class azure.ai.projects.models.TwilioTelephonyBindingListItem(TelephonyBindingListItem, discriminator='twilio'): + connection_name: str + etag: str + id: str + incoming_call_url: str + label: str + phone_number: str + provider: Literal[TelephonyProvider.TWILIO] + status: Union[str, TelephonyBindingStatus] @overload def __init__( self, *, - type: str + connection_name: str, + id: str, + incoming_call_url: str, + label: Optional[str] = ..., + phone_number: str, + status: Union[str, TelephonyBindingStatus] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolboxShellNetworkPolicyDisabled(ToolboxShellNetworkPolicy, discriminator='disabled'): - type: Literal["disabled"] - - @overload - def __init__(self) -> None: ... + class azure.ai.projects.models.UpdateMemoriesLROPoller(LROPoller[MemoryStoreUpdateCompletedResult]): + property superseded_by: Optional[str] # Read-only + property update_id: str # Read-only - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + @classmethod + def from_continuation_token( + cls, + polling_method: PollingMethod[MemoryStoreUpdateCompletedResult], + continuation_token: str, + **kwargs: Any + ) -> UpdateMemoriesLROPoller: ... - class azure.ai.projects.models.ToolboxSkill(_Model): - type: str + class azure.ai.projects.models.UpdateModelVersionRequest(_Model): + description: Optional[str] + tags: Optional[dict[str, str]] @overload def __init__( self, *, - type: str + description: Optional[str] = ..., + tags: Optional[dict[str, str]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolboxSkillReference(ToolboxSkill, discriminator='skill_reference'): - name: str - type: Literal["skill_reference"] - version: Optional[str] + class azure.ai.projects.models.UpdateTelephonyBindingRequest(_Model): + connection_name: Optional[str] + label: Optional[str] + phone_number: Optional[str] + status: Optional[Union[str, TelephonyBindingStatus]] @overload def __init__( self, *, - name: str, - version: Optional[str] = ... + connection_name: Optional[str] = ..., + label: Optional[str] = ..., + phone_number: Optional[str] = ..., + status: Optional[Union[str, TelephonyBindingStatus]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolboxTool(_Model): - description: Optional[str] - name: Optional[str] - tool_configs: Optional[dict[str, ToolConfig]] - type: str + class azure.ai.projects.models.UpdateToolboxRequest(_Model): + default_version: str @overload def __init__( self, *, - description: Optional[str] = ..., - name: Optional[str] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ..., - type: str + default_version: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolboxToolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - A2A_PREVIEW = "a2a_preview" - A2_A = "a2a" - AZURE_AI_SEARCH = "azure_ai_search" - BROWSER_AUTOMATION = "browser_automation" - BROWSER_AUTOMATION_PREVIEW = "browser_automation_preview" - CODE_INTERPRETER = "code_interpreter" - FABRIC_IQ_PREVIEW = "fabric_iq_preview" - FILE_SEARCH = "file_search" - MCP = "mcp" - OPENAPI = "openapi" - REMINDER_PREVIEW = "reminder_preview" - SHELL = "shell" - TOOLBOX_SEARCH = "toolbox_search" - TOOLBOX_SEARCH_PREVIEW = "toolbox_search_preview" - WEB_IQ_PREVIEW = "web_iq_preview" - WEB_SEARCH = "web_search" - WORK_IQ_PREVIEW = "work_iq_preview" + class azure.ai.projects.models.UserConversationSimulationAudioEffect(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BACKGROUND_TV = "background_tv" + CROWD_CHATTER = "crowd_chatter" + METRO_STATION = "metro_station" + STREET_TRAFFIC = "street_traffic" + TELEPHONIC_VOICE = "telephonic_voice" - class azure.ai.projects.models.ToolboxVersionObject(_Model): - created_at: datetime - description: Optional[str] - id: str - metadata: dict[str, str] - name: str - policies: Optional[ToolboxPolicies] - skills: Optional[list[ToolboxSkill]] - tools: list[ToolboxTool] - version: str + class azure.ai.projects.models.UserConversationSimulationAudioEffectsConfiguration(_Model): + effects: Optional[list[Union[str, UserConversationSimulationAudioEffect]]] + volume_percentage: Optional[int] @overload def __init__( self, *, - created_at: datetime, - description: Optional[str] = ..., - id: str, - metadata: dict[str, str], - name: str, - policies: Optional[ToolboxPolicies] = ..., - skills: Optional[list[ToolboxSkill]] = ..., - tools: list[ToolboxTool], - version: str + effects: Optional[list[Union[str, UserConversationSimulationAudioEffect]]] = ..., + volume_percentage: Optional[int] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolboxVersions(_Model): - latest: ToolboxVersionObject + class azure.ai.projects.models.UserConversationSimulationConfiguration(_Model): + audio_effects: Optional[UserConversationSimulationAudioEffectsConfiguration] + conversation_repetitions: Optional[int] + desired_num_turns: Optional[int] + max_num_turns: Optional[int] + user_behavior: Optional[UserConversationSimulationUserBehaviorConfiguration] @overload def __init__( self, *, - latest: ToolboxVersionObject + audio_effects: Optional[UserConversationSimulationAudioEffectsConfiguration] = ..., + conversation_repetitions: Optional[int] = ..., + desired_num_turns: Optional[int] = ..., + max_num_turns: Optional[int] = ..., + user_behavior: Optional[UserConversationSimulationUserBehaviorConfiguration] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TracesDataGenerationJobConfiguration(DataGenerationJobConfiguration, discriminator='traces'): - max_samples: Optional[int] - model_options: DataGenerationModelOptions - redact_private_content: Optional[bool] - train_split: float - type: Literal[DataGenerationJobType.TRACES] + class azure.ai.projects.models.UserConversationSimulationDefaultInterruptionConfiguration(UserConversationSimulationInterruptionConfiguration, discriminator='default'): + type: Literal["default"] @overload - def __init__( - self, - *, - max_samples: Optional[int] = ..., - model_options: Optional[DataGenerationModelOptions] = ..., - redact_private_content: Optional[bool] = ..., - train_split: Optional[float] = ... - ) -> None: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TracesDataGenerationJobSource(DataGenerationJobSource, discriminator='traces'): - agent_id: Optional[str] - agent_name: Optional[str] - agent_version: Optional[str] - description: str - end_time: Optional[datetime] - start_time: datetime - trace_ids: Optional[list[str]] - type: Literal[DataGenerationJobSourceType.TRACES] + class azure.ai.projects.models.UserConversationSimulationInterruptionConfiguration(_Model): + type: str @overload def __init__( self, *, - agent_id: Optional[str] = ..., - agent_name: Optional[str] = ..., - agent_version: Optional[str] = ..., - description: Optional[str] = ..., - end_time: Optional[datetime] = ..., - start_time: datetime, - trace_ids: Optional[list[str]] = ... + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TracesEvaluatorGenerationJobSource(EvaluatorGenerationJobSource, discriminator='traces'): - agent_id: Optional[str] - agent_name: Optional[str] - agent_version: Optional[str] - description: Optional[str] - end_time: Optional[datetime] - start_time: datetime - type: Literal[EvaluatorGenerationJobSourceType.TRACES] + class azure.ai.projects.models.UserConversationSimulationTestCase(_Model): + simulation_configuration: Optional[UserConversationSimulationConfiguration] + test_case_category: Optional[str] + test_case_description: Optional[str] + test_case_id: Optional[str] @overload def __init__( self, *, - agent_id: Optional[str] = ..., - agent_name: Optional[str] = ..., - agent_version: Optional[str] = ..., - description: Optional[str] = ..., - end_time: Optional[datetime] = ..., - start_time: datetime + simulation_configuration: Optional[UserConversationSimulationConfiguration] = ..., + test_case_category: Optional[str] = ..., + test_case_description: Optional[str] = ..., + test_case_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TracesPreviewEvalRunDataSource(TypedDict, total=False): - key "agent_id": str - key "agent_name": str - key "end_time": datetime - key "ingestion_delay_seconds": int - key "lookback_hours": int - key "max_traces": int - key "trace_ids": List[str] - key "type": Required[Literal["azure_ai_traces_preview"]] - - - class azure.ai.projects.models.TranscriptTextUsageDuration(CreateTranscriptionResponseJsonUsage, discriminator='duration'): - seconds: timedelta - type: Literal[CreateTranscriptionResponseJsonUsageType.DURATION] + class azure.ai.projects.models.UserConversationSimulationUserBehaviorConfiguration(_Model): + interruption: Optional[UserConversationSimulationInterruptionConfiguration] @overload def __init__( self, *, - seconds: timedelta + interruption: Optional[UserConversationSimulationInterruptionConfiguration] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TranscriptTextUsageTokens(CreateTranscriptionResponseJsonUsage, discriminator='tokens'): - input_token_details: Optional[TranscriptTextUsageTokensInputTokenDetails] - input_tokens: int - output_tokens: int - total_tokens: int - type: Literal[CreateTranscriptionResponseJsonUsageType.TOKENS] + class azure.ai.projects.models.UserProfileMemoryItem(MemoryItem, discriminator='user_profile'): + content: str + kind: Literal[MemoryItemKind.USER_PROFILE] + memory_id: str + scope: str + updated_at: datetime @overload def __init__( self, *, - input_token_details: Optional[TranscriptTextUsageTokensInputTokenDetails] = ..., - input_tokens: int, - output_tokens: int, - total_tokens: int + content: str, + memory_id: str, + scope: str, + updated_at: datetime ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TranscriptTextUsageTokensInputTokenDetails(_Model): - audio_tokens: Optional[int] - text_tokens: Optional[int] + class azure.ai.projects.models.VersionIndicator(_Model): + type: str @overload def __init__( self, *, - audio_tokens: Optional[int] = ..., - text_tokens: Optional[int] = ... + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TranscriptionLanguage(_Model): - code: str + class azure.ai.projects.models.VersionIndicatorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + VERSION_REF = "version_ref" + + + class azure.ai.projects.models.VersionRefIndicator(VersionIndicator, discriminator='version_ref'): + agent_version: str + type: Literal[VersionIndicatorType.VERSION_REF] @overload def __init__( self, *, - code: str + agent_version: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TreatmentEffectType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CHANGED = "Changed" - DEGRADED = "Degraded" - IMPROVED = "Improved" - INCONCLUSIVE = "Inconclusive" - TOO_FEW_SAMPLES = "TooFewSamples" - - - class azure.ai.projects.models.Trigger(_Model): + class azure.ai.projects.models.VersionSelectionRule(_Model): + agent_version: str type: str @overload def __init__( self, *, + agent_version: str, type: str ) -> None: ... @@ -14972,947 +17783,1017 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TriggerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CRON = "Cron" - ONE_TIME = "OneTime" - RECURRENCE = "Recurrence" - - - class azure.ai.projects.models.TwilioTelephonyBinding(TelephonyBinding, discriminator='twilio'): - connection_name: str - id: str - incoming_call_url: str - label: str - phone_number: str - provider: Literal[TelephonyProvider.TWILIO] - status: Union[str, TelephonyBindingStatus] + class azure.ai.projects.models.VersionSelector(_Model): + version_selection_rules: list[VersionSelectionRule] @overload def __init__( self, *, - connection_name: str, - id: str, - incoming_call_url: str, - label: Optional[str] = ..., - phone_number: str, - status: Union[str, TelephonyBindingStatus] + version_selection_rules: list[VersionSelectionRule] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TwilioTelephonyBindingListItem(TelephonyBindingListItem, discriminator='twilio'): - connection_name: str - etag: str - id: str - incoming_call_url: str - label: str - phone_number: str - provider: Literal[TelephonyProvider.TWILIO] - status: Union[str, TelephonyBindingStatus] + class azure.ai.projects.models.VersionSelectorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FIXED_RATIO = "FixedRatio" + + + class azure.ai.projects.models.VoiceAgentAnimationConfig(_Model): + model_name: Optional[str] + outputs: Optional[list[Union[str, VoiceAgentAnimationOutputType]]] @overload def __init__( self, *, - connection_name: str, - id: str, - incoming_call_url: str, - label: Optional[str] = ..., - phone_number: str, - status: Union[str, TelephonyBindingStatus] + model_name: Optional[str] = ..., + outputs: Optional[list[Union[str, VoiceAgentAnimationOutputType]]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.UpdateMemoriesLROPoller(LROPoller[MemoryStoreUpdateCompletedResult]): - property superseded_by: Optional[str] # Read-only - property update_id: str # Read-only - - @classmethod - def from_continuation_token( - cls, - polling_method: PollingMethod[MemoryStoreUpdateCompletedResult], - continuation_token: str, - **kwargs: Any - ) -> UpdateMemoriesLROPoller: ... + class azure.ai.projects.models.VoiceAgentAnimationOutputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BLENDSHAPES = "blendshapes" + VISEME_ID = "viseme_id" - class azure.ai.projects.models.UpdateModelVersionRequest(_Model): - description: Optional[str] - tags: Optional[dict[str, str]] + class azure.ai.projects.models.VoiceAgentAudioConfig(_Model): + input: Optional[VoiceAgentAudioInputConfig] + output: Optional[VoiceAgentAudioOutputConfig] @overload def __init__( self, *, - description: Optional[str] = ..., - tags: Optional[dict[str, str]] = ... + input: Optional[VoiceAgentAudioInputConfig] = ..., + output: Optional[VoiceAgentAudioOutputConfig] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.UpdateTelephonyBindingRequest(_Model): - connection_name: Optional[str] - label: Optional[str] - phone_number: Optional[str] - status: Optional[Union[str, TelephonyBindingStatus]] + class azure.ai.projects.models.VoiceAgentAudioInputConfig(_Model): + echo_cancellation: Optional[VoiceAgentEchoCancellation] + format: Optional[RealtimeAudioFormats] + noise_reduction: Optional[VoiceAgentNoiseReduction] + transcription: Optional[VoiceAgentInputTranscription] + turn_detection: Optional[VoiceAgentTurnDetectionConfig] @overload def __init__( self, *, - connection_name: Optional[str] = ..., - label: Optional[str] = ..., - phone_number: Optional[str] = ..., - status: Optional[Union[str, TelephonyBindingStatus]] = ... + echo_cancellation: Optional[VoiceAgentEchoCancellation] = ..., + format: Optional[RealtimeAudioFormats] = ..., + noise_reduction: Optional[VoiceAgentNoiseReduction] = ..., + transcription: Optional[VoiceAgentInputTranscription] = ..., + turn_detection: Optional[VoiceAgentTurnDetectionConfig] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.UpdateToolboxRequest(_Model): - default_version: str + class azure.ai.projects.models.VoiceAgentAudioOutputConfig(_Model): + custom_lexicon_url: Optional[str] + custom_text_normalization_url: Optional[str] + custom_voice_endpoint_id: Optional[str] + format: Optional[RealtimeAudioFormats] + output_audio_timestamp_types: Optional[list[Union[str, VoiceAgentAudioTimestampType]]] + personal_voice_model: Optional[str] + pitch: Optional[str] + prefer_locales: Optional[list[str]] + speed: Optional[float] + style: Optional[str] + voice: Optional[str] + voice_locale: Optional[str] + voice_temperature: Optional[float] + voice_type: Optional[Union[str, VoiceType]] + volume: Optional[str] @overload def __init__( self, *, - default_version: str + custom_lexicon_url: Optional[str] = ..., + custom_text_normalization_url: Optional[str] = ..., + custom_voice_endpoint_id: Optional[str] = ..., + format: Optional[RealtimeAudioFormats] = ..., + output_audio_timestamp_types: Optional[list[Union[str, VoiceAgentAudioTimestampType]]] = ..., + personal_voice_model: Optional[str] = ..., + pitch: Optional[str] = ..., + prefer_locales: Optional[list[str]] = ..., + speed: Optional[float] = ..., + style: Optional[str] = ..., + voice: Optional[str] = ..., + voice_locale: Optional[str] = ..., + voice_temperature: Optional[float] = ..., + voice_type: Optional[Union[str, VoiceType]] = ..., + volume: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.UserConversationSimulationAudioEffect(str, Enum, metaclass=CaseInsensitiveEnumMeta): - BACKGROUND_TV = "background_tv" - CROWD_CHATTER = "crowd_chatter" - METRO_STATION = "metro_station" - STREET_TRAFFIC = "street_traffic" - TELEPHONIC_VOICE = "telephonic_voice" + class azure.ai.projects.models.VoiceAgentAudioTimestampType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + WORD = "word" - class azure.ai.projects.models.UserConversationSimulationAudioEffectsConfiguration(_Model): - effects: Optional[list[Union[str, UserConversationSimulationAudioEffect]]] - volume_percentage: Optional[int] + class azure.ai.projects.models.VoiceAgentAvatarConfig(_Model): + character: str + customized: Optional[bool] + model: Optional[str] + output_audit_audio: Optional[bool] + output_protocol: Optional[Union[str, VoiceAgentAvatarOutputProtocol]] + scene: Optional[VoiceAgentAvatarScene] + style: Optional[str] + type: Union[str, VoiceAgentAvatarType] + video: Optional[VoiceAgentAvatarVideoParams] @overload def __init__( self, *, - effects: Optional[list[Union[str, UserConversationSimulationAudioEffect]]] = ..., - volume_percentage: Optional[int] = ... + character: str, + customized: Optional[bool] = ..., + model: Optional[str] = ..., + output_audit_audio: Optional[bool] = ..., + output_protocol: Optional[Union[str, VoiceAgentAvatarOutputProtocol]] = ..., + scene: Optional[VoiceAgentAvatarScene] = ..., + style: Optional[str] = ..., + type: Union[str, VoiceAgentAvatarType], + video: Optional[VoiceAgentAvatarVideoParams] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.UserConversationSimulationConfiguration(_Model): - audio_effects: Optional[UserConversationSimulationAudioEffectsConfiguration] - conversation_repetitions: Optional[int] - desired_num_turns: Optional[int] - max_num_turns: Optional[int] - user_behavior: Optional[UserConversationSimulationUserBehaviorConfiguration] + class azure.ai.projects.models.VoiceAgentAvatarIceServer(_Model): + credential: Optional[str] + urls: list[str] + username: Optional[str] @overload def __init__( self, *, - audio_effects: Optional[UserConversationSimulationAudioEffectsConfiguration] = ..., - conversation_repetitions: Optional[int] = ..., - desired_num_turns: Optional[int] = ..., - max_num_turns: Optional[int] = ..., - user_behavior: Optional[UserConversationSimulationUserBehaviorConfiguration] = ... + credential: Optional[str] = ..., + urls: list[str], + username: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.UserConversationSimulationDefaultInterruptionConfiguration(UserConversationSimulationInterruptionConfiguration, discriminator='default'): - type: Literal["default"] - - @overload - def __init__(self) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.VoiceAgentAvatarOutputProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + WEBRTC = "webrtc" + WEBSOCKET = "websocket" - class azure.ai.projects.models.UserConversationSimulationInterruptionConfiguration(_Model): - type: str + class azure.ai.projects.models.VoiceAgentAvatarScene(_Model): + amplitude: Optional[float] + position_x: Optional[float] + position_y: Optional[float] + rotation_x: Optional[float] + rotation_y: Optional[float] + rotation_z: Optional[float] + zoom: Optional[float] @overload def __init__( self, *, - type: str + amplitude: Optional[float] = ..., + position_x: Optional[float] = ..., + position_y: Optional[float] = ..., + rotation_x: Optional[float] = ..., + rotation_y: Optional[float] = ..., + rotation_z: Optional[float] = ..., + zoom: Optional[float] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.UserConversationSimulationTestCase(_Model): - simulation_configuration: Optional[UserConversationSimulationConfiguration] - test_case_category: Optional[str] - test_case_description: Optional[str] - test_case_id: Optional[str] + class azure.ai.projects.models.VoiceAgentAvatarType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + PHOTO_AVATAR = "photo_avatar" + VIDEO_AVATAR = "video_avatar" + + + class azure.ai.projects.models.VoiceAgentAvatarVideoBackground(_Model): + color: Optional[str] + image_url: Optional[str] @overload def __init__( self, *, - simulation_configuration: Optional[UserConversationSimulationConfiguration] = ..., - test_case_category: Optional[str] = ..., - test_case_description: Optional[str] = ..., - test_case_id: Optional[str] = ... + color: Optional[str] = ..., + image_url: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.UserConversationSimulationUserBehaviorConfiguration(_Model): - interruption: Optional[UserConversationSimulationInterruptionConfiguration] + class azure.ai.projects.models.VoiceAgentAvatarVideoCrop(_Model): + bottom_right: list[int] + top_left: list[int] @overload def __init__( self, *, - interruption: Optional[UserConversationSimulationInterruptionConfiguration] = ... + bottom_right: list[int], + top_left: list[int] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.UserProfileMemoryItem(MemoryItem, discriminator='user_profile'): - content: str - kind: Literal[MemoryItemKind.USER_PROFILE] - memory_id: str - scope: str - updated_at: datetime + class azure.ai.projects.models.VoiceAgentAvatarVideoParams(_Model): + background: Optional[VoiceAgentAvatarVideoBackground] + bitrate: Optional[int] + crop: Optional[VoiceAgentAvatarVideoCrop] + gop_size: Optional[int] + resolution: Optional[VoiceAgentAvatarVideoResolution] @overload def __init__( self, *, - content: str, - memory_id: str, - scope: str, - updated_at: datetime + background: Optional[VoiceAgentAvatarVideoBackground] = ..., + bitrate: Optional[int] = ..., + crop: Optional[VoiceAgentAvatarVideoCrop] = ..., + gop_size: Optional[int] = ..., + resolution: Optional[VoiceAgentAvatarVideoResolution] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VersionIndicator(_Model): - type: str + class azure.ai.projects.models.VoiceAgentAvatarVideoResolution(_Model): + height: int + width: int @overload def __init__( self, *, - type: str + height: int, + width: int ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VersionIndicatorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - VERSION_REF = "version_ref" - - - class azure.ai.projects.models.VersionRefIndicator(VersionIndicator, discriminator='version_ref'): - agent_version: str - type: Literal[VersionIndicatorType.VERSION_REF] + class azure.ai.projects.models.VoiceAgentAzureSemanticVadEnTurnDetection(VoiceAgentTurnDetectionConfig, discriminator='azure_semantic_vad_en'): + auto_truncate: bool + create_response: Optional[bool] + end_of_utterance_detection: Optional[VoiceAgentEndOfUtteranceDetection] + idle_timeout_ms: Optional[timedelta] + interrupt_response: Optional[bool] + prefix_padding_ms: Optional[timedelta] + remove_filler_words: Optional[bool] + silence_duration_ms: Optional[timedelta] + speech_duration_ms: Optional[timedelta] + threshold: Optional[float] + type: Literal[VoiceAgentTurnDetectionType.AZURE_SEMANTIC_VAD_EN] @overload def __init__( self, *, - agent_version: str + auto_truncate: Optional[bool] = ..., + create_response: Optional[bool] = ..., + end_of_utterance_detection: Optional[VoiceAgentEndOfUtteranceDetection] = ..., + idle_timeout_ms: Optional[timedelta] = ..., + interrupt_response: Optional[bool] = ..., + prefix_padding_ms: Optional[timedelta] = ..., + remove_filler_words: Optional[bool] = ..., + silence_duration_ms: Optional[timedelta] = ..., + speech_duration_ms: Optional[timedelta] = ..., + threshold: Optional[float] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VersionSelectionRule(_Model): - agent_version: str - type: str + class azure.ai.projects.models.VoiceAgentAzureSemanticVadMultilingualTurnDetection(VoiceAgentTurnDetectionConfig, discriminator='azure_semantic_vad_multilingual'): + auto_truncate: bool + create_response: Optional[bool] + end_of_utterance_detection: Optional[VoiceAgentEndOfUtteranceDetection] + idle_timeout_ms: Optional[timedelta] + interrupt_response: Optional[bool] + languages: Optional[list[str]] + prefix_padding_ms: Optional[timedelta] + remove_filler_words: Optional[bool] + silence_duration_ms: Optional[timedelta] + speech_duration_ms: Optional[timedelta] + threshold: Optional[float] + type: Literal[VoiceAgentTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL] @overload def __init__( self, *, - agent_version: str, - type: str + auto_truncate: Optional[bool] = ..., + create_response: Optional[bool] = ..., + end_of_utterance_detection: Optional[VoiceAgentEndOfUtteranceDetection] = ..., + idle_timeout_ms: Optional[timedelta] = ..., + interrupt_response: Optional[bool] = ..., + languages: Optional[list[str]] = ..., + prefix_padding_ms: Optional[timedelta] = ..., + remove_filler_words: Optional[bool] = ..., + silence_duration_ms: Optional[timedelta] = ..., + speech_duration_ms: Optional[timedelta] = ..., + threshold: Optional[float] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VersionSelector(_Model): - version_selection_rules: list[VersionSelectionRule] + class azure.ai.projects.models.VoiceAgentAzureSemanticVadTurnDetection(VoiceAgentTurnDetectionConfig, discriminator='azure_semantic_vad'): + auto_truncate: bool + create_response: Optional[bool] + end_of_utterance_detection: Optional[VoiceAgentEndOfUtteranceDetection] + idle_timeout_ms: Optional[timedelta] + interrupt_response: Optional[bool] + languages: Optional[list[str]] + prefix_padding_ms: Optional[timedelta] + remove_filler_words: Optional[bool] + silence_duration_ms: Optional[timedelta] + speech_duration_ms: Optional[timedelta] + threshold: Optional[float] + type: Literal[VoiceAgentTurnDetectionType.AZURE_SEMANTIC_VAD] @overload def __init__( self, *, - version_selection_rules: list[VersionSelectionRule] + auto_truncate: Optional[bool] = ..., + create_response: Optional[bool] = ..., + end_of_utterance_detection: Optional[VoiceAgentEndOfUtteranceDetection] = ..., + idle_timeout_ms: Optional[timedelta] = ..., + interrupt_response: Optional[bool] = ..., + languages: Optional[list[str]] = ..., + prefix_padding_ms: Optional[timedelta] = ..., + remove_filler_words: Optional[bool] = ..., + silence_duration_ms: Optional[timedelta] = ..., + speech_duration_ms: Optional[timedelta] = ..., + threshold: Optional[float] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VersionSelectorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - FIXED_RATIO = "FixedRatio" - - - class azure.ai.projects.models.VoiceAgentAnimationConfig(_Model): - model_name: Optional[str] - outputs: Optional[list[Union[str, VoiceAgentAnimationOutputType]]] + class azure.ai.projects.models.VoiceAgentBaseDefinition(AgentDefinition, discriminator='voice'): + instructions: Optional[str] + kind: Literal[AgentKind.VOICE] + rai_config: RaiConfig + store: Optional[bool] + structured_inputs: Optional[dict[str, StructuredInputDefinition]] + sub_protocol: Optional[Union[str, VoiceAgentSubProtocol]] @overload def __init__( self, *, - model_name: Optional[str] = ..., - outputs: Optional[list[Union[str, VoiceAgentAnimationOutputType]]] = ... + instructions: Optional[str] = ..., + rai_config: Optional[RaiConfig] = ..., + store: Optional[bool] = ..., + structured_inputs: Optional[dict[str, StructuredInputDefinition]] = ..., + sub_protocol: Optional[Union[str, VoiceAgentSubProtocol]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentAnimationOutputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - BLENDSHAPES = "blendshapes" - VISEME_ID = "viseme_id" - - - class azure.ai.projects.models.VoiceAgentAudioConfig(_Model): - input: Optional[VoiceAgentAudioInputConfig] - output: Optional[VoiceAgentAudioOutputConfig] + class azure.ai.projects.models.VoiceAgentClientEventRtcCallSdpCreate(RealtimeClientEvent, discriminator='rtc.call.sdp.create'): + event_id: Optional[str] + sdp_offer: str + session: Optional[VoiceAgentSessionUpdateConfig] + type: Literal[RealtimeClientEventType.RTC_CALL_SDP_CREATE] @overload def __init__( self, *, - input: Optional[VoiceAgentAudioInputConfig] = ..., - output: Optional[VoiceAgentAudioOutputConfig] = ... + event_id: Optional[str] = ..., + sdp_offer: str, + session: Optional[VoiceAgentSessionUpdateConfig] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentAudioInputConfig(_Model): - echo_cancellation: Optional[VoiceAgentEchoCancellation] - format: Optional[RealtimeAudioFormats] - noise_reduction: Optional[VoiceAgentNoiseReduction] - transcription: Optional[VoiceAgentInputTranscription] - turn_detection: Optional[VoiceAgentTurnDetectionConfig] + class azure.ai.projects.models.VoiceAgentClientEventSessionAvatarConnect(RealtimeClientEvent, discriminator='session.avatar.connect'): + client_sdp: str + event_id: Optional[str] + type: Literal[RealtimeClientEventType.SESSION_AVATAR_CONNECT] @overload def __init__( self, *, - echo_cancellation: Optional[VoiceAgentEchoCancellation] = ..., - format: Optional[RealtimeAudioFormats] = ..., - noise_reduction: Optional[VoiceAgentNoiseReduction] = ..., - transcription: Optional[VoiceAgentInputTranscription] = ..., - turn_detection: Optional[VoiceAgentTurnDetectionConfig] = ... + client_sdp: str, + event_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentAudioOutputConfig(_Model): - custom_lexicon_url: Optional[str] - custom_text_normalization_url: Optional[str] - custom_voice_endpoint_id: Optional[str] - format: Optional[RealtimeAudioFormats] - output_audio_timestamp_types: Optional[list[Union[str, VoiceAgentAudioTimestampType]]] - personal_voice_model: Optional[str] - pitch: Optional[str] - prefer_locales: Optional[list[str]] - speed: Optional[float] - style: Optional[str] - voice: Optional[str] - voice_locale: Optional[str] - voice_temperature: Optional[float] - voice_type: Optional[Union[str, VoiceType]] - volume: Optional[str] + class azure.ai.projects.models.VoiceAgentClientEventSessionUpdate(_Model): + event_id: Optional[str] + session: VoiceAgentSessionUpdate + type: Literal[RealtimeClientEventType.SESSION_UPDATE] @overload def __init__( self, *, - custom_lexicon_url: Optional[str] = ..., - custom_text_normalization_url: Optional[str] = ..., - custom_voice_endpoint_id: Optional[str] = ..., - format: Optional[RealtimeAudioFormats] = ..., - output_audio_timestamp_types: Optional[list[Union[str, VoiceAgentAudioTimestampType]]] = ..., - personal_voice_model: Optional[str] = ..., - pitch: Optional[str] = ..., - prefer_locales: Optional[list[str]] = ..., - speed: Optional[float] = ..., - style: Optional[str] = ..., - voice: Optional[str] = ..., - voice_locale: Optional[str] = ..., - voice_temperature: Optional[float] = ..., - voice_type: Optional[Union[str, VoiceType]] = ..., - volume: Optional[str] = ... + event_id: Optional[str] = ..., + session: VoiceAgentSessionUpdate, + type: Literal[RealtimeClientEventType.SESSION_UPDATE] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentAudioTimestampType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - WORD = "word" - - - class azure.ai.projects.models.VoiceAgentAvatarConfig(_Model): - character: str - customized: Optional[bool] + class azure.ai.projects.models.VoiceAgentDefinition(VoiceAgentBaseDefinition): + audio: Optional[VoiceAgentAudioConfig] + avatar: Optional[VoiceAgentAvatarConfig] + conversation_engine: Optional[VoiceConversationEngine] + greeting: Optional[VoiceAgentGreetingConfig] + include: Optional[list[Union[str, VoiceAgentSessionIncludeOption]]] + instructions: str + interim_response: Optional[VoiceAgentInterimResponseConfig] + kind: Union[str, azure.ai.projects.models.VOICE] + max_output_tokens: Optional[VoiceAgentMaxOutputTokens] model: Optional[str] - output_audit_audio: Optional[bool] - output_protocol: Optional[Union[str, VoiceAgentAvatarOutputProtocol]] - scene: Optional[VoiceAgentAvatarScene] - style: Optional[str] - type: Union[str, VoiceAgentAvatarType] - video: Optional[VoiceAgentAvatarVideoParams] + model_type: Optional[Union[str, VoiceModelType]] + output_modalities: Optional[list[Union[str, VoiceOutputModality]]] + parallel_tool_calls: Optional[bool] + rai_config: RaiConfig + soundscape: Optional[VoiceAgentSoundscapeConfig] + store: bool + structured_inputs: dict[str, StructuredInputDefinition] + sub_protocol: Optional[Literal["realtime"]] + subagent_config: Optional[VoiceAgentSubagentConfig] + tool_choice: Optional[VoiceAgentToolChoice] + tools: Optional[list[VoiceAgentTool]] @overload def __init__( self, *, - character: str, - customized: Optional[bool] = ..., + audio: Optional[VoiceAgentAudioConfig] = ..., + avatar: Optional[VoiceAgentAvatarConfig] = ..., + conversation_engine: Optional[VoiceConversationEngine] = ..., + greeting: Optional[VoiceAgentGreetingConfig] = ..., + include: Optional[list[Union[str, VoiceAgentSessionIncludeOption]]] = ..., + instructions: Optional[str] = ..., + interim_response: Optional[VoiceAgentInterimResponseConfig] = ..., + max_output_tokens: Optional[VoiceAgentMaxOutputTokens] = ..., model: Optional[str] = ..., - output_audit_audio: Optional[bool] = ..., - output_protocol: Optional[Union[str, VoiceAgentAvatarOutputProtocol]] = ..., - scene: Optional[VoiceAgentAvatarScene] = ..., - style: Optional[str] = ..., - type: Union[str, VoiceAgentAvatarType], - video: Optional[VoiceAgentAvatarVideoParams] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.VoiceAgentAvatarIceServer(_Model): - credential: Optional[str] - urls: list[str] - username: Optional[str] - - @overload - def __init__( - self, - *, - credential: Optional[str] = ..., - urls: list[str], - username: Optional[str] = ... + model_type: Optional[Union[str, VoiceModelType]] = ..., + output_modalities: Optional[list[Union[str, VoiceOutputModality]]] = ..., + parallel_tool_calls: Optional[bool] = ..., + rai_config: Optional[RaiConfig] = ..., + soundscape: Optional[VoiceAgentSoundscapeConfig] = ..., + store: Optional[bool] = ..., + structured_inputs: Optional[dict[str, StructuredInputDefinition]] = ..., + sub_protocol: Optional[Literal[realtime]] = ..., + subagent_config: Optional[VoiceAgentSubagentConfig] = ..., + tool_choice: Optional[VoiceAgentToolChoice] = ..., + tools: Optional[list[VoiceAgentTool]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentAvatarOutputProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): - WEBRTC = "webrtc" - WEBSOCKET = "websocket" - - - class azure.ai.projects.models.VoiceAgentAvatarScene(_Model): - amplitude: Optional[float] - position_x: Optional[float] - position_y: Optional[float] - rotation_x: Optional[float] - rotation_y: Optional[float] - rotation_z: Optional[float] - zoom: Optional[float] + class azure.ai.projects.models.VoiceAgentEchoCancellation(_Model): + channels: Optional[int] + reference_source: Optional[Union[str, VoiceAgentEchoCancellationReferenceSource]] + type: Literal["server_echo_cancellation"] @overload def __init__( self, *, - amplitude: Optional[float] = ..., - position_x: Optional[float] = ..., - position_y: Optional[float] = ..., - rotation_x: Optional[float] = ..., - rotation_y: Optional[float] = ..., - rotation_z: Optional[float] = ..., - zoom: Optional[float] = ... + channels: Optional[int] = ..., + reference_source: Optional[Union[str, VoiceAgentEchoCancellationReferenceSource]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentAvatarType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - PHOTO_AVATAR = "photo_avatar" - VIDEO_AVATAR = "video_avatar" + class azure.ai.projects.models.VoiceAgentEchoCancellationReferenceSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CLIENT = "client" + SERVER = "server" - class azure.ai.projects.models.VoiceAgentAvatarVideoBackground(_Model): - color: Optional[str] - image_url: Optional[str] + class azure.ai.projects.models.VoiceAgentEndConversationSystemTool(VoiceAgentSystemTool, discriminator='end_conversation'): + description: str + name: Literal[VoiceAgentSystemToolName.END_CONVERSATION] + type: str @overload def __init__( self, *, - color: Optional[str] = ..., - image_url: Optional[str] = ... + description: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentAvatarVideoCrop(_Model): - bottom_right: list[int] - top_left: list[int] + class azure.ai.projects.models.VoiceAgentEndOfUtteranceDetection(_Model): + model: Union[str, VoiceAgentEndOfUtteranceDetectionModel] + threshold_level: Optional[Union[str, VoiceAgentEndOfUtteranceThresholdLevel]] + timeout_ms: Optional[timedelta] @overload def __init__( self, *, - bottom_right: list[int], - top_left: list[int] + model: Union[str, VoiceAgentEndOfUtteranceDetectionModel], + threshold_level: Optional[Union[str, VoiceAgentEndOfUtteranceThresholdLevel]] = ..., + timeout_ms: Optional[timedelta] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentAvatarVideoParams(_Model): - background: Optional[VoiceAgentAvatarVideoBackground] - bitrate: Optional[int] - crop: Optional[VoiceAgentAvatarVideoCrop] - gop_size: Optional[int] - resolution: Optional[VoiceAgentAvatarVideoResolution] + class azure.ai.projects.models.VoiceAgentEndOfUtteranceDetectionModel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + SEMANTIC_DETECTION_V1 = "semantic_detection_v1" + SEMANTIC_DETECTION_V1_EN = "semantic_detection_v1_en" + SEMANTIC_DETECTION_V1_MULTILINGUAL = "semantic_detection_v1_multilingual" + SMART_END_OF_TURN_DETECTION = "smart_end_of_turn_detection" - @overload - def __init__( - self, - *, - background: Optional[VoiceAgentAvatarVideoBackground] = ..., - bitrate: Optional[int] = ..., - crop: Optional[VoiceAgentAvatarVideoCrop] = ..., - gop_size: Optional[int] = ..., - resolution: Optional[VoiceAgentAvatarVideoResolution] = ... - ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.VoiceAgentEndOfUtteranceThresholdLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DEFAULT = "default" + HIGH = "high" + LOW = "low" + MEDIUM = "medium" - class azure.ai.projects.models.VoiceAgentAvatarVideoResolution(_Model): - height: int - width: int + class azure.ai.projects.models.VoiceAgentFunctionTool(VoiceAgentTool, discriminator='function'): + description: Optional[str] + name: str + parameters: Optional[RealtimeFunctionToolParameters] + type: Literal["function"] @overload def __init__( self, *, - height: int, - width: int + description: Optional[str] = ..., + name: str, + parameters: Optional[RealtimeFunctionToolParameters] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentAzureSemanticVadEnTurnDetection(VoiceAgentTurnDetectionConfig, discriminator='azure_semantic_vad_en'): - auto_truncate: bool - create_response: Optional[bool] - end_of_utterance_detection: Optional[VoiceAgentEndOfUtteranceDetection] - idle_timeout_ms: Optional[timedelta] - interrupt_response: Optional[bool] - prefix_padding_ms: Optional[timedelta] - remove_filler_words: Optional[bool] - silence_duration_ms: Optional[timedelta] - speech_duration_ms: Optional[timedelta] - threshold: Optional[float] - type: Literal[VoiceAgentTurnDetectionType.AZURE_SEMANTIC_VAD_EN] + class azure.ai.projects.models.VoiceAgentGreetingConfig(_Model): + type: str @overload def __init__( self, *, - auto_truncate: Optional[bool] = ..., - create_response: Optional[bool] = ..., - end_of_utterance_detection: Optional[VoiceAgentEndOfUtteranceDetection] = ..., - idle_timeout_ms: Optional[timedelta] = ..., - interrupt_response: Optional[bool] = ..., - prefix_padding_ms: Optional[timedelta] = ..., - remove_filler_words: Optional[bool] = ..., - silence_duration_ms: Optional[timedelta] = ..., - speech_duration_ms: Optional[timedelta] = ..., - threshold: Optional[float] = ... + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentAzureSemanticVadMultilingualTurnDetection(VoiceAgentTurnDetectionConfig, discriminator='azure_semantic_vad_multilingual'): - auto_truncate: bool - create_response: Optional[bool] - end_of_utterance_detection: Optional[VoiceAgentEndOfUtteranceDetection] - idle_timeout_ms: Optional[timedelta] - interrupt_response: Optional[bool] + class azure.ai.projects.models.VoiceAgentInputTranscription(_Model): + custom_speech: Optional[dict[str, str]] + delay: Optional[Literal["minimal", "low", "medium", "high", "xhigh"]] + keywords: Optional[list[str]] + language: Optional[str] languages: Optional[list[str]] - prefix_padding_ms: Optional[timedelta] - remove_filler_words: Optional[bool] - silence_duration_ms: Optional[timedelta] - speech_duration_ms: Optional[timedelta] - threshold: Optional[float] - type: Literal[VoiceAgentTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL] + model: Union[str, VoiceAgentInputTranscriptionModel] + phrase_list: Optional[list[str]] + profanity_filter: Optional[Union[str, VoiceAgentProfanityFilterMode]] + prompt: Optional[str] @overload def __init__( self, *, - auto_truncate: Optional[bool] = ..., - create_response: Optional[bool] = ..., - end_of_utterance_detection: Optional[VoiceAgentEndOfUtteranceDetection] = ..., - idle_timeout_ms: Optional[timedelta] = ..., - interrupt_response: Optional[bool] = ..., + custom_speech: Optional[dict[str, str]] = ..., + delay: Optional[Literal[minimal, low, medium, high, xhigh]] = ..., + keywords: Optional[list[str]] = ..., + language: Optional[str] = ..., languages: Optional[list[str]] = ..., - prefix_padding_ms: Optional[timedelta] = ..., - remove_filler_words: Optional[bool] = ..., - silence_duration_ms: Optional[timedelta] = ..., - speech_duration_ms: Optional[timedelta] = ..., - threshold: Optional[float] = ... + model: Union[str, VoiceAgentInputTranscriptionModel], + phrase_list: Optional[list[str]] = ..., + profanity_filter: Optional[Union[str, VoiceAgentProfanityFilterMode]] = ..., + prompt: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentAzureSemanticVadTurnDetection(VoiceAgentTurnDetectionConfig, discriminator='azure_semantic_vad'): - auto_truncate: bool - create_response: Optional[bool] - end_of_utterance_detection: Optional[VoiceAgentEndOfUtteranceDetection] - idle_timeout_ms: Optional[timedelta] - interrupt_response: Optional[bool] - languages: Optional[list[str]] - prefix_padding_ms: Optional[timedelta] - remove_filler_words: Optional[bool] - silence_duration_ms: Optional[timedelta] - speech_duration_ms: Optional[timedelta] - threshold: Optional[float] - type: Literal[VoiceAgentTurnDetectionType.AZURE_SEMANTIC_VAD] + class azure.ai.projects.models.VoiceAgentInputTranscriptionModel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AZURE_SPEECH = "azure-speech" + AZURE_SPEECH_STREAMING = "azure-speech-streaming" + GPT4_O_MINI_TRANSCRIBE = "gpt-4o-mini-transcribe" + GPT4_O_TRANSCRIBE = "gpt-4o-transcribe" + GPT4_O_TRANSCRIBE_DIARIZE = "gpt-4o-transcribe-diarize" + GPT_LIVE_TRANSCRIBE = "gpt-live-transcribe" + GPT_REALTIME_WHISPER = "gpt-realtime-whisper" + GPT_TRANSCRIBE = "gpt-transcribe" + MAI_TRANSCRIBE = "mai-transcribe" + WHISPER1 = "whisper-1" + + + class azure.ai.projects.models.VoiceAgentInterimResponseConfig(_Model): + latency_threshold_ms: Optional[timedelta] + triggers: Optional[list[Union[str, VoiceAgentInterimResponseTrigger]]] + type: str @overload def __init__( self, *, - auto_truncate: Optional[bool] = ..., - create_response: Optional[bool] = ..., - end_of_utterance_detection: Optional[VoiceAgentEndOfUtteranceDetection] = ..., - idle_timeout_ms: Optional[timedelta] = ..., - interrupt_response: Optional[bool] = ..., - languages: Optional[list[str]] = ..., - prefix_padding_ms: Optional[timedelta] = ..., - remove_filler_words: Optional[bool] = ..., - silence_duration_ms: Optional[timedelta] = ..., - speech_duration_ms: Optional[timedelta] = ..., - threshold: Optional[float] = ... + latency_threshold_ms: Optional[timedelta] = ..., + triggers: Optional[list[Union[str, VoiceAgentInterimResponseTrigger]]] = ..., + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentClientEventRtcCallSdpCreate(RealtimeClientEvent, discriminator='rtc.call.sdp.create'): - event_id: Optional[str] - sdp_offer: str - session: Optional[VoiceAgentSessionUpdateConfig] - type: Literal[RealtimeClientEventType.RTC_CALL_SDP_CREATE] + class azure.ai.projects.models.VoiceAgentInterimResponseTrigger(str, Enum, metaclass=CaseInsensitiveEnumMeta): + LATENCY = "latency" + TOOL = "tool" + + + class azure.ai.projects.models.VoiceAgentLiveClientDelegationConversationItem(VoiceAgentLiveDelegationConversationItem, discriminator='client'): + commentary: Optional[str] + created_at: datetime + id: str + response_id: str + target: Literal[VoiceAgentLiveDelegationTarget.CLIENT] + thinking: Optional[str] + type: Union[str, azure.ai.projects.models.DELEGATION] @overload def __init__( self, *, - event_id: Optional[str] = ..., - sdp_offer: str, - session: Optional[VoiceAgentSessionUpdateConfig] = ... + commentary: Optional[str] = ..., + created_at: datetime, + id: str, + response_id: Optional[str] = ..., + thinking: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentClientEventSessionAvatarConnect(RealtimeClientEvent, discriminator='session.avatar.connect'): - client_sdp: str - event_id: Optional[str] - type: Literal[RealtimeClientEventType.SESSION_AVATAR_CONNECT] + class azure.ai.projects.models.VoiceAgentLiveConversation(_Model): + completed_at: Optional[datetime] + created_at: datetime + id: str + last_error: Optional[ApiError] + metadata: Optional[dict[str, str]] + object: Literal["conversation"] + status: Union[str, VoiceConversationStatus] + usage: Optional[LiveSessionUsage] @overload def __init__( self, *, - client_sdp: str, - event_id: Optional[str] = ... + completed_at: Optional[datetime] = ..., + created_at: datetime, + id: str, + last_error: Optional[ApiError] = ..., + metadata: Optional[dict[str, str]] = ..., + status: Union[str, VoiceConversationStatus], + usage: Optional[LiveSessionUsage] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentClientEventSessionUpdate(_Model): - event_id: Optional[str] - session: VoiceAgentSessionUpdate - type: Literal[RealtimeClientEventType.SESSION_UPDATE] + class azure.ai.projects.models.VoiceAgentLiveConversationItem(_Model): + id: str + type: str @overload def __init__( self, *, - event_id: Optional[str] = ..., - session: VoiceAgentSessionUpdate, - type: Literal[RealtimeClientEventType.SESSION_UPDATE] + id: str, + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentDefinition(AgentDefinition, discriminator='voice'): - audio: Optional[VoiceAgentAudioConfig] - avatar: Optional[VoiceAgentAvatarConfig] - conversation_engine: Optional[VoiceConversationEngine] - greeting: Optional[VoiceAgentGreetingConfig] - include: Optional[list[Union[str, VoiceAgentSessionIncludeOption]]] - instructions: Optional[str] - interim_response: Optional[VoiceAgentInterimResponseConfig] - kind: Literal[AgentKind.VOICE] - max_output_tokens: Optional[VoiceAgentMaxOutputTokens] - model: Optional[str] - model_type: Optional[Union[str, VoiceModelType]] - output_modalities: Optional[list[Union[str, VoiceOutputModality]]] - parallel_tool_calls: Optional[bool] + class azure.ai.projects.models.VoiceAgentLiveConversationItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DELEGATION = "delegation" + INPUT = "input" + OUTPUT = "output" + + + class azure.ai.projects.models.VoiceAgentLiveDefinition(VoiceAgentBaseDefinition): + audio: Optional[LiveInitialSessionAudioParam] + delegation: Optional[VoiceAgentLiveDelegation] + greeting: Optional[VoiceAgentTemplateGreetingConfig] + instructions: str + kind: Union[str, azure.ai.projects.models.VOICE] + model: str + model_type: Literal["self_deployed"] rai_config: RaiConfig - store: Optional[bool] - structured_inputs: Optional[dict[str, StructuredInputDefinition]] - subagent_config: Optional[VoiceAgentSubagentConfig] - tool_choice: Optional[VoiceAgentToolChoice] - tools: Optional[list[VoiceAgentTool]] + store: bool + structured_inputs: dict[str, StructuredInputDefinition] + sub_protocol: Literal["live"] @overload def __init__( self, *, - audio: Optional[VoiceAgentAudioConfig] = ..., - avatar: Optional[VoiceAgentAvatarConfig] = ..., - conversation_engine: Optional[VoiceConversationEngine] = ..., - greeting: Optional[VoiceAgentGreetingConfig] = ..., - include: Optional[list[Union[str, VoiceAgentSessionIncludeOption]]] = ..., + audio: Optional[LiveInitialSessionAudioParam] = ..., + delegation: Optional[VoiceAgentLiveDelegation] = ..., + greeting: Optional[VoiceAgentTemplateGreetingConfig] = ..., instructions: Optional[str] = ..., - interim_response: Optional[VoiceAgentInterimResponseConfig] = ..., - max_output_tokens: Optional[VoiceAgentMaxOutputTokens] = ..., - model: Optional[str] = ..., - model_type: Optional[Union[str, VoiceModelType]] = ..., - output_modalities: Optional[list[Union[str, VoiceOutputModality]]] = ..., - parallel_tool_calls: Optional[bool] = ..., + model: str, rai_config: Optional[RaiConfig] = ..., store: Optional[bool] = ..., - structured_inputs: Optional[dict[str, StructuredInputDefinition]] = ..., - subagent_config: Optional[VoiceAgentSubagentConfig] = ..., - tool_choice: Optional[VoiceAgentToolChoice] = ..., - tools: Optional[list[VoiceAgentTool]] = ... + structured_inputs: Optional[dict[str, StructuredInputDefinition]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentEchoCancellation(_Model): - channels: Optional[int] - reference_source: Optional[Union[str, VoiceAgentEchoCancellationReferenceSource]] - type: Literal["server_echo_cancellation"] + class azure.ai.projects.models.VoiceAgentLiveDelegationConversationItem(VoiceAgentLiveConversationItem, discriminator='delegation'): + created_at: datetime + id: str + response_id: Optional[str] + target: str + type: Literal[VoiceAgentLiveConversationItemType.DELEGATION] @overload def __init__( self, *, - channels: Optional[int] = ..., - reference_source: Optional[Union[str, VoiceAgentEchoCancellationReferenceSource]] = ... + created_at: datetime, + id: str, + response_id: Optional[str] = ..., + target: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentEchoCancellationReferenceSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CLIENT = "client" - SERVER = "server" + class azure.ai.projects.models.VoiceAgentLiveDelegationItem(_Model): + id: str + response_id: Optional[str] + target: Union[str, VoiceAgentLiveDelegationTarget] + type: Literal["delegation"] + @overload + def __init__( + self, + *, + id: str, + response_id: Optional[str] = ..., + target: Union[str, VoiceAgentLiveDelegationTarget] + ) -> None: ... - class azure.ai.projects.models.VoiceAgentEndConversationSystemTool(VoiceAgentSystemTool, discriminator='end_conversation'): - description: str - name: Literal[VoiceAgentSystemToolName.END_CONVERSATION] - type: str + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentLiveDelegationResultItem1(_Model): + commentary: Optional[str] + thinking: str @overload def __init__( self, *, - description: Optional[str] = ... + commentary: Optional[str] = ..., + thinking: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentEndOfUtteranceDetection(_Model): - model: Union[str, VoiceAgentEndOfUtteranceDetectionModel] - threshold_level: Optional[Union[str, VoiceAgentEndOfUtteranceThresholdLevel]] - timeout_ms: Optional[timedelta] + class azure.ai.projects.models.VoiceAgentLiveDelegationResultItem2(_Model): + commentary: str + thinking: Optional[str] @overload def __init__( self, *, - model: Union[str, VoiceAgentEndOfUtteranceDetectionModel], - threshold_level: Optional[Union[str, VoiceAgentEndOfUtteranceThresholdLevel]] = ..., - timeout_ms: Optional[timedelta] = ... + commentary: str, + thinking: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentEndOfUtteranceDetectionModel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - SEMANTIC_DETECTION_V1 = "semantic_detection_v1" - SEMANTIC_DETECTION_V1_EN = "semantic_detection_v1_en" - SEMANTIC_DETECTION_V1_MULTILINGUAL = "semantic_detection_v1_multilingual" - SMART_END_OF_TURN_DETECTION = "smart_end_of_turn_detection" + class azure.ai.projects.models.VoiceAgentLiveDelegationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CANCELLED = "cancelled" + COMPLETED = "completed" + FAILED = "failed" + INCOMPLETE = "incomplete" + IN_PROGRESS = "in_progress" - class azure.ai.projects.models.VoiceAgentEndOfUtteranceThresholdLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DEFAULT = "default" - HIGH = "high" - LOW = "low" - MEDIUM = "medium" + class azure.ai.projects.models.VoiceAgentLiveDelegationTarget(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CLIENT = "client" + FOUNDRY_MANAGED_AGENT = "foundry_managed_agent" + RESPONSES = "responses" - class azure.ai.projects.models.VoiceAgentFunctionTool(VoiceAgentTool, discriminator='function'): - description: Optional[str] - name: str - parameters: Optional[RealtimeFunctionToolParameters] - type: Literal["function"] + class azure.ai.projects.models.VoiceAgentLiveFoundryManagedAgentDelegationItem(VoiceAgentLiveDelegationConversationItem, discriminator='foundry_managed_agent'): + agent_name: str + agent_version: str + backend_conversation_id: Optional[str] + created_at: datetime + delegation_context: Optional[str] + id: str + offset_ms: int + output: list[VoiceAgentLiveDelegationResultItem] + response_id: str + status: Union[str, VoiceAgentLiveDelegationStatus] + target: Literal[VoiceAgentLiveDelegationTarget.FOUNDRY_MANAGED_AGENT] + type: Union[str, azure.ai.projects.models.DELEGATION] @overload def __init__( self, *, - description: Optional[str] = ..., - name: str, - parameters: Optional[RealtimeFunctionToolParameters] = ... + agent_name: str, + agent_version: str, + backend_conversation_id: Optional[str] = ..., + created_at: datetime, + delegation_context: Optional[str] = ..., + id: str, + offset_ms: int, + output: list[VoiceAgentLiveDelegationResultItem], + response_id: Optional[str] = ..., + status: Union[str, VoiceAgentLiveDelegationStatus] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentGreetingConfig(_Model): - type: str + class azure.ai.projects.models.VoiceAgentLiveInputConversationItem(VoiceAgentLiveConversationItem, discriminator='input'): + audio: Optional[VoiceAudioItem] + id: str + transcription: Optional[str] + type: Literal[VoiceAgentLiveConversationItemType.INPUT] @overload def __init__( self, *, - type: str + audio: Optional[VoiceAudioItem] = ..., + id: str, + transcription: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentInputTranscription(_Model): - custom_speech: Optional[dict[str, str]] - delay: Optional[Literal["minimal", "low", "medium", "high", "xhigh"]] - keywords: Optional[list[str]] - language: Optional[str] - languages: Optional[list[str]] - model: Union[str, VoiceAgentInputTranscriptionModel] - phrase_list: Optional[list[str]] - prompt: Optional[str] + class azure.ai.projects.models.VoiceAgentLiveManagedAgentDelegation(_Model): + agent_name: str + agent_version: Optional[str] + type: Literal["foundry_managed_agent"] @overload def __init__( self, *, - custom_speech: Optional[dict[str, str]] = ..., - delay: Optional[Literal[minimal, low, medium, high, xhigh]] = ..., - keywords: Optional[list[str]] = ..., - language: Optional[str] = ..., - languages: Optional[list[str]] = ..., - model: Union[str, VoiceAgentInputTranscriptionModel], - phrase_list: Optional[list[str]] = ..., - prompt: Optional[str] = ... + agent_name: str, + agent_version: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentInputTranscriptionModel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AZURE_SPEECH = "azure-speech" - GPT4_O_MINI_TRANSCRIBE = "gpt-4o-mini-transcribe" - GPT4_O_TRANSCRIBE = "gpt-4o-transcribe" - GPT4_O_TRANSCRIBE_DIARIZE = "gpt-4o-transcribe-diarize" - GPT_LIVE_TRANSCRIBE = "gpt-live-transcribe" - GPT_REALTIME_WHISPER = "gpt-realtime-whisper" - GPT_TRANSCRIBE = "gpt-transcribe" - MAI_TRANSCRIBE = "mai-transcribe" - WHISPER1 = "whisper-1" + class azure.ai.projects.models.VoiceAgentLiveOutputConversationItem(VoiceAgentLiveConversationItem, discriminator='output'): + audio: Optional[VoiceAudioItem] + id: str + transcription: Optional[str] + type: Literal[VoiceAgentLiveConversationItemType.OUTPUT] + @overload + def __init__( + self, + *, + audio: Optional[VoiceAudioItem] = ..., + id: str, + transcription: Optional[str] = ... + ) -> None: ... - class azure.ai.projects.models.VoiceAgentInterimResponseConfig(_Model): - latency_threshold_ms: Optional[timedelta] - triggers: Optional[list[Union[str, VoiceAgentInterimResponseTrigger]]] - type: str + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentLiveResponsesDelegationConversationItem(VoiceAgentLiveDelegationConversationItem, discriminator='responses'): + created_at: datetime + id: str + output: Optional[str] + response_id: str + target: Literal[VoiceAgentLiveDelegationTarget.RESPONSES] + type: Union[str, azure.ai.projects.models.DELEGATION] @overload def __init__( self, *, - latency_threshold_ms: Optional[timedelta] = ..., - triggers: Optional[list[Union[str, VoiceAgentInterimResponseTrigger]]] = ..., - type: str + created_at: datetime, + id: str, + output: Optional[str] = ..., + response_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentInterimResponseTrigger(str, Enum, metaclass=CaseInsensitiveEnumMeta): - LATENCY = "latency" - TOOL = "tool" + class azure.ai.projects.models.VoiceAgentLiveSessionResource(_Model): + audio: Optional[LiveInitialSessionAudioParam] + client: Optional[LiveClientConfigParam] + delegation: Optional[VoiceAgentLiveDelegation] + expires_at: int + id: str + input: Optional[list[LiveInitialItem]] + instructions: Optional[str] + model: Union[str, ModelIdsLive] + status: Literal["active"] + store: Optional[bool] + triggers: Optional[list[LiveDecisionTriggerInputParam_2]] + + @overload + def __init__( + self, + *, + audio: Optional[LiveInitialSessionAudioParam] = ..., + client: Optional[LiveClientConfigParam] = ..., + delegation: Optional[VoiceAgentLiveDelegation] = ..., + expires_at: int, + id: str, + input: Optional[list[LiveInitialItem]] = ..., + instructions: Optional[str] = ..., + model: Union[str, ModelIdsLive], + store: Optional[bool] = ..., + triggers: Optional[list[LiveDecisionTriggerInputParam_2]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... class azure.ai.projects.models.VoiceAgentLlmGeneratedGreetingConfig(VoiceAgentGreetingConfig, discriminator='llm_generated'): @@ -16008,10 +18889,18 @@ namespace azure.ai.projects.models class azure.ai.projects.models.VoiceAgentNoiseReductionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): AZURE_DEEP_NOISE_SUPPRESSION = "azure_deep_noise_suppression" + AZURE_DEEP_NOISE_SUPPRESSION_HEADSET = "azure_deep_noise_suppression_headset" + AZURE_PERSONAL_NOISE_SUPPRESSION = "azure_personal_noise_suppression" FAR_FIELD = "far_field" NEAR_FIELD = "near_field" + class azure.ai.projects.models.VoiceAgentProfanityFilterMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + MASKED = "masked" + REMOVED = "removed" + UNFILTERED = "unfiltered" + + class azure.ai.projects.models.VoiceAgentRealtimeResponse(_Model): audio: Optional[VoiceResponseAudio] conversation_id: Optional[str] @@ -16648,6 +19537,87 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.VoiceAgentSoundscapeConfig(_Model): + background: Optional[VoiceAgentSoundscapeTrackConfig] + closing: Optional[VoiceAgentSoundscapeTrackConfig] + opening: Optional[VoiceAgentSoundscapeTrackConfig] + transfer: Optional[VoiceAgentSoundscapeTrackConfig] + working: Optional[VoiceAgentSoundscapeWorkingTrackConfig] + + @overload + def __init__( + self, + *, + background: Optional[VoiceAgentSoundscapeTrackConfig] = ..., + closing: Optional[VoiceAgentSoundscapeTrackConfig] = ..., + opening: Optional[VoiceAgentSoundscapeTrackConfig] = ..., + transfer: Optional[VoiceAgentSoundscapeTrackConfig] = ..., + working: Optional[VoiceAgentSoundscapeWorkingTrackConfig] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentSoundscapeSound(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BUSY_STREET = "busy_street" + CALL_CENTER = "call_center" + DING1 = "ding1" + DING2 = "ding2" + OFFICE = "office" + PEOPLE_TALKING = "people_talking" + STREET_AND_METRO_STATION = "street_and_metro_station" + + + class azure.ai.projects.models.VoiceAgentSoundscapeSourceConfig(_Model): + name: Union[str, VoiceAgentSoundscapeSound] + type: Literal["built_in"] + + @overload + def __init__( + self, + *, + name: Union[str, VoiceAgentSoundscapeSound] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentSoundscapeTrackConfig(_Model): + gain: Optional[float] + source: VoiceAgentSoundscapeSourceConfig + + @overload + def __init__( + self, + *, + gain: Optional[float] = ..., + source: VoiceAgentSoundscapeSourceConfig + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentSoundscapeWorkingTrackConfig(_Model): + delay_ms: Optional[timedelta] + gain: Optional[float] + source: VoiceAgentSoundscapeSourceConfig + + @overload + def __init__( + self, + *, + delay_ms: Optional[timedelta] = ..., + gain: Optional[float] = ..., + source: VoiceAgentSoundscapeSourceConfig + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + class azure.ai.projects.models.VoiceAgentStaticInterimResponseConfig(VoiceAgentInterimResponseConfig, discriminator='static_interim_response'): latency_threshold_ms: timedelta texts: Optional[list[str]] @@ -16667,6 +19637,11 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.VoiceAgentSubProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + LIVE = "live" + REALTIME = "realtime" + + class azure.ai.projects.models.VoiceAgentSubagent(_Model): agent_capabilities: str agent_name: str @@ -17241,54 +20216,6 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.WebSearchPreviewTool(Tool, discriminator='web_search_preview'): - search_content_types: Optional[list[Union[str, SearchContentType]]] - search_context_size: Optional[Union[str, SearchContextSize]] - type: Literal[ToolType.WEB_SEARCH_PREVIEW] - user_location: Optional[ApproximateLocation] - - @overload - def __init__( - self, - *, - search_content_types: Optional[list[Union[str, SearchContentType]]] = ..., - search_context_size: Optional[Union[str, SearchContextSize]] = ..., - user_location: Optional[ApproximateLocation] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.WebSearchTool(Tool, discriminator='web_search'): - custom_search_configuration: Optional[WebSearchConfiguration] - description: Optional[str] - external_web_access: Optional[bool] - filters: Optional[WebSearchToolFilters] - name: Optional[str] - search_context_size: Optional[Literal["low", "medium", "high"]] - tool_configs: Optional[dict[str, ToolConfig]] - type: Literal[ToolType.WEB_SEARCH] - user_location: Optional[WebSearchApproximateLocation] - - @overload - def __init__( - self, - *, - custom_search_configuration: Optional[WebSearchConfiguration] = ..., - description: Optional[str] = ..., - external_web_access: Optional[bool] = ..., - filters: Optional[WebSearchToolFilters] = ..., - name: Optional[str] = ..., - search_context_size: Optional[Literal[low, medium, high]] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ..., - user_location: Optional[WebSearchApproximateLocation] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.ai.projects.models.WebSearchToolFilters(_Model): allowed_domains: Optional[list[str]] diff --git a/sdk/ai/azure-ai-projects/api.metadata.yml b/sdk/ai/azure-ai-projects/api.metadata.yml index 6d6343ea5c66..ba91d1625bce 100644 --- a/sdk/ai/azure-ai-projects/api.metadata.yml +++ b/sdk/ai/azure-ai-projects/api.metadata.yml @@ -1,4 +1,4 @@ -apiHash: bb1ea6eb387aed40913818d64b40f39438c2e7800793c097bd7fea2fb0f4c3f3 -packageVersion: 2.9.0 +apiHash: b12c6367b4159869109631a33624581dbebae2c2d6d73b08e4432108bcbb30e8 +packageVersion: 2.10.0 parserVersion: 0.3.31 pythonVersion: 3.12.10 diff --git a/sdk/ai/azure-ai-projects/apiview-properties.json b/sdk/ai/azure-ai-projects/apiview-properties.json index 4a21720c683a..821edab4b285 100644 --- a/sdk/ai/azure-ai-projects/apiview-properties.json +++ b/sdk/ai/azure-ai-projects/apiview-properties.json @@ -97,10 +97,14 @@ "azure.ai.projects.models.AgentTaxonomyInput": "Azure.AI.Projects.AgentTaxonomyInput", "azure.ai.projects.models.AgentVersionDetails": "Azure.AI.Projects.AgentVersionObject", "azure.ai.projects.models.AISearchIndexResource": "Azure.AI.Projects.AISearchIndexResource", + "azure.ai.projects.models.AnswerResource": "OpenAI.AnswerResource", + "azure.ai.projects.models.AnswerResourceChoice": "OpenAI.AnswerResourceChoice", + "azure.ai.projects.models.AnswerResourcePredicate": "OpenAI.AnswerResourcePredicate", + "azure.ai.projects.models.AnswerResourceRefusal": "OpenAI.AnswerResourceRefusal", + "azure.ai.projects.models.AnswerResourceScore": "OpenAI.AnswerResourceScore", "azure.ai.projects.models.ApiError": "OpenAI.Error", "azure.ai.projects.models.ApiErrorResponse": "Azure.AI.Projects.ApiErrorResponse", "azure.ai.projects.models.ApiKeyCredentials": "Azure.AI.Projects.ApiKeyCredentials", - "azure.ai.projects.models.ApplyPatchToolParam": "OpenAI.ApplyPatchToolParam", "azure.ai.projects.models.ApproximateLocation": "OpenAI.ApproximateLocation", "azure.ai.projects.models.ArtifactProfile": "Azure.AI.Projects.ArtifactProfile", "azure.ai.projects.models.AutoCodeInterpreterToolParam": "OpenAI.AutoCodeInterpreterToolParam", @@ -141,17 +145,16 @@ "azure.ai.projects.models.ChatCompletionTool": "OpenAI.ChatCompletionTool", "azure.ai.projects.models.MemoryItem": "Azure.AI.Projects.MemoryItem", "azure.ai.projects.models.ChatSummaryMemoryItem": "Azure.AI.Projects.ChatSummaryMemoryItem", + "azure.ai.projects.models.ChoiceOptionParam": "OpenAI.ChoiceOptionParam", + "azure.ai.projects.models.ChoiceProbabilityResource": "OpenAI.ChoiceProbabilityResource", "azure.ai.projects.models.ClusterInsightResult": "Azure.AI.Projects.ClusterInsightResult", "azure.ai.projects.models.ClusterTokenUsage": "Azure.AI.Projects.ClusterTokenUsage", "azure.ai.projects.models.EvaluatorDefinition": "Azure.AI.Projects.EvaluatorDefinition", "azure.ai.projects.models.CodeBasedEvaluatorDefinition": "Azure.AI.Projects.CodeBasedEvaluatorDefinition", "azure.ai.projects.models.CodeConfiguration": "Azure.AI.Projects.CodeConfiguration", - "azure.ai.projects.models.CodeInterpreterTool": "OpenAI.CodeInterpreterTool", "azure.ai.projects.models.CodeInterpreterToolboxTool": "Azure.AI.Projects.CodeInterpreterToolboxTool", "azure.ai.projects.models.ComparisonFilter": "OpenAI.ComparisonFilter", "azure.ai.projects.models.CompoundFilter": "OpenAI.CompoundFilter", - "azure.ai.projects.models.ComputerTool": "OpenAI.ComputerTool", - "azure.ai.projects.models.ComputerUsePreviewTool": "OpenAI.ComputerUsePreviewTool", "azure.ai.projects.models.Connection": "Azure.AI.Projects.Connection", "azure.ai.projects.models.FunctionShellToolParamEnvironment": "OpenAI.FunctionShellToolParamEnvironment", "azure.ai.projects.models.ContainerAutoParam": "OpenAI.ContainerAutoParam", @@ -194,6 +197,8 @@ "azure.ai.projects.models.DatasetEvaluatorGenerationJobSource": "Azure.AI.Projects.DatasetEvaluatorGenerationJobSource", "azure.ai.projects.models.DatasetReference": "Azure.AI.Projects.DatasetReference", "azure.ai.projects.models.DatasetVersion": "Azure.AI.Projects.DatasetVersion", + "azure.ai.projects.models.DecisionResponse": "OpenAI.DecisionResponse", + "azure.ai.projects.models.Delegation": "OpenAI.delegation", "azure.ai.projects.models.DeleteAgentResponse": "Azure.AI.Projects.DeleteAgentResponse", "azure.ai.projects.models.DeleteAgentVersionResponse": "Azure.AI.Projects.DeleteAgentVersionResponse", "azure.ai.projects.models.DeleteMemoryResult": "Azure.AI.Projects.DeleteMemoryResponse", @@ -244,7 +249,6 @@ "azure.ai.projects.models.FileDataGenerationJobOutput": "Azure.AI.Projects.FileDataGenerationJobOutput", "azure.ai.projects.models.FileDataGenerationJobSource": "Azure.AI.Projects.FileDataGenerationJobSource", "azure.ai.projects.models.FileDatasetVersion": "Azure.AI.Projects.FileDatasetVersion", - "azure.ai.projects.models.FileSearchTool": "OpenAI.FileSearchTool", "azure.ai.projects.models.FileSearchToolboxTool": "Azure.AI.Projects.FileSearchToolboxTool", "azure.ai.projects.models.VersionSelectionRule": "Azure.AI.Projects.VersionSelectionRule", "azure.ai.projects.models.FixedRatioVersionSelectionRule": "Azure.AI.Projects.FixedRatioVersionSelectionRule", @@ -252,10 +256,8 @@ "azure.ai.projects.models.FoundryModelWarning": "Azure.AI.Projects.FoundryModelWarning", "azure.ai.projects.models.FunctionObject": "OpenAI.FunctionObject", "azure.ai.projects.models.FunctionParameters": "OpenAI.FunctionParameters", - "azure.ai.projects.models.FunctionShellToolParam": "OpenAI.FunctionShellToolParam", "azure.ai.projects.models.FunctionShellToolParamEnvironmentContainerReferenceParam": "OpenAI.FunctionShellToolParamEnvironmentContainerReferenceParam", "azure.ai.projects.models.FunctionShellToolParamEnvironmentLocalEnvironmentParam": "OpenAI.FunctionShellToolParamEnvironmentLocalEnvironmentParam", - "azure.ai.projects.models.FunctionTool": "OpenAI.FunctionTool", "azure.ai.projects.models.FunctionToolParam": "OpenAI.FunctionToolParam", "azure.ai.projects.models.GenerateVoiceAgentRequest": "Azure.AI.Projects.GenerateVoiceAgentRequest", "azure.ai.projects.models.GitHubCopilotHarness": "Azure.AI.Projects.GitHubCopilotHarness", @@ -269,10 +271,10 @@ "azure.ai.projects.models.HourlyRecurrenceSchedule": "Azure.AI.Projects.HourlyRecurrenceSchedule", "azure.ai.projects.models.HumanEvaluationPreviewRuleAction": "Azure.AI.Projects.HumanEvaluationPreviewRuleAction", "azure.ai.projects.models.HybridSearchOptions": "OpenAI.HybridSearchOptions", - "azure.ai.projects.models.ImageGenTool": "OpenAI.ImageGenTool", "azure.ai.projects.models.ImageGenToolInputImageMask": "OpenAI.ImageGenToolInputImageMask", "azure.ai.projects.models.InlineSkillParam": "OpenAI.InlineSkillParam", "azure.ai.projects.models.InlineSkillSourceParam": "OpenAI.InlineSkillSourceParam", + "azure.ai.projects.models.InputTokensDetailsResource": "OpenAI.InputTokensDetailsResource", "azure.ai.projects.models.Insight": "Azure.AI.Projects.Insight", "azure.ai.projects.models.InsightCluster": "Azure.AI.Projects.InsightCluster", "azure.ai.projects.models.InsightModelConfiguration": "Azure.AI.Projects.InsightModelConfiguration", @@ -287,7 +289,126 @@ "azure.ai.projects.models.InvokeAgentInvocationsApiRoutineAction": "Azure.AI.Projects.InvokeAgentInvocationsApiRoutineAction", "azure.ai.projects.models.InvokeAgentResponsesApiDispatchPayload": "Azure.AI.Projects.InvokeAgentResponsesApiDispatchPayload", "azure.ai.projects.models.InvokeAgentResponsesApiRoutineAction": "Azure.AI.Projects.InvokeAgentResponsesApiRoutineAction", - "azure.ai.projects.models.LocalShellToolParam": "OpenAI.LocalShellToolParam", + "azure.ai.projects.models.LiveAllowedServerEventParam": "OpenAI.LiveAllowedServerEventParam", + "azure.ai.projects.models.LiveAllowedToolsChoiceParam": "OpenAI.LiveAllowedToolsChoiceParam", + "azure.ai.projects.models.LiveApplyPatchToolInputParam": "OpenAI.LiveApplyPatchToolInputParam", + "azure.ai.projects.models.LiveAudioFormat": "OpenAI.LiveAudioFormat", + "azure.ai.projects.models.LiveClientConfigParam": "OpenAI.LiveClientConfigParam", + "azure.ai.projects.models.LiveClientDelegationParam": "OpenAI.LiveClientDelegationParam", + "azure.ai.projects.models.LiveClientEvent": "OpenAI.LiveClientEvent", + "azure.ai.projects.models.LiveClientEventLiveCommentaryAppendParam": "OpenAI.LiveClientEventLiveCommentaryAppendParam", + "azure.ai.projects.models.LiveClientEventLiveDecisionCreateParam": "OpenAI.LiveClientEventLiveDecisionCreateParam", + "azure.ai.projects.models.LiveClientEventLiveDecisionItemCreateParam": "OpenAI.LiveClientEventLiveDecisionItemCreateParam", + "azure.ai.projects.models.LiveClientEventLiveDecisionItemDeleteParam": "OpenAI.LiveClientEventLiveDecisionItemDeleteParam", + "azure.ai.projects.models.LiveClientEventLiveInputAudioAppendEvent": "OpenAI.LiveClientEventLiveInputAudioAppendEvent", + "azure.ai.projects.models.LiveClientEventLiveInputAudioMuteParam": "OpenAI.LiveClientEventLiveInputAudioMuteParam", + "azure.ai.projects.models.LiveClientEventLiveInputAudioUnmuteParam": "OpenAI.LiveClientEventLiveInputAudioUnmuteParam", + "azure.ai.projects.models.LiveClientEventLiveInstructionsAppendParam": "OpenAI.LiveClientEventLiveInstructionsAppendParam", + "azure.ai.projects.models.LiveClientEventLiveOutputAudioFixturePlayParam": "OpenAI.LiveClientEventLiveOutputAudioFixturePlayParam", + "azure.ai.projects.models.LiveClientEventLiveResponseCreateParam": "OpenAI.LiveClientEventLiveResponseCreateParam", + "azure.ai.projects.models.LiveClientEventLiveResponseItemCreateParam": "OpenAI.LiveClientEventLiveResponseItemCreateParam", + "azure.ai.projects.models.LiveClientEventLiveSessionCloseParam": "OpenAI.LiveClientEventLiveSessionCloseParam", + "azure.ai.projects.models.LiveClientEventLiveSessionUpdateParam": "OpenAI.LiveClientEventLiveSessionUpdateParam", + "azure.ai.projects.models.LiveClientEventLiveThinkingAppendParam": "OpenAI.LiveClientEventLiveThinkingAppendParam", + "azure.ai.projects.models.LiveCodeInterpreterToolInputParam": "OpenAI.LiveCodeInterpreterToolInputParam", + "azure.ai.projects.models.LiveComputerToolInputParam": "OpenAI.LiveComputerToolInputParam", + "azure.ai.projects.models.LiveContainerNetworkPolicyDisabledParam": "OpenAI.LiveContainerNetworkPolicyDisabledParam", + "azure.ai.projects.models.LiveContainerReferenceParam": "OpenAI.LiveContainerReferenceParam", + "azure.ai.projects.models.LiveContextWindowUsage": "OpenAI.LiveContextWindowUsage", + "azure.ai.projects.models.LiveCustomToolInputParam": "OpenAI.LiveCustomToolInputParam", + "azure.ai.projects.models.LiveCustomVoiceParam": "OpenAI.LiveCustomVoiceParam", + "azure.ai.projects.models.LiveDataChannelConfigParam": "OpenAI.LiveDataChannelConfigParam", + "azure.ai.projects.models.LiveDecisionCompleted": "OpenAI.LiveDecisionCompleted", + "azure.ai.projects.models.LiveDecisionInputImageParam": "OpenAI.LiveDecisionInputImageParam", + "azure.ai.projects.models.LiveDecisionInputItemParam": "OpenAI.LiveDecisionInputItemParam", + "azure.ai.projects.models.LiveDecisionInputTextParam": "OpenAI.LiveDecisionInputTextParam", + "azure.ai.projects.models.LiveDecisionQuestionsInputParam_2": "OpenAI.LiveDecisionQuestionsInputParam-2", + "azure.ai.projects.models.LiveDecisionsDelegationParam_2": "OpenAI.LiveDecisionsDelegationParam-2", + "azure.ai.projects.models.LiveDecisionsDelegationUpdateParam": "OpenAI.LiveDecisionsDelegationUpdateParam", + "azure.ai.projects.models.LiveDecisionsSettingsInputParam_2": "OpenAI.LiveDecisionsSettingsInputParam-2", + "azure.ai.projects.models.LiveDecisionsSettingsUpdateParam": "OpenAI.LiveDecisionsSettingsUpdateParam", + "azure.ai.projects.models.LiveDecisionStoredInputItemParam": "OpenAI.LiveDecisionStoredInputItemParam", + "azure.ai.projects.models.LiveDecisionTriggerInputParam_2": "OpenAI.LiveDecisionTriggerInputParam-2", + "azure.ai.projects.models.LiveDelegationReasoningInputParam": "OpenAI.LiveDelegationReasoningInputParam", + "azure.ai.projects.models.LiveDelegationTextInputParam": "OpenAI.LiveDelegationTextInputParam", + "azure.ai.projects.models.LiveFileSearchToolInputParam": "OpenAI.LiveFileSearchToolInputParam", + "azure.ai.projects.models.LiveFunctionToolChoiceParam": "OpenAI.LiveFunctionToolChoiceParam", + "azure.ai.projects.models.LiveFunctionToolInputParam": "OpenAI.LiveFunctionToolInputParam", + "azure.ai.projects.models.LiveHostedShellContainerAutoParam": "OpenAI.LiveHostedShellContainerAutoParam", + "azure.ai.projects.models.LiveHostedShellNetworkPolicyAllowlistParam": "OpenAI.LiveHostedShellNetworkPolicyAllowlistParam", + "azure.ai.projects.models.LiveHostedShellToolInputParam": "OpenAI.LiveHostedShellToolInputParam", + "azure.ai.projects.models.LiveImageGenerationToolInputParam": "OpenAI.LiveImageGenerationToolInputParam", + "azure.ai.projects.models.LiveInitialItem": "OpenAI.LiveInitialItem", + "azure.ai.projects.models.LiveInitialAssistantMessageItemParam": "OpenAI.LiveInitialAssistantMessageItemParam", + "azure.ai.projects.models.LiveInitialDeveloperMessageItemParam": "OpenAI.LiveInitialDeveloperMessageItemParam", + "azure.ai.projects.models.LiveInitialInputTextContentPartParam": "OpenAI.LiveInitialInputTextContentPartParam", + "azure.ai.projects.models.LiveInitialOutputTextContentPartParam": "OpenAI.LiveInitialOutputTextContentPartParam", + "azure.ai.projects.models.LiveInitialSessionAudioOutputParam": "OpenAI.LiveInitialSessionAudioOutputParam", + "azure.ai.projects.models.LiveInitialSessionAudioParam": "OpenAI.LiveInitialSessionAudioParam", + "azure.ai.projects.models.LiveInitialTextContentPartParam": "OpenAI.LiveInitialTextContentPartParam", + "azure.ai.projects.models.LiveInitialUserMessageItemParam": "OpenAI.LiveInitialUserMessageItemParam", + "azure.ai.projects.models.LiveInlineSkillParam": "OpenAI.LiveInlineSkillParam", + "azure.ai.projects.models.LiveInlineSkillSourceParam": "OpenAI.LiveInlineSkillSourceParam", + "azure.ai.projects.models.LiveServerEvent": "OpenAI.LiveServerEvent", + "azure.ai.projects.models.LiveInputAudioAppend": "OpenAI.LiveInputAudioAppend", + "azure.ai.projects.models.LiveLiveError": "OpenAI.LiveLiveError", + "azure.ai.projects.models.LiveLocalEnvironmentParam": "OpenAI.LiveLocalEnvironmentParam", + "azure.ai.projects.models.LiveLocalSkillParam": "OpenAI.LiveLocalSkillParam", + "azure.ai.projects.models.LiveMCPToolChoiceParam": "OpenAI.LiveMCPToolChoiceParam", + "azure.ai.projects.models.LiveMCPToolInputParam": "OpenAI.LiveMCPToolInputParam", + "azure.ai.projects.models.LiveNamespaceToolInputParam": "OpenAI.LiveNamespaceToolInputParam", + "azure.ai.projects.models.LiveOutputAudioDelta": "OpenAI.LiveOutputAudioDelta", + "azure.ai.projects.models.LiveProgrammaticToolInputParam": "OpenAI.LiveProgrammaticToolInputParam", + "azure.ai.projects.models.LiveResponsesDelegationParam": "OpenAI.LiveResponsesDelegationParam", + "azure.ai.projects.models.LiveResponsesDelegationSettingsInputParam": "OpenAI.LiveResponsesDelegationSettingsInputParam", + "azure.ai.projects.models.LiveResponsesDelegationSettingsUpdateInputParam": "OpenAI.LiveResponsesDelegationSettingsUpdateInputParam", + "azure.ai.projects.models.LiveResponsesDelegationUpdateParam": "OpenAI.LiveResponsesDelegationUpdateParam", + "azure.ai.projects.models.LiveServerEventLiveCommentaryAppended": "OpenAI.LiveServerEventLiveCommentaryAppended", + "azure.ai.projects.models.LiveServerEventLiveDecisionEvent": "OpenAI.LiveServerEventLiveDecisionEvent", + "azure.ai.projects.models.LiveServerEventLiveDecisionItemCreated": "OpenAI.LiveServerEventLiveDecisionItemCreated", + "azure.ai.projects.models.LiveServerEventLiveDecisionItemDeleted": "OpenAI.LiveServerEventLiveDecisionItemDeleted", + "azure.ai.projects.models.LiveServerEventLiveDelegationCreated": "OpenAI.LiveServerEventLiveDelegationCreated", + "azure.ai.projects.models.LiveServerEventLiveErrorEvent": "OpenAI.LiveServerEventLiveErrorEvent", + "azure.ai.projects.models.LiveServerEventLiveInfoEvent": "OpenAI.LiveServerEventLiveInfoEvent", + "azure.ai.projects.models.LiveServerEventLiveInputAudioMuted": "OpenAI.LiveServerEventLiveInputAudioMuted", + "azure.ai.projects.models.LiveServerEventLiveInputAudioUnmuted": "OpenAI.LiveServerEventLiveInputAudioUnmuted", + "azure.ai.projects.models.LiveServerEventLiveInputTranscriptDelta": "OpenAI.LiveServerEventLiveInputTranscriptDelta", + "azure.ai.projects.models.LiveServerEventLiveInstructionsAppended": "OpenAI.LiveServerEventLiveInstructionsAppended", + "azure.ai.projects.models.LiveServerEventLiveOutputAudioFixturePlayed": "OpenAI.LiveServerEventLiveOutputAudioFixturePlayed", + "azure.ai.projects.models.LiveServerEventLiveOutputAudioFixturePlaying": "OpenAI.LiveServerEventLiveOutputAudioFixturePlaying", + "azure.ai.projects.models.LiveServerEventLiveOutputTranscriptDelta": "OpenAI.LiveServerEventLiveOutputTranscriptDelta", + "azure.ai.projects.models.LiveServerEventLiveResponseEvent": "OpenAI.LiveServerEventLiveResponseEvent", + "azure.ai.projects.models.LiveServerEventLiveSessionClosed": "OpenAI.LiveServerEventLiveSessionClosed", + "azure.ai.projects.models.LiveServerEventLiveSessionStarted": "OpenAI.LiveServerEventLiveSessionStarted", + "azure.ai.projects.models.LiveServerEventLiveSessionUpdated": "OpenAI.LiveServerEventLiveSessionUpdated", + "azure.ai.projects.models.LiveServerEventLiveSessionUsageUpdated": "OpenAI.LiveServerEventLiveSessionUsageUpdated", + "azure.ai.projects.models.LiveServerEventLiveThinkingAppended": "OpenAI.LiveServerEventLiveThinkingAppended", + "azure.ai.projects.models.LiveServerEventLiveTransportAnswered": "OpenAI.LiveServerEventLiveTransportAnswered", + "azure.ai.projects.models.LiveServerEventLiveTransportFailed": "OpenAI.LiveServerEventLiveTransportFailed", + "azure.ai.projects.models.LiveServerEventLiveTransportRinging": "OpenAI.LiveServerEventLiveTransportRinging", + "azure.ai.projects.models.LiveSessionAudioFormatPCMAParam": "OpenAI.LiveSessionAudioFormatPCMAParam", + "azure.ai.projects.models.LiveSessionAudioFormatPCMParam": "OpenAI.LiveSessionAudioFormatPCMParam", + "azure.ai.projects.models.LiveSessionAudioFormatPCMUParam": "OpenAI.LiveSessionAudioFormatPCMUParam", + "azure.ai.projects.models.LiveSessionCreateParams": "OpenAI.LiveSessionCreateParams", + "azure.ai.projects.models.LiveSessionStartEvent": "OpenAI.LiveSessionStartEvent", + "azure.ai.projects.models.LiveSessionUpdateParams": "OpenAI.LiveSessionUpdateParams", + "azure.ai.projects.models.LiveSessionUsage": "OpenAI.LiveSessionUsage", + "azure.ai.projects.models.LiveSkillReferenceParam": "OpenAI.LiveSkillReferenceParam", + "azure.ai.projects.models.LiveSpecificApplyPatchParam": "OpenAI.LiveSpecificApplyPatchParam", + "azure.ai.projects.models.LiveSpecificCodeInterpreterParam": "OpenAI.LiveSpecificCodeInterpreterParam", + "azure.ai.projects.models.LiveSpecificComputerParam": "OpenAI.LiveSpecificComputerParam", + "azure.ai.projects.models.LiveSpecificCustomToolParam": "OpenAI.LiveSpecificCustomToolParam", + "azure.ai.projects.models.LiveSpecificFileSearchParam": "OpenAI.LiveSpecificFileSearchParam", + "azure.ai.projects.models.LiveSpecificFunctionShellParam": "OpenAI.LiveSpecificFunctionShellParam", + "azure.ai.projects.models.LiveSpecificImageGenParam": "OpenAI.LiveSpecificImageGenParam", + "azure.ai.projects.models.LiveSpecificProgrammaticToolCallingParam": "OpenAI.LiveSpecificProgrammaticToolCallingParam", + "azure.ai.projects.models.LiveSpecificWebSearchParam": "OpenAI.LiveSpecificWebSearchParam", + "azure.ai.projects.models.LiveSpecificWebSearchPreviewParam": "OpenAI.LiveSpecificWebSearchPreviewParam", + "azure.ai.projects.models.LiveToolSearchToolInputParam": "OpenAI.LiveToolSearchToolInputParam", + "azure.ai.projects.models.LiveTransportCallError": "OpenAI.LiveTransportCallError", + "azure.ai.projects.models.LiveTransportDTMFReceived": "OpenAI.LiveTransportDTMFReceived", + "azure.ai.projects.models.LiveTransportDTMFSend": "OpenAI.LiveTransportDTMFSend", + "azure.ai.projects.models.LiveWebSearchToolInputParam": "OpenAI.LiveWebSearchToolInputParam", "azure.ai.projects.models.LocalSkillParam": "OpenAI.LocalSkillParam", "azure.ai.projects.models.LogProbProperties": "OpenAI.LogProbProperties", "azure.ai.projects.models.LoraConfig": "Azure.AI.Projects.LoraConfig", @@ -350,11 +471,11 @@ "azure.ai.projects.models.OptimizationContext": "Azure.AI.Projects.OptimizationContext", "azure.ai.projects.models.TelemetryEndpoint": "Azure.AI.Projects.TelemetryEndpoint", "azure.ai.projects.models.OtlpTelemetryEndpoint": "Azure.AI.Projects.OtlpTelemetryEndpoint", + "azure.ai.projects.models.OutputTokensDetailsResource": "OpenAI.OutputTokensDetailsResource", "azure.ai.projects.models.PendingUploadRequest": "Azure.AI.Projects.PendingUploadRequest", "azure.ai.projects.models.PendingUploadResponse": "Azure.AI.Projects.PendingUploadResponse", "azure.ai.projects.models.PickPropertiesVoiceAgentAudioConfig": "TypeSpec.PickProperties", "azure.ai.projects.models.ProceduralMemoryItem": "Azure.AI.Projects.ProceduralMemoryItem", - "azure.ai.projects.models.ProgrammaticToolCallingParam": "OpenAI.ProgrammaticToolCallingParam", "azure.ai.projects.models.PromptAgentDefinition": "Azure.AI.Projects.PromptAgentDefinition", "azure.ai.projects.models.PromptAgentDefinitionTextOptions": "Azure.AI.Projects.PromptAgentDefinitionTextOptions", "azure.ai.projects.models.PromptBasedEvaluatorDefinition": "Azure.AI.Projects.PromptBasedEvaluatorDefinition", @@ -365,6 +486,10 @@ "azure.ai.projects.models.ProtocolVersionRecord": "Azure.AI.Projects.ProtocolVersionRecord", "azure.ai.projects.models.TelephonyTransferDestination": "Azure.AI.Projects.TelephonyTransferDestination", "azure.ai.projects.models.PSTNTelephonyTransferDestination": "Azure.AI.Projects.PSTNTelephonyTransferDestination", + "azure.ai.projects.models.QuestionParam": "OpenAI.QuestionParam", + "azure.ai.projects.models.QuestionParamChoice": "OpenAI.QuestionParamChoice", + "azure.ai.projects.models.QuestionParamPredicate": "OpenAI.QuestionParamPredicate", + "azure.ai.projects.models.QuestionParamScore": "OpenAI.QuestionParamScore", "azure.ai.projects.models.RaiConfig": "Azure.AI.Projects.RaiConfig", "azure.ai.projects.models.RaiInvocationModeration": "Azure.AI.Projects.RaiInvocationModeration", "azure.ai.projects.models.RaiSseTextSelector": "Azure.AI.Projects.RaiSseTextSelector", @@ -469,6 +594,7 @@ "azure.ai.projects.models.ResponsesProtocolConfiguration": "Azure.AI.Projects.ResponsesProtocolConfiguration", "azure.ai.projects.models.ResponseUsageInputTokensDetails": "OpenAI.ResponseUsageInputTokensDetails", "azure.ai.projects.models.ResponseUsageOutputTokensDetails": "OpenAI.ResponseUsageOutputTokensDetails", + "azure.ai.projects.models.ResponseUsageResource": "OpenAI.ResponseUsageResource", "azure.ai.projects.models.Routine": "Azure.AI.Projects.Routine", "azure.ai.projects.models.RoutineAuthorization": "Azure.AI.Projects.RoutineAuthorization", "azure.ai.projects.models.RoutineRun": "Azure.AI.Projects.RoutineRun", @@ -478,6 +604,8 @@ "azure.ai.projects.models.Schedule": "Azure.AI.Projects.Schedule", "azure.ai.projects.models.ScheduleRoutineTrigger": "Azure.AI.Projects.ScheduleRoutineTrigger", "azure.ai.projects.models.ScheduleRun": "Azure.AI.Projects.ScheduleRun", + "azure.ai.projects.models.ScoreLevelParam": "OpenAI.ScoreLevelParam", + "azure.ai.projects.models.ScoreProbabilityResource": "OpenAI.ScoreProbabilityResource", "azure.ai.projects.models.SessionConfiguration": "Azure.AI.Projects.SessionConfiguration", "azure.ai.projects.models.SessionDirectoryEntry": "Azure.AI.Projects.SessionDirectoryEntry", "azure.ai.projects.models.SessionFileWriteResult": "Azure.AI.Projects.SessionFileWriteResponse", @@ -529,6 +657,7 @@ "azure.ai.projects.models.TextResponseFormatJsonSchema": "OpenAI.TextResponseFormatJsonSchema", "azure.ai.projects.models.TextResponseFormatText": "OpenAI.TextResponseFormatConfigurationResponseFormatText", "azure.ai.projects.models.TimerRoutineTrigger": "Azure.AI.Projects.TimerRoutineTrigger", + "azure.ai.projects.models.ToolApplyPatchToolParam": "OpenAI.ToolApplyPatchToolParam", "azure.ai.projects.models.ToolboxObject": "Azure.AI.Projects.ToolboxObject", "azure.ai.projects.models.ToolboxPolicies": "Azure.AI.Projects.ToolboxPolicies", "azure.ai.projects.models.ToolboxSearchPreviewToolboxTool": "Azure.AI.Projects.ToolboxSearchPreviewToolboxTool", @@ -553,12 +682,25 @@ "azure.ai.projects.models.ToolChoiceMCP": "OpenAI.ToolChoiceMCP", "azure.ai.projects.models.ToolChoiceWebSearchPreview": "OpenAI.ToolChoiceWebSearchPreview", "azure.ai.projects.models.ToolChoiceWebSearchPreview20250311": "OpenAI.ToolChoiceWebSearchPreview20250311", + "azure.ai.projects.models.ToolCodeInterpreterTool": "OpenAI.ToolCodeInterpreterTool", + "azure.ai.projects.models.ToolComputerTool": "OpenAI.ToolComputerTool", + "azure.ai.projects.models.ToolComputerUsePreviewTool": "OpenAI.ToolComputerUsePreviewTool", "azure.ai.projects.models.ToolConfig": "Azure.AI.Projects.ToolConfig", + "azure.ai.projects.models.ToolCustomToolParam": "OpenAI.ToolCustomToolParam", "azure.ai.projects.models.ToolDescription": "Azure.AI.Projects.ToolDescription", + "azure.ai.projects.models.ToolFileSearchTool": "OpenAI.ToolFileSearchTool", + "azure.ai.projects.models.ToolFunctionShellToolParam": "OpenAI.ToolFunctionShellToolParam", + "azure.ai.projects.models.ToolFunctionTool": "OpenAI.ToolFunctionTool", + "azure.ai.projects.models.ToolImageGenTool": "OpenAI.ToolImageGenTool", + "azure.ai.projects.models.ToolLocalShellToolParam": "OpenAI.ToolLocalShellToolParam", + "azure.ai.projects.models.ToolMcpTool": "OpenAI.ToolMcpTool", + "azure.ai.projects.models.ToolProgrammaticToolCallingParam": "OpenAI.ToolProgrammaticToolCallingParam", "azure.ai.projects.models.ToolProjectConnection": "Azure.AI.Projects.ToolProjectConnection", "azure.ai.projects.models.ToolSearchToolboxTool": "Azure.AI.Projects.ToolSearchToolboxTool", - "azure.ai.projects.models.ToolSearchToolParam": "OpenAI.ToolSearchToolParam", + "azure.ai.projects.models.ToolToolSearchToolParam": "OpenAI.ToolToolSearchToolParam", "azure.ai.projects.models.ToolUseFineTuningDataGenerationJobConfiguration": "Azure.AI.Projects.ToolUseFineTuningDataGenerationJobConfiguration", + "azure.ai.projects.models.ToolWebSearchPreviewTool": "OpenAI.ToolWebSearchPreviewTool", + "azure.ai.projects.models.ToolWebSearchTool": "OpenAI.ToolWebSearchTool", "azure.ai.projects.models.TracesDataGenerationJobConfiguration": "Azure.AI.Projects.TracesDataGenerationJobConfiguration", "azure.ai.projects.models.TracesDataGenerationJobSource": "Azure.AI.Projects.TracesDataGenerationJobSource", "azure.ai.projects.models.TracesEvaluatorGenerationJobSource": "Azure.AI.Projects.TracesEvaluatorGenerationJobSource", @@ -596,6 +738,7 @@ "azure.ai.projects.models.VoiceAgentAzureSemanticVadEnTurnDetection": "Azure.AI.Projects.VoiceAgentAzureSemanticVadEnTurnDetection", "azure.ai.projects.models.VoiceAgentAzureSemanticVadMultilingualTurnDetection": "Azure.AI.Projects.VoiceAgentAzureSemanticVadMultilingualTurnDetection", "azure.ai.projects.models.VoiceAgentAzureSemanticVadTurnDetection": "Azure.AI.Projects.VoiceAgentAzureSemanticVadTurnDetection", + "azure.ai.projects.models.VoiceAgentBaseDefinition": "Azure.AI.Projects.VoiceAgentBaseDefinition", "azure.ai.projects.models.VoiceAgentClientEventRtcCallSdpCreate": "Azure.AI.Projects.VoiceAgentClientEventRtcCallSdpCreate", "azure.ai.projects.models.VoiceAgentClientEventSessionAvatarConnect": "Azure.AI.Projects.VoiceAgentClientEventSessionAvatarConnect", "azure.ai.projects.models.VoiceAgentClientEventSessionUpdate": "Azure.AI.Projects.VoiceAgentClientEventSessionUpdate", @@ -609,6 +752,20 @@ "azure.ai.projects.models.VoiceAgentGreetingConfig": "Azure.AI.Projects.VoiceAgentGreetingConfig", "azure.ai.projects.models.VoiceAgentInputTranscription": "Azure.AI.Projects.VoiceAgentInputTranscription", "azure.ai.projects.models.VoiceAgentInterimResponseConfig": "Azure.AI.Projects.VoiceAgentInterimResponseConfig", + "azure.ai.projects.models.VoiceAgentLiveConversationItem": "Azure.AI.Projects.VoiceAgentLiveConversationItem", + "azure.ai.projects.models.VoiceAgentLiveDelegationConversationItem": "Azure.AI.Projects.VoiceAgentLiveDelegationConversationItem", + "azure.ai.projects.models.VoiceAgentLiveClientDelegationConversationItem": "Azure.AI.Projects.VoiceAgentLiveClientDelegationConversationItem", + "azure.ai.projects.models.VoiceAgentLiveConversation": "Azure.AI.Projects.VoiceAgentLiveConversation", + "azure.ai.projects.models.VoiceAgentLiveDefinition": "Azure.AI.Projects.VoiceAgentLiveDefinition", + "azure.ai.projects.models.VoiceAgentLiveDelegationItem": "Azure.AI.Projects.VoiceAgentLiveDelegationItem", + "azure.ai.projects.models.VoiceAgentLiveDelegationResultItem1": "Azure.AI.Projects.VoiceAgentLiveDelegationResultItem.anonymous", + "azure.ai.projects.models.VoiceAgentLiveDelegationResultItem2": "Azure.AI.Projects.VoiceAgentLiveDelegationResultItem.anonymous", + "azure.ai.projects.models.VoiceAgentLiveFoundryManagedAgentDelegationItem": "Azure.AI.Projects.VoiceAgentLiveFoundryManagedAgentDelegationItem", + "azure.ai.projects.models.VoiceAgentLiveInputConversationItem": "Azure.AI.Projects.VoiceAgentLiveInputConversationItem", + "azure.ai.projects.models.VoiceAgentLiveManagedAgentDelegation": "Azure.AI.Projects.VoiceAgentLiveManagedAgentDelegation", + "azure.ai.projects.models.VoiceAgentLiveOutputConversationItem": "Azure.AI.Projects.VoiceAgentLiveOutputConversationItem", + "azure.ai.projects.models.VoiceAgentLiveResponsesDelegationConversationItem": "Azure.AI.Projects.VoiceAgentLiveResponsesDelegationConversationItem", + "azure.ai.projects.models.VoiceAgentLiveSessionResource": "Azure.AI.Projects.VoiceAgentLiveSessionResource", "azure.ai.projects.models.VoiceAgentLlmGeneratedGreetingConfig": "Azure.AI.Projects.VoiceAgentLlmGeneratedGreetingConfig", "azure.ai.projects.models.VoiceAgentLlmInterimResponseConfig": "Azure.AI.Projects.VoiceAgentLlmInterimResponseConfig", "azure.ai.projects.models.VoiceAgentMcpTool": "Azure.AI.Projects.VoiceAgentMcpTool", @@ -638,6 +795,10 @@ "azure.ai.projects.models.VoiceAgentSessionAvatarConfig": "Azure.AI.Projects.VoiceAgentSessionAvatarConfig", "azure.ai.projects.models.VoiceAgentSessionResponseConfig": "Azure.AI.Projects.VoiceAgentSessionResponseConfig", "azure.ai.projects.models.VoiceAgentSessionUpdateConfig": "Azure.AI.Projects.VoiceAgentSessionUpdateConfig", + "azure.ai.projects.models.VoiceAgentSoundscapeConfig": "Azure.AI.Projects.VoiceAgentSoundscapeConfig", + "azure.ai.projects.models.VoiceAgentSoundscapeSourceConfig": "Azure.AI.Projects.VoiceAgentSoundscapeSourceConfig", + "azure.ai.projects.models.VoiceAgentSoundscapeTrackConfig": "Azure.AI.Projects.VoiceAgentSoundscapeTrackConfig", + "azure.ai.projects.models.VoiceAgentSoundscapeWorkingTrackConfig": "Azure.AI.Projects.VoiceAgentSoundscapeWorkingTrackConfig", "azure.ai.projects.models.VoiceAgentStaticInterimResponseConfig": "Azure.AI.Projects.VoiceAgentStaticInterimResponseConfig", "azure.ai.projects.models.VoiceAgentSubagent": "Azure.AI.Projects.VoiceAgentSubagent", "azure.ai.projects.models.VoiceAgentSubagentConfig": "Azure.AI.Projects.VoiceAgentSubagentConfig", @@ -660,8 +821,6 @@ "azure.ai.projects.models.WebIQPreviewToolboxTool": "Azure.AI.Projects.WebIQPreviewToolboxTool", "azure.ai.projects.models.WebSearchApproximateLocation": "OpenAI.WebSearchApproximateLocation", "azure.ai.projects.models.WebSearchConfiguration": "Azure.AI.Projects.WebSearchConfiguration", - "azure.ai.projects.models.WebSearchPreviewTool": "OpenAI.WebSearchPreviewTool", - "azure.ai.projects.models.WebSearchTool": "OpenAI.WebSearchTool", "azure.ai.projects.models.WebSearchToolboxTool": "Azure.AI.Projects.WebSearchToolboxTool", "azure.ai.projects.models.WebSearchToolFilters": "OpenAI.WebSearchToolFilters", "azure.ai.projects.models.WeeklyRecurrenceSchedule": "Azure.AI.Projects.WeeklyRecurrenceSchedule", @@ -679,6 +838,9 @@ "azure.ai.projects.models.VoiceAudioRole": "Azure.AI.Projects.VoiceAudioRole", "azure.ai.projects.models.VoiceAudioContainerFormat": "Azure.AI.Projects.VoiceAudioContainerFormat", "azure.ai.projects.models.VoiceAudioCodec": "Azure.AI.Projects.VoiceAudioCodec", + "azure.ai.projects.models.VoiceAgentLiveConversationItemType": "Azure.AI.Projects.VoiceAgentLiveConversationItemType", + "azure.ai.projects.models.VoiceAgentLiveDelegationTarget": "Azure.AI.Projects.VoiceAgentLiveDelegationTarget", + "azure.ai.projects.models.VoiceAgentLiveDelegationStatus": "Azure.AI.Projects.VoiceAgentLiveDelegationStatus", "azure.ai.projects.models.TelephonyProvider": "Azure.AI.Projects.TelephonyProvider", "azure.ai.projects.models.TelephonyBindingStatus": "Azure.AI.Projects.TelephonyBindingStatus", "azure.ai.projects.models.TelephonyCallStatus": "Azure.AI.Projects.TelephonyCallStatus", @@ -733,21 +895,7 @@ "azure.ai.projects.models.SearchContentType": "OpenAI.SearchContentType", "azure.ai.projects.models.ToolChoiceParamType": "OpenAI.ToolChoiceParamType", "azure.ai.projects.models.TextResponseFormatConfigurationType": "OpenAI.TextResponseFormatConfigurationType", - "azure.ai.projects.models.VoiceModelType": "Azure.AI.Projects.VoiceModelType", - "azure.ai.projects.models.VoiceAgentNoiseReductionType": "Azure.AI.Projects.VoiceAgentNoiseReductionType", - "azure.ai.projects.models.VoiceAgentTurnDetectionType": "Azure.AI.Projects.VoiceAgentTurnDetectionType", - "azure.ai.projects.models.VoiceAgentEndOfUtteranceDetectionModel": "Azure.AI.Projects.VoiceAgentEndOfUtteranceDetectionModel", - "azure.ai.projects.models.VoiceAgentEndOfUtteranceThresholdLevel": "Azure.AI.Projects.VoiceAgentEndOfUtteranceThresholdLevel", - "azure.ai.projects.models.VoiceAgentEchoCancellationReferenceSource": "Azure.AI.Projects.VoiceAgentEchoCancellationReferenceSource", - "azure.ai.projects.models.VoiceAgentInputTranscriptionModel": "Azure.AI.Projects.VoiceAgentInputTranscriptionModel", - "azure.ai.projects.models.VoiceAgentAudioTimestampType": "Azure.AI.Projects.VoiceAgentAudioTimestampType", - "azure.ai.projects.models.VoiceOutputModality": "Azure.AI.Projects.VoiceOutputModality", - "azure.ai.projects.models.VoiceAgentSessionIncludeOption": "Azure.AI.Projects.VoiceAgentSessionIncludeOption", - "azure.ai.projects.models.VoiceAgentInterimResponseTrigger": "Azure.AI.Projects.VoiceAgentInterimResponseTrigger", - "azure.ai.projects.models.VoiceAgentAvatarType": "Azure.AI.Projects.VoiceAgentAvatarType", - "azure.ai.projects.models.VoiceAgentAvatarOutputProtocol": "Azure.AI.Projects.VoiceAgentAvatarOutputProtocol", - "azure.ai.projects.models.VoiceAgentToolResponseScheduling": "Azure.AI.Projects.VoiceAgentToolResponseScheduling", - "azure.ai.projects.models.VoiceAgentSystemToolName": "Azure.AI.Projects.VoiceAgentSystemToolName", + "azure.ai.projects.models.VoiceAgentSubProtocol": "Azure.AI.Projects.VoiceAgentSubProtocol", "azure.ai.projects.models.AgentVersionStatus": "Azure.AI.Projects.AgentVersionStatus", "azure.ai.projects.models.AgentIdentityStatus": "Azure.AI.Projects.AgentIdentityStatus", "azure.ai.projects.models.AgentBlueprintReferenceType": "Azure.AI.Projects.AgentBlueprintReferenceType", @@ -756,6 +904,9 @@ "azure.ai.projects.models.AgentEndpointAuthorizationSchemeType": "Azure.AI.Projects.AgentEndpointAuthorizationSchemeType", "azure.ai.projects.models.PublishApprovalStatus": "Azure.AI.Projects.PublishApprovalStatus", "azure.ai.projects.models.DigitalWorkerType": "Azure.AI.Projects.DigitalWorkerType", + "azure.ai.projects.models.VoiceModelType": "Azure.AI.Projects.VoiceModelType", + "azure.ai.projects.models.VoiceAgentToolResponseScheduling": "Azure.AI.Projects.VoiceAgentToolResponseScheduling", + "azure.ai.projects.models.VoiceAgentSystemToolName": "Azure.AI.Projects.VoiceAgentSystemToolName", "azure.ai.projects.models.AgentInsightOverviewSource": "Azure.AI.Projects.AgentInsightOverviewSource", "azure.ai.projects.models.JobStatus": "Azure.AI.Projects.JobStatus", "azure.ai.projects.models.AgentInsightRunTrigger": "Azure.AI.Projects.AgentInsightRunTrigger", @@ -834,6 +985,29 @@ "azure.ai.projects.models.RubricGenerationInputQualityWarningSource": "Azure.AI.Projects.RubricGenerationInputQualityWarningSource", "azure.ai.projects.models.ToolboxToolType": "Azure.AI.Projects.ToolboxToolType", "azure.ai.projects.models.MemoryStoreUpdateStatus": "Azure.AI.Projects.MemoryStoreUpdateStatus", + "azure.ai.projects.models.VoiceAgentNoiseReductionType": "Azure.AI.Projects.VoiceAgentNoiseReductionType", + "azure.ai.projects.models.VoiceAgentTurnDetectionType": "Azure.AI.Projects.VoiceAgentTurnDetectionType", + "azure.ai.projects.models.VoiceAgentEndOfUtteranceDetectionModel": "Azure.AI.Projects.VoiceAgentEndOfUtteranceDetectionModel", + "azure.ai.projects.models.VoiceAgentEndOfUtteranceThresholdLevel": "Azure.AI.Projects.VoiceAgentEndOfUtteranceThresholdLevel", + "azure.ai.projects.models.VoiceAgentEchoCancellationReferenceSource": "Azure.AI.Projects.VoiceAgentEchoCancellationReferenceSource", + "azure.ai.projects.models.VoiceAgentInputTranscriptionModel": "Azure.AI.Projects.VoiceAgentInputTranscriptionModel", + "azure.ai.projects.models.VoiceAgentProfanityFilterMode": "Azure.AI.Projects.VoiceAgentProfanityFilterMode", + "azure.ai.projects.models.VoiceAgentAudioTimestampType": "Azure.AI.Projects.VoiceAgentAudioTimestampType", + "azure.ai.projects.models.VoiceAgentSoundscapeSound": "Azure.AI.Projects.VoiceAgentSoundscapeSound", + "azure.ai.projects.models.VoiceOutputModality": "Azure.AI.Projects.VoiceOutputModality", + "azure.ai.projects.models.VoiceAgentSessionIncludeOption": "Azure.AI.Projects.VoiceAgentSessionIncludeOption", + "azure.ai.projects.models.VoiceAgentInterimResponseTrigger": "Azure.AI.Projects.VoiceAgentInterimResponseTrigger", + "azure.ai.projects.models.VoiceAgentAvatarType": "Azure.AI.Projects.VoiceAgentAvatarType", + "azure.ai.projects.models.VoiceAgentAvatarOutputProtocol": "Azure.AI.Projects.VoiceAgentAvatarOutputProtocol", + "azure.ai.projects.models.LiveAudioFormatType": "OpenAI.LiveAudioFormatType", + "azure.ai.projects.models.DelegationType": "OpenAI.DelegationType", + "azure.ai.projects.models.LiveResponsesServiceTier": "OpenAI.LiveResponsesServiceTier", + "azure.ai.projects.models.LiveReasoningEffort": "OpenAI.LiveReasoningEffort", + "azure.ai.projects.models.LiveReasoningSummary": "OpenAI.LiveReasoningSummary", + "azure.ai.projects.models.LiveTextVerbosity": "OpenAI.LiveTextVerbosity", + "azure.ai.projects.models.LiveContainerMemoryLimit": "OpenAI.LiveContainerMemoryLimit", + "azure.ai.projects.models.LiveToolChoiceEnum": "OpenAI.LiveToolChoiceEnum", + "azure.ai.projects.models.LiveToolChoiceValueEnum": "OpenAI.LiveToolChoiceValueEnum", "azure.ai.projects.models.VoiceAgentAnimationOutputType": "Azure.AI.Projects.VoiceAgentAnimationOutputType", "azure.ai.projects.models.RealtimeReasoningEffort": "OpenAI.RealtimeReasoningEffort", "azure.ai.projects.models.RealtimeClientEventType": "OpenAI.RealtimeClientEventType", @@ -841,6 +1015,14 @@ "azure.ai.projects.models.RealtimeServerEventType": "OpenAI.RealtimeServerEventType", "azure.ai.projects.models.CreateTranscriptionResponseJsonUsageType": "OpenAI.CreateTranscriptionResponseJsonUsageType", "azure.ai.projects.models.VoiceAgentSubagentAbortReason": "Azure.AI.Projects.VoiceAgentSubagentAbortReason", + "azure.ai.projects.models.LiveClientEventType": "OpenAI.LiveClientEventType", + "azure.ai.projects.models.LiveDetailEnum": "OpenAI.LiveDetailEnum", + "azure.ai.projects.models.ModelIdsLive": "OpenAI.ModelIdsLive", + "azure.ai.projects.models.LiveInitialItemType": "OpenAI.LiveInitialItemType", + "azure.ai.projects.models.LiveInitialMessageStatus": "OpenAI.LiveInitialMessageStatus", + "azure.ai.projects.models.QuestionParamType": "OpenAI.QuestionParamType", + "azure.ai.projects.models.LiveServerEventType": "OpenAI.LiveServerEventType", + "azure.ai.projects.models.AnswerResourceType": "OpenAI.AnswerResourceType", "azure.ai.projects.models.VoiceAgentTransport": "Azure.AI.Projects.VoiceAgentTransport", "azure.ai.projects.operations.AgentsOperations.get": "Azure.AI.Projects.Agents.getAgent", "azure.ai.projects.aio.operations.AgentsOperations.get": "Azure.AI.Projects.Agents.getAgent", @@ -999,5 +1181,5 @@ "azure.ai.projects.operations.ToolboxesOperations.delete_version": "Azure.AI.Projects.Toolboxes.deleteToolboxVersion", "azure.ai.projects.aio.operations.ToolboxesOperations.delete_version": "Azure.AI.Projects.Toolboxes.deleteToolboxVersion" }, - "CrossLanguageVersion": "05e1b80a337b" + "CrossLanguageVersion": "9bc200aa5497" } \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_unions.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_unions.py index 73da9e2b48ee..4050981e8cb9 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_unions.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_unions.py @@ -10,12 +10,22 @@ if TYPE_CHECKING: from . import models as _models +VoiceAgentLiveDelegationResultItem: TypeAlias = Union[ + "_models.VoiceAgentLiveDelegationResultItem2", "_models.VoiceAgentLiveDelegationResultItem1" +] Filters: TypeAlias = Union["_models.ComparisonFilter", "_models.CompoundFilter"] +RoutineRunStatus: TypeAlias = str VoiceAgentToolChoice: TypeAlias = Union[ Literal["none"], Literal["auto"], Literal["required"], "_models.ToolChoiceFunction", "_models.ToolChoiceMCP" ] VoiceAgentMaxOutputTokens: TypeAlias = Union[int, Literal["inf"]] -RoutineRunStatus: TypeAlias = str +VoiceAgentLiveDelegation: TypeAlias = Union[ + "_models.LiveClientDelegationParam", + "_models.LiveResponsesDelegationParam", + "_models.VoiceAgentLiveManagedAgentDelegation", +] VoiceAgentSessionUpdate: TypeAlias = "_models.VoiceAgentSessionUpdateConfig" VoiceAgentSessionResponse: TypeAlias = "_models.VoiceAgentSessionResponseConfig" +ChoiceValueParam: TypeAlias = Union[str, bool] +ChoiceValueResource: TypeAlias = Union[str, bool] GenerateAgentRequest: TypeAlias = "_models.GenerateVoiceAgentRequest" diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_version.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_version.py index 01239942fb5c..8dbc8389f5a3 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_version.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "2.9.0" +VERSION = "2.10.0" diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_operations.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_operations.py index a4c93a7c971c..56548426f018 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_operations.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_operations.py @@ -161,6 +161,15 @@ build_beta_voice_agents_conversations_list_request, build_beta_voice_agents_conversations_list_response_items_request, build_beta_voice_agents_conversations_list_responses_request, + build_beta_voice_agents_live_conversations_delete_request, + build_beta_voice_agents_live_conversations_download_audio_item_request, + build_beta_voice_agents_live_conversations_download_audio_request, + build_beta_voice_agents_live_conversations_get_audio_item_request, + build_beta_voice_agents_live_conversations_get_audio_request, + build_beta_voice_agents_live_conversations_get_item_request, + build_beta_voice_agents_live_conversations_get_request, + build_beta_voice_agents_live_conversations_list_items_request, + build_beta_voice_agents_live_conversations_list_request, build_beta_voice_agents_telephony_cancel_call_job_request, build_beta_voice_agents_telephony_create_binding_request, build_beta_voice_agents_telephony_create_call_job_request, @@ -8984,6 +8993,9 @@ def __init__(self, *args, **kwargs) -> None: self.conversations = BetaVoiceAgentsConversationsOperations( self._client, self._config, self._serialize, self._deserialize ) + self.live_conversations = BetaVoiceAgentsLiveConversationsOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.telephony = BetaVoiceAgentsTelephonyOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -18424,6 +18436,730 @@ async def download_audio(self, agent_name: str, conversation_id: str, **kwargs: return deserialized # type: ignore +class BetaVoiceAgentsLiveConversationsOperations: # pylint: disable=docstring-missing-param,name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.ai.projects.aio.AIProjectClient`'s + :attr:`live_conversations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AIProjectClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list( + self, + agent_name: str, + *, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + before: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.VoiceAgentLiveConversation"]: + """List Live voice agent conversations. + + Lists stored Live conversations for this agent, including sessions stored via an override. + + :param agent_name: The name of the Live voice agent. Required. + :type agent_name: str + :keyword limit: A limit on the number of objects to be returned. Limit can range between 1 and + 100, and the + default is 20. Default value is None. + :paramtype limit: int + :keyword order: Sort order by the ``created_at`` timestamp of the objects. ``asc`` for + ascending order and``desc`` + for descending order. Known values are: "asc" and "desc". Default value is None. + :paramtype order: str or ~azure.ai.projects.models.PageOrder + :keyword before: A cursor for use in pagination. ``before`` is an object ID that defines your + place in the list. + For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + subsequent call can include before=obj_foo in order to fetch the previous page of the list. + Default value is None. + :paramtype before: str + :return: An iterator like instance of VoiceAgentLiveConversation + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.VoiceAgentLiveConversation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.VoiceAgentLiveConversation]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(_continuation_token=None): + + _request = build_beta_voice_agents_live_conversations_list_request( + agent_name=agent_name, + limit=limit, + order=order, + after=_continuation_token, + before=before, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.VoiceAgentLiveConversation], + deserialized.get("data", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("last_id") or None, AsyncList(list_of_elem) + + async def get_next(_continuation_token=None): + _request = prepare_request(_continuation_token) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get(self, agent_name: str, conversation_id: str, **kwargs: Any) -> _models.VoiceAgentLiveConversation: + """Get a Live voice agent conversation. + + Gets a stored Live conversation; fetch items separately. Returns 404 if absent or not stored. + + :param agent_name: The name of the Live voice agent. Required. + :type agent_name: str + :param conversation_id: The Foundry conversation ID returned in + session.started.conversation_id. Required. + :type conversation_id: str + :return: VoiceAgentLiveConversation. The VoiceAgentLiveConversation is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.VoiceAgentLiveConversation + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.VoiceAgentLiveConversation] = kwargs.pop("cls", None) + + _request = build_beta_voice_agents_live_conversations_get_request( + agent_name=agent_name, + conversation_id=conversation_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.VoiceAgentLiveConversation, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete(self, agent_name: str, conversation_id: str, **kwargs: Any) -> None: + """Delete a Live voice agent conversation. + + Deletes the stored conversation and its items/audio, without closing the Live session. + + :param agent_name: The name of the Live voice agent. Required. + :type agent_name: str + :param conversation_id: The Foundry conversation ID returned in + session.started.conversation_id. Required. + :type conversation_id: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_beta_voice_agents_live_conversations_delete_request( + agent_name=agent_name, + conversation_id=conversation_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_items( + self, + agent_name: str, + conversation_id: str, + *, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + before: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.VoiceAgentLiveConversationItem"]: + """List items in a Live voice agent conversation. + + Lists stored speech and delegation items in order; cursors use item IDs. Returns 404 if the + conversation is absent or unstored. + + :param agent_name: The name of the Live voice agent. Required. + :type agent_name: str + :param conversation_id: The Foundry conversation ID returned in + session.started.conversation_id. Required. + :type conversation_id: str + :keyword limit: A limit on the number of objects to be returned. Limit can range between 1 and + 100, and the + default is 20. Default value is None. + :paramtype limit: int + :keyword order: Sort order by the ``created_at`` timestamp of the objects. ``asc`` for + ascending order and``desc`` + for descending order. Known values are: "asc" and "desc". Default value is None. + :paramtype order: str or ~azure.ai.projects.models.PageOrder + :keyword before: A cursor for use in pagination. ``before`` is an object ID that defines your + place in the list. + For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + subsequent call can include before=obj_foo in order to fetch the previous page of the list. + Default value is None. + :paramtype before: str + :return: An iterator like instance of VoiceAgentLiveConversationItem + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.VoiceAgentLiveConversationItem] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.VoiceAgentLiveConversationItem]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(_continuation_token=None): + + _request = build_beta_voice_agents_live_conversations_list_items_request( + agent_name=agent_name, + conversation_id=conversation_id, + limit=limit, + order=order, + after=_continuation_token, + before=before, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.VoiceAgentLiveConversationItem], + deserialized.get("data", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("last_id") or None, AsyncList(list_of_elem) + + async def get_next(_continuation_token=None): + _request = prepare_request(_continuation_token) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get_item( + self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any + ) -> _models.VoiceAgentLiveConversationItem: + """Get a Live voice agent conversation item. + + Gets a stored item by ID. Returns 404 if the item or conversation is absent. + + :param agent_name: The name of the Live voice agent. Required. + :type agent_name: str + :param conversation_id: The Foundry conversation ID returned in + session.started.conversation_id. Required. + :type conversation_id: str + :param item_id: The id returned on the persisted item. Required. + :type item_id: str + :return: VoiceAgentLiveConversationItem. The VoiceAgentLiveConversationItem is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.VoiceAgentLiveConversationItem + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.VoiceAgentLiveConversationItem] = kwargs.pop("cls", None) + + _request = build_beta_voice_agents_live_conversations_get_item_request( + agent_name=agent_name, + conversation_id=conversation_id, + item_id=item_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.VoiceAgentLiveConversationItem, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_audio_item( + self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any + ) -> _models.VoiceAudioItem: + """Get a Live conversation item's audio metadata. + + Gets captured speech-audio metadata. BYOS uses unsigned blob_uri. Returns 404 for missing + audio, unstored conversations, or delegation items. + + :param agent_name: The name of the Live voice agent. Required. + :type agent_name: str + :param conversation_id: The Foundry conversation ID returned in + session.started.conversation_id. Required. + :type conversation_id: str + :param item_id: The id returned on the persisted item. Required. + :type item_id: str + :return: VoiceAudioItem. The VoiceAudioItem is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.VoiceAudioItem + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.VoiceAudioItem] = kwargs.pop("cls", None) + + _request = build_beta_voice_agents_live_conversations_get_audio_item_request( + agent_name=agent_name, + conversation_id=conversation_id, + item_id=item_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.VoiceAudioItem, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def download_audio_item( + self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + """Stream a Live conversation item's audio. + + Streams captured speech as WAV. BYOS returns 409; use blob_uri. Returns 404 for missing audio, + unstored conversations, or delegation items. + + :param agent_name: The name of the Live voice agent. Required. + :type agent_name: str + :param conversation_id: The Foundry conversation ID returned in + session.started.conversation_id. Required. + :type conversation_id: str + :param item_id: The id returned on the persisted item. Required. + :type item_id: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_beta_voice_agents_live_conversations_download_audio_item_request( + agent_name=agent_name, + conversation_id=conversation_id, + item_id=item_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) + + response_headers = {} + response_headers["Content-Type"] = self._deserialize("str", response.headers.get("Content-Type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_audio(self, agent_name: str, conversation_id: str, **kwargs: Any) -> _models.VoiceRecording: + """Get a Live conversation's merged recording metadata. + + Gets merged stereo recording metadata (user left, assistant right). BYOS uses unsigned + blob_uri. Returns 404 for no audio, or 409 recording_not_ready/recording_unavailable for + pending/failed finalization; pending responses may include Retry-After. + + :param agent_name: The name of the Live voice agent. Required. + :type agent_name: str + :param conversation_id: The Foundry conversation ID returned in + session.started.conversation_id. Required. + :type conversation_id: str + :return: VoiceRecording. The VoiceRecording is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.VoiceRecording + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.VoiceRecording] = kwargs.pop("cls", None) + + _request = build_beta_voice_agents_live_conversations_get_audio_request( + agent_name=agent_name, + conversation_id=conversation_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.VoiceRecording, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def download_audio(self, agent_name: str, conversation_id: str, **kwargs: Any) -> AsyncIterator[bytes]: + """Stream a Live conversation's merged recording. + + Streams the merged stereo WAV. BYOS returns 409; use blob_uri. Returns 404 for no audio, or 409 + recording_not_ready/recording_unavailable for pending/failed finalization. + + :param agent_name: The name of the Live voice agent. Required. + :type agent_name: str + :param conversation_id: The Foundry conversation ID returned in + session.started.conversation_id. Required. + :type conversation_id: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_beta_voice_agents_live_conversations_download_audio_request( + agent_name=agent_name, + conversation_id=conversation_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) + + response_headers = {} + response_headers["Content-Type"] = self._deserialize("str", response.headers.get("Content-Type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + class BetaVoiceAgentsTelephonyOperations: # pylint: disable=docstring-missing-param """ .. warning:: diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/models/__init__.py b/sdk/ai/azure-ai-projects/azure/ai/projects/models/__init__.py index 2442af4e0e21..54d26565fd6b 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/models/__init__.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/models/__init__.py @@ -103,10 +103,14 @@ AgentTaxonomyInput, AgentVersionDetails, AgenticIdentityPreviewCredentials, + AnswerResource, + AnswerResourceChoice, + AnswerResourcePredicate, + AnswerResourceRefusal, + AnswerResourceScore, ApiError, ApiErrorResponse, ApiKeyCredentials, - ApplyPatchToolParam, ApproximateLocation, ArtifactProfile, AutoCodeInterpreterToolParam, @@ -144,16 +148,15 @@ ChartCoordinate, ChatCompletionTool, ChatSummaryMemoryItem, + ChoiceOptionParam, + ChoiceProbabilityResource, ClusterInsightResult, ClusterTokenUsage, CodeBasedEvaluatorDefinition, CodeConfiguration, - CodeInterpreterTool, CodeInterpreterToolboxTool, ComparisonFilter, CompoundFilter, - ComputerTool, - ComputerUsePreviewTool, Connection, ContainerAutoParam, ContainerConfiguration, @@ -192,6 +195,8 @@ DatasetEvaluatorGenerationJobSource, DatasetReference, DatasetVersion, + DecisionResponse, + Delegation, DeleteAgentResponse, DeleteAgentVersionResponse, DeleteMemoryResult, @@ -245,18 +250,15 @@ FileDataGenerationJobOutput, FileDataGenerationJobSource, FileDatasetVersion, - FileSearchTool, FileSearchToolboxTool, FixedRatioVersionSelectionRule, FolderDatasetVersion, FoundryModelWarning, FunctionObject, FunctionParameters, - FunctionShellToolParam, FunctionShellToolParamEnvironment, FunctionShellToolParamEnvironmentContainerReferenceParam, FunctionShellToolParamEnvironmentLocalEnvironmentParam, - FunctionTool, FunctionToolParam, GenerateVoiceAgentRequest, GitHubCopilotHarness, @@ -269,11 +271,11 @@ HourlyRecurrenceSchedule, HumanEvaluationPreviewRuleAction, HybridSearchOptions, - ImageGenTool, ImageGenToolInputImageMask, Index, InlineSkillParam, InlineSkillSourceParam, + InputTokensDetailsResource, Insight, InsightCluster, InsightModelConfiguration, @@ -289,7 +291,126 @@ InvokeAgentInvocationsApiRoutineAction, InvokeAgentResponsesApiDispatchPayload, InvokeAgentResponsesApiRoutineAction, - LocalShellToolParam, + LiveAllowedServerEventParam, + LiveAllowedToolsChoiceParam, + LiveApplyPatchToolInputParam, + LiveAudioFormat, + LiveClientConfigParam, + LiveClientDelegationParam, + LiveClientEvent, + LiveClientEventLiveCommentaryAppendParam, + LiveClientEventLiveDecisionCreateParam, + LiveClientEventLiveDecisionItemCreateParam, + LiveClientEventLiveDecisionItemDeleteParam, + LiveClientEventLiveInputAudioAppendEvent, + LiveClientEventLiveInputAudioMuteParam, + LiveClientEventLiveInputAudioUnmuteParam, + LiveClientEventLiveInstructionsAppendParam, + LiveClientEventLiveOutputAudioFixturePlayParam, + LiveClientEventLiveResponseCreateParam, + LiveClientEventLiveResponseItemCreateParam, + LiveClientEventLiveSessionCloseParam, + LiveClientEventLiveSessionUpdateParam, + LiveClientEventLiveThinkingAppendParam, + LiveCodeInterpreterToolInputParam, + LiveComputerToolInputParam, + LiveContainerNetworkPolicyDisabledParam, + LiveContainerReferenceParam, + LiveContextWindowUsage, + LiveCustomToolInputParam, + LiveCustomVoiceParam, + LiveDataChannelConfigParam, + LiveDecisionCompleted, + LiveDecisionInputImageParam, + LiveDecisionInputItemParam, + LiveDecisionInputTextParam, + LiveDecisionQuestionsInputParam_2, + LiveDecisionStoredInputItemParam, + LiveDecisionTriggerInputParam_2, + LiveDecisionsDelegationParam_2, + LiveDecisionsDelegationUpdateParam, + LiveDecisionsSettingsInputParam_2, + LiveDecisionsSettingsUpdateParam, + LiveDelegationReasoningInputParam, + LiveDelegationTextInputParam, + LiveFileSearchToolInputParam, + LiveFunctionToolChoiceParam, + LiveFunctionToolInputParam, + LiveHostedShellContainerAutoParam, + LiveHostedShellNetworkPolicyAllowlistParam, + LiveHostedShellToolInputParam, + LiveImageGenerationToolInputParam, + LiveInitialAssistantMessageItemParam, + LiveInitialDeveloperMessageItemParam, + LiveInitialInputTextContentPartParam, + LiveInitialItem, + LiveInitialOutputTextContentPartParam, + LiveInitialSessionAudioOutputParam, + LiveInitialSessionAudioParam, + LiveInitialTextContentPartParam, + LiveInitialUserMessageItemParam, + LiveInlineSkillParam, + LiveInlineSkillSourceParam, + LiveInputAudioAppend, + LiveLiveError, + LiveLocalEnvironmentParam, + LiveLocalSkillParam, + LiveMCPToolChoiceParam, + LiveMCPToolInputParam, + LiveNamespaceToolInputParam, + LiveOutputAudioDelta, + LiveProgrammaticToolInputParam, + LiveResponsesDelegationParam, + LiveResponsesDelegationSettingsInputParam, + LiveResponsesDelegationSettingsUpdateInputParam, + LiveResponsesDelegationUpdateParam, + LiveServerEvent, + LiveServerEventLiveCommentaryAppended, + LiveServerEventLiveDecisionEvent, + LiveServerEventLiveDecisionItemCreated, + LiveServerEventLiveDecisionItemDeleted, + LiveServerEventLiveDelegationCreated, + LiveServerEventLiveErrorEvent, + LiveServerEventLiveInfoEvent, + LiveServerEventLiveInputAudioMuted, + LiveServerEventLiveInputAudioUnmuted, + LiveServerEventLiveInputTranscriptDelta, + LiveServerEventLiveInstructionsAppended, + LiveServerEventLiveOutputAudioFixturePlayed, + LiveServerEventLiveOutputAudioFixturePlaying, + LiveServerEventLiveOutputTranscriptDelta, + LiveServerEventLiveResponseEvent, + LiveServerEventLiveSessionClosed, + LiveServerEventLiveSessionStarted, + LiveServerEventLiveSessionUpdated, + LiveServerEventLiveSessionUsageUpdated, + LiveServerEventLiveThinkingAppended, + LiveServerEventLiveTransportAnswered, + LiveServerEventLiveTransportFailed, + LiveServerEventLiveTransportRinging, + LiveSessionAudioFormatPCMAParam, + LiveSessionAudioFormatPCMParam, + LiveSessionAudioFormatPCMUParam, + LiveSessionCreateParams, + LiveSessionStartEvent, + LiveSessionUpdateParams, + LiveSessionUsage, + LiveSkillReferenceParam, + LiveSpecificApplyPatchParam, + LiveSpecificCodeInterpreterParam, + LiveSpecificComputerParam, + LiveSpecificCustomToolParam, + LiveSpecificFileSearchParam, + LiveSpecificFunctionShellParam, + LiveSpecificImageGenParam, + LiveSpecificProgrammaticToolCallingParam, + LiveSpecificWebSearchParam, + LiveSpecificWebSearchPreviewParam, + LiveToolSearchToolInputParam, + LiveTransportCallError, + LiveTransportDTMFReceived, + LiveTransportDTMFSend, + LiveWebSearchToolInputParam, LocalSkillParam, LogProbProperties, LoraConfig, @@ -352,12 +473,12 @@ OpenApiToolboxTool, OptimizationContext, OtlpTelemetryEndpoint, + OutputTokensDetailsResource, PSTNTelephonyTransferDestination, PendingUploadRequest, PendingUploadResponse, PickPropertiesVoiceAgentAudioConfig, ProceduralMemoryItem, - ProgrammaticToolCallingParam, PromptAgentDefinition, PromptAgentDefinitionTextOptions, PromptBasedEvaluatorDefinition, @@ -366,6 +487,10 @@ PromptOptimizationConfiguration, ProtocolConfiguration, ProtocolVersionRecord, + QuestionParam, + QuestionParamChoice, + QuestionParamPredicate, + QuestionParamScore, RaiConfig, RaiInvocationModeration, RaiSseTextSelector, @@ -471,6 +596,7 @@ ReminderPreviewToolboxTool, ResponseUsageInputTokensDetails, ResponseUsageOutputTokensDetails, + ResponseUsageResource, ResponsesProtocolConfiguration, Routine, RoutineAction, @@ -485,6 +611,8 @@ ScheduleRoutineTrigger, ScheduleRun, ScheduleTask, + ScoreLevelParam, + ScoreProbabilityResource, SessionConfiguration, SessionDirectoryEntry, SessionFileWriteResult, @@ -539,6 +667,7 @@ TextResponseFormatText, TimerRoutineTrigger, Tool, + ToolApplyPatchToolParam, ToolChoiceAllowed, ToolChoiceCodeInterpreter, ToolChoiceComputer, @@ -552,12 +681,25 @@ ToolChoiceParam, ToolChoiceWebSearchPreview, ToolChoiceWebSearchPreview20250311, + ToolCodeInterpreterTool, + ToolComputerTool, + ToolComputerUsePreviewTool, ToolConfig, + ToolCustomToolParam, ToolDescription, + ToolFileSearchTool, + ToolFunctionShellToolParam, + ToolFunctionTool, + ToolImageGenTool, + ToolLocalShellToolParam, + ToolMcpTool, + ToolProgrammaticToolCallingParam, ToolProjectConnection, - ToolSearchToolParam, ToolSearchToolboxTool, + ToolToolSearchToolParam, ToolUseFineTuningDataGenerationJobConfiguration, + ToolWebSearchPreviewTool, + ToolWebSearchTool, ToolboxObject, ToolboxPolicies, ToolboxSearchPreviewToolboxTool, @@ -609,6 +751,7 @@ VoiceAgentAzureSemanticVadEnTurnDetection, VoiceAgentAzureSemanticVadMultilingualTurnDetection, VoiceAgentAzureSemanticVadTurnDetection, + VoiceAgentBaseDefinition, VoiceAgentClientEventRtcCallSdpCreate, VoiceAgentClientEventSessionAvatarConnect, VoiceAgentClientEventSessionUpdate, @@ -620,6 +763,20 @@ VoiceAgentGreetingConfig, VoiceAgentInputTranscription, VoiceAgentInterimResponseConfig, + VoiceAgentLiveClientDelegationConversationItem, + VoiceAgentLiveConversation, + VoiceAgentLiveConversationItem, + VoiceAgentLiveDefinition, + VoiceAgentLiveDelegationConversationItem, + VoiceAgentLiveDelegationItem, + VoiceAgentLiveDelegationResultItem1, + VoiceAgentLiveDelegationResultItem2, + VoiceAgentLiveFoundryManagedAgentDelegationItem, + VoiceAgentLiveInputConversationItem, + VoiceAgentLiveManagedAgentDelegation, + VoiceAgentLiveOutputConversationItem, + VoiceAgentLiveResponsesDelegationConversationItem, + VoiceAgentLiveSessionResource, VoiceAgentLlmGeneratedGreetingConfig, VoiceAgentLlmInterimResponseConfig, VoiceAgentMcpTool, @@ -649,6 +806,10 @@ VoiceAgentSessionAvatarConfig, VoiceAgentSessionResponseConfig, VoiceAgentSessionUpdateConfig, + VoiceAgentSoundscapeConfig, + VoiceAgentSoundscapeSourceConfig, + VoiceAgentSoundscapeTrackConfig, + VoiceAgentSoundscapeWorkingTrackConfig, VoiceAgentStaticInterimResponseConfig, VoiceAgentSubagent, VoiceAgentSubagentConfig, @@ -674,8 +835,6 @@ WebIQPreviewToolboxTool, WebSearchApproximateLocation, WebSearchConfiguration, - WebSearchPreviewTool, - WebSearchTool, WebSearchToolFilters, WebSearchToolboxTool, WeeklyRecurrenceSchedule, @@ -712,6 +871,7 @@ AgentState, AgentStateSource, AgentVersionStatus, + AnswerResourceType, AttackStrategy, AzureAISearchQueryType, CallableToolAllowedCaller, @@ -731,6 +891,7 @@ DataGenerationJobType, DatasetType, DayOfWeek, + DelegationType, DeploymentType, DigitalWorkerType, EvaluationLevel, @@ -758,6 +919,19 @@ InputFidelity, InsightType, JobStatus, + LiveAudioFormatType, + LiveClientEventType, + LiveContainerMemoryLimit, + LiveDetailEnum, + LiveInitialItemType, + LiveInitialMessageStatus, + LiveReasoningEffort, + LiveReasoningSummary, + LiveResponsesServiceTier, + LiveServerEventType, + LiveTextVerbosity, + LiveToolChoiceEnum, + LiveToolChoiceValueEnum, MemoryItemKind, MemoryOperationKind, MemoryStoreKind, @@ -766,12 +940,14 @@ Microsoft365PublishScope, MicrosoftCopilotBuiltInTool, MisalignmentErrorType, + ModelIdsLive, OpenApiAuthType, OperationState, OptimizationContextType, PageOrder, PendingUploadType, PublishApprovalStatus, + QuestionParamType, RaiInvocationContentType, RaiInvocationMode, RankerVersionType, @@ -845,8 +1021,14 @@ VoiceAgentEndOfUtteranceThresholdLevel, VoiceAgentInputTranscriptionModel, VoiceAgentInterimResponseTrigger, + VoiceAgentLiveConversationItemType, + VoiceAgentLiveDelegationStatus, + VoiceAgentLiveDelegationTarget, VoiceAgentNoiseReductionType, + VoiceAgentProfanityFilterMode, VoiceAgentSessionIncludeOption, + VoiceAgentSoundscapeSound, + VoiceAgentSubProtocol, VoiceAgentSubagentAbortReason, VoiceAgentSystemToolName, VoiceAgentToolResponseScheduling, @@ -953,10 +1135,14 @@ "AgentTaxonomyInput", "AgentVersionDetails", "AgenticIdentityPreviewCredentials", + "AnswerResource", + "AnswerResourceChoice", + "AnswerResourcePredicate", + "AnswerResourceRefusal", + "AnswerResourceScore", "ApiError", "ApiErrorResponse", "ApiKeyCredentials", - "ApplyPatchToolParam", "ApproximateLocation", "ArtifactProfile", "AutoCodeInterpreterToolParam", @@ -994,16 +1180,15 @@ "ChartCoordinate", "ChatCompletionTool", "ChatSummaryMemoryItem", + "ChoiceOptionParam", + "ChoiceProbabilityResource", "ClusterInsightResult", "ClusterTokenUsage", "CodeBasedEvaluatorDefinition", "CodeConfiguration", - "CodeInterpreterTool", "CodeInterpreterToolboxTool", "ComparisonFilter", "CompoundFilter", - "ComputerTool", - "ComputerUsePreviewTool", "Connection", "ContainerAutoParam", "ContainerConfiguration", @@ -1042,6 +1227,8 @@ "DatasetEvaluatorGenerationJobSource", "DatasetReference", "DatasetVersion", + "DecisionResponse", + "Delegation", "DeleteAgentResponse", "DeleteAgentVersionResponse", "DeleteMemoryResult", @@ -1095,18 +1282,15 @@ "FileDataGenerationJobOutput", "FileDataGenerationJobSource", "FileDatasetVersion", - "FileSearchTool", "FileSearchToolboxTool", "FixedRatioVersionSelectionRule", "FolderDatasetVersion", "FoundryModelWarning", "FunctionObject", "FunctionParameters", - "FunctionShellToolParam", "FunctionShellToolParamEnvironment", "FunctionShellToolParamEnvironmentContainerReferenceParam", "FunctionShellToolParamEnvironmentLocalEnvironmentParam", - "FunctionTool", "FunctionToolParam", "GenerateVoiceAgentRequest", "GitHubCopilotHarness", @@ -1119,11 +1303,11 @@ "HourlyRecurrenceSchedule", "HumanEvaluationPreviewRuleAction", "HybridSearchOptions", - "ImageGenTool", "ImageGenToolInputImageMask", "Index", "InlineSkillParam", "InlineSkillSourceParam", + "InputTokensDetailsResource", "Insight", "InsightCluster", "InsightModelConfiguration", @@ -1139,7 +1323,126 @@ "InvokeAgentInvocationsApiRoutineAction", "InvokeAgentResponsesApiDispatchPayload", "InvokeAgentResponsesApiRoutineAction", - "LocalShellToolParam", + "LiveAllowedServerEventParam", + "LiveAllowedToolsChoiceParam", + "LiveApplyPatchToolInputParam", + "LiveAudioFormat", + "LiveClientConfigParam", + "LiveClientDelegationParam", + "LiveClientEvent", + "LiveClientEventLiveCommentaryAppendParam", + "LiveClientEventLiveDecisionCreateParam", + "LiveClientEventLiveDecisionItemCreateParam", + "LiveClientEventLiveDecisionItemDeleteParam", + "LiveClientEventLiveInputAudioAppendEvent", + "LiveClientEventLiveInputAudioMuteParam", + "LiveClientEventLiveInputAudioUnmuteParam", + "LiveClientEventLiveInstructionsAppendParam", + "LiveClientEventLiveOutputAudioFixturePlayParam", + "LiveClientEventLiveResponseCreateParam", + "LiveClientEventLiveResponseItemCreateParam", + "LiveClientEventLiveSessionCloseParam", + "LiveClientEventLiveSessionUpdateParam", + "LiveClientEventLiveThinkingAppendParam", + "LiveCodeInterpreterToolInputParam", + "LiveComputerToolInputParam", + "LiveContainerNetworkPolicyDisabledParam", + "LiveContainerReferenceParam", + "LiveContextWindowUsage", + "LiveCustomToolInputParam", + "LiveCustomVoiceParam", + "LiveDataChannelConfigParam", + "LiveDecisionCompleted", + "LiveDecisionInputImageParam", + "LiveDecisionInputItemParam", + "LiveDecisionInputTextParam", + "LiveDecisionQuestionsInputParam_2", + "LiveDecisionStoredInputItemParam", + "LiveDecisionTriggerInputParam_2", + "LiveDecisionsDelegationParam_2", + "LiveDecisionsDelegationUpdateParam", + "LiveDecisionsSettingsInputParam_2", + "LiveDecisionsSettingsUpdateParam", + "LiveDelegationReasoningInputParam", + "LiveDelegationTextInputParam", + "LiveFileSearchToolInputParam", + "LiveFunctionToolChoiceParam", + "LiveFunctionToolInputParam", + "LiveHostedShellContainerAutoParam", + "LiveHostedShellNetworkPolicyAllowlistParam", + "LiveHostedShellToolInputParam", + "LiveImageGenerationToolInputParam", + "LiveInitialAssistantMessageItemParam", + "LiveInitialDeveloperMessageItemParam", + "LiveInitialInputTextContentPartParam", + "LiveInitialItem", + "LiveInitialOutputTextContentPartParam", + "LiveInitialSessionAudioOutputParam", + "LiveInitialSessionAudioParam", + "LiveInitialTextContentPartParam", + "LiveInitialUserMessageItemParam", + "LiveInlineSkillParam", + "LiveInlineSkillSourceParam", + "LiveInputAudioAppend", + "LiveLiveError", + "LiveLocalEnvironmentParam", + "LiveLocalSkillParam", + "LiveMCPToolChoiceParam", + "LiveMCPToolInputParam", + "LiveNamespaceToolInputParam", + "LiveOutputAudioDelta", + "LiveProgrammaticToolInputParam", + "LiveResponsesDelegationParam", + "LiveResponsesDelegationSettingsInputParam", + "LiveResponsesDelegationSettingsUpdateInputParam", + "LiveResponsesDelegationUpdateParam", + "LiveServerEvent", + "LiveServerEventLiveCommentaryAppended", + "LiveServerEventLiveDecisionEvent", + "LiveServerEventLiveDecisionItemCreated", + "LiveServerEventLiveDecisionItemDeleted", + "LiveServerEventLiveDelegationCreated", + "LiveServerEventLiveErrorEvent", + "LiveServerEventLiveInfoEvent", + "LiveServerEventLiveInputAudioMuted", + "LiveServerEventLiveInputAudioUnmuted", + "LiveServerEventLiveInputTranscriptDelta", + "LiveServerEventLiveInstructionsAppended", + "LiveServerEventLiveOutputAudioFixturePlayed", + "LiveServerEventLiveOutputAudioFixturePlaying", + "LiveServerEventLiveOutputTranscriptDelta", + "LiveServerEventLiveResponseEvent", + "LiveServerEventLiveSessionClosed", + "LiveServerEventLiveSessionStarted", + "LiveServerEventLiveSessionUpdated", + "LiveServerEventLiveSessionUsageUpdated", + "LiveServerEventLiveThinkingAppended", + "LiveServerEventLiveTransportAnswered", + "LiveServerEventLiveTransportFailed", + "LiveServerEventLiveTransportRinging", + "LiveSessionAudioFormatPCMAParam", + "LiveSessionAudioFormatPCMParam", + "LiveSessionAudioFormatPCMUParam", + "LiveSessionCreateParams", + "LiveSessionStartEvent", + "LiveSessionUpdateParams", + "LiveSessionUsage", + "LiveSkillReferenceParam", + "LiveSpecificApplyPatchParam", + "LiveSpecificCodeInterpreterParam", + "LiveSpecificComputerParam", + "LiveSpecificCustomToolParam", + "LiveSpecificFileSearchParam", + "LiveSpecificFunctionShellParam", + "LiveSpecificImageGenParam", + "LiveSpecificProgrammaticToolCallingParam", + "LiveSpecificWebSearchParam", + "LiveSpecificWebSearchPreviewParam", + "LiveToolSearchToolInputParam", + "LiveTransportCallError", + "LiveTransportDTMFReceived", + "LiveTransportDTMFSend", + "LiveWebSearchToolInputParam", "LocalSkillParam", "LogProbProperties", "LoraConfig", @@ -1202,12 +1505,12 @@ "OpenApiToolboxTool", "OptimizationContext", "OtlpTelemetryEndpoint", + "OutputTokensDetailsResource", "PSTNTelephonyTransferDestination", "PendingUploadRequest", "PendingUploadResponse", "PickPropertiesVoiceAgentAudioConfig", "ProceduralMemoryItem", - "ProgrammaticToolCallingParam", "PromptAgentDefinition", "PromptAgentDefinitionTextOptions", "PromptBasedEvaluatorDefinition", @@ -1216,6 +1519,10 @@ "PromptOptimizationConfiguration", "ProtocolConfiguration", "ProtocolVersionRecord", + "QuestionParam", + "QuestionParamChoice", + "QuestionParamPredicate", + "QuestionParamScore", "RaiConfig", "RaiInvocationModeration", "RaiSseTextSelector", @@ -1321,6 +1628,7 @@ "ReminderPreviewToolboxTool", "ResponseUsageInputTokensDetails", "ResponseUsageOutputTokensDetails", + "ResponseUsageResource", "ResponsesProtocolConfiguration", "Routine", "RoutineAction", @@ -1335,6 +1643,8 @@ "ScheduleRoutineTrigger", "ScheduleRun", "ScheduleTask", + "ScoreLevelParam", + "ScoreProbabilityResource", "SessionConfiguration", "SessionDirectoryEntry", "SessionFileWriteResult", @@ -1389,6 +1699,7 @@ "TextResponseFormatText", "TimerRoutineTrigger", "Tool", + "ToolApplyPatchToolParam", "ToolChoiceAllowed", "ToolChoiceCodeInterpreter", "ToolChoiceComputer", @@ -1402,12 +1713,25 @@ "ToolChoiceParam", "ToolChoiceWebSearchPreview", "ToolChoiceWebSearchPreview20250311", + "ToolCodeInterpreterTool", + "ToolComputerTool", + "ToolComputerUsePreviewTool", "ToolConfig", + "ToolCustomToolParam", "ToolDescription", + "ToolFileSearchTool", + "ToolFunctionShellToolParam", + "ToolFunctionTool", + "ToolImageGenTool", + "ToolLocalShellToolParam", + "ToolMcpTool", + "ToolProgrammaticToolCallingParam", "ToolProjectConnection", - "ToolSearchToolParam", "ToolSearchToolboxTool", + "ToolToolSearchToolParam", "ToolUseFineTuningDataGenerationJobConfiguration", + "ToolWebSearchPreviewTool", + "ToolWebSearchTool", "ToolboxObject", "ToolboxPolicies", "ToolboxSearchPreviewToolboxTool", @@ -1459,6 +1783,7 @@ "VoiceAgentAzureSemanticVadEnTurnDetection", "VoiceAgentAzureSemanticVadMultilingualTurnDetection", "VoiceAgentAzureSemanticVadTurnDetection", + "VoiceAgentBaseDefinition", "VoiceAgentClientEventRtcCallSdpCreate", "VoiceAgentClientEventSessionAvatarConnect", "VoiceAgentClientEventSessionUpdate", @@ -1470,6 +1795,20 @@ "VoiceAgentGreetingConfig", "VoiceAgentInputTranscription", "VoiceAgentInterimResponseConfig", + "VoiceAgentLiveClientDelegationConversationItem", + "VoiceAgentLiveConversation", + "VoiceAgentLiveConversationItem", + "VoiceAgentLiveDefinition", + "VoiceAgentLiveDelegationConversationItem", + "VoiceAgentLiveDelegationItem", + "VoiceAgentLiveDelegationResultItem1", + "VoiceAgentLiveDelegationResultItem2", + "VoiceAgentLiveFoundryManagedAgentDelegationItem", + "VoiceAgentLiveInputConversationItem", + "VoiceAgentLiveManagedAgentDelegation", + "VoiceAgentLiveOutputConversationItem", + "VoiceAgentLiveResponsesDelegationConversationItem", + "VoiceAgentLiveSessionResource", "VoiceAgentLlmGeneratedGreetingConfig", "VoiceAgentLlmInterimResponseConfig", "VoiceAgentMcpTool", @@ -1499,6 +1838,10 @@ "VoiceAgentSessionAvatarConfig", "VoiceAgentSessionResponseConfig", "VoiceAgentSessionUpdateConfig", + "VoiceAgentSoundscapeConfig", + "VoiceAgentSoundscapeSourceConfig", + "VoiceAgentSoundscapeTrackConfig", + "VoiceAgentSoundscapeWorkingTrackConfig", "VoiceAgentStaticInterimResponseConfig", "VoiceAgentSubagent", "VoiceAgentSubagentConfig", @@ -1524,8 +1867,6 @@ "WebIQPreviewToolboxTool", "WebSearchApproximateLocation", "WebSearchConfiguration", - "WebSearchPreviewTool", - "WebSearchTool", "WebSearchToolFilters", "WebSearchToolboxTool", "WeeklyRecurrenceSchedule", @@ -1559,6 +1900,7 @@ "AgentState", "AgentStateSource", "AgentVersionStatus", + "AnswerResourceType", "AttackStrategy", "AzureAISearchQueryType", "CallableToolAllowedCaller", @@ -1578,6 +1920,7 @@ "DataGenerationJobType", "DatasetType", "DayOfWeek", + "DelegationType", "DeploymentType", "DigitalWorkerType", "EvaluationLevel", @@ -1605,6 +1948,19 @@ "InputFidelity", "InsightType", "JobStatus", + "LiveAudioFormatType", + "LiveClientEventType", + "LiveContainerMemoryLimit", + "LiveDetailEnum", + "LiveInitialItemType", + "LiveInitialMessageStatus", + "LiveReasoningEffort", + "LiveReasoningSummary", + "LiveResponsesServiceTier", + "LiveServerEventType", + "LiveTextVerbosity", + "LiveToolChoiceEnum", + "LiveToolChoiceValueEnum", "MemoryItemKind", "MemoryOperationKind", "MemoryStoreKind", @@ -1613,12 +1969,14 @@ "Microsoft365PublishScope", "MicrosoftCopilotBuiltInTool", "MisalignmentErrorType", + "ModelIdsLive", "OpenApiAuthType", "OperationState", "OptimizationContextType", "PageOrder", "PendingUploadType", "PublishApprovalStatus", + "QuestionParamType", "RaiInvocationContentType", "RaiInvocationMode", "RankerVersionType", @@ -1692,8 +2050,14 @@ "VoiceAgentEndOfUtteranceThresholdLevel", "VoiceAgentInputTranscriptionModel", "VoiceAgentInterimResponseTrigger", + "VoiceAgentLiveConversationItemType", + "VoiceAgentLiveDelegationStatus", + "VoiceAgentLiveDelegationTarget", "VoiceAgentNoiseReductionType", + "VoiceAgentProfanityFilterMode", "VoiceAgentSessionIncludeOption", + "VoiceAgentSoundscapeSound", + "VoiceAgentSubProtocol", "VoiceAgentSubagentAbortReason", "VoiceAgentSystemToolName", "VoiceAgentToolResponseScheduling", diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_enums.py b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_enums.py index 2c54cd780175..85c7357aca33 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_enums.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_enums.py @@ -146,6 +146,9 @@ class AgentEndpointProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): """VOICE.""" INVOCATIONS_WS = "invocations_ws" """WebSocket-based protocol for hosted voice and real-time streaming agents.""" + VOICE_CONVERSATION_ENGINE = "voice_conversation_engine" + """Text conversation protocol for a hosted agent used by Voice Live Bridge. Declare version + ``1.0.0``; audio transport remains outside this protocol.""" class AgentIdentityStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -396,6 +399,19 @@ class AgentVersionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The agent version has been deleted.""" +class AnswerResourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of AnswerResourceType.""" + + PREDICATE = "predicate" + """PREDICATE.""" + CHOICE = "choice" + """CHOICE.""" + SCORE = "score" + """SCORE.""" + REFUSAL = "refusal" + """REFUSAL.""" + + class AttackStrategy(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Strategies for attacks.""" @@ -698,6 +714,15 @@ class DayOfWeek(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Saturday.""" +class DelegationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of DelegationType.""" + + CLIENT = "client" + """CLIENT.""" + RESPONSES = "responses" + """RESPONSES.""" + + class DeploymentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of DeploymentType.""" @@ -961,9 +986,9 @@ class IndexType(str, Enum, metaclass=CaseInsensitiveEnumMeta): class InputFidelity(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Control how much effort the model will exert to match the style and features, especially facial - features, of input images. This parameter is only supported for ``gpt-image-1`` and - ``gpt-image-1.5`` and later models, unsupported for ``gpt-image-1-mini``. Supports ``high`` and - ``low``. Defaults to ``low``. + features, of input images. Supports ``high`` and ``low`` on ``gpt-image-1`` and + ``gpt-image-1.5``; ``gpt-image-1-mini`` supports only ``low``. For ``gpt-image-2``, omit this + parameter. Defaults to ``low`` on supported models. """ HIGH = "high" @@ -998,6 +1023,235 @@ class JobStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Job was cancelled by the caller.""" +class LiveAudioFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of LiveAudioFormatType.""" + + AUDIO_PCM = "audio/pcm" + """AUDIO_PCM.""" + AUDIO_PCMU = "audio/pcmu" + """AUDIO_PCMU.""" + AUDIO_PCMA = "audio/pcma" + """AUDIO_PCMA.""" + + +class LiveClientEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of LiveClientEventType.""" + + SESSION_START = "session.start" + """SESSION_START.""" + SESSION_UPDATE = "session.update" + """SESSION_UPDATE.""" + SESSION_INPUT_AUDIO_APPEND = "session.input_audio.append" + """SESSION_INPUT_AUDIO_APPEND.""" + SESSION_INPUT_AUDIO_MUTE = "session.input_audio.mute" + """SESSION_INPUT_AUDIO_MUTE.""" + SESSION_INPUT_AUDIO_UNMUTE = "session.input_audio.unmute" + """SESSION_INPUT_AUDIO_UNMUTE.""" + SESSION_OUTPUT_AUDIO_FIXTURE_PLAY = "session.output_audio.fixture.play" + """SESSION_OUTPUT_AUDIO_FIXTURE_PLAY.""" + SESSION_INSTRUCTIONS_APPEND = "session.instructions.append" + """SESSION_INSTRUCTIONS_APPEND.""" + SESSION_THINKING_APPEND = "session.thinking.append" + """SESSION_THINKING_APPEND.""" + SESSION_COMMENTARY_APPEND = "session.commentary.append" + """SESSION_COMMENTARY_APPEND.""" + DECISION_CREATE = "decision.create" + """DECISION_CREATE.""" + DECISION_ITEM_CREATE = "decision.item.create" + """DECISION_ITEM_CREATE.""" + DECISION_ITEM_DELETE = "decision.item.delete" + """DECISION_ITEM_DELETE.""" + RESPONSE_ITEM_CREATE = "response.item.create" + """RESPONSE_ITEM_CREATE.""" + RESPONSE_CREATE = "response.create" + """RESPONSE_CREATE.""" + SESSION_CLOSE = "session.close" + """SESSION_CLOSE.""" + + +class LiveContainerMemoryLimit(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of LiveContainerMemoryLimit.""" + + ENUM_1_G = "1g" + """1_G.""" + ENUM_4_G = "4g" + """4_G.""" + ENUM_16_G = "16g" + """16_G.""" + ENUM_64_G = "64g" + """64_G.""" + + +class LiveDetailEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of LiveDetailEnum.""" + + LOW = "low" + """LOW.""" + HIGH = "high" + """HIGH.""" + AUTO = "auto" + """AUTO.""" + ORIGINAL = "original" + """ORIGINAL.""" + + +class LiveInitialItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of LiveInitialItemType.""" + + DEVELOPER = "developer" + """DEVELOPER.""" + USER = "user" + """USER.""" + ASSISTANT = "assistant" + """ASSISTANT.""" + + +class LiveInitialMessageStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of LiveInitialMessageStatus.""" + + INCOMPLETE = "incomplete" + """INCOMPLETE.""" + COMPLETED = "completed" + """COMPLETED.""" + + +class LiveReasoningEffort(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of LiveReasoningEffort.""" + + NONE = "none" + """NONE.""" + MINIMAL = "minimal" + """MINIMAL.""" + LOW = "low" + """LOW.""" + MEDIUM = "medium" + """MEDIUM.""" + HIGH = "high" + """HIGH.""" + XHIGH = "xhigh" + """XHIGH.""" + + +class LiveReasoningSummary(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of LiveReasoningSummary.""" + + CONCISE = "concise" + """CONCISE.""" + DETAILED = "detailed" + """DETAILED.""" + AUTO = "auto" + """AUTO.""" + + +class LiveResponsesServiceTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of LiveResponsesServiceTier.""" + + AUTO = "auto" + """AUTO.""" + DEFAULT = "default" + """DEFAULT.""" + FAST_TIER_TEMP_PILOT = "fast_tier_temp_pilot" + """FAST_TIER_TEMP_PILOT.""" + FLEX = "flex" + """FLEX.""" + PRIORITY = "priority" + """PRIORITY.""" + ULTRAFAST = "ultrafast" + """ULTRAFAST.""" + + +class LiveServerEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of LiveServerEventType.""" + + SESSION_STARTED = "session.started" + """SESSION_STARTED.""" + SESSION_UPDATED = "session.updated" + """SESSION_UPDATED.""" + SESSION_INPUT_AUDIO_MUTED = "session.input_audio.muted" + """SESSION_INPUT_AUDIO_MUTED.""" + SESSION_INPUT_AUDIO_UNMUTED = "session.input_audio.unmuted" + """SESSION_INPUT_AUDIO_UNMUTED.""" + SESSION_OUTPUT_AUDIO_FIXTURE_PLAYING = "session.output_audio.fixture.playing" + """SESSION_OUTPUT_AUDIO_FIXTURE_PLAYING.""" + SESSION_OUTPUT_AUDIO_FIXTURE_PLAYED = "session.output_audio.fixture.played" + """SESSION_OUTPUT_AUDIO_FIXTURE_PLAYED.""" + SESSION_INSTRUCTIONS_APPENDED = "session.instructions.appended" + """SESSION_INSTRUCTIONS_APPENDED.""" + SESSION_THINKING_APPENDED = "session.thinking.appended" + """SESSION_THINKING_APPENDED.""" + SESSION_COMMENTARY_APPENDED = "session.commentary.appended" + """SESSION_COMMENTARY_APPENDED.""" + SESSION_INPUT_AUDIO_APPEND = "session.input_audio.append" + """SESSION_INPUT_AUDIO_APPEND.""" + SESSION_OUTPUT_AUDIO_DELTA = "session.output_audio.delta" + """SESSION_OUTPUT_AUDIO_DELTA.""" + SESSION_INPUT_TRANSCRIPT_DELTA = "session.input_transcript.delta" + """SESSION_INPUT_TRANSCRIPT_DELTA.""" + SESSION_OUTPUT_TRANSCRIPT_DELTA = "session.output_transcript.delta" + """SESSION_OUTPUT_TRANSCRIPT_DELTA.""" + SESSION_DELEGATION_CREATED = "session.delegation.created" + """SESSION_DELEGATION_CREATED.""" + DECISION_EVENT = "decision.event" + """DECISION_EVENT.""" + DECISION_ITEM_CREATED = "decision.item.created" + """DECISION_ITEM_CREATED.""" + DECISION_ITEM_DELETED = "decision.item.deleted" + """DECISION_ITEM_DELETED.""" + RESPONSE_EVENT = "response.event" + """RESPONSE_EVENT.""" + SESSION_USAGE_UPDATED = "session.usage.updated" + """SESSION_USAGE_UPDATED.""" + SESSION_CLOSED = "session.closed" + """SESSION_CLOSED.""" + ERROR = "error" + """ERROR.""" + INFO = "info" + """INFO.""" + TRANSPORT_DTMF_RECEIVED = "transport.dtmf.received" + """TRANSPORT_DTMF_RECEIVED.""" + TRANSPORT_DTMF_SEND = "transport.dtmf.send" + """TRANSPORT_DTMF_SEND.""" + TRANSPORT_RINGING = "transport.ringing" + """TRANSPORT_RINGING.""" + TRANSPORT_ANSWERED = "transport.answered" + """TRANSPORT_ANSWERED.""" + TRANSPORT_FAILED = "transport.failed" + """TRANSPORT_FAILED.""" + + +class LiveTextVerbosity(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of LiveTextVerbosity.""" + + LOW = "low" + """LOW.""" + MEDIUM = "medium" + """MEDIUM.""" + HIGH = "high" + """HIGH.""" + + +class LiveToolChoiceEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of LiveToolChoiceEnum.""" + + AUTO = "auto" + """AUTO.""" + NONE = "none" + """NONE.""" + REQUIRED = "required" + """REQUIRED.""" + + +class LiveToolChoiceValueEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of LiveToolChoiceValueEnum.""" + + NONE = "none" + """NONE.""" + AUTO = "auto" + """AUTO.""" + REQUIRED = "required" + """REQUIRED.""" + + class MemoryItemKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Memory item kind.""" @@ -1094,6 +1348,15 @@ class MisalignmentErrorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """OTHER.""" +class ModelIdsLive(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The Live model. Required in the session configuration for every transport; do not pass it as a + URL query parameter. + """ + + GPT_LIVE1 = "gpt-live-1" + """GPT_LIVE1.""" + + class OpenApiAuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Authentication type for OpenApi endpoint. Allowed types are: @@ -1171,6 +1434,17 @@ class PublishApprovalStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): tenant-scoped titles are reviewed.""" +class QuestionParamType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of QuestionParamType.""" + + PREDICATE = "predicate" + """PREDICATE.""" + CHOICE = "choice" + """CHOICE.""" + SCORE = "score" + """SCORE.""" + + class RaiInvocationContentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """How an invocations request/response body is parsed to locate text for content-safety moderation. @@ -1436,7 +1710,7 @@ class ReasoningEffort(str, Enum, metaclass=CaseInsensitiveEnumMeta): ``minimal``, ``low``, ``medium``, ``high``, ``xhigh``, and ``max``. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. Not all reasoning models support every value. See the `reasoning guide - `_ for model-specific support. + `_ for model-specific support. """ NONE = "none" @@ -2466,7 +2740,10 @@ class VoiceAgentEndOfUtteranceThresholdLevel(str, Enum, metaclass=CaseInsensitiv class VoiceAgentInputTranscriptionModel(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The input-audio transcription model identifier. This is a model name, not a Foundry deployment name. Mirrors the transcription models supported by the managed voice backend, covering the - OpenAI Realtime transcription models plus the Azure and MAI models. Additional values may be + OpenAI Realtime transcription models plus the Azure and MAI models. ``azure-speech-streaming`` + is supported for cascaded text-model conversations only (not realtime speech-to-speech models), + requires a nonempty ``language`` such as ``en-US`` (comma-separated locales are supported), and + supports ``custom_speech``, ``phrase_list``, and ``profanity_filter``. Additional values may be added over time. """ @@ -2488,6 +2765,11 @@ class VoiceAgentInputTranscriptionModel(str, Enum, metaclass=CaseInsensitiveEnum """MAI transcription.""" AZURE_SPEECH = "azure-speech" """Azure AI Speech to text.""" + AZURE_SPEECH_STREAMING = "azure-speech-streaming" + """Azure AI Speech streaming transcription for cascaded text-model conversations only. Requires a + nonempty ``language``, such as ``en-US``; comma-separated locales are supported. Supports + ``custom_speech``, ``phrase_list``, and ``profanity_filter``. Not supported with realtime + speech-to-speech models.""" class VoiceAgentInterimResponseTrigger(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -2499,8 +2781,53 @@ class VoiceAgentInterimResponseTrigger(str, Enum, metaclass=CaseInsensitiveEnumM """TOOL.""" +class VoiceAgentLiveConversationItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The kind of a persisted Live conversation item.""" + + INPUT = "input" + """INPUT.""" + OUTPUT = "output" + """OUTPUT.""" + DELEGATION = "delegation" + """DELEGATION.""" + + +class VoiceAgentLiveDelegationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Persisted delegation outcome, not speech or playback status.""" + + IN_PROGRESS = "in_progress" + """IN_PROGRESS.""" + COMPLETED = "completed" + """COMPLETED.""" + FAILED = "failed" + """FAILED.""" + INCOMPLETE = "incomplete" + """INCOMPLETE.""" + CANCELLED = "cancelled" + """CANCELLED.""" + + +class VoiceAgentLiveDelegationTarget(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Delegation owner. Foundry agent targets use native client delegation upstream.""" + + RESPONSES = "responses" + """RESPONSES.""" + CLIENT = "client" + """CLIENT.""" + FOUNDRY_MANAGED_AGENT = "foundry_managed_agent" + """FOUNDRY_MANAGED_AGENT.""" + + class VoiceAgentNoiseReductionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The input audio noise reduction mode.""" + """The input audio noise reduction mode. + + * `azure_deep_noise_suppression_headset`: Azure headset-optimized noise suppression for local voice activity + detection. Optimized for low-sample-rate audio, including 8 kHz telephony audio. Enhances detection audio without + changing the audio used for recognition. The mode is not restricted to headset devices. + * `azure_personal_noise_suppression`: Azure personalized noise suppression for local voice activity detection. + Starts with headset suppression and personalizes detection after automatic speaker enrollment. Recognition audio + is unchanged; headset suppression remains active when personalization is unavailable. + """ NEAR_FIELD = "near_field" """NEAR_FIELD.""" @@ -2508,6 +2835,25 @@ class VoiceAgentNoiseReductionType(str, Enum, metaclass=CaseInsensitiveEnumMeta) """FAR_FIELD.""" AZURE_DEEP_NOISE_SUPPRESSION = "azure_deep_noise_suppression" """Azure deep noise suppression.""" + AZURE_DEEP_NOISE_SUPPRESSION_HEADSET = "azure_deep_noise_suppression_headset" + """Azure headset-optimized noise suppression for local voice activity detection. Optimized for + low-sample-rate audio, including 8 kHz telephony audio. Enhances detection audio without + changing the audio used for recognition. The mode is not restricted to headset devices.""" + AZURE_PERSONAL_NOISE_SUPPRESSION = "azure_personal_noise_suppression" + """Azure personalized noise suppression for local voice activity detection. Starts with headset + suppression and personalizes detection after automatic speaker enrollment. Recognition audio is + unchanged; headset suppression remains active when personalization is unavailable.""" + + +class VoiceAgentProfanityFilterMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The supported input-transcript profanity filtering modes.""" + + MASKED = "masked" + """Masks recognized profanity in the transcript.""" + UNFILTERED = "unfiltered" + """Includes recognized profanity in the transcript, subject to mandatory service masking policies.""" + REMOVED = "removed" + """Removes recognized profanity from the transcript.""" class VoiceAgentSessionIncludeOption(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -2521,6 +2867,25 @@ class VoiceAgentSessionIncludeOption(str, Enum, metaclass=CaseInsensitiveEnumMet """FILE_SEARCH_CALL_RESULTS.""" +class VoiceAgentSoundscapeSound(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The packaged sounds accepted by a built-in soundscape source.""" + + OFFICE = "office" + """Quiet office ambience.""" + CALL_CENTER = "call_center" + """Busy call-center ambience.""" + BUSY_STREET = "busy_street" + """Busy street ambience.""" + PEOPLE_TALKING = "people_talking" + """Crowd conversation ambience.""" + STREET_AND_METRO_STATION = "street_and_metro_station" + """Street and metro-station ambience.""" + DING1 = "ding1" + """The first notification tone.""" + DING2 = "ding2" + """The second notification tone.""" + + class VoiceAgentSubagentAbortReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The reason a subagent consultation was aborted.""" @@ -2538,6 +2903,15 @@ class VoiceAgentSubagentAbortReason(str, Enum, metaclass=CaseInsensitiveEnumMeta """The consultation failed.""" +class VoiceAgentSubProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Voice protocol; realtime includes cascaded models.""" + + REALTIME = "realtime" + """REALTIME.""" + LIVE = "live" + """LIVE.""" + + class VoiceAgentSystemToolName(str, Enum, metaclass=CaseInsensitiveEnumMeta): """A service-managed voice-session control action. Known values are stable; additional values may be added over time. diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py index 5d5140de90d8..5d2580a8c1f1 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py @@ -22,6 +22,7 @@ AgentOptimizationDataSourceType, AgentOptimizationEvaluationSetType, AgentOptimizationTargetConfigurationType, + AnswerResourceType, ContainerNetworkPolicyParamType, ContainerSkillType, CreateTranscriptionResponseJsonUsageType, @@ -32,6 +33,7 @@ DataGenerationJobSourceType, DataGenerationJobType, DatasetType, + DelegationType, DeploymentType, EvaluationRuleActionType, EvaluationTaxonomyInputType, @@ -40,12 +42,17 @@ FunctionShellToolParamEnvironmentType, IndexType, InsightType, + LiveAudioFormatType, + LiveClientEventType, + LiveInitialItemType, + LiveServerEventType, MemoryItemKind, MemoryStoreKind, MemoryStoreObjectType, OpenApiAuthType, OptimizationContextType, PendingUploadType, + QuestionParamType, RealtimeAudioFormatsType, RealtimeClientEventType, RealtimeConversationItemMessageType, @@ -71,6 +78,8 @@ TriggerType, VersionIndicatorType, VersionSelectorType, + VoiceAgentLiveConversationItemType, + VoiceAgentLiveDelegationTarget, VoiceAgentSystemToolName, VoiceAgentTurnDetectionType, ) @@ -174,14 +183,16 @@ class Tool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-on """A tool that can be used to generate a response. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - A2ATool, A2APreviewTool, ApplyPatchToolParam, AzureAISearchTool, AzureFunctionTool, + A2ATool, A2APreviewTool, ToolApplyPatchToolParam, AzureAISearchTool, AzureFunctionTool, BingCustomSearchPreviewTool, BingGroundingTool, BrowserAutomationTool, - BrowserAutomationPreviewTool, CaptureStructuredOutputsTool, CodeInterpreterTool, ComputerTool, - ComputerUsePreviewTool, CustomToolParam, MicrosoftFabricPreviewTool, FabricIQPreviewTool, - FileSearchTool, FunctionTool, GitHubCopilotToolsetPreview, ImageGenTool, LocalShellToolParam, - MCPTool, MemorySearchPreviewTool, MicrosoftCopilotToolsetPreview, NamespaceToolParam, - OpenApiTool, ProgrammaticToolCallingParam, SharepointPreviewTool, FunctionShellToolParam, - ToolSearchToolParam, WebIQPreviewTool, WebSearchTool, WebSearchPreviewTool, WorkIQPreviewTool + BrowserAutomationPreviewTool, CaptureStructuredOutputsTool, ToolCodeInterpreterTool, + ToolComputerTool, ToolComputerUsePreviewTool, ToolCustomToolParam, MicrosoftFabricPreviewTool, + FabricIQPreviewTool, ToolFileSearchTool, ToolFunctionTool, GitHubCopilotToolsetPreview, + ToolImageGenTool, ToolLocalShellToolParam, ToolMcpTool, MemorySearchPreviewTool, + MicrosoftCopilotToolsetPreview, NamespaceToolParam, OpenApiTool, + ToolProgrammaticToolCallingParam, SharepointPreviewTool, ToolFunctionShellToolParam, + ToolToolSearchToolParam, WebIQPreviewTool, ToolWebSearchTool, ToolWebSearchPreviewTool, + WorkIQPreviewTool :ivar type: Required. Known values are: "function", "file_search", "computer", "computer_use_preview", "web_search", "mcp", "code_interpreter", "programmatic_tool_calling", @@ -960,8 +971,8 @@ class AgentDefinition(_Model): # pylint: disable=docstring-keyword-should-match """AgentDefinition. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ExternalAgentDefinition, HostedAgentDefinition, PromptAgentDefinition, VoiceAgentDefinition, - WorkflowAgentDefinition + ExternalAgentDefinition, HostedAgentDefinition, PromptAgentDefinition, + VoiceAgentBaseDefinition, WorkflowAgentDefinition :ivar kind: Required. Known values are: "prompt", "hosted", "workflow", "external", and "voice". @@ -4664,6 +4675,218 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class AnswerResource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A completed question always includes its name, including null when unnamed. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + AnswerResourceChoice, AnswerResourcePredicate, AnswerResourceRefusal, AnswerResourceScore + + :ivar type: Required. Known values are: "predicate", "choice", "score", and "refusal". + :vartype type: str or ~azure.ai.projects.models.AnswerResourceType + """ + + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"predicate\", \"choice\", \"score\", and \"refusal\".""" + + @overload + def __init__( + self, + *, + type: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AnswerResourceChoice( + AnswerResource, discriminator="choice" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """AnswerResourceChoice. + + :ivar type: The type of the object. Always ``choice``. Required. CHOICE. + :vartype type: str or ~azure.ai.projects.models.CHOICE + :ivar name: Required. + :vartype name: str + :ivar choice: Required. Is either a str type or a bool type. + :vartype choice: str or bool + :ivar probabilities: Required. + :vartype probabilities: list[~azure.ai.projects.models.ChoiceProbabilityResource] + :ivar confidence: Required. + :vartype confidence: float + """ + + type: Literal[AnswerResourceType.CHOICE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the object. Always ``choice``. Required. CHOICE.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + choice: "_unions.ChoiceValueResource" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Is either a str type or a bool type.""" + probabilities: list["_models.ChoiceProbabilityResource"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required.""" + confidence: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + name: str, + choice: "_unions.ChoiceValueResource", + probabilities: list["_models.ChoiceProbabilityResource"], + confidence: float, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = AnswerResourceType.CHOICE # type: ignore + + +class AnswerResourcePredicate( + AnswerResource, discriminator="predicate" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """AnswerResourcePredicate. + + :ivar type: The type of the object. Always ``predicate``. Required. PREDICATE. + :vartype type: str or ~azure.ai.projects.models.PREDICATE + :ivar name: Required. + :vartype name: str + :ivar probability: Required. + :vartype probability: float + """ + + type: Literal[AnswerResourceType.PREDICATE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the object. Always ``predicate``. Required. PREDICATE.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + probability: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + name: str, + probability: float, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = AnswerResourceType.PREDICATE # type: ignore + + +class AnswerResourceRefusal( + AnswerResource, discriminator="refusal" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """The model declined to answer this question. Other questions in the same request can still + receive answers. + + :ivar type: The type of the object. Always ``refusal``. Required. REFUSAL. + :vartype type: str or ~azure.ai.projects.models.REFUSAL + :ivar name: Required. + :vartype name: str + """ + + type: Literal[AnswerResourceType.REFUSAL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the object. Always ``refusal``. Required. REFUSAL.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + name: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = AnswerResourceType.REFUSAL # type: ignore + + +class AnswerResourceScore( + AnswerResource, discriminator="score" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """AnswerResourceScore. + + :ivar type: The type of the object. Always ``score``. Required. SCORE. + :vartype type: str or ~azure.ai.projects.models.SCORE + :ivar name: Required. + :vartype name: str + :ivar score: Required. + :vartype score: float + :ivar probabilities: Required. + :vartype probabilities: list[~azure.ai.projects.models.ScoreProbabilityResource] + :ivar confidence: Required. + :vartype confidence: float + """ + + type: Literal[AnswerResourceType.SCORE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the object. Always ``score``. Required. SCORE.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + score: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + probabilities: list["_models.ScoreProbabilityResource"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required.""" + confidence: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + name: str, + score: float, + probabilities: list["_models.ScoreProbabilityResource"], + confidence: float, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = AnswerResourceType.SCORE # type: ignore + + class ApiError(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """ApiError. @@ -4789,42 +5012,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = CredentialType.API_KEY # type: ignore -class ApplyPatchToolParam( - Tool, discriminator="apply_patch" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Apply patch tool. - - :ivar type: The type of the tool. Always ``apply_patch``. Required. APPLY_PATCH. - :vartype type: str or ~azure.ai.projects.models.APPLY_PATCH - :ivar allowed_callers: - :vartype allowed_callers: list[str or ~azure.ai.projects.models.CallableToolAllowedCaller] - """ - - type: Literal[ToolType.APPLY_PATCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the tool. Always ``apply_patch``. Required. APPLY_PATCH.""" - allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - - @overload - def __init__( - self, - *, - allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type = ToolType.APPLY_PATCH # type: ignore - - class ApproximateLocation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """ApproximateLocation. @@ -6032,6 +6219,9 @@ class BrowserAutomationPreviewTool( Tool, discriminator="browser_automation_preview" ): # pylint: disable=docstring-keyword-should-match-keyword-only """The input definition information for a Browser Automation Tool, as used to configure an Agent. + BrowserAutomationPreviewTool is deprecated. Please use BrowserAutomationTool instead. See + `https://aka.ms/bat/docs `_ for more information on Browser automation + tool. :ivar type: The object type, which is always 'browser_automation_preview'. Required. BROWSER_AUTOMATION_PREVIEW. @@ -6070,7 +6260,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class BrowserAutomationPreviewToolboxTool( ToolboxTool, discriminator="browser_automation_preview" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """A browser automation tool stored in a toolbox. + """A browser automation tool stored in a toolbox. BrowserAutomationPreviewToolboxTool is + deprecated. Please use BrowserAutomationToolboxTool instead. See `https://aka.ms/bat/docs + `_ for more information on Browser automation tool. :ivar name: Optional user-defined name for this tool or configuration. :vartype name: str @@ -6494,6 +6686,71 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = MemoryItemKind.CHAT_SUMMARY # type: ignore +class ChoiceOptionParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """ChoiceOptionParam. + + :ivar value: Required. Is either a str type or a bool type. + :vartype value: str or bool + :ivar description: + :vartype description: str + """ + + value: "_unions.ChoiceValueParam" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Is either a str type or a bool type.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + + @overload + def __init__( + self, + *, + value: "_unions.ChoiceValueParam", + description: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ChoiceProbabilityResource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """ChoiceProbabilityResource. + + :ivar value: Required. Is either a str type or a bool type. + :vartype value: str or bool + :ivar probability: Required. + :vartype probability: float + """ + + value: "_unions.ChoiceValueResource" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Is either a str type or a bool type.""" + probability: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + value: "_unions.ChoiceValueResource", + probability: float, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + class ClusterInsightResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Insights from the cluster analysis. @@ -6791,75 +7048,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CodeInterpreterTool( - Tool, discriminator="code_interpreter" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Code interpreter. - - :ivar type: The type of the code interpreter tool. Always ``code_interpreter``. Required. - CODE_INTERPRETER. - :vartype type: str or ~azure.ai.projects.models.CODE_INTERPRETER - :ivar allowed_callers: - :vartype allowed_callers: list[str or ~azure.ai.projects.models.CallableToolAllowedCaller] - :ivar name: Deprecated. This property is deprecated and will be removed in a future version. - :vartype name: str - :ivar description: Deprecated. This property is deprecated and will be removed in a future - version. - :vartype description: str - :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future - version. - :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] - :ivar container: The code interpreter container. Can be a container ID or an object that - specifies uploaded file IDs to make available to your code, along with an optional - ``memory_limit`` setting. If not provided, the service assumes auto. Is either a str type or a - AutoCodeInterpreterToolParam type. - :vartype container: str or ~azure.ai.projects.models.AutoCodeInterpreterToolParam - """ - - type: Literal[ToolType.CODE_INTERPRETER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the code interpreter tool. Always ``code_interpreter``. Required. CODE_INTERPRETER.""" - allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Deprecated. This property is deprecated and will be removed in a future version.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Deprecated. This property is deprecated and will be removed in a future version.""" - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Deprecated. This property is deprecated and will be removed in a future version.""" - container: Optional[Union[str, "_models.AutoCodeInterpreterToolParam"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The code interpreter container. Can be a container ID or an object that specifies uploaded file - IDs to make available to your code, along with an optional ``memory_limit`` setting. If not - provided, the service assumes auto. Is either a str type or a AutoCodeInterpreterToolParam - type.""" - - @overload - def __init__( - self, - *, - allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = None, - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, - container: Optional[Union[str, "_models.AutoCodeInterpreterToolParam"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type = ToolType.CODE_INTERPRETER # type: ignore - - class CodeInterpreterToolboxTool( ToolboxTool, discriminator="code_interpreter" ): # pylint: disable=docstring-keyword-should-match-keyword-only @@ -6996,13 +7184,14 @@ class CompoundFilter(_Model): # pylint: disable=docstring-keyword-should-match- :vartype type: str or str :ivar filters: Array of filters to combine. Items can be ``ComparisonFilter`` or ``CompoundFilter``. Required. - :vartype filters: list[~azure.ai.projects.models.ComparisonFilter or any] + :vartype filters: list[~azure.ai.projects.models.ComparisonFilter or + ~azure.ai.projects.models.CompoundFilter] """ type: Literal["and", "or"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Type of operation: ``and`` or ``or``. Required. Is either a Literal[\"and\"] type or a Literal[\"or\"] type.""" - filters: list[Union["_models.ComparisonFilter", Any]] = rest_field( + filters: list[Union["_models.ComparisonFilter", "_models.CompoundFilter"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """Array of filters to combine. Items can be ``ComparisonFilter`` or ``CompoundFilter``. Required.""" @@ -7012,7 +7201,7 @@ def __init__( self, *, type: Literal["and", "or"], - filters: list[Union["_models.ComparisonFilter", Any]], + filters: list[Union["_models.ComparisonFilter", "_models.CompoundFilter"]], ) -> None: ... @overload @@ -7026,84 +7215,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ComputerTool(Tool, discriminator="computer"): - """Computer. - - :ivar type: The type of the computer tool. Always ``computer``. Required. COMPUTER. - :vartype type: str or ~azure.ai.projects.models.COMPUTER - """ - - type: Literal[ToolType.COMPUTER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the computer tool. Always ``computer``. Required. COMPUTER.""" - - @overload - def __init__( - self, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type = ToolType.COMPUTER # type: ignore - - -class ComputerUsePreviewTool( - Tool, discriminator="computer_use_preview" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Computer use preview. - - :ivar type: The type of the computer use tool. Always ``computer_use_preview``. Required. - COMPUTER_USE_PREVIEW. - :vartype type: str or ~azure.ai.projects.models.COMPUTER_USE_PREVIEW - :ivar environment: The type of computer environment to control. Required. Known values are: - "windows", "mac", "linux", "ubuntu", and "browser". - :vartype environment: str or ~azure.ai.projects.models.ComputerEnvironment - :ivar display_width: The width of the computer display. Required. - :vartype display_width: int - :ivar display_height: The height of the computer display. Required. - :vartype display_height: int - """ - - type: Literal[ToolType.COMPUTER_USE_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the computer use tool. Always ``computer_use_preview``. Required. - COMPUTER_USE_PREVIEW.""" - environment: Union[str, "_models.ComputerEnvironment"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The type of computer environment to control. Required. Known values are: \"windows\", \"mac\", - \"linux\", \"ubuntu\", and \"browser\".""" - display_width: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The width of the computer display. Required.""" - display_height: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The height of the computer display. Required.""" - - @overload - def __init__( - self, - *, - environment: Union[str, "_models.ComputerEnvironment"], - display_width: int, - display_height: int, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type = ToolType.COMPUTER_USE_PREVIEW # type: ignore - - class Connection(_Model): """Response from the list and get connections operations. @@ -8221,11 +8332,12 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = CustomToolParamFormatType.TEXT # type: ignore -class CustomToolParam(Tool, discriminator="custom"): # pylint: disable=docstring-keyword-should-match-keyword-only +class CustomToolParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Custom tool. - :ivar type: The type of the custom tool. Always ``custom``. Required. CUSTOM. - :vartype type: str or ~azure.ai.projects.models.CUSTOM + :ivar type: The type of the custom tool. Always ``custom``. Required. Default value is + "custom". + :vartype type: str :ivar name: The name of the custom tool, used to identify it in tool calls. Required. :vartype name: str :ivar async_property: Whether the tool response can be returned asynchronously versus @@ -8241,8 +8353,8 @@ class CustomToolParam(Tool, discriminator="custom"): # pylint: disable=docstrin :vartype allowed_callers: list[str or ~azure.ai.projects.models.CallableToolAllowedCaller] """ - type: Literal[ToolType.CUSTOM] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the custom tool. Always ``custom``. Required. CUSTOM.""" + type: Literal["custom"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of the custom tool. Always ``custom``. Required. Default value is \"custom\".""" name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The name of the custom tool, used to identify it in tool calls. Required.""" async_property: Optional[bool] = rest_field( @@ -8283,7 +8395,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.CUSTOM # type: ignore + self.type: Literal["custom"] = "custom" class RecurrenceSchedule(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only @@ -8905,6 +9017,81 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class DecisionResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """DecisionResponse. + + :ivar model: The model used. Required. + :vartype model: str + :ivar answers: Answers in question order. Any question can return a refusal instead of an + answer; other questions can still receive answers. A refusal has ``type: "refusal"`` and the + question's ``name``, or ``null`` if it was unnamed. Required. + :vartype answers: list[~azure.ai.projects.models.AnswerResource] + :ivar usage: Token usage for the request. Required. + :vartype usage: ~azure.ai.projects.models.ResponseUsageResource + """ + + model: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The model used. Required.""" + answers: list["_models.AnswerResource"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Answers in question order. Any question can return a refusal instead of an answer; other + questions can still receive answers. A refusal has ``type: \"refusal\"`` and the question's + ``name``, or ``null`` if it was unnamed. Required.""" + usage: "_models.ResponseUsageResource" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Token usage for the request. Required.""" + + @overload + def __init__( + self, + *, + model: str, + answers: list["_models.AnswerResource"], + usage: "_models.ResponseUsageResource", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Delegation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Who handles tasks delegated by the Live model. Omitted or null selects your application; use + ``responses`` to let the API manage a Responses backend. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + LiveClientDelegationParam, LiveResponsesDelegationParam + + :ivar type: Required. Known values are: "client" and "responses". + :vartype type: str or ~azure.ai.projects.models.DelegationType + """ + + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"client\" and \"responses\".""" + + @overload + def __init__( + self, + *, + type: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + class DeleteAgentResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """A deleted agent Object. @@ -11344,77 +11531,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = DatasetType.URI_FILE # type: ignore -class FileSearchTool(Tool, discriminator="file_search"): # pylint: disable=docstring-keyword-should-match-keyword-only - """File search. - - :ivar type: The type of the file search tool. Always ``file_search``. Required. FILE_SEARCH. - :vartype type: str or ~azure.ai.projects.models.FILE_SEARCH - :ivar vector_store_ids: The IDs of the vector stores to search. Required. - :vartype vector_store_ids: list[str] - :ivar max_num_results: The maximum number of results to return. This number should be between 1 - and 50 inclusive. - :vartype max_num_results: int - :ivar ranking_options: Ranking options for search. - :vartype ranking_options: ~azure.ai.projects.models.RankingOptions - :ivar filters: Is either a ComparisonFilter type or a CompoundFilter type. - :vartype filters: ~azure.ai.projects.models.ComparisonFilter or - ~azure.ai.projects.models.CompoundFilter - :ivar name: Deprecated. This property is deprecated and will be removed in a future version. - :vartype name: str - :ivar description: Deprecated. This property is deprecated and will be removed in a future - version. - :vartype description: str - :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future - version. - :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] - """ - - type: Literal[ToolType.FILE_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the file search tool. Always ``file_search``. Required. FILE_SEARCH.""" - vector_store_ids: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The IDs of the vector stores to search. Required.""" - max_num_results: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The maximum number of results to return. This number should be between 1 and 50 inclusive.""" - ranking_options: Optional["_models.RankingOptions"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Ranking options for search.""" - filters: Optional["_unions.Filters"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Is either a ComparisonFilter type or a CompoundFilter type.""" - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Deprecated. This property is deprecated and will be removed in a future version.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Deprecated. This property is deprecated and will be removed in a future version.""" - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Deprecated. This property is deprecated and will be removed in a future version.""" - - @overload - def __init__( - self, - *, - vector_store_ids: list[str], - max_num_results: Optional[int] = None, - ranking_options: Optional["_models.RankingOptions"] = None, - filters: Optional["_unions.Filters"] = None, - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type = ToolType.FILE_SEARCH # type: ignore - - class FileSearchToolboxTool( ToolboxTool, discriminator="file_search" ): # pylint: disable=docstring-keyword-should-match-keyword-only @@ -11695,74 +11811,13 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class FunctionParameters(_Model): """The parameters the functions accepts, described as a JSON Schema object. See the `guide - `_ for examples, and the `JSON Schema reference - `_ for documentation about the format. - Omitting ``parameters`` defines a function with an empty parameter list. + `_ for examples, and the `JSON + Schema reference `_ for documentation about + the format. Omitting ``parameters`` defines a function with an empty parameter list. """ -class FunctionShellToolParam( - Tool, discriminator="shell" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Shell tool. - - :ivar type: The type of the shell tool. Always ``shell``. Required. SHELL. - :vartype type: str or ~azure.ai.projects.models.SHELL - :ivar environment: - :vartype environment: ~azure.ai.projects.models.FunctionShellToolParamEnvironment - :ivar allowed_callers: - :vartype allowed_callers: list[str or ~azure.ai.projects.models.CallableToolAllowedCaller] - :ivar name: Deprecated. This property is deprecated and will be removed in a future version. - :vartype name: str - :ivar description: Deprecated. This property is deprecated and will be removed in a future - version. - :vartype description: str - :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future - version. - :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] - """ - - type: Literal[ToolType.SHELL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the shell tool. Always ``shell``. Required. SHELL.""" - environment: Optional["_models.FunctionShellToolParamEnvironment"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Deprecated. This property is deprecated and will be removed in a future version.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Deprecated. This property is deprecated and will be removed in a future version.""" - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Deprecated. This property is deprecated and will be removed in a future version.""" - - @overload - def __init__( - self, - *, - environment: Optional["_models.FunctionShellToolParamEnvironment"] = None, - allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = None, - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type = ToolType.SHELL # type: ignore - - class FunctionShellToolParamEnvironmentContainerReferenceParam( FunctionShellToolParamEnvironment, discriminator="container_reference" ): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only @@ -11836,74 +11891,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = FunctionShellToolParamEnvironmentType.LOCAL # type: ignore -class FunctionTool(Tool, discriminator="function"): # pylint: disable=docstring-keyword-should-match-keyword-only - """Function. - - :ivar type: The type of the function tool. Always ``function``. Required. FUNCTION. - :vartype type: str or ~azure.ai.projects.models.FUNCTION - :ivar name: The name of the function to call. Required. - :vartype name: str - :ivar async_property: - :vartype async_property: bool - :ivar description: - :vartype description: str - :ivar parameters: Required. - :vartype parameters: dict[str, any] - :ivar output_schema: - :vartype output_schema: dict[str, any] - :ivar strict: Required. - :vartype strict: bool - :ivar defer_loading: Whether this function is deferred and loaded via tool search. - :vartype defer_loading: bool - :ivar allowed_callers: - :vartype allowed_callers: list[str or ~azure.ai.projects.models.CallableToolAllowedCaller] - """ - - type: Literal[ToolType.FUNCTION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the function tool. Always ``function``. Required. FUNCTION.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the function to call. Required.""" - async_property: Optional[bool] = rest_field( - name="async", visibility=["read", "create", "update", "delete", "query"] - ) - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - parameters: dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - output_schema: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - strict: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - defer_loading: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether this function is deferred and loaded via tool search.""" - allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - - @overload - def __init__( - self, - *, - name: str, - parameters: dict[str, Any], - strict: bool, - async_property: Optional[bool] = None, - description: Optional[str] = None, - output_schema: Optional[dict[str, Any]] = None, - defer_loading: Optional[bool] = None, - allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type = ToolType.FUNCTION # type: ignore - - class FunctionToolParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """FunctionToolParam. @@ -12387,6 +12374,10 @@ class HostedAgentDefinition( :ivar session_configuration: Optional session defaults (for example, the idle timeout) applied to sessions created for this agent version. :vartype session_configuration: ~azure.ai.projects.models.SessionConfiguration + :ivar enable_memory_snapshot: Whether this agent version uses memory snapshots. Sessions for a + snapshot-enabled version start from a snapshot of the agent's initialized process rather than + starting the process from its image. Defaults to false. + :vartype enable_memory_snapshot: bool """ kind: Literal[AgentKind.HOSTED] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore @@ -12423,6 +12414,10 @@ class HostedAgentDefinition( ) """Optional session defaults (for example, the idle timeout) applied to sessions created for this agent version.""" + enable_memory_snapshot: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether this agent version uses memory snapshots. Sessions for a snapshot-enabled version start + from a snapshot of the agent's initialized process rather than starting the process from its + image. Defaults to false.""" @overload def __init__( @@ -12437,6 +12432,7 @@ def __init__( code_configuration: Optional["_models.CodeConfiguration"] = None, telemetry_config: Optional["_models.TelemetryConfig"] = None, session_configuration: Optional["_models.SessionConfiguration"] = None, + enable_memory_snapshot: Optional[bool] = None, ) -> None: ... @overload @@ -12546,191 +12542,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ImageGenTool( - Tool, discriminator="image_generation" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Image generation tool. - - :ivar type: The type of the image generation tool. Always ``image_generation``. Required. - IMAGE_GENERATION. - :vartype type: str or ~azure.ai.projects.models.IMAGE_GENERATION - :ivar model: Is one of the following types: Literal["gpt-image-1"], - Literal["gpt-image-1-mini"], Literal["gpt-image-1.5"], Literal["gpt-image-2"], - Literal["gpt-image-2-2026-04-21"], str - :vartype model: str or str or str or str or str or str - :ivar quality: The quality of the generated image. One of ``low``, ``medium``, ``high``, or - ``auto``. Default: ``auto``. Is one of the following types: Literal["low"], Literal["medium"], - Literal["high"], Literal["auto"] - :vartype quality: str or str or str or str - :ivar size: The size of the generated images. For ``gpt-image-2`` and - ``gpt-image-2-2026-04-21``, arbitrary resolutions are supported as ``WIDTHxHEIGHT`` strings, - for example ``1536x864``. Width and height must both be divisible by 16 and the requested - aspect ratio must be between 1:3 and 3:1. Resolutions above ``2560x1440`` are experimental, and - the maximum supported resolution is ``3840x2160``. The requested size must also satisfy the - model's current pixel and edge limits. The standard sizes ``1024x1024``, ``1536x1024``, and - ``1024x1536`` are supported by the GPT image models; ``auto`` is supported for models that - allow automatic sizing. For ``dall-e-2``, use one of ``256x256``, ``512x512``, or - ``1024x1024``. For ``dall-e-3``, use one of ``1024x1024``, ``1792x1024``, or ``1024x1792``. Is - one of the following types: Literal["1024x1024"], Literal["1024x1536"], Literal["1536x1024"], - Literal["auto"], str - :vartype size: str or str or str or str or str - :ivar output_format: The output format of the generated image. One of ``png``, ``webp``, or - ``jpeg``. Default: ``png``. Is one of the following types: Literal["png"], Literal["webp"], - Literal["jpeg"] - :vartype output_format: str or str or str - :ivar output_compression: Compression level for the output image. Default: 100. - :vartype output_compression: int - :ivar moderation: Moderation level for the generated image. Default: ``auto``. Is either a - Literal["auto"] type or a Literal["low"] type. - :vartype moderation: str or str - :ivar background: Set the background of the generated image. One of ``transparent``, - ``opaque``, or ``auto``. Transparent backgrounds are available for supported GPT Image models. - For ``gpt-image-2`` and ``gpt-image-2-2026-04-21``, this support is in preview. When using - ``transparent``, set the output format to ``png`` or ``webp``. Default: ``auto``. Is one of the - following types: Literal["transparent"], Literal["opaque"], Literal["auto"] - :vartype background: str or str or str - :ivar input_fidelity: Known values are: "high" and "low". - :vartype input_fidelity: str or ~azure.ai.projects.models.InputFidelity - :ivar input_image_mask: Optional mask for inpainting. Contains ``image_url`` (string, optional) - and ``file_id`` (string, optional). - :vartype input_image_mask: ~azure.ai.projects.models.ImageGenToolInputImageMask - :ivar partial_images: Number of partial images to generate in streaming mode, from 0 (default - value) to 3. - :vartype partial_images: int - :ivar action: Whether to generate a new image or edit an existing image. Default: ``auto``. - Known values are: "generate", "edit", and "auto". - :vartype action: str or ~azure.ai.projects.models.ImageGenAction - :ivar name: Deprecated. This property is deprecated and will be removed in a future version. - :vartype name: str - :ivar description: Deprecated. This property is deprecated and will be removed in a future - version. - :vartype description: str - :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future - version. - :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] - """ - - type: Literal[ToolType.IMAGE_GENERATION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the image generation tool. Always ``image_generation``. Required. IMAGE_GENERATION.""" - model: Optional[ - Union[ - Literal["gpt-image-1"], - Literal["gpt-image-1-mini"], - Literal["gpt-image-1.5"], - Literal["gpt-image-2"], - Literal["gpt-image-2-2026-04-21"], - str, - ] - ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Is one of the following types: Literal[\"gpt-image-1\"], Literal[\"gpt-image-1-mini\"], - Literal[\"gpt-image-1.5\"], Literal[\"gpt-image-2\"], Literal[\"gpt-image-2-2026-04-21\"], str""" - quality: Optional[Literal["low", "medium", "high", "auto"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The quality of the generated image. One of ``low``, ``medium``, ``high``, or ``auto``. Default: - ``auto``. Is one of the following types: Literal[\"low\"], Literal[\"medium\"], - Literal[\"high\"], Literal[\"auto\"]""" - size: Optional[Union[Literal["1024x1024"], Literal["1024x1536"], Literal["1536x1024"], Literal["auto"], str]] = ( - rest_field(visibility=["read", "create", "update", "delete", "query"]) - ) - """The size of the generated images. For ``gpt-image-2`` and ``gpt-image-2-2026-04-21``, arbitrary - resolutions are supported as ``WIDTHxHEIGHT`` strings, for example ``1536x864``. Width and - height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. - Resolutions above ``2560x1440`` are experimental, and the maximum supported resolution is - ``3840x2160``. The requested size must also satisfy the model's current pixel and edge limits. - The standard sizes ``1024x1024``, ``1536x1024``, and ``1024x1536`` are supported by the GPT - image models; ``auto`` is supported for models that allow automatic sizing. For ``dall-e-2``, - use one of ``256x256``, ``512x512``, or ``1024x1024``. For ``dall-e-3``, use one of - ``1024x1024``, ``1792x1024``, or ``1024x1792``. Is one of the following types: - Literal[\"1024x1024\"], Literal[\"1024x1536\"], Literal[\"1536x1024\"], Literal[\"auto\"], str""" - output_format: Optional[Literal["png", "webp", "jpeg"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The output format of the generated image. One of ``png``, ``webp``, or ``jpeg``. Default: - ``png``. Is one of the following types: Literal[\"png\"], Literal[\"webp\"], Literal[\"jpeg\"]""" - output_compression: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Compression level for the output image. Default: 100.""" - moderation: Optional[Literal["auto", "low"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Moderation level for the generated image. Default: ``auto``. Is either a Literal[\"auto\"] type - or a Literal[\"low\"] type.""" - background: Optional[Literal["transparent", "opaque", "auto"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Set the background of the generated image. One of ``transparent``, ``opaque``, or ``auto``. - Transparent backgrounds are available for supported GPT Image models. For ``gpt-image-2`` and - ``gpt-image-2-2026-04-21``, this support is in preview. When using ``transparent``, set the - output format to ``png`` or ``webp``. Default: ``auto``. Is one of the following types: - Literal[\"transparent\"], Literal[\"opaque\"], Literal[\"auto\"]""" - input_fidelity: Optional[Union[str, "_models.InputFidelity"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Known values are: \"high\" and \"low\".""" - input_image_mask: Optional["_models.ImageGenToolInputImageMask"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Optional mask for inpainting. Contains ``image_url`` (string, optional) and ``file_id`` - (string, optional).""" - partial_images: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Number of partial images to generate in streaming mode, from 0 (default value) to 3.""" - action: Optional[Union[str, "_models.ImageGenAction"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Whether to generate a new image or edit an existing image. Default: ``auto``. Known values are: - \"generate\", \"edit\", and \"auto\".""" - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Deprecated. This property is deprecated and will be removed in a future version.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Deprecated. This property is deprecated and will be removed in a future version.""" - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Deprecated. This property is deprecated and will be removed in a future version.""" - - @overload - def __init__( - self, - *, - model: Optional[ - Union[ - Literal["gpt-image-1"], - Literal["gpt-image-1-mini"], - Literal["gpt-image-1.5"], - Literal["gpt-image-2"], - Literal["gpt-image-2-2026-04-21"], - str, - ] - ] = None, - quality: Optional[Literal["low", "medium", "high", "auto"]] = None, - size: Optional[ - Union[Literal["1024x1024"], Literal["1024x1536"], Literal["1536x1024"], Literal["auto"], str] - ] = None, - output_format: Optional[Literal["png", "webp", "jpeg"]] = None, - output_compression: Optional[int] = None, - moderation: Optional[Literal["auto", "low"]] = None, - background: Optional[Literal["transparent", "opaque", "auto"]] = None, - input_fidelity: Optional[Union[str, "_models.InputFidelity"]] = None, - input_image_mask: Optional["_models.ImageGenToolInputImageMask"] = None, - partial_images: Optional[int] = None, - action: Optional[Union[str, "_models.ImageGenAction"]] = None, - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type = ToolType.IMAGE_GENERATION # type: ignore - - class ImageGenToolInputImageMask(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """ImageGenToolInputImageMask. @@ -12848,6 +12659,39 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.media_type: Literal["application/zip"] = "application/zip" +class InputTokensDetailsResource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """InputTokensDetailsResource. + + :ivar cached_tokens: Required. + :vartype cached_tokens: int + :ivar cache_write_tokens: Required. + :vartype cache_write_tokens: int + """ + + cached_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + cache_write_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + cached_tokens: int, + cache_write_tokens: int, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + class Insight(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The response body for cluster insights. @@ -13393,41 +13237,110 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = RoutineActionType.INVOKE_AGENT_RESPONSES_API # type: ignore -class LocalShellToolParam( - Tool, discriminator="local_shell" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Local shell tool. +class LiveAllowedServerEventParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A Live server event selector for the WebRTC frontend data channel. - :ivar type: The type of the local shell tool. Always ``local_shell``. Required. LOCAL_SHELL. - :vartype type: str or ~azure.ai.projects.models.LOCAL_SHELL - :ivar name: Deprecated. This property is deprecated and will be removed in a future version. - :vartype name: str - :ivar description: Deprecated. This property is deprecated and will be removed in a future - version. - :vartype description: str - :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future - version. - :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] + :ivar type: The outer Live server event type. Use 'response.event' for Responses events. + Required. + :vartype type: str + :ivar response_event: The nested Responses event type. Required when type is 'response.event'; + forbidden for other event types. + :vartype response_event: str """ - type: Literal[ToolType.LOCAL_SHELL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the local shell tool. Always ``local_shell``. Required. LOCAL_SHELL.""" - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Deprecated. This property is deprecated and will be removed in a future version.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Deprecated. This property is deprecated and will be removed in a future version.""" - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = rest_field( + type: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The outer Live server event type. Use 'response.event' for Responses events. Required.""" + response_event: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The nested Responses event type. Required when type is 'response.event'; forbidden for other + event types.""" + + @overload + def __init__( + self, + *, + type: str, + response_event: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class LiveAllowedToolsChoiceParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """LiveAllowedToolsChoiceParam. + + :ivar type: The tool choice type. Always ``allowed_tools``. Required. Default value is + "allowed_tools". + :vartype type: str + :ivar tools: The tools that the delegated Responses model may call. Required. + :vartype tools: list[~azure.ai.projects.models.LiveFunctionToolChoiceParam or + ~azure.ai.projects.models.LiveMCPToolChoiceParam or + ~azure.ai.projects.models.LiveSpecificFileSearchParam or + ~azure.ai.projects.models.LiveSpecificWebSearchParam or + ~azure.ai.projects.models.LiveSpecificWebSearchPreviewParam or + ~azure.ai.projects.models.LiveSpecificImageGenParam or + ~azure.ai.projects.models.LiveSpecificComputerParam or + ~azure.ai.projects.models.LiveSpecificCodeInterpreterParam or + ~azure.ai.projects.models.LiveSpecificProgrammaticToolCallingParam or + ~azure.ai.projects.models.LiveSpecificFunctionShellParam or + ~azure.ai.projects.models.LiveSpecificCustomToolParam or + ~azure.ai.projects.models.LiveSpecificApplyPatchParam] + :ivar mode: Known values are: "none", "auto", and "required". + :vartype mode: str or ~azure.ai.projects.models.LiveToolChoiceValueEnum + """ + + type: Literal["allowed_tools"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The tool choice type. Always ``allowed_tools``. Required. Default value is \"allowed_tools\".""" + tools: list[ + Union[ + "_models.LiveFunctionToolChoiceParam", + "_models.LiveMCPToolChoiceParam", + "_models.LiveSpecificFileSearchParam", + "_models.LiveSpecificWebSearchParam", + "_models.LiveSpecificWebSearchPreviewParam", + "_models.LiveSpecificImageGenParam", + "_models.LiveSpecificComputerParam", + "_models.LiveSpecificCodeInterpreterParam", + "_models.LiveSpecificProgrammaticToolCallingParam", + "_models.LiveSpecificFunctionShellParam", + "_models.LiveSpecificCustomToolParam", + "_models.LiveSpecificApplyPatchParam", + ] + ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The tools that the delegated Responses model may call. Required.""" + mode: Optional[Union[str, "_models.LiveToolChoiceValueEnum"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Deprecated. This property is deprecated and will be removed in a future version.""" + """Known values are: \"none\", \"auto\", and \"required\".""" @overload def __init__( self, *, - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + tools: list[ + Union[ + "_models.LiveFunctionToolChoiceParam", + "_models.LiveMCPToolChoiceParam", + "_models.LiveSpecificFileSearchParam", + "_models.LiveSpecificWebSearchParam", + "_models.LiveSpecificWebSearchPreviewParam", + "_models.LiveSpecificImageGenParam", + "_models.LiveSpecificComputerParam", + "_models.LiveSpecificCodeInterpreterParam", + "_models.LiveSpecificProgrammaticToolCallingParam", + "_models.LiveSpecificFunctionShellParam", + "_models.LiveSpecificCustomToolParam", + "_models.LiveSpecificApplyPatchParam", + ] + ], + mode: Optional[Union[str, "_models.LiveToolChoiceValueEnum"]] = None, ) -> None: ... @overload @@ -13439,34 +13352,45 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.LOCAL_SHELL # type: ignore + self.type: Literal["allowed_tools"] = "allowed_tools" -class LocalSkillParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """LocalSkillParam. +class LiveApplyPatchToolInputParam(_Model): # pylint: disable=docstring-missing-param + """LiveApplyPatchToolInputParam. - :ivar name: The name of the skill. Required. - :vartype name: str - :ivar description: The description of the skill. Required. - :vartype description: str - :ivar path: The path to the directory containing the skill. Required. - :vartype path: str + :ivar type: Required. Default value is "apply_patch". + :vartype type: str """ - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the skill. Required.""" - description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The description of the skill. Required.""" - path: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The path to the directory containing the skill. Required.""" + type: Literal["apply_patch"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"apply_patch\".""" + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type: Literal["apply_patch"] = "apply_patch" + + +class LiveAudioFormat(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Audio encoding and sample rate for audio sent and received over a Live WebSocket connection. + WebRTC and SIP negotiate their media format separately. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + LiveSessionAudioFormatPCMParam, LiveSessionAudioFormatPCMAParam, + LiveSessionAudioFormatPCMUParam + + :ivar type: Required. Known values are: "audio/pcm", "audio/pcmu", and "audio/pcma". + :vartype type: str or ~azure.ai.projects.models.LiveAudioFormatType + """ + + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"audio/pcm\", \"audio/pcmu\", and \"audio/pcma\".""" @overload def __init__( self, *, - name: str, - description: str, - path: str, + type: str, ) -> None: ... @overload @@ -13480,31 +13404,25 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class LogProbProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A log probability object. +class LiveClientConfigParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Startup-only capabilities for an untrusted frontend attached to a unified WebRTC session. + Trusted sideband connections are unaffected. - :ivar token: The token that was used to generate the log probability. Required. - :vartype token: str - :ivar logprob: The log probability of the token. Required. - :vartype logprob: float - :ivar bytes: The bytes that were used to generate the log probability. Required. - :vartype bytes: list[int] + :ivar data_channel: Client and server event permissions for the WebRTC frontend data channel. + Required. + :vartype data_channel: ~azure.ai.projects.models.LiveDataChannelConfigParam """ - token: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The token that was used to generate the log probability. Required.""" - logprob: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The log probability of the token. Required.""" - bytes: list[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The bytes that were used to generate the log probability. Required.""" + data_channel: "_models.LiveDataChannelConfigParam" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Client and server event permissions for the WebRTC frontend data channel. Required.""" @overload def __init__( self, *, - token: str, - logprob: float, - bytes: list[int], + data_channel: "_models.LiveDataChannelConfigParam", ) -> None: ... @overload @@ -13518,41 +13436,22 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class LoraConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Adapter-specific metadata for LoRA models. Drives serving engine configuration at deployment - time. +class LiveClientDelegationParam(Delegation, discriminator="client"): + """Delegate tasks to your application. The Live session emits delegation events that your backend + handles. - :ivar rank: LoRA rank (r). Positive integer. Common values: 8, 16, 32, 64. - :vartype rank: int - :ivar alpha: LoRA scaling factor (α). Positive integer; typically 2× the rank. - :vartype alpha: int - :ivar target_modules: Model layers modified by the adapter (e.g., q_proj, v_proj). - Auto-detected from adapter_config.json if omitted. - :vartype target_modules: list[str] - :ivar dropout: Dropout rate used during training. Informational — not used at serving time. - :vartype dropout: float + :ivar type: The delegation owner. Always ``client`` for tasks handled by your application. + Required. CLIENT. + :vartype type: str or ~azure.ai.projects.models.CLIENT """ - rank: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """LoRA rank (r). Positive integer. Common values: 8, 16, 32, 64.""" - alpha: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """LoRA scaling factor (α). Positive integer; typically 2× the rank.""" - target_modules: Optional[list[str]] = rest_field( - name="targetModules", visibility=["read", "create", "update", "delete", "query"] - ) - """Model layers modified by the adapter (e.g., q_proj, v_proj). Auto-detected from - adapter_config.json if omitted.""" - dropout: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Dropout rate used during training. Informational — not used at serving time.""" + type: Literal[DelegationType.CLIENT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The delegation owner. Always ``client`` for tasks handled by your application. Required. + CLIENT.""" @overload def __init__( self, - *, - rank: Optional[int] = None, - alpha: Optional[int] = None, - target_modules: Optional[list[str]] = None, - dropout: Optional[float] = None, ) -> None: ... @overload @@ -13564,29 +13463,48 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = DelegationType.CLIENT # type: ignore -class ManagedAgentIdentityBlueprintReference( - AgentBlueprintReference, discriminator="ManagedAgentIdentityBlueprint" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """ManagedAgentIdentityBlueprintReference. +class LiveClientEvent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Client events for Live. Initialize a primary WebSocket with session.start and wait for + session.started. WebRTC creation already starts the session. Audio append is primary + WebSocket-only. See the `Live prompting guide + `_ before writing frontend + instructions and delegation policies. - :ivar type: Required. MANAGED_AGENT_IDENTITY_BLUEPRINT. - :vartype type: str or ~azure.ai.projects.models.MANAGED_AGENT_IDENTITY_BLUEPRINT - :ivar blueprint_id: The ID of the managed blueprint. Required. - :vartype blueprint_id: str + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + LiveClientEventLiveDecisionCreateParam, LiveClientEventLiveDecisionItemCreateParam, + LiveClientEventLiveDecisionItemDeleteParam, LiveClientEventLiveResponseCreateParam, + LiveClientEventLiveResponseItemCreateParam, LiveClientEventLiveSessionCloseParam, + LiveClientEventLiveCommentaryAppendParam, LiveClientEventLiveInputAudioAppendEvent, + LiveClientEventLiveInputAudioMuteParam, LiveClientEventLiveInputAudioUnmuteParam, + LiveClientEventLiveInstructionsAppendParam, LiveClientEventLiveOutputAudioFixturePlayParam, + LiveSessionStartEvent, LiveClientEventLiveThinkingAppendParam, + LiveClientEventLiveSessionUpdateParam + + :ivar type: Required. Known values are: "session.start", "session.update", + "session.input_audio.append", "session.input_audio.mute", "session.input_audio.unmute", + "session.output_audio.fixture.play", "session.instructions.append", "session.thinking.append", + "session.commentary.append", "decision.create", "decision.item.create", "decision.item.delete", + "response.item.create", "response.create", and "session.close". + :vartype type: str or ~azure.ai.projects.models.LiveClientEventType """ - type: Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. MANAGED_AGENT_IDENTITY_BLUEPRINT.""" - blueprint_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the managed blueprint. Required.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"session.start\", \"session.update\", + \"session.input_audio.append\", \"session.input_audio.mute\", \"session.input_audio.unmute\", + \"session.output_audio.fixture.play\", \"session.instructions.append\", + \"session.thinking.append\", \"session.commentary.append\", \"decision.create\", + \"decision.item.create\", \"decision.item.delete\", \"response.item.create\", + \"response.create\", and \"session.close\".""" @overload def __init__( self, *, - blueprint_id: str, + type: str, ) -> None: ... @overload @@ -13598,42 +13516,43 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT # type: ignore -class ManagedAzureAISearchIndex( - Index, discriminator="ManagedAzureSearch" +class LiveClientEventLiveCommentaryAppendParam( + LiveClientEvent, discriminator="session.commentary.append" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Managed Azure AI Search Index Definition. + """Provide context the Live model can communicate to the user, optionally for an existing client + delegation. Rejected while an audio fixture is active. - :ivar id: Asset ID, a unique identifier for the asset. - :vartype id: str - :ivar name: The name of the resource. Required. - :vartype name: str - :ivar version: The version of the resource. Required. - :vartype version: str - :ivar description: The asset description text. - :vartype description: str - :ivar tags: Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar type: Type of index. Required. Managed Azure Search. - :vartype type: str or ~azure.ai.projects.models.MANAGED_AZURE_SEARCH - :ivar vector_store_id: Vector store id of managed index. Required. - :vartype vector_store_id: str + :ivar event_id: + :vartype event_id: str + :ivar type: The Live client event type. Always ``session.commentary.append``. Required. + SESSION_COMMENTARY_APPEND. + :vartype type: str or ~azure.ai.projects.models.SESSION_COMMENTARY_APPEND + :ivar delegation_id: Required. + :vartype delegation_id: str + :ivar content: Speakable context for the Live model, limited to 500 tokens. Use this for a + result the model should communicate; use session.thinking.append for silent context. Required. + :vartype content: str """ - type: Literal[IndexType.MANAGED_AZURE_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Type of index. Required. Managed Azure Search.""" - vector_store_id: str = rest_field(name="vectorStoreId", visibility=["create"]) - """Vector store id of managed index. Required.""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[LiveClientEventType.SESSION_COMMENTARY_APPEND] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The Live client event type. Always ``session.commentary.append``. Required. + SESSION_COMMENTARY_APPEND.""" + delegation_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + content: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Speakable context for the Live model, limited to 500 tokens. Use this for a result the model + should communicate; use session.thinking.append for silent context. Required.""" @overload def __init__( self, *, - vector_store_id: str, - description: Optional[str] = None, - tags: Optional[dict[str, str]] = None, + delegation_id: str, + content: str, + event_id: Optional[str] = None, ) -> None: ... @overload @@ -13645,41 +13564,31 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = IndexType.MANAGED_AZURE_SEARCH # type: ignore + self.type = LiveClientEventType.SESSION_COMMENTARY_APPEND # type: ignore -class MCPListToolsTool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """MCP list tools tool. +class LiveClientEventLiveDecisionCreateParam( + LiveClientEvent, discriminator="decision.create" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Evaluate the configured questions using the current conversation and Decision inputs. Reusing + an event_id is rejected for the lifetime of the session. - :ivar name: The name of the tool. Required. - :vartype name: str - :ivar description: - :vartype description: str - :ivar input_schema: The JSON schema describing the tool's input. Required. - :vartype input_schema: ~azure.ai.projects.models.MCPListToolsToolInputSchema - :ivar annotations: - :vartype annotations: ~azure.ai.projects.models.MCPListToolsToolAnnotations + :ivar event_id: Required. + :vartype event_id: str + :ivar type: Required. DECISION_CREATE. + :vartype type: str or ~azure.ai.projects.models.DECISION_CREATE """ - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the tool. Required.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - input_schema: "_models.MCPListToolsToolInputSchema" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The JSON schema describing the tool's input. Required.""" - annotations: Optional["_models.MCPListToolsToolAnnotations"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + type: Literal[LiveClientEventType.DECISION_CREATE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. DECISION_CREATE.""" @overload def __init__( self, *, - name: str, - input_schema: "_models.MCPListToolsToolInputSchema", - description: Optional[str] = None, - annotations: Optional["_models.MCPListToolsToolAnnotations"] = None, + event_id: str, ) -> None: ... @overload @@ -13691,172 +13600,75 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = LiveClientEventType.DECISION_CREATE # type: ignore -class MCPListToolsToolAnnotations(_Model): - """MCPListToolsToolAnnotations.""" - +class LiveClientEventLiveDecisionItemCreateParam( + LiveClientEvent, discriminator="decision.item.create" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Append an input item for future decisions without starting an evaluation or changing Live voice + context. -class MCPListToolsToolInputSchema(_Model): - """MCPListToolsToolInputSchema.""" + :ivar event_id: + :vartype event_id: str + :ivar type: Required. DECISION_ITEM_CREATE. + :vartype type: str or ~azure.ai.projects.models.DECISION_ITEM_CREATE + :ivar item: Required. + :vartype item: ~azure.ai.projects.models.LiveDecisionInputItemParam + """ + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[LiveClientEventType.DECISION_ITEM_CREATE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. DECISION_ITEM_CREATE.""" + item: "_models.LiveDecisionInputItemParam" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" -class McpProtocolConfiguration(_Model): - """Configuration specific to the MCP protocol.""" + @overload + def __init__( + self, + *, + item: "_models.LiveDecisionInputItemParam", + event_id: Optional[str] = None, + ) -> None: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ -class MCPTool(Tool, discriminator="mcp"): # pylint: disable=docstring-keyword-should-match-keyword-only - """MCP tool. + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = LiveClientEventType.DECISION_ITEM_CREATE # type: ignore - :ivar type: The type of the MCP tool. Always ``mcp``. Required. MCP. - :vartype type: str or ~azure.ai.projects.models.MCP - :ivar server_label: A label for this MCP server, used to identify it in tool calls. Required. - :vartype server_label: str - :ivar server_url: The URL for the MCP server. One of ``server_url``, ``connector_id``, or - ``tunnel_id`` must be provided. - :vartype server_url: str - :ivar connector_id: Identifier for service connectors, like those available in ChatGPT. One of - ``server_url``, ``connector_id``, or ``tunnel_id`` must be provided. Learn more about service - connectors `here `_. Currently supported - ``connector_id`` values are: - * Dropbox: `connector_dropbox` - * Gmail: `connector_gmail` - * Google Calendar: `connector_googlecalendar` - * Google Drive: `connector_googledrive` - * Microsoft Teams: `connector_microsoftteams` - * Outlook Calendar: `connector_outlookcalendar` - * Outlook Email: `connector_outlookemail` - * SharePoint: `connector_sharepoint`. Is one of the following types: - Literal["connector_dropbox"], Literal["connector_gmail"], Literal["connector_googlecalendar"], - Literal["connector_googledrive"], Literal["connector_microsoftteams"], - Literal["connector_outlookcalendar"], Literal["connector_outlookemail"], - Literal["connector_sharepoint"] +class LiveClientEventLiveDecisionItemDeleteParam( + LiveClientEvent, discriminator="decision.item.delete" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Delete an input item from future decisions without starting an evaluation or changing Live + voice context. - :vartype connector_id: str or str or str or str or str or str or str or str - :ivar tunnel_id: The Secure MCP Tunnel ID to use instead of a direct server URL. One of - ``server_url``, ``connector_id``, or ``tunnel_id`` must be provided. - :vartype tunnel_id: str - :ivar authorization: An OAuth access token that can be used with a remote MCP server, either - with a custom MCP server URL or a service connector. Your application must handle the OAuth - authorization flow and provide the token here. - :vartype authorization: str - :ivar server_description: Optional description of the MCP server, used to provide more context. - :vartype server_description: str - :ivar headers: - :vartype headers: dict[str, str] - :ivar allowed_tools: Is either a [str] type or a MCPToolFilter type. - :vartype allowed_tools: list[str] or ~azure.ai.projects.models.MCPToolFilter - :ivar allowed_callers: - :vartype allowed_callers: list[str or ~azure.ai.projects.models.CallableToolAllowedCaller] - :ivar require_approval: Is one of the following types: MCPToolRequireApproval, - Literal["always"], Literal["never"] - :vartype require_approval: ~azure.ai.projects.models.MCPToolRequireApproval or str or str - :ivar defer_loading: Whether this MCP tool is deferred and discovered via tool search. - :vartype defer_loading: bool - :ivar project_connection_id: The connection ID in the project for the MCP server. The - connection stores authentication and other connection details needed to connect to the MCP - server. - :vartype project_connection_id: str - :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future - version. - :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] + :ivar event_id: + :vartype event_id: str + :ivar type: Required. DECISION_ITEM_DELETE. + :vartype type: str or ~azure.ai.projects.models.DECISION_ITEM_DELETE + :ivar item_id: Required. + :vartype item_id: str """ - type: Literal[ToolType.MCP] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the MCP tool. Always ``mcp``. Required. MCP.""" - server_label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A label for this MCP server, used to identify it in tool calls. Required.""" - server_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The URL for the MCP server. One of ``server_url``, ``connector_id``, or ``tunnel_id`` must be - provided.""" - connector_id: Optional[ - Literal[ - "connector_dropbox", - "connector_gmail", - "connector_googlecalendar", - "connector_googledrive", - "connector_microsoftteams", - "connector_outlookcalendar", - "connector_outlookemail", - "connector_sharepoint", - ] - ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Identifier for service connectors, like those available in ChatGPT. One of ``server_url``, - ``connector_id``, or ``tunnel_id`` must be provided. Learn more about service connectors `here - `_. Currently supported ``connector_id`` values are: - - * Dropbox: `connector_dropbox` - * Gmail: `connector_gmail` - * Google Calendar: `connector_googlecalendar` - * Google Drive: `connector_googledrive` - * Microsoft Teams: `connector_microsoftteams` - * Outlook Calendar: `connector_outlookcalendar` - * Outlook Email: `connector_outlookemail` - * SharePoint: `connector_sharepoint`. Is one of the following types: - Literal[\"connector_dropbox\"], Literal[\"connector_gmail\"], - Literal[\"connector_googlecalendar\"], Literal[\"connector_googledrive\"], - Literal[\"connector_microsoftteams\"], Literal[\"connector_outlookcalendar\"], - Literal[\"connector_outlookemail\"], Literal[\"connector_sharepoint\"]""" - tunnel_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The Secure MCP Tunnel ID to use instead of a direct server URL. One of ``server_url``, - ``connector_id``, or ``tunnel_id`` must be provided.""" - authorization: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """An OAuth access token that can be used with a remote MCP server, either with a custom MCP - server URL or a service connector. Your application must handle the OAuth authorization flow - and provide the token here.""" - server_description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional description of the MCP server, used to provide more context.""" - headers: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - allowed_tools: Optional[Union[list[str], "_models.MCPToolFilter"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Is either a [str] type or a MCPToolFilter type.""" - allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - require_approval: Optional[Union["_models.MCPToolRequireApproval", Literal["always"], Literal["never"]]] = ( - rest_field(visibility=["read", "create", "update", "delete", "query"]) - ) - """Is one of the following types: MCPToolRequireApproval, Literal[\"always\"], Literal[\"never\"]""" - defer_loading: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether this MCP tool is deferred and discovered via tool search.""" - project_connection_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The connection ID in the project for the MCP server. The connection stores authentication and - other connection details needed to connect to the MCP server.""" - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Deprecated. This property is deprecated and will be removed in a future version.""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[LiveClientEventType.DECISION_ITEM_DELETE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. DECISION_ITEM_DELETE.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - server_label: str, - server_url: Optional[str] = None, - connector_id: Optional[ - Literal[ - "connector_dropbox", - "connector_gmail", - "connector_googlecalendar", - "connector_googledrive", - "connector_microsoftteams", - "connector_outlookcalendar", - "connector_outlookemail", - "connector_sharepoint", - ] - ] = None, - tunnel_id: Optional[str] = None, - authorization: Optional[str] = None, - server_description: Optional[str] = None, - headers: Optional[dict[str, str]] = None, - allowed_tools: Optional[Union[list[str], "_models.MCPToolFilter"]] = None, - allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = None, - require_approval: Optional[Union["_models.MCPToolRequireApproval", Literal["always"], Literal["never"]]] = None, - defer_loading: Optional[bool] = None, - project_connection_id: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + item_id: str, + event_id: Optional[str] = None, ) -> None: ... @overload @@ -13868,164 +13680,43 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.MCP # type: ignore - - -class MCPToolboxTool(ToolboxTool, discriminator="mcp"): # pylint: disable=docstring-keyword-should-match-keyword-only - """An MCP tool stored in a toolbox. + self.type = LiveClientEventType.DECISION_ITEM_DELETE # type: ignore - :ivar name: Optional user-defined name for this tool or configuration. - :vartype name: str - :ivar description: Optional user-defined description for this tool or configuration. - :vartype description: str - :ivar tool_configs: Per-tool configuration map. Keys are tool names or ``*`` (catch-all - default). Resolution order: exact tool name match takes priority over ``*``. Unknown tool names - are silently ignored at runtime. - :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] - :ivar type: Required. MCP. - :vartype type: str or ~azure.ai.projects.models.MCP - :ivar server_label: A label for this MCP server, used to identify it in tool calls. Required. - :vartype server_label: str - :ivar server_url: The URL for the MCP server. One of ``server_url``, ``connector_id``, or - ``tunnel_id`` must be provided. - :vartype server_url: str - :ivar connector_id: Identifier for service connectors, like those available in ChatGPT. One of - ``server_url``, ``connector_id``, or ``tunnel_id`` must be provided. Learn more about service - connectors `here `_. Currently supported - ``connector_id`` values are: - * Dropbox: `connector_dropbox` - * Gmail: `connector_gmail` - * Google Calendar: `connector_googlecalendar` - * Google Drive: `connector_googledrive` - * Microsoft Teams: `connector_microsoftteams` - * Outlook Calendar: `connector_outlookcalendar` - * Outlook Email: `connector_outlookemail` - * SharePoint: `connector_sharepoint`. Is one of the following types: - Literal["connector_dropbox"], Literal["connector_gmail"], Literal["connector_googlecalendar"], - Literal["connector_googledrive"], Literal["connector_microsoftteams"], - Literal["connector_outlookcalendar"], Literal["connector_outlookemail"], - Literal["connector_sharepoint"] +class LiveClientEventLiveInputAudioAppendEvent( + LiveClientEvent, discriminator="session.input_audio.append" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Send audio to a Live session over its primary WebSocket. WebRTC and SIP sessions send audio + over their media transport. - :vartype connector_id: str or str or str or str or str or str or str or str - :ivar tunnel_id: The Secure MCP Tunnel ID to use instead of a direct server URL. One of - ``server_url``, ``connector_id``, or ``tunnel_id`` must be provided. - :vartype tunnel_id: str - :ivar authorization: An OAuth access token that can be used with a remote MCP server, either - with a custom MCP server URL or a service connector. Your application must handle the OAuth - authorization flow and provide the token here. - :vartype authorization: str - :ivar server_description: Optional description of the MCP server, used to provide more context. - :vartype server_description: str - :ivar headers: - :vartype headers: dict[str, str] - :ivar allowed_tools: Is either a [str] type or a MCPToolFilter type. - :vartype allowed_tools: list[str] or ~azure.ai.projects.models.MCPToolFilter - :ivar allowed_callers: - :vartype allowed_callers: list[str or ~azure.ai.projects.models.CallableToolAllowedCaller] - :ivar require_approval: Is one of the following types: MCPToolRequireApproval, - Literal["always"], Literal["never"] - :vartype require_approval: ~azure.ai.projects.models.MCPToolRequireApproval or str or str - :ivar defer_loading: Whether this MCP tool is deferred and discovered via tool search. - :vartype defer_loading: bool - :ivar project_connection_id: The connection ID in the project for the MCP server. The - connection stores authentication and other connection details needed to connect to the MCP - server. - :vartype project_connection_id: str + :ivar event_id: + :vartype event_id: str + :ivar type: The Live client event type. Always ``session.input_audio.append``. Required. + SESSION_INPUT_AUDIO_APPEND. + :vartype type: str or ~azure.ai.projects.models.SESSION_INPUT_AUDIO_APPEND + :ivar audio: Base64-encoded raw audio in the startup-selected format, without a WAV or other + container header. Primary WebSocket only; media transports use their audio track. Audio appends + have no acknowledgment. Reflected sideband server events reuse this event type and audio key, + with no timestamps or event_id; their audio is always mono PCM16LE at 24 kHz. Required. + :vartype audio: str """ - type: Literal[ToolboxToolType.MCP] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. MCP.""" - server_label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A label for this MCP server, used to identify it in tool calls. Required.""" - server_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The URL for the MCP server. One of ``server_url``, ``connector_id``, or ``tunnel_id`` must be - provided.""" - connector_id: Optional[ - Literal[ - "connector_dropbox", - "connector_gmail", - "connector_googlecalendar", - "connector_googledrive", - "connector_microsoftteams", - "connector_outlookcalendar", - "connector_outlookemail", - "connector_sharepoint", - ] - ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Identifier for service connectors, like those available in ChatGPT. One of ``server_url``, - ``connector_id``, or ``tunnel_id`` must be provided. Learn more about service connectors `here - `_. Currently supported ``connector_id`` values are: - - * Dropbox: `connector_dropbox` - * Gmail: `connector_gmail` - * Google Calendar: `connector_googlecalendar` - * Google Drive: `connector_googledrive` - * Microsoft Teams: `connector_microsoftteams` - * Outlook Calendar: `connector_outlookcalendar` - * Outlook Email: `connector_outlookemail` - * SharePoint: `connector_sharepoint`. Is one of the following types: - Literal[\"connector_dropbox\"], Literal[\"connector_gmail\"], - Literal[\"connector_googlecalendar\"], Literal[\"connector_googledrive\"], - Literal[\"connector_microsoftteams\"], Literal[\"connector_outlookcalendar\"], - Literal[\"connector_outlookemail\"], Literal[\"connector_sharepoint\"]""" - tunnel_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The Secure MCP Tunnel ID to use instead of a direct server URL. One of ``server_url``, - ``connector_id``, or ``tunnel_id`` must be provided.""" - authorization: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """An OAuth access token that can be used with a remote MCP server, either with a custom MCP - server URL or a service connector. Your application must handle the OAuth authorization flow - and provide the token here.""" - server_description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional description of the MCP server, used to provide more context.""" - headers: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - allowed_tools: Optional[Union[list[str], "_models.MCPToolFilter"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Is either a [str] type or a MCPToolFilter type.""" - allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - require_approval: Optional[Union["_models.MCPToolRequireApproval", Literal["always"], Literal["never"]]] = ( - rest_field(visibility=["read", "create", "update", "delete", "query"]) - ) - """Is one of the following types: MCPToolRequireApproval, Literal[\"always\"], Literal[\"never\"]""" - defer_loading: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether this MCP tool is deferred and discovered via tool search.""" - project_connection_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The connection ID in the project for the MCP server. The connection stores authentication and - other connection details needed to connect to the MCP server.""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[LiveClientEventType.SESSION_INPUT_AUDIO_APPEND] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The Live client event type. Always ``session.input_audio.append``. Required. + SESSION_INPUT_AUDIO_APPEND.""" + audio: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Base64-encoded raw audio in the startup-selected format, without a WAV or other container + header. Primary WebSocket only; media transports use their audio track. Audio appends have no + acknowledgment. Reflected sideband server events reuse this event type and audio key, with no + timestamps or event_id; their audio is always mono PCM16LE at 24 kHz. Required.""" @overload def __init__( self, *, - server_label: str, - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, - server_url: Optional[str] = None, - connector_id: Optional[ - Literal[ - "connector_dropbox", - "connector_gmail", - "connector_googlecalendar", - "connector_googledrive", - "connector_microsoftteams", - "connector_outlookcalendar", - "connector_outlookemail", - "connector_sharepoint", - ] - ] = None, - tunnel_id: Optional[str] = None, - authorization: Optional[str] = None, - server_description: Optional[str] = None, - headers: Optional[dict[str, str]] = None, - allowed_tools: Optional[Union[list[str], "_models.MCPToolFilter"]] = None, - allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = None, - require_approval: Optional[Union["_models.MCPToolRequireApproval", Literal["always"], Literal["never"]]] = None, - defer_loading: Optional[bool] = None, - project_connection_id: Optional[str] = None, + audio: str, + event_id: Optional[str] = None, ) -> None: ... @overload @@ -14037,35 +13728,32 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolboxToolType.MCP # type: ignore + self.type = LiveClientEventType.SESSION_INPUT_AUDIO_APPEND # type: ignore -class MCPToolFilter(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """MCP tool filter. +class LiveClientEventLiveInputAudioMuteParam( + LiveClientEvent, discriminator="session.input_audio.mute" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Mute audio input to the Live model without closing the session. The server acknowledges with + ``session.input_audio.muted``. - :ivar tool_names: MCP allowed tools. - :vartype tool_names: list[str] - :ivar read_only: Indicates whether or not a tool modifies data or is read-only. If an MCP - server is `annotated with `readOnlyHint` - `_, - it will match this filter. - :vartype read_only: bool + :ivar event_id: + :vartype event_id: str + :ivar type: The Live client event type. Always ``session.input_audio.mute``. Required. + SESSION_INPUT_AUDIO_MUTE. + :vartype type: str or ~azure.ai.projects.models.SESSION_INPUT_AUDIO_MUTE """ - tool_names: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """MCP allowed tools.""" - read_only: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Indicates whether or not a tool modifies data or is read-only. If an MCP server is `annotated - with `readOnlyHint` - `_, - it will match this filter.""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[LiveClientEventType.SESSION_INPUT_AUDIO_MUTE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The Live client event type. Always ``session.input_audio.mute``. Required. + SESSION_INPUT_AUDIO_MUTE.""" @overload def __init__( self, *, - tool_names: Optional[list[str]] = None, - read_only: Optional[bool] = None, + event_id: Optional[str] = None, ) -> None: ... @overload @@ -14077,26 +13765,33 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = LiveClientEventType.SESSION_INPUT_AUDIO_MUTE # type: ignore -class MCPToolRequireApproval(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """MCPToolRequireApproval. +class LiveClientEventLiveInputAudioUnmuteParam( + LiveClientEvent, discriminator="session.input_audio.unmute" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Resume audio input to a Live model after muting it. The server acknowledges with + ``session.input_audio.unmuted``. An active audio fixture still pauses inference until playback + finishes. - :ivar always: - :vartype always: ~azure.ai.projects.models.MCPToolFilter - :ivar never: - :vartype never: ~azure.ai.projects.models.MCPToolFilter + :ivar event_id: + :vartype event_id: str + :ivar type: The Live client event type. Always ``session.input_audio.unmute``. Required. + SESSION_INPUT_AUDIO_UNMUTE. + :vartype type: str or ~azure.ai.projects.models.SESSION_INPUT_AUDIO_UNMUTE """ - always: Optional["_models.MCPToolFilter"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - never: Optional["_models.MCPToolFilter"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[LiveClientEventType.SESSION_INPUT_AUDIO_UNMUTE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The Live client event type. Always ``session.input_audio.unmute``. Required. + SESSION_INPUT_AUDIO_UNMUTE.""" @overload def __init__( self, *, - always: Optional["_models.MCPToolFilter"] = None, - never: Optional["_models.MCPToolFilter"] = None, + event_id: Optional[str] = None, ) -> None: ... @overload @@ -14108,32 +13803,47 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = LiveClientEventType.SESSION_INPUT_AUDIO_UNMUTE # type: ignore -class MemoryOperation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Represents a single memory operation (create, update, or delete) performed on a memory item. +class LiveClientEventLiveInstructionsAppendParam( + LiveClientEvent, discriminator="session.instructions.append" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Append developer instructions to the Live conversation while it is running, optionally + associating them with an existing client delegation. Rejected while an audio fixture is active. + These instructions remain in conversation history through compaction and are included in future + backend delegations. For external audio, describe content already delivered so the assistant + does not repeat it. - :ivar kind: The type of memory operation being performed. Required. Known values are: "create", - "update", and "delete". - :vartype kind: str or ~azure.ai.projects.models.MemoryOperationKind - :ivar memory_item: The memory item to create, update, or delete. Required. - :vartype memory_item: ~azure.ai.projects.models.MemoryItem + :ivar event_id: + :vartype event_id: str + :ivar type: The Live client event type. Always ``session.instructions.append``. Required. + SESSION_INSTRUCTIONS_APPEND. + :vartype type: str or ~azure.ai.projects.models.SESSION_INSTRUCTIONS_APPEND + :ivar delegation_id: Required. + :vartype delegation_id: str + :ivar content: Instruction text to append, limited to 500 tokens. This is a plain string, not + an array of content parts. Required. + :vartype content: str """ - kind: Union[str, "_models.MemoryOperationKind"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The type of memory operation being performed. Required. Known values are: \"create\", - \"update\", and \"delete\".""" - memory_item: "_models.MemoryItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The memory item to create, update, or delete. Required.""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[LiveClientEventType.SESSION_INSTRUCTIONS_APPEND] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The Live client event type. Always ``session.instructions.append``. Required. + SESSION_INSTRUCTIONS_APPEND.""" + delegation_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + content: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Instruction text to append, limited to 500 tokens. This is a plain string, not an array of + content parts. Required.""" @overload def __init__( self, *, - kind: Union[str, "_models.MemoryOperationKind"], - memory_item: "_models.MemoryItem", + delegation_id: str, + content: str, + event_id: Optional[str] = None, ) -> None: ... @overload @@ -14145,23 +13855,42 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = LiveClientEventType.SESSION_INSTRUCTIONS_APPEND # type: ignore -class MemorySearchItem(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A retrieved memory item from memory search. +class LiveClientEventLiveOutputAudioFixturePlayParam( + LiveClientEvent, discriminator="session.output_audio.fixture.play" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Play one complete audio fixture through the session output. Send this event over the primary + WebSocket or a server sideband. Audio must be raw mono PCM16 little-endian at 24 kHz, + regardless of the session audio format, and at most 30 seconds. The entire payload is validated + before model speech is interrupted and input is muted. Only one fixture can be active. + fixture.playing acknowledges acceptance and fixture.played reports server mixer drain. These + notifications are not exact transport-media boundaries. Input arriving during playback is + dropped and not replayed. - :ivar memory_item: Retrieved memory item. Required. - :vartype memory_item: ~azure.ai.projects.models.MemoryItem + :ivar event_id: + :vartype event_id: str + :ivar type: Required. SESSION_OUTPUT_AUDIO_FIXTURE_PLAY. + :vartype type: str or ~azure.ai.projects.models.SESSION_OUTPUT_AUDIO_FIXTURE_PLAY + :ivar audio: Base64-encoded raw mono PCM16 audio, little-endian, at 24 kHz. Do not include a + WAV or other container header. Required. + :vartype audio: str """ - memory_item: "_models.MemoryItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Retrieved memory item. Required.""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[LiveClientEventType.SESSION_OUTPUT_AUDIO_FIXTURE_PLAY] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. SESSION_OUTPUT_AUDIO_FIXTURE_PLAY.""" + audio: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Base64-encoded raw mono PCM16 audio, little-endian, at 24 kHz. Do not include a WAV or other + container header. Required.""" @overload def __init__( self, *, - memory_item: "_models.MemoryItem", + audio: str, + event_id: Optional[str] = None, ) -> None: ... @overload @@ -14173,23 +13902,30 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = LiveClientEventType.SESSION_OUTPUT_AUDIO_FIXTURE_PLAY # type: ignore -class MemorySearchOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Memory search options. +class LiveClientEventLiveResponseCreateParam( + LiveClientEvent, discriminator="response.create" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Request a response from the Live session’s Responses backend, or continue a delegated response + waiting for tool results. Requires Responses delegation. - :ivar max_memories: Maximum number of memory items to return. - :vartype max_memories: int + :ivar event_id: + :vartype event_id: str + :ivar type: The Live client event type. Always ``response.create``. Required. RESPONSE_CREATE. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_CREATE """ - max_memories: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Maximum number of memory items to return.""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[LiveClientEventType.RESPONSE_CREATE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The Live client event type. Always ``response.create``. Required. RESPONSE_CREATE.""" @overload def __init__( self, *, - max_memories: Optional[int] = None, + event_id: Optional[str] = None, ) -> None: ... @overload @@ -14201,52 +13937,38 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = LiveClientEventType.RESPONSE_CREATE # type: ignore -class MemorySearchPreviewTool( - Tool, discriminator="memory_search_preview" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A tool for integrating memories into the agent. +class LiveClientEventLiveResponseItemCreateParam( + LiveClientEvent, discriminator="response.item.create" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Add an input item to the Live session’s Responses backend. Requires Responses delegation; use + ``response.create`` to request a response. - :ivar type: The type of the tool. Always ``memory_search_preview``. Required. - MEMORY_SEARCH_PREVIEW. - :vartype type: str or ~azure.ai.projects.models.MEMORY_SEARCH_PREVIEW - :ivar memory_store_name: The name of the memory store to use. Required. - :vartype memory_store_name: str - :ivar scope: The namespace used to group and isolate memories, such as a user ID. Limits which - memories can be retrieved or updated. Use special variable ``{{$userId}}`` to scope memories to - the current signed-in user. Required. - :vartype scope: str - :ivar search_options: Options for searching the memory store. - :vartype search_options: ~azure.ai.projects.models.MemorySearchOptions - :ivar update_delay: Time to wait before updating memories after inactivity (seconds). Default - 300. - :vartype update_delay: int + :ivar event_id: + :vartype event_id: str + :ivar type: The Live client event type. Always ``response.item.create``. Required. + RESPONSE_ITEM_CREATE. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_ITEM_CREATE + :ivar item: An input item to append to the Responses backend conversation, such as a user + message or a function tool result. Required. + :vartype item: dict[str, any] """ - type: Literal[ToolType.MEMORY_SEARCH_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the tool. Always ``memory_search_preview``. Required. MEMORY_SEARCH_PREVIEW.""" - memory_store_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the memory store to use. Required.""" - scope: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The namespace used to group and isolate memories, such as a user ID. Limits which memories can - be retrieved or updated. Use special variable ``{{$userId}}`` to scope memories to the current - signed-in user. Required.""" - search_options: Optional["_models.MemorySearchOptions"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Options for searching the memory store.""" - update_delay: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Time to wait before updating memories after inactivity (seconds). Default 300.""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[LiveClientEventType.RESPONSE_ITEM_CREATE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The Live client event type. Always ``response.item.create``. Required. RESPONSE_ITEM_CREATE.""" + item: dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An input item to append to the Responses backend conversation, such as a user message or a + function tool result. Required.""" @overload def __init__( self, *, - memory_store_name: str, - scope: str, - search_options: Optional["_models.MemorySearchOptions"] = None, - update_delay: Optional[int] = None, + item: dict[str, Any], + event_id: Optional[str] = None, ) -> None: ... @overload @@ -14258,28 +13980,30 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.MEMORY_SEARCH_PREVIEW # type: ignore - + self.type = LiveClientEventType.RESPONSE_ITEM_CREATE # type: ignore -class MemoryStoreDefinition(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Base definition for memory store configurations. - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - MemoryStoreDefaultDefinition +class LiveClientEventLiveSessionCloseParam( + LiveClientEvent, discriminator="session.close" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Request that the Live session close. The terminal ``session.closed`` event contains the close + reason and final usage. - :ivar kind: The kind of the memory store. Required. "default" - :vartype kind: str or ~azure.ai.projects.models.MemoryStoreKind + :ivar event_id: + :vartype event_id: str + :ivar type: The Live client event type. Always ``session.close``. Required. SESSION_CLOSE. + :vartype type: str or ~azure.ai.projects.models.SESSION_CLOSE """ - __mapping__: dict[str, _Model] = {} - kind: str = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) - """The kind of the memory store. Required. \"default\"""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[LiveClientEventType.SESSION_CLOSE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The Live client event type. Always ``session.close``. Required. SESSION_CLOSE.""" @overload def __init__( self, *, - kind: str, + event_id: Optional[str] = None, ) -> None: ... @overload @@ -14291,42 +14015,39 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = LiveClientEventType.SESSION_CLOSE # type: ignore -class MemoryStoreDefaultDefinition( - MemoryStoreDefinition, discriminator="default" +class LiveClientEventLiveSessionUpdateParam( + LiveClientEvent, discriminator="session.update" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Default memory store implementation. + """Update the delegation settings or transcript triggers of an active Live session. The server + acknowledges accepted changes with ``session.updated``. - :ivar kind: The kind of the memory store. Required. The default memory store implementation. - :vartype kind: str or ~azure.ai.projects.models.DEFAULT - :ivar chat_model: The name or identifier of the chat completion model deployment used for - memory processing. Required. - :vartype chat_model: str - :ivar embedding_model: The name or identifier of the embedding model deployment used for memory - processing. Required. - :vartype embedding_model: str - :ivar options: Default memory store options. - :vartype options: ~azure.ai.projects.models.MemoryStoreDefaultOptions + :ivar event_id: + :vartype event_id: str + :ivar type: The Live client event type. Always ``session.update``. Required. SESSION_UPDATE. + :vartype type: str or ~azure.ai.projects.models.SESSION_UPDATE + :ivar session: Sparse delegation and trigger updates. Omitted settings retain their values. The + delegation type cannot change. Model, frontend instructions, audio, and startup input are + immutable. Required. + :vartype session: ~azure.ai.projects.models.LiveSessionUpdateParams """ - kind: Literal[MemoryStoreKind.DEFAULT] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The kind of the memory store. Required. The default memory store implementation.""" - chat_model: str = rest_field(visibility=["read", "create"]) - """The name or identifier of the chat completion model deployment used for memory processing. + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[LiveClientEventType.SESSION_UPDATE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The Live client event type. Always ``session.update``. Required. SESSION_UPDATE.""" + session: "_models.LiveSessionUpdateParams" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Sparse delegation and trigger updates. Omitted settings retain their values. The delegation + type cannot change. Model, frontend instructions, audio, and startup input are immutable. Required.""" - embedding_model: str = rest_field(visibility=["read", "create"]) - """The name or identifier of the embedding model deployment used for memory processing. Required.""" - options: Optional["_models.MemoryStoreDefaultOptions"] = rest_field(visibility=["read", "create"]) - """Default memory store options.""" @overload def __init__( self, *, - chat_model: str, - embedding_model: str, - options: Optional["_models.MemoryStoreDefaultOptions"] = None, + session: "_models.LiveSessionUpdateParams", + event_id: Optional[str] = None, ) -> None: ... @overload @@ -14338,53 +14059,45 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.kind = MemoryStoreKind.DEFAULT # type: ignore + self.type = LiveClientEventType.SESSION_UPDATE # type: ignore -class MemoryStoreDefaultOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Default memory store configurations. +class LiveClientEventLiveThinkingAppendParam( + LiveClientEvent, discriminator="session.thinking.append" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Provide silent reasoning or progress context to the Live model, optionally for an existing + client delegation. Rejected while an audio fixture is active. - :ivar user_profile_enabled: Whether to enable user profile extraction and storage. Default is - true. Required. - :vartype user_profile_enabled: bool - :ivar user_profile_details: Specific categories or types of user profile information to extract - and store. - :vartype user_profile_details: str - :ivar chat_summary_enabled: Whether to enable chat summary extraction and storage. Defaults to - ``true``. Required. - :vartype chat_summary_enabled: bool - :ivar procedural_memory_enabled: Whether to enable procedural memory extraction and storage. - The service defaults to ``true`` if a value is not specified by the caller. - :vartype procedural_memory_enabled: bool - :ivar default_ttl_seconds: The default time-to-live for memories in seconds. A value of ``0`` - indicates that memories do not expire. Defaults to ``0``. - :vartype default_ttl_seconds: ~datetime.timedelta + :ivar event_id: + :vartype event_id: str + :ivar type: The Live client event type. Always ``session.thinking.append``. Required. + SESSION_THINKING_APPEND. + :vartype type: str or ~azure.ai.projects.models.SESSION_THINKING_APPEND + :ivar delegation_id: Required. + :vartype delegation_id: str + :ivar content: Silent reasoning or progress context, limited to 500 tokens. It does not + directly request speech, but can influence later speech and is not a secrecy boundary. + Required. + :vartype content: str """ - user_profile_enabled: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether to enable user profile extraction and storage. Default is true. Required.""" - user_profile_details: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Specific categories or types of user profile information to extract and store.""" - chat_summary_enabled: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether to enable chat summary extraction and storage. Defaults to ``true``. Required.""" - procedural_memory_enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether to enable procedural memory extraction and storage. The service defaults to ``true`` if - a value is not specified by the caller.""" - default_ttl_seconds: Optional[datetime.timedelta] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="duration-seconds-int" - ) - """The default time-to-live for memories in seconds. A value of ``0`` indicates that memories do - not expire. Defaults to ``0``.""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[LiveClientEventType.SESSION_THINKING_APPEND] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The Live client event type. Always ``session.thinking.append``. Required. + SESSION_THINKING_APPEND.""" + delegation_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + content: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Silent reasoning or progress context, limited to 500 tokens. It does not directly request + speech, but can influence later speech and is not a secrecy boundary. Required.""" @overload def __init__( self, *, - user_profile_enabled: bool, - chat_summary_enabled: bool, - user_profile_details: Optional[str] = None, - procedural_memory_enabled: Optional[bool] = None, - default_ttl_seconds: Optional[datetime.timedelta] = None, + delegation_id: str, + content: str, + event_id: Optional[str] = None, ) -> None: ... @overload @@ -14396,41 +14109,76 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = LiveClientEventType.SESSION_THINKING_APPEND # type: ignore -class MemoryStoreDeleteScopeResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Response for deleting memories from a scope. +class LiveCodeInterpreterToolInputParam(_Model): # pylint: disable=docstring-missing-param + """LiveCodeInterpreterToolInputParam. - :ivar object: The object type. Always 'memory_store.scope.deleted'. Required. - MEMORY_STORE_SCOPE_DELETED. - :vartype object: str or ~azure.ai.projects.models.MEMORY_STORE_SCOPE_DELETED - :ivar name: The name of the memory store. Required. - :vartype name: str - :ivar scope: The scope from which memories were deleted. Required. - :vartype scope: str - :ivar deleted: Whether the deletion operation was successful. Required. - :vartype deleted: bool + :ivar type: Required. Default value is "code_interpreter". + :vartype type: str """ - object: Literal[MemoryStoreObjectType.MEMORY_STORE_SCOPE_DELETED] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The object type. Always 'memory_store.scope.deleted'. Required. MEMORY_STORE_SCOPE_DELETED.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the memory store. Required.""" - scope: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The scope from which memories were deleted. Required.""" - deleted: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether the deletion operation was successful. Required.""" + type: Literal["code_interpreter"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"code_interpreter\".""" + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type: Literal["code_interpreter"] = "code_interpreter" + + +class LiveComputerToolInputParam(_Model): # pylint: disable=docstring-missing-param + """LiveComputerToolInputParam. + + :ivar type: Required. Default value is "computer". + :vartype type: str + """ + + type: Literal["computer"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"computer\".""" + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type: Literal["computer"] = "computer" + + +class LiveContainerNetworkPolicyDisabledParam(_Model): # pylint: disable=docstring-missing-param + """LiveContainerNetworkPolicyDisabledParam. + + :ivar type: Disable outbound network access. Always ``disabled``. Required. Default value is + "disabled". + :vartype type: str + """ + + type: Literal["disabled"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Disable outbound network access. Always ``disabled``. Required. Default value is \"disabled\".""" + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type: Literal["disabled"] = "disabled" + + +class LiveContainerReferenceParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """LiveContainerReferenceParam. + + :ivar type: References a container created with the /v1/containers endpoint. Required. Default + value is "container_reference". + :vartype type: str + :ivar container_id: The ID of the referenced container. Required. + :vartype container_id: str + """ + + type: Literal["container_reference"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """References a container created with the /v1/containers endpoint. Required. Default value is + \"container_reference\".""" + container_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the referenced container. Required.""" @overload def __init__( self, *, - object: Literal[MemoryStoreObjectType.MEMORY_STORE_SCOPE_DELETED], - name: str, - scope: str, - deleted: bool, + container_id: str, ) -> None: ... @overload @@ -14442,65 +14190,27 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["container_reference"] = "container_reference" -class MemoryStoreDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A memory store that can store and retrieve user memories. +class LiveContextWindowUsage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The latest measured context-window usage of the Live model. This is separate from billing usage + and delegated Responses token usage. - :ivar object: The object type, which is always 'memory_store'. Required. MEMORY_STORE. - :vartype object: str or ~azure.ai.projects.models.MEMORY_STORE - :ivar id: The unique identifier of the memory store. Required. - :vartype id: str - :ivar created_at: The Unix timestamp (seconds) when the memory store was created. Required. - :vartype created_at: ~datetime.datetime - :ivar updated_at: The Unix timestamp (seconds) when the memory store was last updated. - Required. - :vartype updated_at: ~datetime.datetime - :ivar name: The name of the memory store. Required. - :vartype name: str - :ivar description: A human-readable description of the memory store. - :vartype description: str - :ivar metadata: Arbitrary key-value metadata to associate with the memory store. - :vartype metadata: dict[str, str] - :ivar definition: The definition of the memory store. Required. - :vartype definition: ~azure.ai.projects.models.MemoryStoreDefinition + :ivar usage_ratio: The latest active context token count divided by the Live model context + limit. Can decrease after compaction and may lag between measured audio frames. Required. + :vartype usage_ratio: float """ - object: Literal[MemoryStoreObjectType.MEMORY_STORE] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The object type, which is always 'memory_store'. Required. MEMORY_STORE.""" - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique identifier of the memory store. Required.""" - created_at: datetime.datetime = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp (seconds) when the memory store was created. Required.""" - updated_at: datetime.datetime = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp (seconds) when the memory store was last updated. Required.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the memory store. Required.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A human-readable description of the memory store.""" - metadata: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Arbitrary key-value metadata to associate with the memory store.""" - definition: "_models.MemoryStoreDefinition" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The definition of the memory store. Required.""" + usage_ratio: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The latest active context token count divided by the Live model context limit. Can decrease + after compaction and may lag between measured audio frames. Required.""" @overload def __init__( self, *, - object: Literal[MemoryStoreObjectType.MEMORY_STORE], - id: str, # pylint: disable=redefined-builtin - created_at: datetime.datetime, - updated_at: datetime.datetime, - name: str, - definition: "_models.MemoryStoreDefinition", - description: Optional[str] = None, - metadata: Optional[dict[str, str]] = None, + usage_ratio: float, ) -> None: ... @overload @@ -14514,50 +14224,36 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MemoryStoreOperationUsage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Usage statistics of a memory store operation. +class LiveCustomToolInputParam(_Model): # pylint: disable=docstring-missing-param + """LiveCustomToolInputParam. - :ivar embedding_tokens: The number of embedding tokens. Required. - :vartype embedding_tokens: int - :ivar input_tokens: The number of input tokens. Required. - :vartype input_tokens: int - :ivar input_tokens_details: A detailed breakdown of the input tokens. Required. - :vartype input_tokens_details: ~azure.ai.projects.models.ResponseUsageInputTokensDetails - :ivar output_tokens: The number of output tokens. Required. - :vartype output_tokens: int - :ivar output_tokens_details: A detailed breakdown of the output tokens. Required. - :vartype output_tokens_details: ~azure.ai.projects.models.ResponseUsageOutputTokensDetails - :ivar total_tokens: The total number of tokens used. Required. - :vartype total_tokens: int + :ivar type: Required. Default value is "custom". + :vartype type: str """ - embedding_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The number of embedding tokens. Required.""" - input_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The number of input tokens. Required.""" - input_tokens_details: "_models.ResponseUsageInputTokensDetails" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """A detailed breakdown of the input tokens. Required.""" - output_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The number of output tokens. Required.""" - output_tokens_details: "_models.ResponseUsageOutputTokensDetails" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """A detailed breakdown of the output tokens. Required.""" - total_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The total number of tokens used. Required.""" + type: Literal["custom"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"custom\".""" + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type: Literal["custom"] = "custom" + + +class LiveCustomVoiceParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """LiveCustomVoiceParam. + + :ivar id: Required. + :vartype id: str + """ + + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - embedding_tokens: int, - input_tokens: int, - input_tokens_details: "_models.ResponseUsageInputTokensDetails", - output_tokens: int, - output_tokens_details: "_models.ResponseUsageOutputTokensDetails", - total_tokens: int, + id: str, # pylint: disable=redefined-builtin ) -> None: ... @overload @@ -14571,33 +14267,43 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MemoryStoreSearchResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Memory search response. +class LiveDataChannelConfigParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Control which Live events an untrusted WebRTC frontend can send and receive over its data + channel. These restrictions do not apply to trusted sideband connections. - :ivar search_id: The unique ID of this search request. Use this value as previous_search_id in - subsequent requests to perform incremental searches. Required. - :vartype search_id: str - :ivar memories: Related memory items found during the search operation. Required. - :vartype memories: list[~azure.ai.projects.models.MemorySearchItem] - :ivar usage: Usage statistics associated with the memory search operation. Required. - :vartype usage: ~azure.ai.projects.models.MemoryStoreOperationUsage + :ivar allowed_client_events: Client event types that the frontend data channel may send. Use + 'all' to allow every client event; an empty array allows none. Omission preserves the existing + allow-all behavior. Is either a Literal["all"] type or a [str] type. + :vartype allowed_client_events: str or list[str] + :ivar allowed_server_events: Server events that may be sent to the frontend data channel. Use + 'all' to allow every server event; an empty array allows none. Omission preserves the existing + allow-all behavior. Responses events use an object with type 'response.event' and a + response_event selector. Is either a Literal["all"] type or a [LiveAllowedServerEventParam] + type. + :vartype allowed_server_events: str or + list[~azure.ai.projects.models.LiveAllowedServerEventParam] """ - search_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of this search request. Use this value as previous_search_id in subsequent - requests to perform incremental searches. Required.""" - memories: list["_models.MemorySearchItem"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Related memory items found during the search operation. Required.""" - usage: "_models.MemoryStoreOperationUsage" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Usage statistics associated with the memory search operation. Required.""" + allowed_client_events: Optional[Union[Literal["all"], list[str]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Client event types that the frontend data channel may send. Use 'all' to allow every client + event; an empty array allows none. Omission preserves the existing allow-all behavior. Is + either a Literal[\"all\"] type or a [str] type.""" + allowed_server_events: Optional[Union[Literal["all"], list["_models.LiveAllowedServerEventParam"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Server events that may be sent to the frontend data channel. Use 'all' to allow every server + event; an empty array allows none. Omission preserves the existing allow-all behavior. + Responses events use an object with type 'response.event' and a response_event selector. Is + either a Literal[\"all\"] type or a [LiveAllowedServerEventParam] type.""" @overload def __init__( self, *, - search_id: str, - memories: list["_models.MemorySearchItem"], - usage: "_models.MemoryStoreOperationUsage", + allowed_client_events: Optional[Union[Literal["all"], list[str]]] = None, + allowed_server_events: Optional[Union[Literal["all"], list["_models.LiveAllowedServerEventParam"]]] = None, ) -> None: ... @overload @@ -14611,29 +14317,27 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MemoryStoreUpdateCompletedResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Memory update result. +class LiveDecisionCompleted(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """LiveDecisionCompleted. - :ivar memory_operations: A list of individual memory operations that were performed during the - update. Required. - :vartype memory_operations: list[~azure.ai.projects.models.MemoryOperation] - :ivar usage: Usage statistics associated with the memory update operation. Required. - :vartype usage: ~azure.ai.projects.models.MemoryStoreOperationUsage + :ivar type: Required. Default value is "decision.completed". + :vartype type: str + :ivar decision: The native Decision API response, including its model, ordered answers, and + token usage. Required. + :vartype decision: ~azure.ai.projects.models.DecisionResponse """ - memory_operations: list["_models.MemoryOperation"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """A list of individual memory operations that were performed during the update. Required.""" - usage: "_models.MemoryStoreOperationUsage" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Usage statistics associated with the memory update operation. Required.""" + type: Literal["decision.completed"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"decision.completed\".""" + decision: "_models.DecisionResponse" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The native Decision API response, including its model, ordered answers, and token usage. + Required.""" @overload def __init__( self, *, - memory_operations: list["_models.MemoryOperation"], - usage: "_models.MemoryStoreOperationUsage", + decision: "_models.DecisionResponse", ) -> None: ... @overload @@ -14645,53 +14349,36 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["decision.completed"] = "decision.completed" -class MemoryStoreUpdateResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Provides the status of a memory store update operation. +class LiveDecisionInputImageParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """LiveDecisionInputImageParam. - :ivar update_id: The unique ID of this update request. Use this value as previous_update_id in - subsequent requests to perform incremental updates. Required. - :vartype update_id: str - :ivar status: The status of the memory update operation. One of "queued", "in_progress", - "completed", "failed", or "superseded". Required. Known values are: "queued", "in_progress", - "completed", "failed", and "superseded". - :vartype status: str or ~azure.ai.projects.models.MemoryStoreUpdateStatus - :ivar superseded_by: The update_id the operation was superseded by when status is "superseded". - :vartype superseded_by: str - :ivar result: The result of memory store update operation when status is "completed". - :vartype result: ~azure.ai.projects.models.MemoryStoreUpdateCompletedResult - :ivar error: Error object that describes the error when status is "failed". - :vartype error: ~azure.ai.projects.models.ApiError + :ivar type: The type of the input item. Always ``input_image``. Required. Default value is + "input_image". + :vartype type: str + :ivar image_url: An inline image encoded as a data URL. Required. + :vartype image_url: str + :ivar detail: Known values are: "low", "high", "auto", and "original". + :vartype detail: str or ~azure.ai.projects.models.LiveDetailEnum """ - update_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of this update request. Use this value as previous_update_id in subsequent - requests to perform incremental updates. Required.""" - status: Union[str, "_models.MemoryStoreUpdateStatus"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The status of the memory update operation. One of \"queued\", \"in_progress\", \"completed\", - \"failed\", or \"superseded\". Required. Known values are: \"queued\", \"in_progress\", - \"completed\", \"failed\", and \"superseded\".""" - superseded_by: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The update_id the operation was superseded by when status is \"superseded\".""" - result: Optional["_models.MemoryStoreUpdateCompletedResult"] = rest_field( + type: Literal["input_image"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of the input item. Always ``input_image``. Required. Default value is \"input_image\".""" + image_url: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An inline image encoded as a data URL. Required.""" + detail: Optional[Union[str, "_models.LiveDetailEnum"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The result of memory store update operation when status is \"completed\".""" - error: Optional["_models.ApiError"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Error object that describes the error when status is \"failed\".""" + """Known values are: \"low\", \"high\", \"auto\", and \"original\".""" @overload def __init__( self, *, - update_id: str, - status: Union[str, "_models.MemoryStoreUpdateStatus"], - superseded_by: Optional[str] = None, - result: Optional["_models.MemoryStoreUpdateCompletedResult"] = None, - error: Optional["_models.ApiError"] = None, + image_url: str, + detail: Optional[Union[str, "_models.LiveDetailEnum"]] = None, ) -> None: ... @overload @@ -14703,39 +14390,42 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["input_image"] = "input_image" -class Metadata(_Model): - """Set of 16 key-value pairs that can be attached to an object. This can be useful for storing - additional information about the object in a structured format, and querying for objects via - API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are - strings with a maximum length of 512 characters. - - """ - - -class Microsoft365PermissionScopes(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A set of delegated permission scopes requested from a single resource application. +class LiveDecisionInputItemParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """LiveDecisionInputItemParam. - :ivar resource_app_id: Application id of the resource that exposes the requested delegated - scopes. Required. - :vartype resource_app_id: str - :ivar scopes: Delegated scope names requested from the resource application. Must not be empty. - Required. - :vartype scopes: list[str] + :ivar id: + :vartype id: str + :ivar type: Default value is "message". + :vartype type: str + :ivar role: The message role. Always ``user``. Required. Default value is "user". + :vartype role: str + :ivar content: Required. Is either a str type or a [Union["_models.LiveDecisionInputTextParam", + "_models.LiveDecisionInputImageParam"]] type. + :vartype content: str or list[~azure.ai.projects.models.LiveDecisionInputTextParam or + ~azure.ai.projects.models.LiveDecisionInputImageParam] """ - resource_app_id: str = rest_field(name="resourceAppId", visibility=["read", "create", "update", "delete", "query"]) - """Application id of the resource that exposes the requested delegated scopes. Required.""" - scopes: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Delegated scope names requested from the resource application. Must not be empty. Required.""" + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Optional[Literal["message"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Default value is \"message\".""" + role: Literal["user"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The message role. Always ``user``. Required. Default value is \"user\".""" + content: Union[str, list[Union["_models.LiveDecisionInputTextParam", "_models.LiveDecisionInputImageParam"]]] = ( + rest_field(visibility=["read", "create", "update", "delete", "query"]) + ) + """Required. Is either a str type or a [Union[\"_models.LiveDecisionInputTextParam\", + \"_models.LiveDecisionInputImageParam\"]] type.""" @overload def __init__( self, *, - resource_app_id: str, - scopes: list[str], + content: Union[str, list[Union["_models.LiveDecisionInputTextParam", "_models.LiveDecisionInputImageParam"]]], + id: Optional[str] = None, # pylint: disable=redefined-builtin + type: Optional[Literal["message"]] = None, ) -> None: ... @overload @@ -14747,125 +14437,29 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.role: Literal["user"] = "user" -class Microsoft365PublishDefaults(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Default and previously-published values used to pre-populate a Microsoft 365 publish request - for a Foundry agent. +class LiveDecisionInputTextParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """LiveDecisionInputTextParam. - :ivar app_publish_scope: The publish scope. Known values are: "Personal", "Shared", and - "Tenant". - :vartype app_publish_scope: str or ~azure.ai.projects.models.Microsoft365PublishScope - :ivar agent_name: The agent name. - :vartype agent_name: str - :ivar agent_display_name: The user-facing display name for the agent. Defaults to the agent - name if not previously overridden. - :vartype agent_display_name: str - :ivar app_registration_client_id: The app-registration client id associated with the agent. - :vartype app_registration_client_id: str - :ivar bot_service_arm_id: ARM resource id of the Azure Bot Service associated with the - previously-published app, if any. - :vartype bot_service_arm_id: str - :ivar app_version: The most recently published app version. - :vartype app_version: str - :ivar recommended_next_app_version: The recommended next app version (the most recent app - version, incremented). - :vartype recommended_next_app_version: str - :ivar title_id: The Microsoft 365 title id of the previously-published app, if any. - :vartype title_id: str - :ivar teams_app_id: The Microsoft Teams app id of the previously-published app, if any. - :vartype teams_app_id: str - :ivar short_description: Short, one-line description shown in the Teams app listing. - :vartype short_description: str - :ivar full_description: Full description shown on the Teams app details page. - :vartype full_description: str - :ivar developer_name: Display name of the developer / publisher. - :vartype developer_name: str - :ivar developer_website_url: Developer / publisher website URL. - :vartype developer_website_url: str - :ivar privacy_url: Privacy policy URL. - :vartype privacy_url: str - :ivar terms_of_use_url: Terms-of-use URL. - :vartype terms_of_use_url: str + :ivar type: The type of the input item. Always ``input_text``. Required. Default value is + "input_text". + :vartype type: str + :ivar text: The text input to the model. Required. + :vartype text: str """ - app_publish_scope: Optional[Union[str, "_models.Microsoft365PublishScope"]] = rest_field( - name="appPublishScope", visibility=["read", "create", "update", "delete", "query"] - ) - """The publish scope. Known values are: \"Personal\", \"Shared\", and \"Tenant\".""" - agent_name: Optional[str] = rest_field(name="agentName", visibility=["read", "create", "update", "delete", "query"]) - """The agent name.""" - agent_display_name: Optional[str] = rest_field( - name="agentDisplayName", visibility=["read", "create", "update", "delete", "query"] - ) - """The user-facing display name for the agent. Defaults to the agent name if not previously - overridden.""" - app_registration_client_id: Optional[str] = rest_field( - name="appRegistrationClientId", visibility=["read", "create", "update", "delete", "query"] - ) - """The app-registration client id associated with the agent.""" - bot_service_arm_id: Optional[str] = rest_field( - name="botServiceArmId", visibility=["read", "create", "update", "delete", "query"] - ) - """ARM resource id of the Azure Bot Service associated with the previously-published app, if any.""" - app_version: Optional[str] = rest_field( - name="appVersion", visibility=["read", "create", "update", "delete", "query"] - ) - """The most recently published app version.""" - recommended_next_app_version: Optional[str] = rest_field( - name="recommendedNextAppVersion", visibility=["read", "create", "update", "delete", "query"] - ) - """The recommended next app version (the most recent app version, incremented).""" - title_id: Optional[str] = rest_field(name="titleId", visibility=["read", "create", "update", "delete", "query"]) - """The Microsoft 365 title id of the previously-published app, if any.""" - teams_app_id: Optional[str] = rest_field( - name="teamsAppId", visibility=["read", "create", "update", "delete", "query"] - ) - """The Microsoft Teams app id of the previously-published app, if any.""" - short_description: Optional[str] = rest_field( - name="shortDescription", visibility=["read", "create", "update", "delete", "query"] - ) - """Short, one-line description shown in the Teams app listing.""" - full_description: Optional[str] = rest_field( - name="fullDescription", visibility=["read", "create", "update", "delete", "query"] - ) - """Full description shown on the Teams app details page.""" - developer_name: Optional[str] = rest_field( - name="developerName", visibility=["read", "create", "update", "delete", "query"] - ) - """Display name of the developer / publisher.""" - developer_website_url: Optional[str] = rest_field( - name="developerWebsiteUrl", visibility=["read", "create", "update", "delete", "query"] - ) - """Developer / publisher website URL.""" - privacy_url: Optional[str] = rest_field( - name="privacyUrl", visibility=["read", "create", "update", "delete", "query"] - ) - """Privacy policy URL.""" - terms_of_use_url: Optional[str] = rest_field( - name="termsOfUseUrl", visibility=["read", "create", "update", "delete", "query"] - ) - """Terms-of-use URL.""" + type: Literal["input_text"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of the input item. Always ``input_text``. Required. Default value is \"input_text\".""" + text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The text input to the model. Required.""" @overload def __init__( self, *, - app_publish_scope: Optional[Union[str, "_models.Microsoft365PublishScope"]] = None, - agent_name: Optional[str] = None, - agent_display_name: Optional[str] = None, - app_registration_client_id: Optional[str] = None, - bot_service_arm_id: Optional[str] = None, - app_version: Optional[str] = None, - recommended_next_app_version: Optional[str] = None, - title_id: Optional[str] = None, - teams_app_id: Optional[str] = None, - short_description: Optional[str] = None, - full_description: Optional[str] = None, - developer_name: Optional[str] = None, - developer_website_url: Optional[str] = None, - privacy_url: Optional[str] = None, - terms_of_use_url: Optional[str] = None, + text: str, ) -> None: ... @overload @@ -14877,30 +14471,24 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["input_text"] = "input_text" -class Microsoft365PublishResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Response from publishing an agent to Microsoft 365 / Microsoft Teams. +class LiveDecisionQuestionsInputParam_2(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Questions evaluated using the current transcript and the session's shared Decision items. - :ivar title_id: The Microsoft 365 title id of the published app. - :vartype title_id: str - :ivar teams_app_id: The Microsoft Teams app id of the published app. - :vartype teams_app_id: str + :ivar questions: Native Decision API questions evaluated together, in order. Required. + :vartype questions: list[~azure.ai.projects.models.QuestionParam] """ - title_id: Optional[str] = rest_field(name="titleId", visibility=["read", "create", "update", "delete", "query"]) - """The Microsoft 365 title id of the published app.""" - teams_app_id: Optional[str] = rest_field( - name="teamsAppId", visibility=["read", "create", "update", "delete", "query"] - ) - """The Microsoft Teams app id of the published app.""" + questions: list["_models.QuestionParam"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Native Decision API questions evaluated together, in order. Required.""" @overload def __init__( self, *, - title_id: Optional[str] = None, - teams_app_id: Optional[str] = None, + questions: list["_models.QuestionParam"], ) -> None: ... @overload @@ -14914,21 +14502,27 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MicrosoftCopilotHarness(AgentHarness, discriminator="microsoft_copilot_preview"): - """The Microsoft Copilot managed harness for prompt agents. +class LiveDecisionsDelegationParam_2(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """LiveDecisionsDelegationParam_2. - :ivar type: The type of managed harness. Always ``microsoft_copilot_preview``. Required. - Default value is "microsoft_copilot_preview". + :ivar type: Required. Default value is "decisions". :vartype type: str + :ivar decisions: Required. + :vartype decisions: ~azure.ai.projects.models.LiveDecisionsSettingsInputParam_2 """ - type: Literal["microsoft_copilot_preview"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of managed harness. Always ``microsoft_copilot_preview``. Required. Default value is - \"microsoft_copilot_preview\".""" + type: Literal["decisions"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"decisions\".""" + decisions: "_models.LiveDecisionsSettingsInputParam_2" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required.""" @overload def __init__( self, + *, + decisions: "_models.LiveDecisionsSettingsInputParam_2", ) -> None: ... @overload @@ -14940,33 +14534,29 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = "microsoft_copilot_preview" # type: ignore + self.type: Literal["decisions"] = "decisions" -class MicrosoftCopilotToolsetConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """An enablement override for a Microsoft Copilot built-in tool. +class LiveDecisionsDelegationUpdateParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """LiveDecisionsDelegationUpdateParam. - :ivar name: The built-in tool to configure. Required. Known values are: "filesystem_read", - "filesystem_write", "shell", "web", and "subagents". - :vartype name: str or ~azure.ai.projects.models.MicrosoftCopilotBuiltInTool - :ivar enabled: Whether the built-in tool is enabled. If omitted, the toolset default applies. - :vartype enabled: bool + :ivar type: Required. Default value is "decisions". + :vartype type: str + :ivar decisions: + :vartype decisions: ~azure.ai.projects.models.LiveDecisionsSettingsUpdateParam """ - name: Union[str, "_models.MicrosoftCopilotBuiltInTool"] = rest_field( + type: Literal["decisions"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"decisions\".""" + decisions: Optional["_models.LiveDecisionsSettingsUpdateParam"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The built-in tool to configure. Required. Known values are: \"filesystem_read\", - \"filesystem_write\", \"shell\", \"web\", and \"subagents\".""" - enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether the built-in tool is enabled. If omitted, the toolset default applies.""" @overload def __init__( self, *, - name: Union[str, "_models.MicrosoftCopilotBuiltInTool"], - enabled: Optional[bool] = None, + decisions: Optional["_models.LiveDecisionsSettingsUpdateParam"] = None, ) -> None: ... @overload @@ -14978,23 +14568,29 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["decisions"] = "decisions" -class MicrosoftCopilotToolsetDefaultConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The default enablement setting for Microsoft Copilot built-in tools. +class LiveDecisionsSettingsInputParam_2(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """LiveDecisionsSettingsInputParam_2. - :ivar enabled: Whether built-in tools are enabled by default. Defaults to true. - :vartype enabled: bool + :ivar questions: Native Decision API questions evaluated together, in order. Required. + :vartype questions: list[~azure.ai.projects.models.QuestionParam] + :ivar model: Required. + :vartype model: str """ - enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether built-in tools are enabled by default. Defaults to true.""" + questions: list["_models.QuestionParam"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Native Decision API questions evaluated together, in order. Required.""" + model: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - enabled: Optional[bool] = None, + questions: list["_models.QuestionParam"], + model: str, ) -> None: ... @overload @@ -15008,40 +14604,27 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MicrosoftCopilotToolsetPreview( - Tool, discriminator="microsoft_copilot_toolset_preview" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Configuration overrides for Microsoft Copilot built-in tools. +class LiveDecisionsSettingsUpdateParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """LiveDecisionsSettingsUpdateParam. - :ivar type: The type of the toolset. Always ``microsoft_copilot_toolset_preview``. Required. - MICROSOFT_COPILOT_TOOLSET_PREVIEW. - :vartype type: str or ~azure.ai.projects.models.MICROSOFT_COPILOT_TOOLSET_PREVIEW - :ivar default_config: The default configuration for built-in tools. If omitted, built-in tools - are enabled by default. - :vartype default_config: ~azure.ai.projects.models.MicrosoftCopilotToolsetDefaultConfig - :ivar configs: Per-tool configuration overrides. Duplicate built-in tool names are not allowed. - :vartype configs: list[~azure.ai.projects.models.MicrosoftCopilotToolsetConfig] + :ivar model: + :vartype model: str + :ivar questions: Native Decision API questions evaluated together, in order. + :vartype questions: list[~azure.ai.projects.models.QuestionParam] """ - type: Literal[ToolType.MICROSOFT_COPILOT_TOOLSET_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the toolset. Always ``microsoft_copilot_toolset_preview``. Required. - MICROSOFT_COPILOT_TOOLSET_PREVIEW.""" - default_config: Optional["_models.MicrosoftCopilotToolsetDefaultConfig"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The default configuration for built-in tools. If omitted, built-in tools are enabled by - default.""" - configs: Optional[list["_models.MicrosoftCopilotToolsetConfig"]] = rest_field( + model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + questions: Optional[list["_models.QuestionParam"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Per-tool configuration overrides. Duplicate built-in tool names are not allowed.""" + """Native Decision API questions evaluated together, in order.""" @overload def __init__( self, *, - default_config: Optional["_models.MicrosoftCopilotToolsetDefaultConfig"] = None, - configs: Optional[list["_models.MicrosoftCopilotToolsetConfig"]] = None, + model: Optional[str] = None, + questions: Optional[list["_models.QuestionParam"]] = None, ) -> None: ... @overload @@ -15053,34 +14636,42 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.MICROSOFT_COPILOT_TOOLSET_PREVIEW # type: ignore -class MicrosoftFabricPreviewTool( - Tool, discriminator="fabric_dataagent_preview" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """The input definition information for a Microsoft Fabric tool as used to configure an agent. +class LiveDecisionStoredInputItemParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """LiveDecisionStoredInputItemParam. - :ivar type: The object type, which is always 'fabric_dataagent_preview'. Required. - FABRIC_DATAAGENT_PREVIEW. - :vartype type: str or ~azure.ai.projects.models.FABRIC_DATAAGENT_PREVIEW - :ivar fabric_dataagent_preview: The fabric data agent tool parameters. Required. - :vartype fabric_dataagent_preview: ~azure.ai.projects.models.FabricDataAgentToolParameters + :ivar id: The ID of the stored Decision input item. Required. + :vartype id: str + :ivar type: Default value is "message". + :vartype type: str + :ivar role: The message role. Always ``user``. Required. Default value is "user". + :vartype role: str + :ivar content: Required. Is either a str type or a [Union["_models.LiveDecisionInputTextParam", + "_models.LiveDecisionInputImageParam"]] type. + :vartype content: str or list[~azure.ai.projects.models.LiveDecisionInputTextParam or + ~azure.ai.projects.models.LiveDecisionInputImageParam] """ - type: Literal[ToolType.FABRIC_DATAAGENT_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The object type, which is always 'fabric_dataagent_preview'. Required. - FABRIC_DATAAGENT_PREVIEW.""" - fabric_dataagent_preview: "_models.FabricDataAgentToolParameters" = rest_field( - visibility=["read", "create", "update", "delete", "query"] + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the stored Decision input item. Required.""" + type: Optional[Literal["message"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Default value is \"message\".""" + role: Literal["user"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The message role. Always ``user``. Required. Default value is \"user\".""" + content: Union[str, list[Union["_models.LiveDecisionInputTextParam", "_models.LiveDecisionInputImageParam"]]] = ( + rest_field(visibility=["read", "create", "update", "delete", "query"]) ) - """The fabric data agent tool parameters. Required.""" + """Required. Is either a str type or a [Union[\"_models.LiveDecisionInputTextParam\", + \"_models.LiveDecisionInputImageParam\"]] type.""" @overload def __init__( self, *, - fabric_dataagent_preview: "_models.FabricDataAgentToolParameters", + id: str, # pylint: disable=redefined-builtin + content: Union[str, list[Union["_models.LiveDecisionInputTextParam", "_models.LiveDecisionInputImageParam"]]], + type: Optional[Literal["message"]] = None, ) -> None: ... @overload @@ -15092,42 +14683,41 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.FABRIC_DATAAGENT_PREVIEW # type: ignore + self.role: Literal["user"] = "user" -class MisalignmentErrorDetailsResource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """MisalignmentErrorDetailsResource. +class LiveDecisionTriggerInputParam_2(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """LiveDecisionTriggerInputParam_2. - :ivar error_type: An optional classification; clients must accept additional values. Known - values are: "potentially_unintended_data_transfer", "potentially_unintended_data_access", - "potentially_unintended_destructive_activity", and "other". - :vartype error_type: str or ~azure.ai.projects.models.MisalignmentErrorType - :ivar detailed_explanation: The public explanation for this block. - :vartype detailed_explanation: str - :ivar steer: An optional public continuation instruction. - :vartype steer: ~azure.ai.projects.models.MisalignmentSteer + :ivar type: Required. Default value is "decisions". + :vartype type: str + :ivar event_type: Required. Is either a Literal["session.input_transcript.delta"] type or a + Literal["session.output_transcript.delta"] type. + :vartype event_type: str or str + :ivar decisions: Questions evaluated using the current transcript and the session's shared + Decision items. Required. + :vartype decisions: ~azure.ai.projects.models.LiveDecisionQuestionsInputParam_2 """ - error_type: Optional[Union[str, "_models.MisalignmentErrorType"]] = rest_field( + type: Literal["decisions"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"decisions\".""" + event_type: Literal["session.input_transcript.delta", "session.output_transcript.delta"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """An optional classification; clients must accept additional values. Known values are: - \"potentially_unintended_data_transfer\", \"potentially_unintended_data_access\", - \"potentially_unintended_destructive_activity\", and \"other\".""" - detailed_explanation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The public explanation for this block.""" - steer: Optional["_models.MisalignmentSteer"] = rest_field( + """Required. Is either a Literal[\"session.input_transcript.delta\"] type or a + Literal[\"session.output_transcript.delta\"] type.""" + decisions: "_models.LiveDecisionQuestionsInputParam_2" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """An optional public continuation instruction.""" + """Questions evaluated using the current transcript and the session's shared Decision items. + Required.""" @overload def __init__( self, *, - error_type: Optional[Union[str, "_models.MisalignmentErrorType"]] = None, - detailed_explanation: Optional[str] = None, - steer: Optional["_models.MisalignmentSteer"] = None, + event_type: Literal["session.input_transcript.delta", "session.output_transcript.delta"], + decisions: "_models.LiveDecisionQuestionsInputParam_2", ) -> None: ... @overload @@ -15139,23 +14729,33 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["decisions"] = "decisions" -class MisalignmentSteer(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """MisalignmentSteer. +class LiveDelegationReasoningInputParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Reasoning options for Responses requests made on behalf of the Live session. - :ivar message: The public continuation instruction. Required. - :vartype message: str + :ivar effort: Known values are: "none", "minimal", "low", "medium", "high", and "xhigh". + :vartype effort: str or ~azure.ai.projects.models.LiveReasoningEffort + :ivar summary: Known values are: "concise", "detailed", and "auto". + :vartype summary: str or ~azure.ai.projects.models.LiveReasoningSummary """ - message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The public continuation instruction. Required.""" + effort: Optional[Union[str, "_models.LiveReasoningEffort"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Known values are: \"none\", \"minimal\", \"low\", \"medium\", \"high\", and \"xhigh\".""" + summary: Optional[Union[str, "_models.LiveReasoningSummary"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Known values are: \"concise\", \"detailed\", and \"auto\".""" @overload def __init__( self, *, - message: str, + effort: Optional[Union[str, "_models.LiveReasoningEffort"]] = None, + summary: Optional[Union[str, "_models.LiveReasoningSummary"]] = None, ) -> None: ... @overload @@ -15169,21 +14769,23 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ModelCredentialRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Request to fetch credentials for a model asset. +class LiveDelegationTextInputParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Text generation options for the Live session’s Responses backend. - :ivar blob_uri: Blob URI of the model asset to fetch credentials for. Required. - :vartype blob_uri: str + :ivar verbosity: Known values are: "low", "medium", and "high". + :vartype verbosity: str or ~azure.ai.projects.models.LiveTextVerbosity """ - blob_uri: str = rest_field(name="blobUri", visibility=["read", "create", "update", "delete", "query"]) - """Blob URI of the model asset to fetch credentials for. Required.""" + verbosity: Optional[Union[str, "_models.LiveTextVerbosity"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Known values are: \"low\", \"medium\", and \"high\".""" @overload def __init__( self, *, - blob_uri: str, + verbosity: Optional[Union[str, "_models.LiveTextVerbosity"]] = None, ) -> None: ... @overload @@ -15197,45 +14799,40 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ModelDeployment(Deployment, discriminator="ModelDeployment"): - """Model Deployment Definition. +class LiveFileSearchToolInputParam(_Model): # pylint: disable=docstring-missing-param + """LiveFileSearchToolInputParam. - :ivar name: Name of the deployment. Required. + :ivar type: Required. Default value is "file_search". + :vartype type: str + """ + + type: Literal["file_search"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"file_search\".""" + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type: Literal["file_search"] = "file_search" + + +class LiveFunctionToolChoiceParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """LiveFunctionToolChoiceParam. + + :ivar type: The tool to call. Always ``function``. Required. Default value is "function". + :vartype type: str + :ivar name: The name of the function tool to call. Required. :vartype name: str - :ivar type: The type of the deployment. Required. Model deployment. - :vartype type: str or ~azure.ai.projects.models.MODEL_DEPLOYMENT - :ivar model_name: Publisher-specific name of the deployed model. Required. - :vartype model_name: str - :ivar model_version: Publisher-specific version of the deployed model. Required. - :vartype model_version: str - :ivar model_publisher: Name of the deployed model's publisher. Required. - :vartype model_publisher: str - :ivar capabilities: Capabilities of deployed model. Required. - :vartype capabilities: dict[str, str] - :ivar sku: Sku of the model deployment. Required. - :vartype sku: ~azure.ai.projects.models.ModelDeploymentSku - :ivar connection_name: Name of the connection the deployment comes from. - :vartype connection_name: str """ - type: Literal[DeploymentType.MODEL_DEPLOYMENT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the deployment. Required. Model deployment.""" - model_name: str = rest_field(name="modelName", visibility=["read"]) - """Publisher-specific name of the deployed model. Required.""" - model_version: str = rest_field(name="modelVersion", visibility=["read"]) - """Publisher-specific version of the deployed model. Required.""" - model_publisher: str = rest_field(name="modelPublisher", visibility=["read"]) - """Name of the deployed model's publisher. Required.""" - capabilities: dict[str, str] = rest_field(visibility=["read"]) - """Capabilities of deployed model. Required.""" - sku: "_models.ModelDeploymentSku" = rest_field(visibility=["read"]) - """Sku of the model deployment. Required.""" - connection_name: Optional[str] = rest_field(name="connectionName", visibility=["read"]) - """Name of the connection the deployment comes from.""" + type: Literal["function"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The tool to call. Always ``function``. Required. Default value is \"function\".""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the function tool to call. Required.""" @overload def __init__( self, + *, + name: str, ) -> None: ... @overload @@ -15247,44 +14844,40 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = DeploymentType.MODEL_DEPLOYMENT # type: ignore + self.type: Literal["function"] = "function" -class ModelDeploymentSku(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Sku information. +class LiveFunctionToolInputParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A function tool available to the Responses backend when the Live model delegates a task. - :ivar capacity: Sku capacity. Required. - :vartype capacity: int - :ivar family: Sku family. Required. - :vartype family: str - :ivar name: Sku name. Required. + :ivar type: The tool type. Always ``function``. Required. Default value is "function". + :vartype type: str + :ivar name: The name the delegated Responses model uses when calling this function. Required. :vartype name: str - :ivar size: Sku size. Required. - :vartype size: str - :ivar tier: Sku tier. Required. - :vartype tier: str + :ivar description: + :vartype description: str + :ivar parameters: + :vartype parameters: dict[str, any] + :ivar strict: + :vartype strict: bool """ - capacity: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Sku capacity. Required.""" - family: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Sku family. Required.""" + type: Literal["function"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The tool type. Always ``function``. Required. Default value is \"function\".""" name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Sku name. Required.""" - size: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Sku size. Required.""" - tier: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Sku tier. Required.""" + """The name the delegated Responses model uses when calling this function. Required.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + parameters: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + strict: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - capacity: int, - family: str, name: str, - size: str, - tier: str, + description: Optional[str] = None, + parameters: Optional[dict[str, Any]] = None, + strict: Optional[bool] = None, ) -> None: ... @overload @@ -15296,42 +14889,57 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["function"] = "function" -class ModelPendingUploadRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Represents a request for a pending upload of a model version. - - :ivar pending_upload_id: If PendingUploadId is not provided, a random GUID will be used. - :vartype pending_upload_id: str - :ivar connection_name: Azure Storage Account connection name to use for generating temporary - SAS token. - :vartype connection_name: str - :ivar pending_upload_type: The type of pending upload. Only TemporaryBlobReference is supported - for models. Required. Temporary blob reference. - :vartype pending_upload_type: str or ~azure.ai.projects.models.TEMPORARY_BLOB_REFERENCE - """ +class LiveHostedShellContainerAutoParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """LiveHostedShellContainerAutoParam. - pending_upload_id: Optional[str] = rest_field( - name="pendingUploadId", visibility=["read", "create", "update", "delete", "query"] - ) - """If PendingUploadId is not provided, a random GUID will be used.""" - connection_name: Optional[str] = rest_field( - name="connectionName", visibility=["read", "create", "update", "delete", "query"] + :ivar type: Automatically creates a container for this request. Required. Default value is + "container_auto". + :vartype type: str + :ivar file_ids: + :vartype file_ids: list[str] + :ivar memory_limit: Known values are: "1g", "4g", "16g", and "64g". + :vartype memory_limit: str or ~azure.ai.projects.models.LiveContainerMemoryLimit + :ivar network_policy: Is either a LiveContainerNetworkPolicyDisabledParam type or a + LiveHostedShellNetworkPolicyAllowlistParam type. + :vartype network_policy: ~azure.ai.projects.models.LiveContainerNetworkPolicyDisabledParam or + ~azure.ai.projects.models.LiveHostedShellNetworkPolicyAllowlistParam + :ivar skills: + :vartype skills: list[~azure.ai.projects.models.LiveSkillReferenceParam or + ~azure.ai.projects.models.LiveInlineSkillParam] + """ + + type: Literal["container_auto"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Automatically creates a container for this request. Required. Default value is + \"container_auto\".""" + file_ids: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + memory_limit: Optional[Union[str, "_models.LiveContainerMemoryLimit"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """Azure Storage Account connection name to use for generating temporary SAS token.""" - pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE] = rest_field( - name="pendingUploadType", visibility=["read", "create", "update", "delete", "query"] + """Known values are: \"1g\", \"4g\", \"16g\", and \"64g\".""" + network_policy: Optional[ + Union["_models.LiveContainerNetworkPolicyDisabledParam", "_models.LiveHostedShellNetworkPolicyAllowlistParam"] + ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Is either a LiveContainerNetworkPolicyDisabledParam type or a + LiveHostedShellNetworkPolicyAllowlistParam type.""" + skills: Optional[list[Union["_models.LiveSkillReferenceParam", "_models.LiveInlineSkillParam"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """The type of pending upload. Only TemporaryBlobReference is supported for models. Required. - Temporary blob reference.""" @overload def __init__( self, *, - pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE], - pending_upload_id: Optional[str] = None, - connection_name: Optional[str] = None, + file_ids: Optional[list[str]] = None, + memory_limit: Optional[Union[str, "_models.LiveContainerMemoryLimit"]] = None, + network_policy: Optional[ + Union[ + "_models.LiveContainerNetworkPolicyDisabledParam", "_models.LiveHostedShellNetworkPolicyAllowlistParam" + ] + ] = None, + skills: Optional[list[Union["_models.LiveSkillReferenceParam", "_models.LiveInlineSkillParam"]]] = None, ) -> None: ... @overload @@ -15343,47 +14951,32 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["container_auto"] = "container_auto" -class ModelPendingUploadResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Represents the response for a model pending upload request. +class LiveHostedShellNetworkPolicyAllowlistParam( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """LiveHostedShellNetworkPolicyAllowlistParam. - :ivar blob_reference: Container-level read, write, list SAS. Required. - :vartype blob_reference: ~azure.ai.projects.models.BlobReference - :ivar pending_upload_id: ID for this upload request. Required. - :vartype pending_upload_id: str - :ivar version: Version of asset to be created if user did not specify version when initially - creating upload. - :vartype version: str - :ivar pending_upload_type: The type of pending upload. Only TemporaryBlobReference is supported - for models. Required. Temporary blob reference. - :vartype pending_upload_type: str or ~azure.ai.projects.models.TEMPORARY_BLOB_REFERENCE + :ivar type: Allow outbound network access only to specified domains. Always ``allowlist``. + Required. Default value is "allowlist". + :vartype type: str + :ivar allowed_domains: A list of allowed domains when type is ``allowlist``. Required. + :vartype allowed_domains: list[str] """ - blob_reference: "_models.BlobReference" = rest_field( - name="blobReference", visibility=["read", "create", "update", "delete", "query"] - ) - """Container-level read, write, list SAS. Required.""" - pending_upload_id: str = rest_field( - name="pendingUploadId", visibility=["read", "create", "update", "delete", "query"] - ) - """ID for this upload request. Required.""" - version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Version of asset to be created if user did not specify version when initially creating upload.""" - pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE] = rest_field( - name="pendingUploadType", visibility=["read", "create", "update", "delete", "query"] - ) - """The type of pending upload. Only TemporaryBlobReference is supported for models. Required. - Temporary blob reference.""" + type: Literal["allowlist"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Allow outbound network access only to specified domains. Always ``allowlist``. Required. + Default value is \"allowlist\".""" + allowed_domains: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A list of allowed domains when type is ``allowlist``. Required.""" @overload def __init__( self, *, - blob_reference: "_models.BlobReference", - pending_upload_id: str, - pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE], - version: Optional[str] = None, + allowed_domains: list[str], ) -> None: ... @overload @@ -15395,39 +14988,45 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["allowlist"] = "allowlist" -class ModelSamplingParams(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Represents a set of parameters used to control the sampling behavior of a language model during - text generation. +class LiveHostedShellToolInputParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A Responses shell tool. Use a hosted container or return local shell results with + response.item.create. Domain secrets are not supported. - :ivar temperature: The temperature parameter for sampling. Defaults to 1.0. - :vartype temperature: float - :ivar top_p: The top-p parameter for nucleus sampling. Defaults to 1.0. - :vartype top_p: float - :ivar seed: The random seed for reproducibility. Defaults to 42. - :vartype seed: int - :ivar max_completion_tokens: The maximum number of tokens allowed in the completion. - :vartype max_completion_tokens: int + :ivar type: Required. Default value is "shell". + :vartype type: str + :ivar environment: Is one of the following types: LiveHostedShellContainerAutoParam, + LiveContainerReferenceParam, LiveLocalEnvironmentParam + :vartype environment: ~azure.ai.projects.models.LiveHostedShellContainerAutoParam or + ~azure.ai.projects.models.LiveContainerReferenceParam or + ~azure.ai.projects.models.LiveLocalEnvironmentParam """ - temperature: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The temperature parameter for sampling. Defaults to 1.0.""" - top_p: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The top-p parameter for nucleus sampling. Defaults to 1.0.""" - seed: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The random seed for reproducibility. Defaults to 42.""" - max_completion_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The maximum number of tokens allowed in the completion.""" + type: Literal["shell"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"shell\".""" + environment: Optional[ + Union[ + "_models.LiveHostedShellContainerAutoParam", + "_models.LiveContainerReferenceParam", + "_models.LiveLocalEnvironmentParam", + ] + ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Is one of the following types: LiveHostedShellContainerAutoParam, LiveContainerReferenceParam, + LiveLocalEnvironmentParam""" @overload def __init__( self, *, - temperature: Optional[float] = None, - top_p: Optional[float] = None, - seed: Optional[int] = None, - max_completion_tokens: Optional[int] = None, + environment: Optional[ + Union[ + "_models.LiveHostedShellContainerAutoParam", + "_models.LiveContainerReferenceParam", + "_models.LiveLocalEnvironmentParam", + ] + ] = None, ) -> None: ... @overload @@ -15439,31 +15038,45 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["shell"] = "shell" -class ModelSourceData(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Source information for the model. +class LiveImageGenerationToolInputParam(_Model): # pylint: disable=docstring-missing-param + """LiveImageGenerationToolInputParam. - :ivar source_type: The source type of the model. Known values are: "LocalUpload" and - "TrainingJob". - :vartype source_type: str or ~azure.ai.projects.models.FoundryModelSourceType - :ivar job_id: The job ID that produced this model. - :vartype job_id: str + :ivar type: Required. Default value is "image_generation". + :vartype type: str """ - source_type: Optional[Union[str, "_models.FoundryModelSourceType"]] = rest_field( - name="sourceType", visibility=["read", "create", "update", "delete", "query"] - ) - """The source type of the model. Known values are: \"LocalUpload\" and \"TrainingJob\".""" - job_id: Optional[str] = rest_field(name="jobId", visibility=["read", "create", "update", "delete", "query"]) - """The job ID that produced this model.""" + type: Literal["image_generation"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"image_generation\".""" + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type: Literal["image_generation"] = "image_generation" + + +class LiveInitialItem(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A developer, user, or assistant message supplied as text history before the Live session + starts. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + LiveInitialAssistantMessageItemParam, LiveInitialDeveloperMessageItemParam, + LiveInitialUserMessageItemParam + + :ivar role: Required. Known values are: "developer", "user", and "assistant". + :vartype role: str or ~azure.ai.projects.models.LiveInitialItemType + """ + + __mapping__: dict[str, _Model] = {} + role: str = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"developer\", \"user\", and \"assistant\".""" @overload def __init__( self, *, - source_type: Optional[Union[str, "_models.FoundryModelSourceType"]] = None, - job_id: Optional[str] = None, + role: str, ) -> None: ... @overload @@ -15477,78 +15090,50 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ModelVersion(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Model Version Definition. +class LiveInitialAssistantMessageItemParam( + LiveInitialItem, discriminator="assistant" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """An assistant message included in the initial text history of a Live session. - :ivar blob_uri: URI of the model artifact in blob storage. Required. - :vartype blob_uri: str - :ivar weight_type: The weight type of the model. Known values are: "FullWeight", "LoRA", and - "DraftModel". - :vartype weight_type: str or ~azure.ai.projects.models.FoundryModelWeightType - :ivar base_model: Base model asset ID. - :vartype base_model: str - :ivar source: The source of the model. - :vartype source: ~azure.ai.projects.models.ModelSourceData - :ivar lora_config: Adapter-specific configuration. Required when weight_type is lora; ignored - otherwise. May be auto-populated from adapter_config.json when present in the uploaded files — - user-provided values take precedence over auto-detected values. - :vartype lora_config: ~azure.ai.projects.models.LoraConfig - :ivar artifact_profile: The artifact profile of the model. - :vartype artifact_profile: ~azure.ai.projects.models.ArtifactProfile - :ivar warnings: Service-computed advisory warnings derived from the artifact profile. - :vartype warnings: list[~azure.ai.projects.models.FoundryModelWarning] - :ivar id: Asset ID, a unique identifier for the asset. + :ivar id: :vartype id: str - :ivar name: The name of the resource. Required. - :vartype name: str - :ivar version: The version of the resource. Required. - :vartype version: str - :ivar description: The asset description text. - :vartype description: str - :ivar tags: Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] + :ivar type: The history item type. Always ``message``. Default value is "message". + :vartype type: str + :ivar status: Known values are: "incomplete" and "completed". + :vartype status: str or ~azure.ai.projects.models.LiveInitialMessageStatus + :ivar role: The author of this history message. Always ``assistant``. Required. ASSISTANT. + :vartype role: str or ~azure.ai.projects.models.ASSISTANT + :ivar content: The message content. Supply exactly one text part for the initial Live + conversation history. Required. + :vartype content: list[~azure.ai.projects.models.LiveInitialTextContentPartParam or + ~azure.ai.projects.models.LiveInitialOutputTextContentPartParam] """ - blob_uri: str = rest_field(name="blobUri", visibility=["read", "create", "update", "delete", "query"]) - """URI of the model artifact in blob storage. Required.""" - weight_type: Optional[Union[str, "_models.FoundryModelWeightType"]] = rest_field( - name="weightType", visibility=["read", "create", "update", "delete", "query"] + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Optional[Literal["message"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The history item type. Always ``message``. Default value is \"message\".""" + status: Optional[Union[str, "_models.LiveInitialMessageStatus"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """The weight type of the model. Known values are: \"FullWeight\", \"LoRA\", and \"DraftModel\".""" - base_model: Optional[str] = rest_field(name="baseModel", visibility=["read", "create"]) - """Base model asset ID.""" - source: Optional["_models.ModelSourceData"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The source of the model.""" - lora_config: Optional["_models.LoraConfig"] = rest_field(name="loraConfig", visibility=["read", "create"]) - """Adapter-specific configuration. Required when weight_type is lora; ignored otherwise. May be - auto-populated from adapter_config.json when present in the uploaded files — user-provided - values take precedence over auto-detected values.""" - artifact_profile: Optional["_models.ArtifactProfile"] = rest_field(name="artifactProfile", visibility=["read"]) - """The artifact profile of the model.""" - warnings: Optional[list["_models.FoundryModelWarning"]] = rest_field(visibility=["read"]) - """Service-computed advisory warnings derived from the artifact profile.""" - id: Optional[str] = rest_field(visibility=["read"]) - """Asset ID, a unique identifier for the asset.""" - name: str = rest_field(visibility=["read"]) - """The name of the resource. Required.""" - version: str = rest_field(visibility=["read"]) - """The version of the resource. Required.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update"]) - """The asset description text.""" - tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update"]) - """Tag dictionary. Tags can be added, removed, and updated.""" + """Known values are: \"incomplete\" and \"completed\".""" + role: Literal[LiveInitialItemType.ASSISTANT] = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The author of this history message. Always ``assistant``. Required. ASSISTANT.""" + content: list[Union["_models.LiveInitialTextContentPartParam", "_models.LiveInitialOutputTextContentPartParam"]] = ( + rest_field(visibility=["read", "create", "update", "delete", "query"]) + ) + """The message content. Supply exactly one text part for the initial Live conversation history. + Required.""" @overload def __init__( self, *, - blob_uri: str, - weight_type: Optional[Union[str, "_models.FoundryModelWeightType"]] = None, - base_model: Optional[str] = None, - source: Optional["_models.ModelSourceData"] = None, - lora_config: Optional["_models.LoraConfig"] = None, - description: Optional[str] = None, - tags: Optional[dict[str, str]] = None, + content: list[ + Union["_models.LiveInitialTextContentPartParam", "_models.LiveInitialOutputTextContentPartParam"] + ], + id: Optional[str] = None, # pylint: disable=redefined-builtin + type: Optional[Literal["message"]] = None, + status: Optional[Union[str, "_models.LiveInitialMessageStatus"]] = None, ) -> None: ... @overload @@ -15560,31 +15145,50 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.role = LiveInitialItemType.ASSISTANT # type: ignore -class MonthlyRecurrenceSchedule( - RecurrenceSchedule, discriminator="Monthly" +class LiveInitialDeveloperMessageItemParam( + LiveInitialItem, discriminator="developer" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Monthly recurrence schedule. + """A developer message included in the initial text history of a Live session. - :ivar type: Monthly recurrence type. Required. Monthly recurrence pattern. - :vartype type: str or ~azure.ai.projects.models.MONTHLY - :ivar days_of_month: Days of the month for the recurrence schedule. Required. - :vartype days_of_month: list[int] + :ivar id: + :vartype id: str + :ivar type: The history item type. Always ``message``. Default value is "message". + :vartype type: str + :ivar status: Known values are: "incomplete" and "completed". + :vartype status: str or ~azure.ai.projects.models.LiveInitialMessageStatus + :ivar role: The author of this history message. Always ``developer``. Required. DEVELOPER. + :vartype role: str or ~azure.ai.projects.models.DEVELOPER + :ivar content: The message content. Supply exactly one text part for the initial Live + conversation history. Required. + :vartype content: list[~azure.ai.projects.models.LiveInitialInputTextContentPartParam] """ - type: Literal[RecurrenceType.MONTHLY] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Monthly recurrence type. Required. Monthly recurrence pattern.""" - days_of_month: list[int] = rest_field( - name="daysOfMonth", visibility=["read", "create", "update", "delete", "query"] + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Optional[Literal["message"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The history item type. Always ``message``. Default value is \"message\".""" + status: Optional[Union[str, "_models.LiveInitialMessageStatus"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """Days of the month for the recurrence schedule. Required.""" + """Known values are: \"incomplete\" and \"completed\".""" + role: Literal[LiveInitialItemType.DEVELOPER] = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The author of this history message. Always ``developer``. Required. DEVELOPER.""" + content: list["_models.LiveInitialInputTextContentPartParam"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The message content. Supply exactly one text part for the initial Live conversation history. + Required.""" @overload def __init__( self, *, - days_of_month: list[int], + content: list["_models.LiveInitialInputTextContentPartParam"], + id: Optional[str] = None, # pylint: disable=redefined-builtin + type: Optional[Literal["message"]] = None, + status: Optional[Union[str, "_models.LiveInitialMessageStatus"]] = None, ) -> None: ... @overload @@ -15596,43 +15200,30 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RecurrenceType.MONTHLY # type: ignore + self.role = LiveInitialItemType.DEVELOPER # type: ignore -class NamespaceToolParam( - Tool, discriminator="namespace" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Namespace. +class LiveInitialInputTextContentPartParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Text supplied in a developer or user message when starting a Live session. - :ivar type: The type of the tool. Always ``namespace``. Required. NAMESPACE. - :vartype type: str or ~azure.ai.projects.models.NAMESPACE - :ivar name: The namespace name used in tool calls (for example, ``crm``). Required. - :vartype name: str - :ivar description: A description of the namespace shown to the model. Required. - :vartype description: str - :ivar tools: The function/custom tools available inside this namespace. Required. - :vartype tools: list[~azure.ai.projects.models.FunctionToolParam or - ~azure.ai.projects.models.CustomToolParam] + :ivar type: The text content type. Always ``input_text``. Default value is "input_text". + :vartype type: str + :ivar text: The message text to include in the Live session’s initial conversation history. + Required. + :vartype text: str """ - type: Literal[ToolType.NAMESPACE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the tool. Always ``namespace``. Required. NAMESPACE.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The namespace name used in tool calls (for example, ``crm``). Required.""" - description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A description of the namespace shown to the model. Required.""" - tools: list[Union["_models.FunctionToolParam", "_models.CustomToolParam"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The function/custom tools available inside this namespace. Required.""" + type: Optional[Literal["input_text"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The text content type. Always ``input_text``. Default value is \"input_text\".""" + text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The message text to include in the Live session’s initial conversation history. Required.""" @overload def __init__( self, *, - name: str, - description: str, - tools: list[Union["_models.FunctionToolParam", "_models.CustomToolParam"]], + text: str, + type: Optional[Literal["input_text"]] = None, ) -> None: ... @overload @@ -15644,22 +15235,29 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.NAMESPACE # type: ignore -class NoAuthenticationCredentials(BaseCredentials, discriminator="None"): - """Credentials that do not require authentication. +class LiveInitialOutputTextContentPartParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Assistant output text supplied as conversation history when starting a Live session. - :ivar type: The credential type. Required. No credential. - :vartype type: str or ~azure.ai.projects.models.NONE + :ivar type: The text content type. Always ``output_text``. Required. Default value is + "output_text". + :vartype type: str + :ivar text: The message text to include in the Live session’s initial conversation history. + Required. + :vartype text: str """ - type: Literal[CredentialType.NONE] = rest_discriminator(name="type", visibility=["read"]) # type: ignore - """The credential type. Required. No credential.""" + type: Literal["output_text"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The text content type. Always ``output_text``. Required. Default value is \"output_text\".""" + text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The message text to include in the Live session’s initial conversation history. Required.""" @overload def __init__( self, + *, + text: str, ) -> None: ... @overload @@ -15671,35 +15269,116 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = CredentialType.NONE # type: ignore + self.type: Literal["output_text"] = "output_text" -class OneTimeTrigger(Trigger, discriminator="OneTime"): # pylint: disable=docstring-keyword-should-match-keyword-only - """One-time trigger. +class LiveInitialSessionAudioOutputParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Settings for speech generated by the Live model. Choose the voice before starting the session. - :ivar type: Required. One-time trigger. - :vartype type: str or ~azure.ai.projects.models.ONE_TIME - :ivar trigger_at: Date and time for the one-time trigger in ISO 8601 format. Required. - :vartype trigger_at: ~datetime.datetime - :ivar time_zone: Time zone for the one-time trigger. Defaults to ``UTC``. - :vartype time_zone: str + :ivar voice: The voice used for Live speech, as a built-in voice name or a custom voice object + containing its ID. Defaults to ``marin`` and cannot change after startup. Is one of the + following types: str, Literal["alloy"], Literal["ash"], Literal["ballad"], Literal["beacon"], + Literal["bossa"], Literal["brise"], Literal["cedar"], Literal["cinder"], Literal["coral"], + Literal["delta"], Literal["echo"], Literal["flitz"], Literal["gleam"], Literal["harema"], + Literal["juni"], Literal["marin"], Literal["meridian"], Literal["nira"], Literal["noeul"], + Literal["nuri"], Literal["quartz"], Literal["ripple"], Literal["sage"], Literal["shida"], + Literal["shimmer"], Literal["sillage"], Literal["stone"], Literal["tempo"], Literal["verse"], + Literal["vesper"], Literal["willow"], LiveCustomVoiceParam + :vartype voice: str or str or str or str or str or str or str or str or str or str or str or + str or str or str or str or str or str or str or str or str or str or str or str or str or str + or str or str or str or str or str or str or str or + ~azure.ai.projects.models.LiveCustomVoiceParam """ - type: Literal[TriggerType.ONE_TIME] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. One-time trigger.""" - trigger_at: datetime.datetime = rest_field( - name="triggerAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" - ) - """Date and time for the one-time trigger in ISO 8601 format. Required.""" - time_zone: Optional[str] = rest_field(name="timeZone", visibility=["read", "create", "update", "delete", "query"]) - """Time zone for the one-time trigger. Defaults to ``UTC``.""" + voice: Optional[ + Union[ + str, + Literal["alloy"], + Literal["ash"], + Literal["ballad"], + Literal["beacon"], + Literal["bossa"], + Literal["brise"], + Literal["cedar"], + Literal["cinder"], + Literal["coral"], + Literal["delta"], + Literal["echo"], + Literal["flitz"], + Literal["gleam"], + Literal["harema"], + Literal["juni"], + Literal["marin"], + Literal["meridian"], + Literal["nira"], + Literal["noeul"], + Literal["nuri"], + Literal["quartz"], + Literal["ripple"], + Literal["sage"], + Literal["shida"], + Literal["shimmer"], + Literal["sillage"], + Literal["stone"], + Literal["tempo"], + Literal["verse"], + Literal["vesper"], + Literal["willow"], + "_models.LiveCustomVoiceParam", + ] + ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The voice used for Live speech, as a built-in voice name or a custom voice object containing + its ID. Defaults to ``marin`` and cannot change after startup. Is one of the following types: + str, Literal[\"alloy\"], Literal[\"ash\"], Literal[\"ballad\"], Literal[\"beacon\"], + Literal[\"bossa\"], Literal[\"brise\"], Literal[\"cedar\"], Literal[\"cinder\"], + Literal[\"coral\"], Literal[\"delta\"], Literal[\"echo\"], Literal[\"flitz\"], + Literal[\"gleam\"], Literal[\"harema\"], Literal[\"juni\"], Literal[\"marin\"], + Literal[\"meridian\"], Literal[\"nira\"], Literal[\"noeul\"], Literal[\"nuri\"], + Literal[\"quartz\"], Literal[\"ripple\"], Literal[\"sage\"], Literal[\"shida\"], + Literal[\"shimmer\"], Literal[\"sillage\"], Literal[\"stone\"], Literal[\"tempo\"], + Literal[\"verse\"], Literal[\"vesper\"], Literal[\"willow\"], LiveCustomVoiceParam""" @overload def __init__( self, *, - trigger_at: datetime.datetime, - time_zone: Optional[str] = None, + voice: Optional[ + Union[ + str, + Literal["alloy"], + Literal["ash"], + Literal["ballad"], + Literal["beacon"], + Literal["bossa"], + Literal["brise"], + Literal["cedar"], + Literal["cinder"], + Literal["coral"], + Literal["delta"], + Literal["echo"], + Literal["flitz"], + Literal["gleam"], + Literal["harema"], + Literal["juni"], + Literal["marin"], + Literal["meridian"], + Literal["nira"], + Literal["noeul"], + Literal["nuri"], + Literal["quartz"], + Literal["ripple"], + Literal["sage"], + Literal["shida"], + Literal["shimmer"], + Literal["sillage"], + Literal["stone"], + Literal["tempo"], + Literal["verse"], + Literal["vesper"], + Literal["willow"], + "_models.LiveCustomVoiceParam", + ] + ] = None, ) -> None: ... @overload @@ -15711,30 +15390,33 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = TriggerType.ONE_TIME # type: ignore -class OpenApiAuthDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """authentication details for OpenApiFunctionDefinition. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - OpenApiAnonymousAuthDetails, OpenApiManagedAuthDetails, OpenApiProjectConnectionAuthDetails +class LiveInitialSessionAudioParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Startup audio configuration. Only primary WebSockets accept audio.format; WebRTC and SIP + negotiate their media format. Voice and format are immutable after startup. - :ivar type: The type of authentication, must be anonymous/project_connection/managed_identity. - Required. Known values are: "anonymous", "project_connection", and "managed_identity". - :vartype type: str or ~azure.ai.projects.models.OpenApiAuthType + :ivar format: Audio encoding and sample rate for audio sent and received over a Live WebSocket + connection. WebRTC and SIP negotiate their media format separately. + :vartype format: ~azure.ai.projects.models.LiveAudioFormat + :ivar output: The voice used for speech generated by the Live model. + :vartype output: ~azure.ai.projects.models.LiveInitialSessionAudioOutputParam """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The type of authentication, must be anonymous/project_connection/managed_identity. Required. - Known values are: \"anonymous\", \"project_connection\", and \"managed_identity\".""" + format: Optional["_models.LiveAudioFormat"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Audio encoding and sample rate for audio sent and received over a Live WebSocket connection. + WebRTC and SIP negotiate their media format separately.""" + output: Optional["_models.LiveInitialSessionAudioOutputParam"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The voice used for speech generated by the Live model.""" @overload def __init__( self, *, - type: str, + format: Optional["_models.LiveAudioFormat"] = None, + output: Optional["_models.LiveInitialSessionAudioOutputParam"] = None, ) -> None: ... @overload @@ -15748,19 +15430,27 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OpenApiAnonymousAuthDetails(OpenApiAuthDetails, discriminator="anonymous"): - """Security details for OpenApi anonymous authentication. +class LiveInitialTextContentPartParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Assistant text supplied as conversation history when starting a Live session. - :ivar type: The object type, which is always 'anonymous'. Required. ANONYMOUS. - :vartype type: str or ~azure.ai.projects.models.ANONYMOUS + :ivar type: The text content type. Always ``text``. Default value is "text". + :vartype type: str + :ivar text: The message text to include in the Live session’s initial conversation history. + Required. + :vartype text: str """ - type: Literal[OpenApiAuthType.ANONYMOUS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The object type, which is always 'anonymous'. Required. ANONYMOUS.""" + type: Optional[Literal["text"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The text content type. Always ``text``. Default value is \"text\".""" + text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The message text to include in the Live session’s initial conversation history. Required.""" @overload def __init__( self, + *, + text: str, + type: Optional[Literal["text"]] = None, ) -> None: ... @overload @@ -15772,50 +15462,49 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = OpenApiAuthType.ANONYMOUS # type: ignore -class OpenApiFunctionDefinition(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The input definition information for an openapi function. +class LiveInitialUserMessageItemParam( + LiveInitialItem, discriminator="user" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A user message included in the initial text history of a Live session. - :ivar name: The name of the function to be called. Required. - :vartype name: str - :ivar description: A description of what the function does, used by the model to choose when - and how to call the function. - :vartype description: str - :ivar spec: The openapi function shape, described as a JSON Schema object. Required. - :vartype spec: dict[str, any] - :ivar auth: Open API authentication details. Required. - :vartype auth: ~azure.ai.projects.models.OpenApiAuthDetails - :ivar default_params: List of OpenAPI spec parameters that will use user-provided defaults. - :vartype default_params: list[str] - :ivar functions: List of function definitions used by OpenApi tool. - :vartype functions: list[~azure.ai.projects.models.OpenApiFunctionDefinitionFunction] + :ivar id: + :vartype id: str + :ivar type: The history item type. Always ``message``. Default value is "message". + :vartype type: str + :ivar status: Known values are: "incomplete" and "completed". + :vartype status: str or ~azure.ai.projects.models.LiveInitialMessageStatus + :ivar role: The author of this history message. Always ``user``. Required. USER. + :vartype role: str or ~azure.ai.projects.models.USER + :ivar content: The message content. Supply exactly one text part for the initial Live + conversation history. Required. + :vartype content: list[~azure.ai.projects.models.LiveInitialInputTextContentPartParam] """ - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the function to be called. Required.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A description of what the function does, used by the model to choose when and how to call the - function.""" - spec: dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The openapi function shape, described as a JSON Schema object. Required.""" - auth: "_models.OpenApiAuthDetails" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Open API authentication details. Required.""" - default_params: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """List of OpenAPI spec parameters that will use user-provided defaults.""" - functions: Optional[list["_models.OpenApiFunctionDefinitionFunction"]] = rest_field(visibility=["read"]) - """List of function definitions used by OpenApi tool.""" + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Optional[Literal["message"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The history item type. Always ``message``. Default value is \"message\".""" + status: Optional[Union[str, "_models.LiveInitialMessageStatus"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Known values are: \"incomplete\" and \"completed\".""" + role: Literal[LiveInitialItemType.USER] = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The author of this history message. Always ``user``. Required. USER.""" + content: list["_models.LiveInitialInputTextContentPartParam"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The message content. Supply exactly one text part for the initial Live conversation history. + Required.""" @overload def __init__( self, *, - name: str, - spec: dict[str, Any], - auth: "_models.OpenApiAuthDetails", - description: Optional[str] = None, - default_params: Optional[list[str]] = None, + content: list["_models.LiveInitialInputTextContentPartParam"], + id: Optional[str] = None, # pylint: disable=redefined-builtin + type: Optional[Literal["message"]] = None, + status: Optional[Union[str, "_models.LiveInitialMessageStatus"]] = None, ) -> None: ... @overload @@ -15827,36 +15516,40 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.role = LiveInitialItemType.USER # type: ignore -class OpenApiFunctionDefinitionFunction(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """OpenApiFunctionDefinitionFunction. +class LiveInlineSkillParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """LiveInlineSkillParam. - :ivar name: The name of the function to be called. Required. + :ivar type: Defines an inline skill for this request. Required. Default value is "inline". + :vartype type: str + :ivar name: The name of the skill. Required. :vartype name: str - :ivar description: A description of what the function does, used by the model to choose when - and how to call the function. + :ivar description: The description of the skill. Required. :vartype description: str - :ivar parameters: The parameters the functions accepts, described as a JSON Schema object. - Required. - :vartype parameters: dict[str, any] + :ivar source: Inline skill payload. Required. + :vartype source: ~azure.ai.projects.models.LiveInlineSkillSourceParam """ + type: Literal["inline"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Defines an inline skill for this request. Required. Default value is \"inline\".""" name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the function to be called. Required.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A description of what the function does, used by the model to choose when and how to call the - function.""" - parameters: dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The parameters the functions accepts, described as a JSON Schema object. Required.""" + """The name of the skill. Required.""" + description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The description of the skill. Required.""" + source: "_models.LiveInlineSkillSourceParam" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Inline skill payload. Required.""" @overload def __init__( self, *, name: str, - parameters: dict[str, Any], - description: Optional[str] = None, + description: str, + source: "_models.LiveInlineSkillSourceParam", ) -> None: ... @overload @@ -15868,31 +15561,35 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["inline"] = "inline" -class OpenApiManagedAuthDetails( - OpenApiAuthDetails, discriminator="managed_identity" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Security details for OpenApi managed_identity authentication. +class LiveInlineSkillSourceParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Inline skill payload. - :ivar type: The object type, which is always 'managed_identity'. Required. MANAGED_IDENTITY. - :vartype type: str or ~azure.ai.projects.models.MANAGED_IDENTITY - :ivar security_scheme: Connection auth security details. Required. - :vartype security_scheme: ~azure.ai.projects.models.OpenApiManagedSecurityScheme + :ivar type: The type of the inline skill source. Must be ``base64``. Required. Default value is + "base64". + :vartype type: str + :ivar media_type: The media type of the inline skill payload. Must be ``application/zip``. + Required. Default value is "application/zip". + :vartype media_type: str + :ivar data: Base64-encoded skill zip bundle. Required. + :vartype data: str """ - type: Literal[OpenApiAuthType.MANAGED_IDENTITY] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The object type, which is always 'managed_identity'. Required. MANAGED_IDENTITY.""" - security_scheme: "_models.OpenApiManagedSecurityScheme" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Connection auth security details. Required.""" + type: Literal["base64"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of the inline skill source. Must be ``base64``. Required. Default value is \"base64\".""" + media_type: Literal["application/zip"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The media type of the inline skill payload. Must be ``application/zip``. Required. Default + value is \"application/zip\".""" + data: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Base64-encoded skill zip bundle. Required.""" @overload def __init__( self, *, - security_scheme: "_models.OpenApiManagedSecurityScheme", + data: str, ) -> None: ... @overload @@ -15904,24 +15601,59 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = OpenApiAuthType.MANAGED_IDENTITY # type: ignore + self.type: Literal["base64"] = "base64" + self.media_type: Literal["application/zip"] = "application/zip" -class OpenApiManagedSecurityScheme(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Security scheme for OpenApi managed_identity authentication. +class LiveServerEvent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """An event sent by the Live API on a primary WebSocket or sideband connection. - :ivar audience: Authentication scope for managed_identity auth type. Required. - :vartype audience: str + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + LiveServerEventLiveDecisionEvent, LiveServerEventLiveDecisionItemCreated, + LiveServerEventLiveDecisionItemDeleted, LiveServerEventLiveErrorEvent, + LiveServerEventLiveInfoEvent, LiveServerEventLiveResponseEvent, + LiveServerEventLiveSessionClosed, LiveServerEventLiveCommentaryAppended, + LiveServerEventLiveDelegationCreated, LiveInputAudioAppend, LiveServerEventLiveInputAudioMuted, + LiveServerEventLiveInputAudioUnmuted, LiveServerEventLiveInputTranscriptDelta, + LiveServerEventLiveInstructionsAppended, LiveOutputAudioDelta, + LiveServerEventLiveOutputAudioFixturePlayed, LiveServerEventLiveOutputAudioFixturePlaying, + LiveServerEventLiveOutputTranscriptDelta, LiveServerEventLiveSessionStarted, + LiveServerEventLiveThinkingAppended, LiveServerEventLiveSessionUpdated, + LiveServerEventLiveSessionUsageUpdated, LiveServerEventLiveTransportAnswered, + LiveTransportDTMFReceived, LiveTransportDTMFSend, LiveServerEventLiveTransportFailed, + LiveServerEventLiveTransportRinging + + :ivar type: Required. Known values are: "session.started", "session.updated", + "session.input_audio.muted", "session.input_audio.unmuted", + "session.output_audio.fixture.playing", "session.output_audio.fixture.played", + "session.instructions.appended", "session.thinking.appended", "session.commentary.appended", + "session.input_audio.append", "session.output_audio.delta", "session.input_transcript.delta", + "session.output_transcript.delta", "session.delegation.created", "decision.event", + "decision.item.created", "decision.item.deleted", "response.event", "session.usage.updated", + "session.closed", "error", "info", "transport.dtmf.received", "transport.dtmf.send", + "transport.ringing", "transport.answered", and "transport.failed". + :vartype type: str or ~azure.ai.projects.models.LiveServerEventType """ - audience: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Authentication scope for managed_identity auth type. Required.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"session.started\", \"session.updated\", + \"session.input_audio.muted\", \"session.input_audio.unmuted\", + \"session.output_audio.fixture.playing\", \"session.output_audio.fixture.played\", + \"session.instructions.appended\", \"session.thinking.appended\", + \"session.commentary.appended\", \"session.input_audio.append\", + \"session.output_audio.delta\", \"session.input_transcript.delta\", + \"session.output_transcript.delta\", \"session.delegation.created\", \"decision.event\", + \"decision.item.created\", \"decision.item.deleted\", \"response.event\", + \"session.usage.updated\", \"session.closed\", \"error\", \"info\", + \"transport.dtmf.received\", \"transport.dtmf.send\", \"transport.ringing\", + \"transport.answered\", and \"transport.failed\".""" @overload def __init__( self, *, - audience: str, + type: str, ) -> None: ... @overload @@ -15935,30 +15667,33 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OpenApiProjectConnectionAuthDetails( - OpenApiAuthDetails, discriminator="project_connection" +class LiveInputAudioAppend( + LiveServerEvent, discriminator="session.input_audio.append" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Security details for OpenApi project connection authentication. - - :ivar type: The object type, which is always 'project_connection'. Required. - PROJECT_CONNECTION. - :vartype type: str or ~azure.ai.projects.models.PROJECT_CONNECTION - :ivar security_scheme: Project connection auth security details. Required. - :vartype security_scheme: ~azure.ai.projects.models.OpenApiProjectConnectionSecurityScheme + """Input audio received from the primary transport and reflected to a Live sideband connection + before model-input muting. + + :ivar type: The event type, always ``session.input_audio.append``. Required. + SESSION_INPUT_AUDIO_APPEND. + :vartype type: str or ~azure.ai.projects.models.SESSION_INPUT_AUDIO_APPEND + :ivar audio: Base64-encoded raw mono PCM16LE at 24 kHz received from the primary transport, + reflected to the sideband before model-input muting. This server event uses the same audio key + as the client command, but is not an acknowledgment of it. Required. + :vartype audio: str """ - type: Literal[OpenApiAuthType.PROJECT_CONNECTION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The object type, which is always 'project_connection'. Required. PROJECT_CONNECTION.""" - security_scheme: "_models.OpenApiProjectConnectionSecurityScheme" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Project connection auth security details. Required.""" + type: Literal[LiveServerEventType.SESSION_INPUT_AUDIO_APPEND] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, always ``session.input_audio.append``. Required. SESSION_INPUT_AUDIO_APPEND.""" + audio: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Base64-encoded raw mono PCM16LE at 24 kHz received from the primary transport, reflected to the + sideband before model-input muting. This server event uses the same audio key as the client + command, but is not an acknowledgment of it. Required.""" @overload def __init__( self, *, - security_scheme: "_models.OpenApiProjectConnectionSecurityScheme", + audio: str, ) -> None: ... @overload @@ -15970,24 +15705,48 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = OpenApiAuthType.PROJECT_CONNECTION # type: ignore + self.type = LiveServerEventType.SESSION_INPUT_AUDIO_APPEND # type: ignore -class OpenApiProjectConnectionSecurityScheme(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Security scheme for OpenApi managed_identity authentication. +class LiveLiveError(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Details of an error encountered by the Live session, including the affected parameter or client + command when available. - :ivar project_connection_id: Project connection id for Project Connection auth type. Required. - :vartype project_connection_id: str + :ivar type: The category of error, such as ``invalid_request_error`` for an invalid Live client + command. Required. + :vartype type: str + :ivar code: A machine-readable code identifying the Live error, such as ``unknown_parameter``. + Required. + :vartype code: str + :ivar message: A human-readable explanation of the Live error. Required. + :vartype message: str + :ivar param: The parameter that caused the error, when applicable, such as ``session.voice``. + :vartype param: str + :ivar client_event_id: The event_id of the client command that caused the error, when supplied. + :vartype client_event_id: str """ - project_connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Project connection id for Project Connection auth type. Required.""" + type: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The category of error, such as ``invalid_request_error`` for an invalid Live client command. + Required.""" + code: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A machine-readable code identifying the Live error, such as ``unknown_parameter``. Required.""" + message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A human-readable explanation of the Live error. Required.""" + param: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The parameter that caused the error, when applicable, such as ``session.voice``.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command that caused the error, when supplied.""" @overload def __init__( self, *, - project_connection_id: str, + type: str, + code: str, + message: str, + param: Optional[str] = None, + client_event_id: Optional[str] = None, ) -> None: ... @overload @@ -16001,35 +15760,26 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OpenApiTool(Tool, discriminator="openapi"): # pylint: disable=docstring-keyword-should-match-keyword-only - """The input definition information for an OpenAPI tool as used to configure an agent. +class LiveLocalEnvironmentParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """LiveLocalEnvironmentParam. - :ivar type: The object type, which is always 'openapi'. Required. OPENAPI. - :vartype type: str or ~azure.ai.projects.models.OPENAPI - :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future - version. - :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] - :ivar openapi: The openapi function definition. Required. - :vartype openapi: ~azure.ai.projects.models.OpenApiFunctionDefinition + :ivar type: Use a local computer environment. Required. Default value is "local". + :vartype type: str + :ivar skills: + :vartype skills: list[~azure.ai.projects.models.LiveLocalSkillParam] """ - type: Literal[ToolType.OPENAPI] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The object type, which is always 'openapi'. Required. OPENAPI.""" - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Deprecated. This property is deprecated and will be removed in a future version.""" - openapi: "_models.OpenApiFunctionDefinition" = rest_field( + type: Literal["local"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Use a local computer environment. Required. Default value is \"local\".""" + skills: Optional[list["_models.LiveLocalSkillParam"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The openapi function definition. Required.""" @overload def __init__( self, *, - openapi: "_models.OpenApiFunctionDefinition", - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + skills: Optional[list["_models.LiveLocalSkillParam"]] = None, ) -> None: ... @overload @@ -16041,43 +15791,34 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.OPENAPI # type: ignore + self.type: Literal["local"] = "local" -class OpenApiToolboxTool( - ToolboxTool, discriminator="openapi" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """An OpenAPI tool stored in a toolbox. +class LiveLocalSkillParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """LiveLocalSkillParam. - :ivar name: Optional user-defined name for this tool or configuration. + :ivar name: The name of the skill. Required. :vartype name: str - :ivar description: Optional user-defined description for this tool or configuration. + :ivar description: The description of the skill. Required. :vartype description: str - :ivar tool_configs: Per-tool configuration map. Keys are tool names or ``*`` (catch-all - default). Resolution order: exact tool name match takes priority over ``*``. Unknown tool names - are silently ignored at runtime. - :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] - :ivar type: Required. OPENAPI. - :vartype type: str or ~azure.ai.projects.models.OPENAPI - :ivar openapi: The openapi function definition. Required. - :vartype openapi: ~azure.ai.projects.models.OpenApiFunctionDefinition + :ivar path: The path to the directory containing the skill. Required. + :vartype path: str """ - type: Literal[ToolboxToolType.OPENAPI] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. OPENAPI.""" - openapi: "_models.OpenApiFunctionDefinition" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The openapi function definition. Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the skill. Required.""" + description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The description of the skill. Required.""" + path: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The path to the directory containing the skill. Required.""" @overload def __init__( self, *, - openapi: "_models.OpenApiFunctionDefinition", - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + name: str, + description: str, + path: str, ) -> None: ... @overload @@ -16089,28 +15830,31 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolboxToolType.OPENAPI # type: ignore - -class OptimizationContext(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Base model for typed optimization context. - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - SteeringPromptOptimizationContext +class LiveMCPToolChoiceParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """LiveMCPToolChoiceParam. - :ivar type: Optimization context type discriminator. Required. "steering_prompt" - :vartype type: str or ~azure.ai.projects.models.OptimizationContextType + :ivar type: The tool to call. Always ``mcp``. Required. Default value is "mcp". + :vartype type: str + :ivar server_label: The label of the MCP server to call. Required. + :vartype server_label: str + :ivar name: + :vartype name: str """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Optimization context type discriminator. Required. \"steering_prompt\"""" + type: Literal["mcp"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The tool to call. Always ``mcp``. Required. Default value is \"mcp\".""" + server_label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The label of the MCP server to call. Required.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - type: str, + server_label: str, + name: Optional[str] = None, ) -> None: ... @overload @@ -16122,42 +15866,80 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["mcp"] = "mcp" -class TelemetryEndpoint(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A telemetry export endpoint configuration. +class LiveMCPToolInputParam(_Model): # pylint: disable=docstring-missing-param + """LiveMCPToolInputParam. - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - OtlpTelemetryEndpoint + :ivar type: Required. Default value is "mcp". + :vartype type: str + """ - :ivar kind: The telemetry export endpoint kind. Required. "OTLP" - :vartype kind: str or ~azure.ai.projects.models.TelemetryEndpointKind - :ivar data: Data types to export to this endpoint. Use an empty array to export no data. - Required. - :vartype data: list[str or ~azure.ai.projects.models.TelemetryDataKind] - :ivar auth: Optional authentication configuration. - :vartype auth: ~azure.ai.projects.models.TelemetryEndpointAuth + type: Literal["mcp"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"mcp\".""" + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type: Literal["mcp"] = "mcp" + + +class LiveNamespaceToolInputParam(_Model): # pylint: disable=docstring-missing-param + """LiveNamespaceToolInputParam. + + :ivar type: Required. Default value is "namespace". + :vartype type: str """ - __mapping__: dict[str, _Model] = {} - kind: str = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) - """The telemetry export endpoint kind. Required. \"OTLP\"""" - data: list[Union[str, "_models.TelemetryDataKind"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Data types to export to this endpoint. Use an empty array to export no data. Required.""" - auth: Optional["_models.TelemetryEndpointAuth"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Optional authentication configuration.""" + type: Literal["namespace"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"namespace\".""" + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type: Literal["namespace"] = "namespace" + + +class LiveOutputAudioDelta( + LiveServerEvent, discriminator="session.output_audio.delta" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """An audio chunk generated by the Live model. Decode and play primary WebSocket chunks in + delivery order using the configured session audio format. Sideband connections receive + reflected output audio with timestamps. + + :ivar type: The event type, always ``session.output_audio.delta``. Required. + SESSION_OUTPUT_AUDIO_DELTA. + :vartype type: str or ~azure.ai.projects.models.SESSION_OUTPUT_AUDIO_DELTA + :ivar delta: Base64-encoded raw audio. Primary WebSocket events use the session's configured + format; reflected sideband events use mono PCM16LE at 24 kHz. Required. + :vartype delta: str + :ivar start_ms: Inclusive session-relative start in milliseconds. Required on reflected + sideband events; omitted on the primary WebSocket. + :vartype start_ms: int + :ivar end_ms: Exclusive session-relative end in milliseconds. Required on reflected sideband + events; omitted on the primary WebSocket. Dropped output frames leave gaps between reflected + ranges. + :vartype end_ms: int + """ + + type: Literal[LiveServerEventType.SESSION_OUTPUT_AUDIO_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, always ``session.output_audio.delta``. Required. SESSION_OUTPUT_AUDIO_DELTA.""" + delta: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Base64-encoded raw audio. Primary WebSocket events use the session's configured format; + reflected sideband events use mono PCM16LE at 24 kHz. Required.""" + start_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Inclusive session-relative start in milliseconds. Required on reflected sideband events; + omitted on the primary WebSocket.""" + end_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Exclusive session-relative end in milliseconds. Required on reflected sideband events; omitted + on the primary WebSocket. Dropped output frames leave gaps between reflected ranges.""" @overload def __init__( self, *, - kind: str, - data: list[Union[str, "_models.TelemetryDataKind"]], - auth: Optional["_models.TelemetryEndpointAuth"] = None, + delta: str, + start_ms: Optional[int] = None, + end_ms: Optional[int] = None, ) -> None: ... @overload @@ -16169,47 +15951,51 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = LiveServerEventType.SESSION_OUTPUT_AUDIO_DELTA # type: ignore -class OtlpTelemetryEndpoint( - TelemetryEndpoint, discriminator="OTLP" +class LiveProgrammaticToolInputParam(_Model): # pylint: disable=docstring-missing-param + """LiveProgrammaticToolInputParam. + + :ivar type: Required. Default value is "programmatic_tool_calling". + :vartype type: str + """ + + type: Literal["programmatic_tool_calling"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"programmatic_tool_calling\".""" + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type: Literal["programmatic_tool_calling"] = "programmatic_tool_calling" + + +class LiveResponsesDelegationParam( + Delegation, discriminator="responses" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """An OTLP (OpenTelemetry Protocol) telemetry export endpoint. + """Delegate tasks to a Responses model managed by the Live session. - :ivar data: Data types to export to this endpoint. Use an empty array to export no data. - Required. - :vartype data: list[str or ~azure.ai.projects.models.TelemetryDataKind] - :ivar auth: Optional authentication configuration. - :vartype auth: ~azure.ai.projects.models.TelemetryEndpointAuth - :ivar kind: The endpoint kind, always 'OTLP' for OpenTelemetry Protocol endpoints. Required. - OpenTelemetry Protocol (OTLP) endpoint. - :vartype kind: str or ~azure.ai.projects.models.OTLP - :ivar endpoint: The OTLP collector endpoint URL. Required. - :vartype endpoint: str - :ivar protocol: The transport protocol for the OTLP endpoint. Required. Known values are: - "Http" and "Grpc". - :vartype protocol: str or ~azure.ai.projects.models.TelemetryTransportProtocol + :ivar type: The delegation owner. Always ``responses`` for tasks handled by the Responses API. + Required. RESPONSES. + :vartype type: str or ~azure.ai.projects.models.RESPONSES + :ivar responses: Backend model, prompt, and tools used when the Live session delegates a task + to Responses. Required. + :vartype responses: ~azure.ai.projects.models.LiveResponsesDelegationSettingsInputParam """ - kind: Literal[TelemetryEndpointKind.OTLP] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The endpoint kind, always 'OTLP' for OpenTelemetry Protocol endpoints. Required. OpenTelemetry - Protocol (OTLP) endpoint.""" - endpoint: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The OTLP collector endpoint URL. Required.""" - protocol: Union[str, "_models.TelemetryTransportProtocol"] = rest_field( + type: Literal[DelegationType.RESPONSES] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The delegation owner. Always ``responses`` for tasks handled by the Responses API. Required. + RESPONSES.""" + responses: "_models.LiveResponsesDelegationSettingsInputParam" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The transport protocol for the OTLP endpoint. Required. Known values are: \"Http\" and - \"Grpc\".""" + """Backend model, prompt, and tools used when the Live session delegates a task to Responses. + Required.""" @overload def __init__( self, *, - data: list[Union[str, "_models.TelemetryDataKind"]], - endpoint: str, - protocol: Union[str, "_models.TelemetryTransportProtocol"], - auth: Optional["_models.TelemetryEndpointAuth"] = None, + responses: "_models.LiveResponsesDelegationSettingsInputParam", ) -> None: ... @overload @@ -16221,43 +16007,180 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.kind = TelemetryEndpointKind.OTLP # type: ignore + self.type = DelegationType.RESPONSES # type: ignore -class PendingUploadRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Represents a request for a pending upload. +class LiveResponsesDelegationSettingsInputParam( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Model, prompt, and tool settings for tasks delegated by the Live session to a Responses + backend. - :ivar pending_upload_id: If PendingUploadId is not provided, a random GUID will be used. - :vartype pending_upload_id: str - :ivar connection_name: Azure Storage Account connection name to use for generating temporary - SAS token. - :vartype connection_name: str - :ivar pending_upload_type: The type of pending upload. Required. Deprecated: the service never - read this value and silently ignored it. Use TemporaryBlobReference instead. - :vartype pending_upload_type: str or ~azure.ai.projects.models.BLOB_REFERENCE + :ivar model: The model used for server-owned Responses delegations. Required. + :vartype model: str + :ivar instructions: + :vartype instructions: str + :ivar max_output_tokens: + :vartype max_output_tokens: int + :ivar service_tier: Known values are: "auto", "default", "fast_tier_temp_pilot", "flex", + "priority", and "ultrafast". + :vartype service_tier: str or ~azure.ai.projects.models.LiveResponsesServiceTier + :ivar reasoning: + :vartype reasoning: ~azure.ai.projects.models.LiveDelegationReasoningInputParam + :ivar text: + :vartype text: ~azure.ai.projects.models.LiveDelegationTextInputParam + :ivar tools: Tools available to the Responses backend while it handles tasks delegated by the + Live model. + :vartype tools: list[~azure.ai.projects.models.LiveFunctionToolInputParam or + ~azure.ai.projects.models.LiveWebSearchToolInputParam or + ~azure.ai.projects.models.LiveFileSearchToolInputParam or + ~azure.ai.projects.models.LiveCodeInterpreterToolInputParam or + ~azure.ai.projects.models.LiveHostedShellToolInputParam or + ~azure.ai.projects.models.LiveImageGenerationToolInputParam or + ~azure.ai.projects.models.LiveMCPToolInputParam or + ~azure.ai.projects.models.LiveCustomToolInputParam or + ~azure.ai.projects.models.LiveNamespaceToolInputParam or + ~azure.ai.projects.models.LiveToolSearchToolInputParam or + ~azure.ai.projects.models.LiveProgrammaticToolInputParam or + ~azure.ai.projects.models.LiveComputerToolInputParam or + ~azure.ai.projects.models.LiveApplyPatchToolInputParam] + :ivar tool_choice: Controls which tool the Responses backend uses when handling a task + delegated by the Live model. Is one of the following types: Union[str, + "_models.LiveToolChoiceEnum"], LiveFunctionToolChoiceParam, LiveMCPToolChoiceParam, + LiveSpecificFileSearchParam, LiveSpecificWebSearchParam, LiveSpecificWebSearchPreviewParam, + LiveSpecificImageGenParam, LiveSpecificComputerParam, LiveSpecificCodeInterpreterParam, + LiveSpecificProgrammaticToolCallingParam, LiveSpecificFunctionShellParam, + LiveSpecificCustomToolParam, LiveSpecificApplyPatchParam, LiveAllowedToolsChoiceParam + :vartype tool_choice: str or ~azure.ai.projects.models.LiveToolChoiceEnum or + ~azure.ai.projects.models.LiveFunctionToolChoiceParam or + ~azure.ai.projects.models.LiveMCPToolChoiceParam or + ~azure.ai.projects.models.LiveSpecificFileSearchParam or + ~azure.ai.projects.models.LiveSpecificWebSearchParam or + ~azure.ai.projects.models.LiveSpecificWebSearchPreviewParam or + ~azure.ai.projects.models.LiveSpecificImageGenParam or + ~azure.ai.projects.models.LiveSpecificComputerParam or + ~azure.ai.projects.models.LiveSpecificCodeInterpreterParam or + ~azure.ai.projects.models.LiveSpecificProgrammaticToolCallingParam or + ~azure.ai.projects.models.LiveSpecificFunctionShellParam or + ~azure.ai.projects.models.LiveSpecificCustomToolParam or + ~azure.ai.projects.models.LiveSpecificApplyPatchParam or + ~azure.ai.projects.models.LiveAllowedToolsChoiceParam + :ivar parallel_tool_calls: + :vartype parallel_tool_calls: bool """ - pending_upload_id: Optional[str] = rest_field( - name="pendingUploadId", visibility=["read", "create", "update", "delete", "query"] + model: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The model used for server-owned Responses delegations. Required.""" + instructions: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + max_output_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + service_tier: Optional[Union[str, "_models.LiveResponsesServiceTier"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """If PendingUploadId is not provided, a random GUID will be used.""" - connection_name: Optional[str] = rest_field( - name="connectionName", visibility=["read", "create", "update", "delete", "query"] + """Known values are: \"auto\", \"default\", \"fast_tier_temp_pilot\", \"flex\", \"priority\", and + \"ultrafast\".""" + reasoning: Optional["_models.LiveDelegationReasoningInputParam"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """Azure Storage Account connection name to use for generating temporary SAS token.""" - pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE] = rest_field( - name="pendingUploadType", visibility=["read", "create", "update", "delete", "query"] + text: Optional["_models.LiveDelegationTextInputParam"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """The type of pending upload. Required. Deprecated: the service never read this value and - silently ignored it. Use TemporaryBlobReference instead.""" + tools: Optional[ + list[ + Union[ + "_models.LiveFunctionToolInputParam", + "_models.LiveWebSearchToolInputParam", + "_models.LiveFileSearchToolInputParam", + "_models.LiveCodeInterpreterToolInputParam", + "_models.LiveHostedShellToolInputParam", + "_models.LiveImageGenerationToolInputParam", + "_models.LiveMCPToolInputParam", + "_models.LiveCustomToolInputParam", + "_models.LiveNamespaceToolInputParam", + "_models.LiveToolSearchToolInputParam", + "_models.LiveProgrammaticToolInputParam", + "_models.LiveComputerToolInputParam", + "_models.LiveApplyPatchToolInputParam", + ] + ] + ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Tools available to the Responses backend while it handles tasks delegated by the Live model.""" + tool_choice: Optional[ + Union[ + str, + "_models.LiveToolChoiceEnum", + "_models.LiveFunctionToolChoiceParam", + "_models.LiveMCPToolChoiceParam", + "_models.LiveSpecificFileSearchParam", + "_models.LiveSpecificWebSearchParam", + "_models.LiveSpecificWebSearchPreviewParam", + "_models.LiveSpecificImageGenParam", + "_models.LiveSpecificComputerParam", + "_models.LiveSpecificCodeInterpreterParam", + "_models.LiveSpecificProgrammaticToolCallingParam", + "_models.LiveSpecificFunctionShellParam", + "_models.LiveSpecificCustomToolParam", + "_models.LiveSpecificApplyPatchParam", + "_models.LiveAllowedToolsChoiceParam", + ] + ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Controls which tool the Responses backend uses when handling a task delegated by the Live + model. Is one of the following types: Union[str, \"_models.LiveToolChoiceEnum\"], + LiveFunctionToolChoiceParam, LiveMCPToolChoiceParam, LiveSpecificFileSearchParam, + LiveSpecificWebSearchParam, LiveSpecificWebSearchPreviewParam, LiveSpecificImageGenParam, + LiveSpecificComputerParam, LiveSpecificCodeInterpreterParam, + LiveSpecificProgrammaticToolCallingParam, LiveSpecificFunctionShellParam, + LiveSpecificCustomToolParam, LiveSpecificApplyPatchParam, LiveAllowedToolsChoiceParam""" + parallel_tool_calls: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE], - pending_upload_id: Optional[str] = None, - connection_name: Optional[str] = None, + model: str, + instructions: Optional[str] = None, + max_output_tokens: Optional[int] = None, + service_tier: Optional[Union[str, "_models.LiveResponsesServiceTier"]] = None, + reasoning: Optional["_models.LiveDelegationReasoningInputParam"] = None, + text: Optional["_models.LiveDelegationTextInputParam"] = None, + tools: Optional[ + list[ + Union[ + "_models.LiveFunctionToolInputParam", + "_models.LiveWebSearchToolInputParam", + "_models.LiveFileSearchToolInputParam", + "_models.LiveCodeInterpreterToolInputParam", + "_models.LiveHostedShellToolInputParam", + "_models.LiveImageGenerationToolInputParam", + "_models.LiveMCPToolInputParam", + "_models.LiveCustomToolInputParam", + "_models.LiveNamespaceToolInputParam", + "_models.LiveToolSearchToolInputParam", + "_models.LiveProgrammaticToolInputParam", + "_models.LiveComputerToolInputParam", + "_models.LiveApplyPatchToolInputParam", + ] + ] + ] = None, + tool_choice: Optional[ + Union[ + str, + "_models.LiveToolChoiceEnum", + "_models.LiveFunctionToolChoiceParam", + "_models.LiveMCPToolChoiceParam", + "_models.LiveSpecificFileSearchParam", + "_models.LiveSpecificWebSearchParam", + "_models.LiveSpecificWebSearchPreviewParam", + "_models.LiveSpecificImageGenParam", + "_models.LiveSpecificComputerParam", + "_models.LiveSpecificCodeInterpreterParam", + "_models.LiveSpecificProgrammaticToolCallingParam", + "_models.LiveSpecificFunctionShellParam", + "_models.LiveSpecificCustomToolParam", + "_models.LiveSpecificApplyPatchParam", + "_models.LiveAllowedToolsChoiceParam", + ] + ] = None, + parallel_tool_calls: Optional[bool] = None, ) -> None: ... @overload @@ -16271,45 +16194,179 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PendingUploadResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Represents the response for a pending upload request. +class LiveResponsesDelegationSettingsUpdateInputParam( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Updates to the Responses backend of an existing Live session. Omitted settings retain their + current values. - :ivar blob_reference: Container-level read, write, list SAS. Required. - :vartype blob_reference: ~azure.ai.projects.models.BlobReference - :ivar pending_upload_id: ID for this upload request. Required. - :vartype pending_upload_id: str - :ivar version: Version of asset to be created if user did not specify version when initially - creating upload. - :vartype version: str - :ivar pending_upload_type: The type of pending upload. Required. Deprecated: the service never - read this value and silently ignored it. Use TemporaryBlobReference instead. - :vartype pending_upload_type: str or ~azure.ai.projects.models.BLOB_REFERENCE + :ivar model: The Responses backend model to use for subsequent delegated requests. Omit to keep + the current backend model. + :vartype model: str + :ivar instructions: + :vartype instructions: str + :ivar max_output_tokens: + :vartype max_output_tokens: int + :ivar service_tier: Known values are: "auto", "default", "fast_tier_temp_pilot", "flex", + "priority", and "ultrafast". + :vartype service_tier: str or ~azure.ai.projects.models.LiveResponsesServiceTier + :ivar reasoning: + :vartype reasoning: ~azure.ai.projects.models.LiveDelegationReasoningInputParam + :ivar text: + :vartype text: ~azure.ai.projects.models.LiveDelegationTextInputParam + :ivar tools: Tools available to the Responses backend while it handles tasks delegated by the + Live model. + :vartype tools: list[~azure.ai.projects.models.LiveFunctionToolInputParam or + ~azure.ai.projects.models.LiveWebSearchToolInputParam or + ~azure.ai.projects.models.LiveFileSearchToolInputParam or + ~azure.ai.projects.models.LiveCodeInterpreterToolInputParam or + ~azure.ai.projects.models.LiveHostedShellToolInputParam or + ~azure.ai.projects.models.LiveImageGenerationToolInputParam or + ~azure.ai.projects.models.LiveMCPToolInputParam or + ~azure.ai.projects.models.LiveCustomToolInputParam or + ~azure.ai.projects.models.LiveNamespaceToolInputParam or + ~azure.ai.projects.models.LiveToolSearchToolInputParam or + ~azure.ai.projects.models.LiveProgrammaticToolInputParam or + ~azure.ai.projects.models.LiveComputerToolInputParam or + ~azure.ai.projects.models.LiveApplyPatchToolInputParam] + :ivar tool_choice: Controls which tool the Responses backend uses when handling a task + delegated by the Live model. Is one of the following types: Union[str, + "_models.LiveToolChoiceEnum"], LiveFunctionToolChoiceParam, LiveMCPToolChoiceParam, + LiveSpecificFileSearchParam, LiveSpecificWebSearchParam, LiveSpecificWebSearchPreviewParam, + LiveSpecificImageGenParam, LiveSpecificComputerParam, LiveSpecificCodeInterpreterParam, + LiveSpecificProgrammaticToolCallingParam, LiveSpecificFunctionShellParam, + LiveSpecificCustomToolParam, LiveSpecificApplyPatchParam, LiveAllowedToolsChoiceParam + :vartype tool_choice: str or ~azure.ai.projects.models.LiveToolChoiceEnum or + ~azure.ai.projects.models.LiveFunctionToolChoiceParam or + ~azure.ai.projects.models.LiveMCPToolChoiceParam or + ~azure.ai.projects.models.LiveSpecificFileSearchParam or + ~azure.ai.projects.models.LiveSpecificWebSearchParam or + ~azure.ai.projects.models.LiveSpecificWebSearchPreviewParam or + ~azure.ai.projects.models.LiveSpecificImageGenParam or + ~azure.ai.projects.models.LiveSpecificComputerParam or + ~azure.ai.projects.models.LiveSpecificCodeInterpreterParam or + ~azure.ai.projects.models.LiveSpecificProgrammaticToolCallingParam or + ~azure.ai.projects.models.LiveSpecificFunctionShellParam or + ~azure.ai.projects.models.LiveSpecificCustomToolParam or + ~azure.ai.projects.models.LiveSpecificApplyPatchParam or + ~azure.ai.projects.models.LiveAllowedToolsChoiceParam + :ivar parallel_tool_calls: + :vartype parallel_tool_calls: bool """ - blob_reference: "_models.BlobReference" = rest_field( - name="blobReference", visibility=["read", "create", "update", "delete", "query"] + model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Responses backend model to use for subsequent delegated requests. Omit to keep the current + backend model.""" + instructions: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + max_output_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + service_tier: Optional[Union[str, "_models.LiveResponsesServiceTier"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """Container-level read, write, list SAS. Required.""" - pending_upload_id: str = rest_field( - name="pendingUploadId", visibility=["read", "create", "update", "delete", "query"] + """Known values are: \"auto\", \"default\", \"fast_tier_temp_pilot\", \"flex\", \"priority\", and + \"ultrafast\".""" + reasoning: Optional["_models.LiveDelegationReasoningInputParam"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """ID for this upload request. Required.""" - version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Version of asset to be created if user did not specify version when initially creating upload.""" - pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE] = rest_field( - name="pendingUploadType", visibility=["read", "create", "update", "delete", "query"] + text: Optional["_models.LiveDelegationTextInputParam"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """The type of pending upload. Required. Deprecated: the service never read this value and - silently ignored it. Use TemporaryBlobReference instead.""" + tools: Optional[ + list[ + Union[ + "_models.LiveFunctionToolInputParam", + "_models.LiveWebSearchToolInputParam", + "_models.LiveFileSearchToolInputParam", + "_models.LiveCodeInterpreterToolInputParam", + "_models.LiveHostedShellToolInputParam", + "_models.LiveImageGenerationToolInputParam", + "_models.LiveMCPToolInputParam", + "_models.LiveCustomToolInputParam", + "_models.LiveNamespaceToolInputParam", + "_models.LiveToolSearchToolInputParam", + "_models.LiveProgrammaticToolInputParam", + "_models.LiveComputerToolInputParam", + "_models.LiveApplyPatchToolInputParam", + ] + ] + ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Tools available to the Responses backend while it handles tasks delegated by the Live model.""" + tool_choice: Optional[ + Union[ + str, + "_models.LiveToolChoiceEnum", + "_models.LiveFunctionToolChoiceParam", + "_models.LiveMCPToolChoiceParam", + "_models.LiveSpecificFileSearchParam", + "_models.LiveSpecificWebSearchParam", + "_models.LiveSpecificWebSearchPreviewParam", + "_models.LiveSpecificImageGenParam", + "_models.LiveSpecificComputerParam", + "_models.LiveSpecificCodeInterpreterParam", + "_models.LiveSpecificProgrammaticToolCallingParam", + "_models.LiveSpecificFunctionShellParam", + "_models.LiveSpecificCustomToolParam", + "_models.LiveSpecificApplyPatchParam", + "_models.LiveAllowedToolsChoiceParam", + ] + ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Controls which tool the Responses backend uses when handling a task delegated by the Live + model. Is one of the following types: Union[str, \"_models.LiveToolChoiceEnum\"], + LiveFunctionToolChoiceParam, LiveMCPToolChoiceParam, LiveSpecificFileSearchParam, + LiveSpecificWebSearchParam, LiveSpecificWebSearchPreviewParam, LiveSpecificImageGenParam, + LiveSpecificComputerParam, LiveSpecificCodeInterpreterParam, + LiveSpecificProgrammaticToolCallingParam, LiveSpecificFunctionShellParam, + LiveSpecificCustomToolParam, LiveSpecificApplyPatchParam, LiveAllowedToolsChoiceParam""" + parallel_tool_calls: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - blob_reference: "_models.BlobReference", - pending_upload_id: str, - pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE], - version: Optional[str] = None, + model: Optional[str] = None, + instructions: Optional[str] = None, + max_output_tokens: Optional[int] = None, + service_tier: Optional[Union[str, "_models.LiveResponsesServiceTier"]] = None, + reasoning: Optional["_models.LiveDelegationReasoningInputParam"] = None, + text: Optional["_models.LiveDelegationTextInputParam"] = None, + tools: Optional[ + list[ + Union[ + "_models.LiveFunctionToolInputParam", + "_models.LiveWebSearchToolInputParam", + "_models.LiveFileSearchToolInputParam", + "_models.LiveCodeInterpreterToolInputParam", + "_models.LiveHostedShellToolInputParam", + "_models.LiveImageGenerationToolInputParam", + "_models.LiveMCPToolInputParam", + "_models.LiveCustomToolInputParam", + "_models.LiveNamespaceToolInputParam", + "_models.LiveToolSearchToolInputParam", + "_models.LiveProgrammaticToolInputParam", + "_models.LiveComputerToolInputParam", + "_models.LiveApplyPatchToolInputParam", + ] + ] + ] = None, + tool_choice: Optional[ + Union[ + str, + "_models.LiveToolChoiceEnum", + "_models.LiveFunctionToolChoiceParam", + "_models.LiveMCPToolChoiceParam", + "_models.LiveSpecificFileSearchParam", + "_models.LiveSpecificWebSearchParam", + "_models.LiveSpecificWebSearchPreviewParam", + "_models.LiveSpecificImageGenParam", + "_models.LiveSpecificComputerParam", + "_models.LiveSpecificCodeInterpreterParam", + "_models.LiveSpecificProgrammaticToolCallingParam", + "_models.LiveSpecificFunctionShellParam", + "_models.LiveSpecificCustomToolParam", + "_models.LiveSpecificApplyPatchParam", + "_models.LiveAllowedToolsChoiceParam", + ] + ] = None, + parallel_tool_calls: Optional[bool] = None, ) -> None: ... @overload @@ -16323,23 +16380,31 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PickPropertiesVoiceAgentAudioConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The template for picking properties. +class LiveResponsesDelegationUpdateParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Update the Responses backend for an existing Live session without changing delegation + ownership. - :ivar output: Output (agent speech) audio configuration. - :vartype output: ~azure.ai.projects.models.VoiceAgentAudioOutputConfig + :ivar type: The delegation owner. Always ``responses`` for tasks handled by the Responses API. + Required. Default value is "responses". + :vartype type: str + :ivar responses: Responses backend settings to update. Omitted settings keep their existing + values. + :vartype responses: ~azure.ai.projects.models.LiveResponsesDelegationSettingsUpdateInputParam """ - output: Optional["_models.VoiceAgentAudioOutputConfig"] = rest_field( + type: Literal["responses"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The delegation owner. Always ``responses`` for tasks handled by the Responses API. Required. + Default value is \"responses\".""" + responses: Optional["_models.LiveResponsesDelegationSettingsUpdateInputParam"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Output (agent speech) audio configuration.""" + """Responses backend settings to update. Omitted settings keep their existing values.""" @overload def __init__( self, *, - output: Optional["_models.VoiceAgentAudioOutputConfig"] = None, + responses: Optional["_models.LiveResponsesDelegationSettingsUpdateInputParam"] = None, ) -> None: ... @overload @@ -16351,38 +16416,53 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["responses"] = "responses" -class ProceduralMemoryItem( - MemoryItem, discriminator="procedural" +class LiveServerEventLiveCommentaryAppended( + LiveServerEvent, discriminator="session.commentary.appended" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """A memory item containing a procedure extracted from conversations. + """Returned when a session.commentary.append command is accepted into the Live session timeline. + Acknowledges the added commentary without guaranteeing exact wording or completed audio + playback. - :ivar memory_id: The unique ID of the memory item. Required. - :vartype memory_id: str - :ivar updated_at: The last update time of the memory item. Required. - :vartype updated_at: ~datetime.datetime - :ivar scope: The namespace that logically groups and isolates memories, such as a user ID. - Required. - :vartype scope: str - :ivar content: The content of the memory. Required. - :vartype content: str - :ivar kind: The kind of the memory item. Required. Routine procedures extracted from - conversations. - :vartype kind: str or ~azure.ai.projects.models.PROCEDURAL + :ivar event_id: The unique ID of the Live server event. Required. + :vartype event_id: str + :ivar client_event_id: The event_id of the client command associated with this server event, + when supplied. + :vartype client_event_id: str + :ivar start_ms: The start of this event on the Live session timeline, in milliseconds from the + beginning of the session. Required. + :vartype start_ms: int + :ivar end_ms: The end of this event on the Live session timeline, in milliseconds from the + beginning of the session. For appended context, this can equal start_ms. Required. + :vartype end_ms: int + :ivar type: The event type, always ``session.commentary.appended``. Required. + SESSION_COMMENTARY_APPENDED. + :vartype type: str or ~azure.ai.projects.models.SESSION_COMMENTARY_APPENDED """ - kind: Literal[MemoryItemKind.PROCEDURAL] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The kind of the memory item. Required. Routine procedures extracted from conversations.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the Live server event. Required.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command associated with this server event, when supplied.""" + start_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The start of this event on the Live session timeline, in milliseconds from the beginning of the + session. Required.""" + end_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The end of this event on the Live session timeline, in milliseconds from the beginning of the + session. For appended context, this can equal start_ms. Required.""" + type: Literal[LiveServerEventType.SESSION_COMMENTARY_APPENDED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, always ``session.commentary.appended``. Required. SESSION_COMMENTARY_APPENDED.""" @overload def __init__( self, *, - memory_id: str, - updated_at: datetime.datetime, - scope: str, - content: str, + event_id: str, + start_ms: int, + end_ms: int, + client_event_id: Optional[str] = None, ) -> None: ... @overload @@ -16394,24 +16474,60 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.kind = MemoryItemKind.PROCEDURAL # type: ignore + self.type = LiveServerEventType.SESSION_COMMENTARY_APPENDED # type: ignore -class ProgrammaticToolCallingParam(Tool, discriminator="programmatic_tool_calling"): - """ProgrammaticToolCallingParam. - - :ivar type: The type of the tool. Always ``programmatic_tool_calling``. Required. - PROGRAMMATIC_TOOL_CALLING. - :vartype type: str or ~azure.ai.projects.models.PROGRAMMATIC_TOOL_CALLING - """ +class LiveServerEventLiveDecisionEvent( + LiveServerEvent, discriminator="decision.event" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A Decision API event for a Live delegation or transcript trigger. For a trigger, + source_event_id identifies the transcript delta that caused this evaluation. - type: Literal[ToolType.PROGRAMMATIC_TOOL_CALLING] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the tool. Always ``programmatic_tool_calling``. Required. - PROGRAMMATIC_TOOL_CALLING.""" + :ivar type: Required. DECISION_EVENT. + :vartype type: str or ~azure.ai.projects.models.DECISION_EVENT + :ivar event_id: The unique ID of this Live server event. Required. + :vartype event_id: str + :ivar delegation_id: Required. + :vartype delegation_id: str + :ivar trigger_id: Required. + :vartype trigger_id: str + :ivar source_event_type: Required. Is either a Literal["session.input_transcript.delta"] type + or a Literal["session.output_transcript.delta"] type. + :vartype source_event_type: str or str + :ivar source_event_id: Required. + :vartype source_event_id: str + :ivar event: Required. + :vartype event: ~azure.ai.projects.models.LiveDecisionCompleted + """ + + type: Literal[LiveServerEventType.DECISION_EVENT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. DECISION_EVENT.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of this Live server event. Required.""" + delegation_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + trigger_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + source_event_type: Literal["session.input_transcript.delta", "session.output_transcript.delta"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Is either a Literal[\"session.input_transcript.delta\"] type or a + Literal[\"session.output_transcript.delta\"] type.""" + source_event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + event: "_models.LiveDecisionCompleted" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, + *, + event_id: str, + delegation_id: str, + trigger_id: str, + source_event_type: Literal["session.input_transcript.delta", "session.output_transcript.delta"], + source_event_id: str, + event: "_models.LiveDecisionCompleted", ) -> None: ... @overload @@ -16423,113 +16539,43 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.PROGRAMMATIC_TOOL_CALLING # type: ignore + self.type = LiveServerEventType.DECISION_EVENT # type: ignore -class PromptAgentDefinition( - AgentDefinition, discriminator="prompt" +class LiveServerEventLiveDecisionItemCreated( + LiveServerEvent, discriminator="decision.item.created" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """The prompt agent definition. + """An input item was appended for future decisions. - :ivar rai_config: Configuration for Responsible AI (RAI) content filtering and safety features. - :vartype rai_config: ~azure.ai.projects.models.RaiConfig - :ivar kind: Required. PROMPT. - :vartype kind: str or ~azure.ai.projects.models.PROMPT - :ivar harness: The managed runtime and agent loop used to execute this prompt agent. - :vartype harness: ~azure.ai.projects.models.AgentHarness - :ivar model: The model deployment to use for this agent. Required. - :vartype model: str - :ivar instructions: A system (or developer) message inserted into the model's context. - :vartype instructions: str - :ivar skills: The Foundry skills available to this prompt agent. An omitted skill version is - resolved and pinned when the agent version is created. - :vartype skills: list[~azure.ai.projects.models.SkillReference] - :ivar temperature: What sampling temperature to use, between 0 and 2. Higher values like 0.8 - will make the output more random, while lower values like 0.2 will make it more focused and - deterministic. We generally recommend altering this or ``top_p`` but not both. Defaults to - ``1``. - :vartype temperature: float - :ivar top_p: An alternative to sampling with temperature, called nucleus sampling, where the - model considers the results of the tokens with top_p probability mass. So 0.1 means only the - tokens comprising the top 10% probability mass are considered. We generally recommend altering - this or ``temperature`` but not both. Defaults to ``1``. - :vartype top_p: float - :ivar reasoning: - :vartype reasoning: ~azure.ai.projects.models.Reasoning - :ivar tools: An array of tools the model may call while generating a response. You can specify - which tool to use by setting the ``tool_choice`` parameter. - :vartype tools: list[~azure.ai.projects.models.Tool] - :ivar tool_choice: How the model should select which tool (or tools) to use when generating a - response. See the ``tools`` parameter to see how to specify which tools the model can call. Is - either a str type or a ToolChoiceParam type. - :vartype tool_choice: str or ~azure.ai.projects.models.ToolChoiceParam - :ivar text: Configuration options for a text response from the model. Can be plain text or - structured JSON data. - :vartype text: ~azure.ai.projects.models.PromptAgentDefinitionTextOptions - :ivar structured_inputs: Set of structured inputs that can participate in prompt template - substitution or tool argument bindings. - :vartype structured_inputs: dict[str, ~azure.ai.projects.models.StructuredInputDefinition] + :ivar event_id: The unique ID of the Live server event. Required. + :vartype event_id: str + :ivar client_event_id: The event_id of the client command associated with this server event, + when supplied. + :vartype client_event_id: str + :ivar type: Required. DECISION_ITEM_CREATED. + :vartype type: str or ~azure.ai.projects.models.DECISION_ITEM_CREATED + :ivar item: Required. + :vartype item: ~azure.ai.projects.models.LiveDecisionStoredInputItemParam """ - kind: Literal[AgentKind.PROMPT] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. PROMPT.""" - harness: Optional["_models.AgentHarness"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The managed runtime and agent loop used to execute this prompt agent.""" - model: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The model deployment to use for this agent. Required.""" - instructions: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A system (or developer) message inserted into the model's context.""" - skills: Optional[list["_models.SkillReference"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The Foundry skills available to this prompt agent. An omitted skill version is resolved and - pinned when the agent version is created.""" - temperature: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output - more random, while lower values like 0.2 will make it more focused and deterministic. We - generally recommend altering this or ``top_p`` but not both. Defaults to ``1``.""" - top_p: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """An alternative to sampling with temperature, called nucleus sampling, where the model considers - the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising - the top 10% probability mass are considered. We generally recommend altering this or - ``temperature`` but not both. Defaults to ``1``.""" - reasoning: Optional["_models.Reasoning"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - tools: Optional[list["_models.Tool"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """An array of tools the model may call while generating a response. You can specify which tool to - use by setting the ``tool_choice`` parameter.""" - tool_choice: Optional[Union[str, "_models.ToolChoiceParam"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """How the model should select which tool (or tools) to use when generating a response. See the - ``tools`` parameter to see how to specify which tools the model can call. Is either a str type - or a ToolChoiceParam type.""" - text: Optional["_models.PromptAgentDefinitionTextOptions"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Configuration options for a text response from the model. Can be plain text or structured JSON - data.""" - structured_inputs: Optional[dict[str, "_models.StructuredInputDefinition"]] = rest_field( + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the Live server event. Required.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command associated with this server event, when supplied.""" + type: Literal[LiveServerEventType.DECISION_ITEM_CREATED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. DECISION_ITEM_CREATED.""" + item: "_models.LiveDecisionStoredInputItemParam" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Set of structured inputs that can participate in prompt template substitution or tool argument - bindings.""" + """Required.""" @overload def __init__( self, *, - model: str, - rai_config: Optional["_models.RaiConfig"] = None, - harness: Optional["_models.AgentHarness"] = None, - instructions: Optional[str] = None, - skills: Optional[list["_models.SkillReference"]] = None, - temperature: Optional[float] = None, - top_p: Optional[float] = None, - reasoning: Optional["_models.Reasoning"] = None, - tools: Optional[list["_models.Tool"]] = None, - tool_choice: Optional[Union[str, "_models.ToolChoiceParam"]] = None, - text: Optional["_models.PromptAgentDefinitionTextOptions"] = None, - structured_inputs: Optional[dict[str, "_models.StructuredInputDefinition"]] = None, + event_id: str, + item: "_models.LiveDecisionStoredInputItemParam", + client_event_id: Optional[str] = None, ) -> None: ... @overload @@ -16541,26 +16587,41 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.kind = AgentKind.PROMPT # type: ignore + self.type = LiveServerEventType.DECISION_ITEM_CREATED # type: ignore -class PromptAgentDefinitionTextOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Configuration options for a text response from the model. Can be plain text or structured JSON - data. +class LiveServerEventLiveDecisionItemDeleted( + LiveServerEvent, discriminator="decision.item.deleted" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """An input item was removed from future decisions. - :ivar format: - :vartype format: ~azure.ai.projects.models.TextResponseFormat + :ivar event_id: The unique ID of the Live server event. Required. + :vartype event_id: str + :ivar client_event_id: The event_id of the client command associated with this server event, + when supplied. + :vartype client_event_id: str + :ivar type: Required. DECISION_ITEM_DELETED. + :vartype type: str or ~azure.ai.projects.models.DECISION_ITEM_DELETED + :ivar item_id: Required. + :vartype item_id: str """ - format: Optional["_models.TextResponseFormat"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the Live server event. Required.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command associated with this server event, when supplied.""" + type: Literal[LiveServerEventType.DECISION_ITEM_DELETED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. DECISION_ITEM_DELETED.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - format: Optional["_models.TextResponseFormat"] = None, + event_id: str, + item_id: str, + client_event_id: Optional[str] = None, ) -> None: ... @overload @@ -16572,40 +16633,55 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = LiveServerEventType.DECISION_ITEM_DELETED # type: ignore -class PromptBasedEvaluatorDefinition( - EvaluatorDefinition, discriminator="prompt" +class LiveServerEventLiveDelegationCreated( + LiveServerEvent, discriminator="session.delegation.created" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Prompt-based evaluator. + """Returned when the Live model delegates work to your application, Responses, or Decisions. + Contains delegation metadata and the position on the session timeline where the work was + delegated. - :ivar init_parameters: The JSON schema (Draft 2020-12) for the evaluator's input parameters. - This includes parameters like type, properties, required. - :vartype init_parameters: dict[str, any] - :ivar data_schema: The JSON schema (Draft 2020-12) for the evaluator's input data. This - includes parameters like type, properties, required. - :vartype data_schema: dict[str, any] - :ivar metrics: List of output metrics produced by this evaluator. - :vartype metrics: dict[str, ~azure.ai.projects.models.EvaluatorMetric] - :ivar type: Required. Prompt-based definition. - :vartype type: str or ~azure.ai.projects.models.PROMPT - :ivar prompt_text: The prompt text used for evaluation. Required. - :vartype prompt_text: str + :ivar event_id: The unique ID of the Live server event. Required. + :vartype event_id: str + :ivar client_event_id: The event_id of the client command associated with this server event, + when supplied. + :vartype client_event_id: str + :ivar type: The event type, always ``session.delegation.created``. Required. + SESSION_DELEGATION_CREATED. + :vartype type: str or ~azure.ai.projects.models.SESSION_DELEGATION_CREATED + :ivar offset_ms: The position on the Live session timeline where the delegation was created, in + milliseconds from the beginning of the session. Required. + :vartype offset_ms: int + :ivar delegation: The delegated work identifier and destination. This object contains metadata, + not the task text. Required. + :vartype delegation: ~azure.ai.projects.models.VoiceAgentLiveDelegationItem """ - type: Literal[EvaluatorDefinitionType.PROMPT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Prompt-based definition.""" - prompt_text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The prompt text used for evaluation. Required.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the Live server event. Required.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command associated with this server event, when supplied.""" + type: Literal[LiveServerEventType.SESSION_DELEGATION_CREATED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, always ``session.delegation.created``. Required. SESSION_DELEGATION_CREATED.""" + offset_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The position on the Live session timeline where the delegation was created, in milliseconds + from the beginning of the session. Required.""" + delegation: "_models.VoiceAgentLiveDelegationItem" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The delegated work identifier and destination. This object contains metadata, not the task + text. Required.""" @overload def __init__( self, *, - prompt_text: str, - init_parameters: Optional[dict[str, Any]] = None, - data_schema: Optional[dict[str, Any]] = None, - metrics: Optional[dict[str, "_models.EvaluatorMetric"]] = None, + event_id: str, + offset_ms: int, + delegation: "_models.VoiceAgentLiveDelegationItem", + client_event_id: Optional[str] = None, ) -> None: ... @overload @@ -16617,38 +16693,43 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = EvaluatorDefinitionType.PROMPT # type: ignore + self.type = LiveServerEventType.SESSION_DELEGATION_CREATED # type: ignore -class PromptDataGenerationJobSource( - DataGenerationJobSource, discriminator="prompt" +class LiveServerEventLiveErrorEvent( + LiveServerEvent, discriminator="error" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Prompt source for data generation jobs — inline text provided by the user. + """Reports an error in the Live session, such as an invalid client command. Use + error.client_event_id, when present, to identify the command that caused the error. - :ivar description: Optional description of what this source represents — helps the pipeline - interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core - capabilities'). - :vartype description: str - :ivar type: The source type for this source, which is Prompt. Required. Prompt source — inline - text provided by the user. - :vartype type: str or ~azure.ai.projects.models.PROMPT - :ivar prompt: Inline prompt text (e.g., agent description, policy text, supplementary context). + :ivar event_id: The unique ID of the Live server event. Required. + :vartype event_id: str + :ivar client_event_id: The event_id of the client command associated with this server event, + when supplied. + :vartype client_event_id: str + :ivar type: The event type, always ``error``. Required. ERROR. + :vartype type: str or ~azure.ai.projects.models.ERROR + :ivar error: Details of the Live error and the client command that caused it, when known. Required. - :vartype prompt: str + :vartype error: ~azure.ai.projects.models.LiveLiveError """ - type: Literal[DataGenerationJobSourceType.PROMPT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The source type for this source, which is Prompt. Required. Prompt source — inline text - provided by the user.""" - prompt: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Inline prompt text (e.g., agent description, policy text, supplementary context). Required.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the Live server event. Required.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command associated with this server event, when supplied.""" + type: Literal[LiveServerEventType.ERROR] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, always ``error``. Required. ERROR.""" + error: "_models.LiveLiveError" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Details of the Live error and the client command that caused it, when known. Required.""" @overload def __init__( self, *, - prompt: str, - description: Optional[str] = None, + event_id: str, + error: "_models.LiveLiveError", + client_event_id: Optional[str] = None, ) -> None: ... @overload @@ -16660,41 +16741,48 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = DataGenerationJobSourceType.PROMPT # type: ignore + self.type = LiveServerEventType.ERROR # type: ignore -class PromptEvaluatorGenerationJobSource( - EvaluatorGenerationJobSource, discriminator="prompt" +class LiveServerEventLiveInfoEvent( + LiveServerEvent, discriminator="info" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Prompt source for evaluator generation jobs — inline text provided by the user. + """An informational notice about the Live session, such as the event permissions applied to a + frontend data channel. - :ivar description: Optional description of what this source represents — helps the pipeline - interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core - capabilities'). - :vartype description: str - :ivar type: The source type for this source, which is Prompt. Required. Prompt source — inline - text provided by the user. - :vartype type: str or ~azure.ai.projects.models.PROMPT - :ivar prompt: Inline prompt text (e.g., agent description, policy text, supplementary context). + :ivar event_id: The unique ID of the Live server event. Required. + :vartype event_id: str + :ivar client_event_id: The event_id of the client command associated with this server event, + when supplied. + :vartype client_event_id: str + :ivar type: The event type, always ``info``. Required. INFO. + :vartype type: str or ~azure.ai.projects.models.INFO + :ivar code: A machine-readable code for the notice, such as ``data_channel_permissions``. Required. - :vartype prompt: str + :vartype code: str + :ivar message: A human-readable explanation of the Live session notice. Required. + :vartype message: str """ - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional description of what this source represents — helps the pipeline interpret its content - (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities').""" - type: Literal[EvaluatorGenerationJobSourceType.PROMPT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The source type for this source, which is Prompt. Required. Prompt source — inline text - provided by the user.""" - prompt: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Inline prompt text (e.g., agent description, policy text, supplementary context). Required.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the Live server event. Required.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command associated with this server event, when supplied.""" + type: Literal[LiveServerEventType.INFO] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, always ``info``. Required. INFO.""" + code: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A machine-readable code for the notice, such as ``data_channel_permissions``. Required.""" + message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A human-readable explanation of the Live session notice. Required.""" @overload def __init__( self, *, - prompt: str, - description: Optional[str] = None, + event_id: str, + code: str, + message: str, + client_event_id: Optional[str] = None, ) -> None: ... @overload @@ -16706,32 +16794,38 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = EvaluatorGenerationJobSourceType.PROMPT # type: ignore + self.type = LiveServerEventType.INFO # type: ignore -class PromptOptimizationConfiguration( - AgentOptimizationConfigurationBase, discriminator="prompt_optimization" +class LiveServerEventLiveInputAudioMuted( + LiveServerEvent, discriminator="session.input_audio.muted" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Configuration for a one-shot prompt transformation without comparative evaluation. + """Acknowledges a session.input_audio.mute command. An independent input mute sends silence to the + model and preserves sideband audio reflection. Fixture playback does not emit this event. - :ivar type: Optimization type discriminator. Required. One-shot prompt optimization. - :vartype type: str or ~azure.ai.projects.models.PROMPT_OPTIMIZATION - :ivar context: Context used to steer prompt optimization. Omitted when no context is supplied. - :vartype context: list[~azure.ai.projects.models.OptimizationContext] + :ivar event_id: The unique ID of the Live server event. Required. + :vartype event_id: str + :ivar client_event_id: The event_id of the client command associated with this server event, + when supplied. + :vartype client_event_id: str + :ivar type: The event type, always ``session.input_audio.muted``. Required. + SESSION_INPUT_AUDIO_MUTED. + :vartype type: str or ~azure.ai.projects.models.SESSION_INPUT_AUDIO_MUTED """ - type: Literal[AgentOptimizationConfigurationType.PROMPT_OPTIMIZATION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Optimization type discriminator. Required. One-shot prompt optimization.""" - context: Optional[list["_models.OptimizationContext"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Context used to steer prompt optimization. Omitted when no context is supplied.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the Live server event. Required.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command associated with this server event, when supplied.""" + type: Literal[LiveServerEventType.SESSION_INPUT_AUDIO_MUTED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, always ``session.input_audio.muted``. Required. SESSION_INPUT_AUDIO_MUTED.""" @overload def __init__( self, *, - context: Optional[list["_models.OptimizationContext"]] = None, + event_id: str, + client_event_id: Optional[str] = None, ) -> None: ... @overload @@ -16743,61 +16837,39 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = AgentOptimizationConfigurationType.PROMPT_OPTIMIZATION # type: ignore + self.type = LiveServerEventType.SESSION_INPUT_AUDIO_MUTED # type: ignore -class ProtocolConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Per-protocol configuration for the agent endpoint. +class LiveServerEventLiveInputAudioUnmuted( + LiveServerEvent, discriminator="session.input_audio.unmuted" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Acknowledges a session.input_audio.unmute command, removing the independent input mute. An + active audio fixture still pauses inference until playback finishes. Fixture playback does not + emit this event. - :ivar activity: Configuration for the activity protocol. - :vartype activity: ~azure.ai.projects.models.ActivityProtocolConfiguration - :ivar responses: Configuration for the responses protocol. - :vartype responses: ~azure.ai.projects.models.ResponsesProtocolConfiguration - :ivar a2a: Configuration for the A2A protocol. - :vartype a2a: ~azure.ai.projects.models.A2AProtocolConfiguration - :ivar mcp: Configuration for the MCP protocol. - :vartype mcp: ~azure.ai.projects.models.McpProtocolConfiguration - :ivar invocations: Configuration for the invocations protocol. - :vartype invocations: ~azure.ai.projects.models.InvocationsProtocolConfiguration - :ivar invocations_ws: Configuration for the WebSocket-based invocations protocol. - :vartype invocations_ws: ~azure.ai.projects.models.InvocationsWsProtocolConfiguration + :ivar event_id: The unique ID of the Live server event. Required. + :vartype event_id: str + :ivar client_event_id: The event_id of the client command associated with this server event, + when supplied. + :vartype client_event_id: str + :ivar type: The event type, always ``session.input_audio.unmuted``. Required. + SESSION_INPUT_AUDIO_UNMUTED. + :vartype type: str or ~azure.ai.projects.models.SESSION_INPUT_AUDIO_UNMUTED """ - activity: Optional["_models.ActivityProtocolConfiguration"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Configuration for the activity protocol.""" - responses: Optional["_models.ResponsesProtocolConfiguration"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Configuration for the responses protocol.""" - a2a: Optional["_models.A2AProtocolConfiguration"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Configuration for the A2A protocol.""" - mcp: Optional["_models.McpProtocolConfiguration"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Configuration for the MCP protocol.""" - invocations: Optional["_models.InvocationsProtocolConfiguration"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Configuration for the invocations protocol.""" - invocations_ws: Optional["_models.InvocationsWsProtocolConfiguration"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Configuration for the WebSocket-based invocations protocol.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the Live server event. Required.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command associated with this server event, when supplied.""" + type: Literal[LiveServerEventType.SESSION_INPUT_AUDIO_UNMUTED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, always ``session.input_audio.unmuted``. Required. SESSION_INPUT_AUDIO_UNMUTED.""" @overload def __init__( self, *, - activity: Optional["_models.ActivityProtocolConfiguration"] = None, - responses: Optional["_models.ResponsesProtocolConfiguration"] = None, - a2a: Optional["_models.A2AProtocolConfiguration"] = None, - mcp: Optional["_models.McpProtocolConfiguration"] = None, - invocations: Optional["_models.InvocationsProtocolConfiguration"] = None, - invocations_ws: Optional["_models.InvocationsWsProtocolConfiguration"] = None, + event_id: str, + client_event_id: Optional[str] = None, ) -> None: ... @overload @@ -16809,32 +16881,60 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = LiveServerEventType.SESSION_INPUT_AUDIO_UNMUTED # type: ignore -class ProtocolVersionRecord(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A record mapping for a single protocol and its version. +class LiveServerEventLiveInputTranscriptDelta( + LiveServerEvent, discriminator="session.input_transcript.delta" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A transcript fragment for user input audio in the Live session. Accumulate fragments in + delivery order; these events do not define complete turns or include a transcript-done event. - :ivar protocol: The protocol type. Required. Known values are: "activity", "responses", "a2a", - "mcp", "invocations", "voice", and "invocations_ws". - :vartype protocol: str or ~azure.ai.projects.models.AgentEndpointProtocol - :ivar version: The version string for the protocol, e.g. 'v0.1.1'. Required. - :vartype version: str + :ivar event_id: The unique ID of the Live server event. Required. + :vartype event_id: str + :ivar client_event_id: The event_id of the client command associated with this server event, + when supplied. + :vartype client_event_id: str + :ivar start_ms: The start of this event on the Live session timeline, in milliseconds from the + beginning of the session. Required. + :vartype start_ms: int + :ivar end_ms: The end of this event on the Live session timeline, in milliseconds from the + beginning of the session. For appended context, this can equal start_ms. Required. + :vartype end_ms: int + :ivar delta: The transcript text fragment for the audio in this time range. Append fragments in + delivery order to build the transcript. Required. + :vartype delta: str + :ivar type: The event type, always ``session.input_transcript.delta``. Required. + SESSION_INPUT_TRANSCRIPT_DELTA. + :vartype type: str or ~azure.ai.projects.models.SESSION_INPUT_TRANSCRIPT_DELTA """ - protocol: Union[str, "_models.AgentEndpointProtocol"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The protocol type. Required. Known values are: \"activity\", \"responses\", \"a2a\", \"mcp\", - \"invocations\", \"voice\", and \"invocations_ws\".""" - version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The version string for the protocol, e.g. 'v0.1.1'. Required.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the Live server event. Required.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command associated with this server event, when supplied.""" + start_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The start of this event on the Live session timeline, in milliseconds from the beginning of the + session. Required.""" + end_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The end of this event on the Live session timeline, in milliseconds from the beginning of the + session. For appended context, this can equal start_ms. Required.""" + delta: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The transcript text fragment for the audio in this time range. Append fragments in delivery + order to build the transcript. Required.""" + type: Literal[LiveServerEventType.SESSION_INPUT_TRANSCRIPT_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, always ``session.input_transcript.delta``. Required. + SESSION_INPUT_TRANSCRIPT_DELTA.""" @overload def __init__( self, *, - protocol: Union[str, "_models.AgentEndpointProtocol"], - version: str, + event_id: str, + start_ms: int, + end_ms: int, + delta: str, + client_event_id: Optional[str] = None, ) -> None: ... @overload @@ -16846,30 +16946,53 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = LiveServerEventType.SESSION_INPUT_TRANSCRIPT_DELTA # type: ignore -class TelephonyTransferDestination(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A destination for a telephony transfer target. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - PSTNTelephonyTransferDestination, SipTelephonyTransferDestination, - TeamsTelephonyTransferDestination +class LiveServerEventLiveInstructionsAppended( + LiveServerEvent, discriminator="session.instructions.appended" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Returned when a session.instructions.append command is accepted into the Live session timeline. + Acknowledges the appended instructions without guaranteeing that the model has acted on them. - :ivar kind: The telephony transfer destination type. Required. Known values are: "pstn", - "teams", and "sip". - :vartype kind: str or ~azure.ai.projects.models.TelephonyTransferDestinationKind + :ivar event_id: The unique ID of the Live server event. Required. + :vartype event_id: str + :ivar client_event_id: The event_id of the client command associated with this server event, + when supplied. + :vartype client_event_id: str + :ivar start_ms: The start of this event on the Live session timeline, in milliseconds from the + beginning of the session. Required. + :vartype start_ms: int + :ivar end_ms: The end of this event on the Live session timeline, in milliseconds from the + beginning of the session. For appended context, this can equal start_ms. Required. + :vartype end_ms: int + :ivar type: The event type, always ``session.instructions.appended``. Required. + SESSION_INSTRUCTIONS_APPENDED. + :vartype type: str or ~azure.ai.projects.models.SESSION_INSTRUCTIONS_APPENDED """ - __mapping__: dict[str, _Model] = {} - kind: str = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) - """The telephony transfer destination type. Required. Known values are: \"pstn\", \"teams\", and - \"sip\".""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the Live server event. Required.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command associated with this server event, when supplied.""" + start_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The start of this event on the Live session timeline, in milliseconds from the beginning of the + session. Required.""" + end_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The end of this event on the Live session timeline, in milliseconds from the beginning of the + session. For appended context, this can equal start_ms. Required.""" + type: Literal[LiveServerEventType.SESSION_INSTRUCTIONS_APPENDED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, always ``session.instructions.appended``. Required. + SESSION_INSTRUCTIONS_APPENDED.""" @overload def __init__( self, *, - kind: str, + event_id: str, + start_ms: int, + end_ms: int, + client_event_id: Optional[str] = None, ) -> None: ... @overload @@ -16881,30 +17004,39 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = LiveServerEventType.SESSION_INSTRUCTIONS_APPENDED # type: ignore -class PSTNTelephonyTransferDestination( - TelephonyTransferDestination, discriminator="pstn" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A PSTN destination for a telephony transfer target. +class LiveServerEventLiveOutputAudioFixturePlayed( + LiveServerEvent, discriminator="session.output_audio.fixture.played" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The complete audio fixture has drained from the server mixer and normal inference has resumed. + Transport buffers may still contain audio; this event does not prove listener-side completion. + The optional client_event_id echoes the play command. This event is not emitted for canceled or + failed playback. - :ivar kind: The PSTN destination type. Required. A public switched telephone network - destination. - :vartype kind: str or ~azure.ai.projects.models.PSTN - :ivar value: The E.164 phone number to call. Required. - :vartype value: str + :ivar event_id: The unique ID of the Live server event. Required. + :vartype event_id: str + :ivar client_event_id: The event_id of the client command associated with this server event, + when supplied. + :vartype client_event_id: str + :ivar type: Required. SESSION_OUTPUT_AUDIO_FIXTURE_PLAYED. + :vartype type: str or ~azure.ai.projects.models.SESSION_OUTPUT_AUDIO_FIXTURE_PLAYED """ - kind: Literal[TelephonyTransferDestinationKind.PSTN] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The PSTN destination type. Required. A public switched telephone network destination.""" - value: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The E.164 phone number to call. Required.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the Live server event. Required.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command associated with this server event, when supplied.""" + type: Literal[LiveServerEventType.SESSION_OUTPUT_AUDIO_FIXTURE_PLAYED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. SESSION_OUTPUT_AUDIO_FIXTURE_PLAYED.""" @overload def __init__( self, *, - value: str, + event_id: str, + client_event_id: Optional[str] = None, ) -> None: ... @overload @@ -16916,37 +17048,38 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.kind = TelephonyTransferDestinationKind.PSTN # type: ignore + self.type = LiveServerEventType.SESSION_OUTPUT_AUDIO_FIXTURE_PLAYED # type: ignore -class RaiConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Configuration for Responsible AI (RAI) content filtering and safety features. +class LiveServerEventLiveOutputAudioFixturePlaying( + LiveServerEvent, discriminator="session.output_audio.fixture.playing" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The existing playback path has accepted the validated audio fixture. This acknowledgment does + not identify when the listener receives the first sample. The optional client_event_id echoes + the play command. - :ivar rai_policy_name: The name of the RAI policy to apply. Required. - :vartype rai_policy_name: str - :ivar invocations_moderation: Author-declared configuration telling the platform where - user/agent text lives in the agent-defined invocations request/response bodies, so - content-safety guardrails can extract and moderate it. Optional; a rai_config without it leaves - the invocations path without content-safety moderation. - :vartype invocations_moderation: ~azure.ai.projects.models.RaiInvocationModeration + :ivar event_id: The unique ID of the Live server event. Required. + :vartype event_id: str + :ivar client_event_id: The event_id of the client command associated with this server event, + when supplied. + :vartype client_event_id: str + :ivar type: Required. SESSION_OUTPUT_AUDIO_FIXTURE_PLAYING. + :vartype type: str or ~azure.ai.projects.models.SESSION_OUTPUT_AUDIO_FIXTURE_PLAYING """ - rai_policy_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the RAI policy to apply. Required.""" - invocations_moderation: Optional["_models.RaiInvocationModeration"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Author-declared configuration telling the platform where user/agent text lives in the - agent-defined invocations request/response bodies, so content-safety guardrails can extract and - moderate it. Optional; a rai_config without it leaves the invocations path without - content-safety moderation.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the Live server event. Required.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command associated with this server event, when supplied.""" + type: Literal[LiveServerEventType.SESSION_OUTPUT_AUDIO_FIXTURE_PLAYING] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. SESSION_OUTPUT_AUDIO_FIXTURE_PLAYING.""" @overload def __init__( self, *, - rai_policy_name: str, - invocations_moderation: Optional["_models.RaiInvocationModeration"] = None, + event_id: str, + client_event_id: Optional[str] = None, ) -> None: ... @overload @@ -16958,67 +17091,60 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = LiveServerEventType.SESSION_OUTPUT_AUDIO_FIXTURE_PLAYING # type: ignore -class RaiInvocationModeration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Declares where request/response text lives so content-safety guardrails can extract it. +class LiveServerEventLiveOutputTranscriptDelta( + LiveServerEvent, discriminator="session.output_transcript.delta" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A transcript fragment for assistant output audio in the Live session. Accumulate fragments in + delivery order; these events do not define complete turns or include a transcript-done event. - :ivar input_content_type: How the REQUEST body is parsed. When omitted, the service defaults to - ``json``. Known values are: "json" and "text". - :vartype input_content_type: str or ~azure.ai.projects.models.RaiInvocationContentType - :ivar output_content_type: How the RESPONSE body is parsed. When omitted, the service defaults - to ``json``. Known values are: "json" and "text". - :vartype output_content_type: str or ~azure.ai.projects.models.RaiInvocationContentType - :ivar response_mode: Author-declared response shape; drives which output gate runs and which - fields are required. Required. Known values are: "non_streaming", "streaming", and "both". - :vartype response_mode: str or ~azure.ai.projects.models.RaiInvocationMode - :ivar input_paths: Path(s) to user text in the REQUEST body. Required when input_content_type - is ``json``. - :vartype input_paths: list[str] - :ivar output_paths: Path(s) to agent text in a NON-STREAMING response body. Required when - response_mode is non_streaming/both and output_content_type is ``json``. - :vartype output_paths: list[str] - :ivar stream_selectors: One SSE event->field selector per event type carrying text. Required - when response_mode is streaming/both and output_content_type is ``json``. - :vartype stream_selectors: list[~azure.ai.projects.models.RaiSseTextSelector] + :ivar event_id: The unique ID of the Live server event. Required. + :vartype event_id: str + :ivar client_event_id: The event_id of the client command associated with this server event, + when supplied. + :vartype client_event_id: str + :ivar start_ms: The start of this event on the Live session timeline, in milliseconds from the + beginning of the session. Required. + :vartype start_ms: int + :ivar end_ms: The end of this event on the Live session timeline, in milliseconds from the + beginning of the session. For appended context, this can equal start_ms. Required. + :vartype end_ms: int + :ivar delta: The transcript text fragment for the audio in this time range. Append fragments in + delivery order to build the transcript. Required. + :vartype delta: str + :ivar type: The event type, always ``session.output_transcript.delta``. Required. + SESSION_OUTPUT_TRANSCRIPT_DELTA. + :vartype type: str or ~azure.ai.projects.models.SESSION_OUTPUT_TRANSCRIPT_DELTA """ - input_content_type: Optional[Union[str, "_models.RaiInvocationContentType"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """How the REQUEST body is parsed. When omitted, the service defaults to ``json``. Known values - are: \"json\" and \"text\".""" - output_content_type: Optional[Union[str, "_models.RaiInvocationContentType"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """How the RESPONSE body is parsed. When omitted, the service defaults to ``json``. Known values - are: \"json\" and \"text\".""" - response_mode: Union[str, "_models.RaiInvocationMode"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Author-declared response shape; drives which output gate runs and which fields are required. - Required. Known values are: \"non_streaming\", \"streaming\", and \"both\".""" - input_paths: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Path(s) to user text in the REQUEST body. Required when input_content_type is ``json``.""" - output_paths: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Path(s) to agent text in a NON-STREAMING response body. Required when response_mode is - non_streaming/both and output_content_type is ``json``.""" - stream_selectors: Optional[list["_models.RaiSseTextSelector"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """One SSE event->field selector per event type carrying text. Required when response_mode is - streaming/both and output_content_type is ``json``.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the Live server event. Required.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command associated with this server event, when supplied.""" + start_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The start of this event on the Live session timeline, in milliseconds from the beginning of the + session. Required.""" + end_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The end of this event on the Live session timeline, in milliseconds from the beginning of the + session. For appended context, this can equal start_ms. Required.""" + delta: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The transcript text fragment for the audio in this time range. Append fragments in delivery + order to build the transcript. Required.""" + type: Literal[LiveServerEventType.SESSION_OUTPUT_TRANSCRIPT_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, always ``session.output_transcript.delta``. Required. + SESSION_OUTPUT_TRANSCRIPT_DELTA.""" @overload def __init__( self, *, - response_mode: Union[str, "_models.RaiInvocationMode"], - input_content_type: Optional[Union[str, "_models.RaiInvocationContentType"]] = None, - output_content_type: Optional[Union[str, "_models.RaiInvocationContentType"]] = None, - input_paths: Optional[list[str]] = None, - output_paths: Optional[list[str]] = None, - stream_selectors: Optional[list["_models.RaiSseTextSelector"]] = None, + event_id: str, + start_ms: int, + end_ms: int, + delta: str, + client_event_id: Optional[str] = None, ) -> None: ... @overload @@ -17030,30 +17156,50 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = LiveServerEventType.SESSION_OUTPUT_TRANSCRIPT_DELTA # type: ignore -class RaiSseTextSelector(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """An SSE event-type to text-field selector for streaming invocation output. +class LiveServerEventLiveResponseEvent( + LiveServerEvent, discriminator="response.event" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A streaming Responses API event from a backend delegated to by the Live session. Use the outer + delegation_id to associate the nested stream with its Live delegation. - :ivar event_type: The SSE event ``type`` value that carries text. Required. - :vartype event_type: str - :ivar text_field: The field on a matched event holding the text delta. When omitted, the - service defaults to ``delta``. - :vartype text_field: str + :ivar event_id: The unique ID of the Live server event. Required. + :vartype event_id: str + :ivar client_event_id: The event_id of the client command associated with this server event, + when supplied. + :vartype client_event_id: str + :ivar type: The event type, always ``response.event``. Required. RESPONSE_EVENT. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_EVENT + :ivar delegation_id: + :vartype delegation_id: str + :ivar event: The nested Responses streaming event. Dispatch on its type field. Response + lifecycle snapshots omit input and clear instructions, tools, and output to keep messages + small; consume granular output events for the generated content. Required. + :vartype event: dict[str, any] """ - event_type: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The SSE event ``type`` value that carries text. Required.""" - text_field: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The field on a matched event holding the text delta. When omitted, the service defaults to - ``delta``.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the Live server event. Required.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command associated with this server event, when supplied.""" + type: Literal[LiveServerEventType.RESPONSE_EVENT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, always ``response.event``. Required. RESPONSE_EVENT.""" + delegation_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + event: dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The nested Responses streaming event. Dispatch on its type field. Response lifecycle snapshots + omit input and clear instructions, tools, and output to keep messages small; consume granular + output events for the generated content. Required.""" @overload def __init__( self, *, - event_type: str, - text_field: Optional[str] = None, + event_id: str, + event: dict[str, Any], + client_event_id: Optional[str] = None, + delegation_id: Optional[str] = None, ) -> None: ... @overload @@ -17065,43 +17211,67 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = LiveServerEventType.RESPONSE_EVENT # type: ignore -class RankingOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """RankingOptions. +class LiveServerEventLiveSessionClosed( + LiveServerEvent, discriminator="session.closed" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Returned after the Live session finishes finalizing, with the close reason, final session + snapshot, and cumulative audio usage. A connection closing without this event does not confirm + successful finalization. - :ivar ranker: The ranker to use for the file search. Known values are: "auto" and - "default-2024-11-15". - :vartype ranker: str or ~azure.ai.projects.models.RankerVersionType - :ivar score_threshold: The score threshold for the file search, a number between 0 and 1. - Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer - results. - :vartype score_threshold: float - :ivar hybrid_search: Weights that control how reciprocal rank fusion balances semantic - embedding matches versus sparse keyword matches when hybrid search is enabled. - :vartype hybrid_search: ~azure.ai.projects.models.HybridSearchOptions + :ivar event_id: The unique ID of the Live server event. Required. + :vartype event_id: str + :ivar client_event_id: The event_id of the client command associated with this server event, + when supplied. + :vartype client_event_id: str + :ivar type: The event type, always ``session.closed``. Required. SESSION_CLOSED. + :vartype type: str or ~azure.ai.projects.models.SESSION_CLOSED + :ivar reason: Why the Live session ended: ``close_requested`` for an application close or + hangup request, ``expired`` for the session duration limit, ``content`` for a safety filter, + ``remote_hangup`` for a graceful remote disconnect, or ``connection_lost`` for an unexpected + primary or upstream disconnection. Required. Is one of the following types: + Literal["close_requested"], Literal["expired"], Literal["content"], Literal["remote_hangup"], + Literal["connection_lost"] + :vartype reason: str or str or str or str or str + :ivar session: Required. + :vartype session: ~azure.ai.projects.models.VoiceAgentLiveSessionResource + :ivar usage: The final cumulative Live audio usage after session finalization. Required. + :vartype usage: ~azure.ai.projects.models.LiveSessionUsage """ - ranker: Optional[Union[str, "_models.RankerVersionType"]] = rest_field( + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the Live server event. Required.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command associated with this server event, when supplied.""" + type: Literal[LiveServerEventType.SESSION_CLOSED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, always ``session.closed``. Required. SESSION_CLOSED.""" + reason: Literal["close_requested", "expired", "content", "remote_hangup", "connection_lost"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The ranker to use for the file search. Known values are: \"auto\" and \"default-2024-11-15\".""" - score_threshold: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will - attempt to return only the most relevant results, but may return fewer results.""" - hybrid_search: Optional["_models.HybridSearchOptions"] = rest_field( + """Why the Live session ended: ``close_requested`` for an application close or hangup request, + ``expired`` for the session duration limit, ``content`` for a safety filter, ``remote_hangup`` + for a graceful remote disconnect, or ``connection_lost`` for an unexpected primary or upstream + disconnection. Required. Is one of the following types: Literal[\"close_requested\"], + Literal[\"expired\"], Literal[\"content\"], Literal[\"remote_hangup\"], + Literal[\"connection_lost\"]""" + session: "_models.VoiceAgentLiveSessionResource" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Weights that control how reciprocal rank fusion balances semantic embedding matches versus - sparse keyword matches when hybrid search is enabled.""" + """Required.""" + usage: "_models.LiveSessionUsage" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The final cumulative Live audio usage after session finalization. Required.""" @overload def __init__( self, *, - ranker: Optional[Union[str, "_models.RankerVersionType"]] = None, - score_threshold: Optional[float] = None, - hybrid_search: Optional["_models.HybridSearchOptions"] = None, + event_id: str, + reason: Literal["close_requested", "expired", "content", "remote_hangup", "connection_lost"], + session: "_models.VoiceAgentLiveSessionResource", + usage: "_models.LiveSessionUsage", + client_event_id: Optional[str] = None, ) -> None: ... @overload @@ -17113,27 +17283,51 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = LiveServerEventType.SESSION_CLOSED # type: ignore -class RealtimeAudioFormats(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """RealtimeAudioFormats. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - RealtimeAudioFormatsAudioPcm, RealtimeAudioFormatsAudioPcma, RealtimeAudioFormatsAudioPcmu +class LiveServerEventLiveSessionStarted( + LiveServerEvent, discriminator="session.started" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Returned when a Live session has started. Contains the resolved session configuration, + including server defaults. - :ivar type: Required. Known values are: "audio/pcm", "audio/pcmu", and "audio/pcma". - :vartype type: str or ~azure.ai.projects.models.RealtimeAudioFormatsType + :ivar type: The event type, always ``session.started``. Required. SESSION_STARTED. + :vartype type: str or ~azure.ai.projects.models.SESSION_STARTED + :ivar event_id: The unique ID of the Live server event. Required. + :vartype event_id: str + :ivar client_event_id: The event_id of the client command associated with this server event, + when supplied. + :vartype client_event_id: str + :ivar session: Required. + :vartype session: ~azure.ai.projects.models.VoiceAgentLiveSessionResource + :ivar conversation_id: Stored conversation ID when effective store is true. Use + protocols/voice/live/conversations; this ID differs from session.id. + :vartype conversation_id: str """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"audio/pcm\", \"audio/pcmu\", and \"audio/pcma\".""" + type: Literal[LiveServerEventType.SESSION_STARTED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, always ``session.started``. Required. SESSION_STARTED.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the Live server event. Required.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command associated with this server event, when supplied.""" + session: "_models.VoiceAgentLiveSessionResource" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required.""" + conversation_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Stored conversation ID when effective store is true. Use protocols/voice/live/conversations; + this ID differs from session.id.""" @overload def __init__( self, *, - type: str, + event_id: str, + session: "_models.VoiceAgentLiveSessionResource", + client_event_id: Optional[str] = None, + conversation_id: Optional[str] = None, ) -> None: ... @overload @@ -17145,29 +17339,44 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = LiveServerEventType.SESSION_STARTED # type: ignore -class RealtimeAudioFormatsAudioPcm( - RealtimeAudioFormats, discriminator="audio/pcm" +class LiveServerEventLiveSessionUpdated( + LiveServerEvent, discriminator="session.updated" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """RealtimeAudioFormatsAudioPcm. + """Returned when a Live session update is accepted. Contains the resolved session configuration + after the update. - :ivar type: Required. AUDIO_PCM. - :vartype type: str or ~azure.ai.projects.models.AUDIO_PCM - :ivar rate: Default value is 24000. - :vartype rate: int + :ivar type: The event type, always ``session.updated``. Required. SESSION_UPDATED. + :vartype type: str or ~azure.ai.projects.models.SESSION_UPDATED + :ivar event_id: The unique ID of the Live server event. Required. + :vartype event_id: str + :ivar client_event_id: The event_id of the client command associated with this server event, + when supplied. + :vartype client_event_id: str + :ivar session: Required. + :vartype session: ~azure.ai.projects.models.VoiceAgentLiveSessionResource """ - type: Literal[RealtimeAudioFormatsType.AUDIO_PCM] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. AUDIO_PCM.""" - rate: Optional[Literal[24000]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Default value is 24000.""" + type: Literal[LiveServerEventType.SESSION_UPDATED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, always ``session.updated``. Required. SESSION_UPDATED.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the Live server event. Required.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command associated with this server event, when supplied.""" + session: "_models.VoiceAgentLiveSessionResource" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required.""" @overload def __init__( self, *, - rate: Optional[Literal[24000]] = None, + event_id: str, + session: "_models.VoiceAgentLiveSessionResource", + client_event_id: Optional[str] = None, ) -> None: ... @overload @@ -17179,22 +17388,50 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeAudioFormatsType.AUDIO_PCM # type: ignore + self.type = LiveServerEventType.SESSION_UPDATED # type: ignore -class RealtimeAudioFormatsAudioPcma(RealtimeAudioFormats, discriminator="audio/pcma"): - """RealtimeAudioFormatsAudioPcma. +class LiveServerEventLiveSessionUsageUpdated( + LiveServerEvent, discriminator="session.usage.updated" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Reports cumulative Live audio usage and, when available, the most recent context-window usage. + Delegated Responses token usage is reported separately in response.event events. - :ivar type: Required. AUDIO_PCMA. - :vartype type: str or ~azure.ai.projects.models.AUDIO_PCMA + :ivar event_id: The unique ID of the Live server event. Required. + :vartype event_id: str + :ivar client_event_id: The event_id of the client command associated with this server event, + when supplied. + :vartype client_event_id: str + :ivar type: The event type, always ``session.usage.updated``. Required. SESSION_USAGE_UPDATED. + :vartype type: str or ~azure.ai.projects.models.SESSION_USAGE_UPDATED + :ivar usage: The cumulative Live audio usage so far. Required. + :vartype usage: ~azure.ai.projects.models.LiveSessionUsage + :ivar context_window: The latest measured Live context-window usage. Omitted when the context + limit is unknown. + :vartype context_window: ~azure.ai.projects.models.LiveContextWindowUsage """ - type: Literal[RealtimeAudioFormatsType.AUDIO_PCMA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. AUDIO_PCMA.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the Live server event. Required.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command associated with this server event, when supplied.""" + type: Literal[LiveServerEventType.SESSION_USAGE_UPDATED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, always ``session.usage.updated``. Required. SESSION_USAGE_UPDATED.""" + usage: "_models.LiveSessionUsage" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The cumulative Live audio usage so far. Required.""" + context_window: Optional["_models.LiveContextWindowUsage"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The latest measured Live context-window usage. Omitted when the context limit is unknown.""" @overload def __init__( self, + *, + event_id: str, + usage: "_models.LiveSessionUsage", + client_event_id: Optional[str] = None, + context_window: Optional["_models.LiveContextWindowUsage"] = None, ) -> None: ... @overload @@ -17206,22 +17443,52 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeAudioFormatsType.AUDIO_PCMA # type: ignore + self.type = LiveServerEventType.SESSION_USAGE_UPDATED # type: ignore -class RealtimeAudioFormatsAudioPcmu(RealtimeAudioFormats, discriminator="audio/pcmu"): - """RealtimeAudioFormatsAudioPcmu. +class LiveServerEventLiveThinkingAppended( + LiveServerEvent, discriminator="session.thinking.appended" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Returned when a session.thinking.append command is accepted into the Live session timeline. + Acknowledges the added reasoning context without guaranteeing any spoken output. - :ivar type: Required. AUDIO_PCMU. - :vartype type: str or ~azure.ai.projects.models.AUDIO_PCMU + :ivar event_id: The unique ID of the Live server event. Required. + :vartype event_id: str + :ivar client_event_id: The event_id of the client command associated with this server event, + when supplied. + :vartype client_event_id: str + :ivar start_ms: The start of this event on the Live session timeline, in milliseconds from the + beginning of the session. Required. + :vartype start_ms: int + :ivar end_ms: The end of this event on the Live session timeline, in milliseconds from the + beginning of the session. For appended context, this can equal start_ms. Required. + :vartype end_ms: int + :ivar type: The event type, always ``session.thinking.appended``. Required. + SESSION_THINKING_APPENDED. + :vartype type: str or ~azure.ai.projects.models.SESSION_THINKING_APPENDED """ - type: Literal[RealtimeAudioFormatsType.AUDIO_PCMU] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. AUDIO_PCMU.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the Live server event. Required.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command associated with this server event, when supplied.""" + start_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The start of this event on the Live session timeline, in milliseconds from the beginning of the + session. Required.""" + end_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The end of this event on the Live session timeline, in milliseconds from the beginning of the + session. For appended context, this can equal start_ms. Required.""" + type: Literal[LiveServerEventType.SESSION_THINKING_APPENDED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, always ``session.thinking.appended``. Required. SESSION_THINKING_APPENDED.""" @overload def __init__( self, + *, + event_id: str, + start_ms: int, + end_ms: int, + client_event_id: Optional[str] = None, ) -> None: ... @overload @@ -17233,41 +17500,36 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeAudioFormatsType.AUDIO_PCMU # type: ignore + self.type = LiveServerEventType.SESSION_THINKING_APPENDED # type: ignore -class RealtimeClientEvent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A realtime client event. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - RealtimeClientEventConversationItemCreate, RealtimeClientEventConversationItemDelete, - RealtimeClientEventConversationItemRetrieve, RealtimeClientEventConversationItemTruncate, - RealtimeClientEventInputAudioBufferAppend, RealtimeClientEventInputAudioBufferClear, - RealtimeClientEventInputAudioBufferCommit, RealtimeClientEventOutputAudioBufferClear, - RealtimeClientEventResponseCancel, RealtimeClientEventResponseCreate, - VoiceAgentClientEventRtcCallSdpCreate, VoiceAgentClientEventSessionAvatarConnect +class LiveServerEventLiveTransportAnswered( + LiveServerEvent, discriminator="transport.answered" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """The outbound SIP provider leg answered and media is established. Delivered only to sideband + observers. - :ivar type: Required. Known values are: "conversation.item.create", "conversation.item.delete", - "conversation.item.retrieve", "conversation.item.truncate", "input_audio_buffer.append", - "input_audio_buffer.clear", "output_audio_buffer.clear", "input_audio_buffer.commit", - "response.cancel", "response.create", "session.update", "session.avatar.connect", and - "rtc.call.sdp.create". - :vartype type: str or ~azure.ai.projects.models.RealtimeClientEventType + :ivar event_id: Required. + :vartype event_id: str + :ivar session_id: The canonical Live session ID. Required. + :vartype session_id: str + :ivar type: Required. TRANSPORT_ANSWERED. + :vartype type: str or ~azure.ai.projects.models.TRANSPORT_ANSWERED """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"conversation.item.create\", \"conversation.item.delete\", - \"conversation.item.retrieve\", \"conversation.item.truncate\", \"input_audio_buffer.append\", - \"input_audio_buffer.clear\", \"output_audio_buffer.clear\", \"input_audio_buffer.commit\", - \"response.cancel\", \"response.create\", \"session.update\", \"session.avatar.connect\", and - \"rtc.call.sdp.create\".""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + session_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The canonical Live session ID. Required.""" + type: Literal[LiveServerEventType.TRANSPORT_ANSWERED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. TRANSPORT_ANSWERED.""" @overload def __init__( self, *, - type: str, + event_id: str, + session_id: str, ) -> None: ... @overload @@ -17279,52 +17541,40 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = LiveServerEventType.TRANSPORT_ANSWERED # type: ignore -class RealtimeClientEventConversationItemCreate( - RealtimeClientEvent, discriminator="conversation.item.create" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Add a new Item to the Conversation's context, including messages, function calls, and function - call responses. This event can be used both to populate a "history" of the conversation and to - add new items mid-stream, but has the current limitation that it cannot populate assistant - audio messages. If successful, the server will respond with a ``conversation.item.created`` - event, otherwise an ``error`` event will be sent. +class LiveServerEventLiveTransportFailed( + LiveServerEvent, discriminator="transport.failed" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """An asynchronous outbound SIP setup failure. Delivered only to sideband observers. - :ivar event_id: Optional client-generated ID used to identify this event. + :ivar event_id: Required. :vartype event_id: str - :ivar type: The event type, must be ``conversation.item.create``. Required. - CONVERSATION_ITEM_CREATE. - :vartype type: str or ~azure.ai.projects.models.CONVERSATION_ITEM_CREATE - :ivar previous_item_id: The ID of the preceding item after which the new item will be inserted. - If not set, the new item will be appended to the end of the conversation. If set to ``root``, - the new item will be added to the beginning of the conversation. If set to an existing ID, it - allows an item to be inserted mid-conversation. If the ID cannot be found, an error will be - returned and the item will not be added. - :vartype previous_item_id: str - :ivar item: Required. - :vartype item: ~azure.ai.projects.models.RealtimeConversationItem + :ivar session_id: The canonical Live session ID. Required. + :vartype session_id: str + :ivar type: Required. TRANSPORT_FAILED. + :vartype type: str or ~azure.ai.projects.models.TRANSPORT_FAILED + :ivar error: Required. + :vartype error: ~azure.ai.projects.models.LiveTransportCallError """ - event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional client-generated ID used to identify this event.""" - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_CREATE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``conversation.item.create``. Required. CONVERSATION_ITEM_CREATE.""" - previous_item_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the preceding item after which the new item will be inserted. If not set, the new - item will be appended to the end of the conversation. If set to ``root``, the new item will be - added to the beginning of the conversation. If set to an existing ID, it allows an item to be - inserted mid-conversation. If the ID cannot be found, an error will be returned and the item - will not be added.""" - item: "_models.RealtimeConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + session_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The canonical Live session ID. Required.""" + type: Literal[LiveServerEventType.TRANSPORT_FAILED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. TRANSPORT_FAILED.""" + error: "_models.LiveTransportCallError" = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Required.""" @overload def __init__( self, *, - item: "_models.RealtimeConversationItem", - event_id: Optional[str] = None, - previous_item_id: Optional[str] = None, + event_id: str, + session_id: str, + error: "_models.LiveTransportCallError", ) -> None: ... @overload @@ -17336,38 +17586,36 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeClientEventType.CONVERSATION_ITEM_CREATE # type: ignore + self.type = LiveServerEventType.TRANSPORT_FAILED # type: ignore -class RealtimeClientEventConversationItemDelete( - RealtimeClientEvent, discriminator="conversation.item.delete" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Send this event when you want to remove any item from the conversation history. The server will - respond with a ``conversation.item.deleted`` event, unless the item does not exist in the - conversation history, in which case the server will respond with an error. +class LiveServerEventLiveTransportRinging( + LiveServerEvent, discriminator="transport.ringing" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """The outbound SIP provider leg is ringing or providing early media. Delivered only to sideband + observers. - :ivar event_id: Optional client-generated ID used to identify this event. + :ivar event_id: Required. :vartype event_id: str - :ivar type: The event type, must be ``conversation.item.delete``. Required. - CONVERSATION_ITEM_DELETE. - :vartype type: str or ~azure.ai.projects.models.CONVERSATION_ITEM_DELETE - :ivar item_id: The ID of the item to delete. Required. - :vartype item_id: str + :ivar session_id: The canonical Live session ID. Required. + :vartype session_id: str + :ivar type: Required. TRANSPORT_RINGING. + :vartype type: str or ~azure.ai.projects.models.TRANSPORT_RINGING """ - event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional client-generated ID used to identify this event.""" - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_DELETE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``conversation.item.delete``. Required. CONVERSATION_ITEM_DELETE.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the item to delete. Required.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + session_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The canonical Live session ID. Required.""" + type: Literal[LiveServerEventType.TRANSPORT_RINGING] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. TRANSPORT_RINGING.""" @overload def __init__( self, *, - item_id: str, - event_id: Optional[str] = None, + event_id: str, + session_id: str, ) -> None: ... @overload @@ -17379,40 +17627,30 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeClientEventType.CONVERSATION_ITEM_DELETE # type: ignore + self.type = LiveServerEventType.TRANSPORT_RINGING # type: ignore -class RealtimeClientEventConversationItemRetrieve( - RealtimeClientEvent, discriminator="conversation.item.retrieve" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Send this event when you want to retrieve the server's representation of a specific item in the - conversation history. This is useful, for example, to inspect user audio after noise - cancellation and VAD. The server will respond with a ``conversation.item.retrieved`` event, - unless the item does not exist in the conversation history, in which case the server will - respond with an error. +class LiveSessionAudioFormatPCMAParam( + LiveAudioFormat, discriminator="audio/pcma" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Raw, mono G.711 A-law audio for a Live WebSocket connection. - :ivar event_id: Optional client-generated ID used to identify this event. - :vartype event_id: str - :ivar type: The event type, must be ``conversation.item.retrieve``. Required. - CONVERSATION_ITEM_RETRIEVE. - :vartype type: str or ~azure.ai.projects.models.CONVERSATION_ITEM_RETRIEVE - :ivar item_id: The ID of the item to retrieve. Required. - :vartype item_id: str + :ivar type: The audio encoding. Always ``audio/pcma``. Required. AUDIO_PCMA. + :vartype type: str or ~azure.ai.projects.models.AUDIO_PCMA + :ivar rate: Audio sample rate in hertz. G.711 audio uses 8000 Hz. Required. + :vartype rate: int """ - event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional client-generated ID used to identify this event.""" - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``conversation.item.retrieve``. Required. CONVERSATION_ITEM_RETRIEVE.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the item to retrieve. Required.""" + type: Literal[LiveAudioFormatType.AUDIO_PCMA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The audio encoding. Always ``audio/pcma``. Required. AUDIO_PCMA.""" + rate: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Audio sample rate in hertz. G.711 audio uses 8000 Hz. Required.""" @overload def __init__( self, *, - item_id: str, - event_id: Optional[str] = None, + rate: int, ) -> None: ... @overload @@ -17424,57 +17662,32 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE # type: ignore + self.type = LiveAudioFormatType.AUDIO_PCMA # type: ignore -class RealtimeClientEventConversationItemTruncate( - RealtimeClientEvent, discriminator="conversation.item.truncate" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Send this event to truncate a previous assistant message’s audio. The server will produce audio - faster than realtime, so this event is useful when the user interrupts to truncate audio that - has already been sent to the client but not yet played. This will synchronize the server's - understanding of the audio with the client's playback. Truncating audio will delete the - server-side text transcript to ensure there is not text in the context that hasn't been heard - by the user. If successful, the server will respond with a ``conversation.item.truncated`` - event. +class LiveSessionAudioFormatPCMParam( + LiveAudioFormat, discriminator="audio/pcm" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Raw, mono 16-bit little-endian PCM audio for a Live WebSocket connection. - :ivar event_id: Optional client-generated ID used to identify this event. - :vartype event_id: str - :ivar type: The event type, must be ``conversation.item.truncate``. Required. - CONVERSATION_ITEM_TRUNCATE. - :vartype type: str or ~azure.ai.projects.models.CONVERSATION_ITEM_TRUNCATE - :ivar item_id: The ID of the assistant message item to truncate. Only assistant message items - can be truncated. Required. - :vartype item_id: str - :ivar content_index: The index of the content part to truncate. Set this to ``0``. Required. - :vartype content_index: int - :ivar audio_end_ms: Inclusive duration up to which audio is truncated, in milliseconds. If the - audio_end_ms is greater than the actual audio duration, the server will respond with an error. - Required. - :vartype audio_end_ms: int + :ivar type: The audio encoding. Always ``audio/pcm``. Required. AUDIO_PCM. + :vartype type: str or ~azure.ai.projects.models.AUDIO_PCM + :ivar rate: Audio sample rate in hertz. Live WebSocket PCM audio supports 16000 or 24000 Hz. + Required. Is either a Literal[16000] type or a Literal[24000] type. + :vartype rate: int or int """ - event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional client-generated ID used to identify this event.""" - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_TRUNCATE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``conversation.item.truncate``. Required. CONVERSATION_ITEM_TRUNCATE.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the assistant message item to truncate. Only assistant message items can be - truncated. Required.""" - content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the content part to truncate. Set this to ``0``. Required.""" - audio_end_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Inclusive duration up to which audio is truncated, in milliseconds. If the audio_end_ms is - greater than the actual audio duration, the server will respond with an error. Required.""" + type: Literal[LiveAudioFormatType.AUDIO_PCM] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The audio encoding. Always ``audio/pcm``. Required. AUDIO_PCM.""" + rate: Literal[16000, 24000] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Audio sample rate in hertz. Live WebSocket PCM audio supports 16000 or 24000 Hz. Required. Is + either a Literal[16000] type or a Literal[24000] type.""" @overload def __init__( self, *, - item_id: str, - content_index: int, - audio_end_ms: int, - event_id: Optional[str] = None, + rate: Literal[16000, 24000], ) -> None: ... @overload @@ -17486,47 +17699,30 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeClientEventType.CONVERSATION_ITEM_TRUNCATE # type: ignore + self.type = LiveAudioFormatType.AUDIO_PCM # type: ignore -class RealtimeClientEventInputAudioBufferAppend( - RealtimeClientEvent, discriminator="input_audio_buffer.append" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Send this event to append audio bytes to the input audio buffer. The audio buffer is temporary - storage you can write to and later commit. A "commit" will create a new user message item in - the conversation history from the buffer content and clear the buffer. Input audio - transcription (if enabled) will be generated when the buffer is committed. If VAD is enabled - the audio buffer is used to detect speech and the server will decide when to commit. When - Server VAD is disabled, you must commit the audio buffer manually. Input audio noise reduction - operates on writes to the audio buffer. The client may choose how much audio to place in each - event up to a maximum of 15 MiB, for example streaming smaller chunks from the client may allow - the VAD to be more responsive. Unlike most other client events, the server will not send a - confirmation response to this event. +class LiveSessionAudioFormatPCMUParam( + LiveAudioFormat, discriminator="audio/pcmu" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Raw, mono G.711 μ-law audio for a Live WebSocket connection. - :ivar event_id: Optional client-generated ID used to identify this event. - :vartype event_id: str - :ivar type: The event type, must be ``input_audio_buffer.append``. Required. - INPUT_AUDIO_BUFFER_APPEND. - :vartype type: str or ~azure.ai.projects.models.INPUT_AUDIO_BUFFER_APPEND - :ivar audio: Base64-encoded audio bytes. This must be in the format specified by the - ``input_audio_format`` field in the session configuration. Required. - :vartype audio: str + :ivar type: The audio encoding. Always ``audio/pcmu``. Required. AUDIO_PCMU. + :vartype type: str or ~azure.ai.projects.models.AUDIO_PCMU + :ivar rate: Audio sample rate in hertz. G.711 audio uses 8000 Hz. Required. + :vartype rate: int """ - event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional client-generated ID used to identify this event.""" - type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_APPEND] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``input_audio_buffer.append``. Required. INPUT_AUDIO_BUFFER_APPEND.""" - audio: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Base64-encoded audio bytes. This must be in the format specified by the ``input_audio_format`` - field in the session configuration. Required.""" + type: Literal[LiveAudioFormatType.AUDIO_PCMU] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The audio encoding. Always ``audio/pcmu``. Required. AUDIO_PCMU.""" + rate: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Audio sample rate in hertz. G.711 audio uses 8000 Hz. Required.""" @overload def __init__( self, *, - audio: str, - event_id: Optional[str] = None, + rate: int, ) -> None: ... @overload @@ -17538,32 +17734,97 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeClientEventType.INPUT_AUDIO_BUFFER_APPEND # type: ignore + self.type = LiveAudioFormatType.AUDIO_PCMU # type: ignore -class RealtimeClientEventInputAudioBufferClear( - RealtimeClientEvent, discriminator="input_audio_buffer.clear" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Send this event to clear the audio bytes in the buffer. The server will respond with an - ``input_audio_buffer.cleared`` event. +class LiveSessionCreateParams(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Initial configuration for a Live session, including its model, conversation instructions, + audio, and delegated task handling. - :ivar event_id: Optional client-generated ID used to identify this event. - :vartype event_id: str - :ivar type: The event type, must be ``input_audio_buffer.clear``. Required. - INPUT_AUDIO_BUFFER_CLEAR. - :vartype type: str or ~azure.ai.projects.models.INPUT_AUDIO_BUFFER_CLEAR + :ivar model: Required. "gpt-live-1" + :vartype model: str or ~azure.ai.projects.models.ModelIdsLive + :ivar instructions: + :vartype instructions: str + :ivar input: Ordered text-only history supplied before startup. Supports developer, user, and + assistant messages with one text part each; at most 128 messages and a configured + rendered-token limit (8,192 by default). + :vartype input: list[~azure.ai.projects.models.LiveInitialItem] + :ivar audio: Startup audio configuration. Only primary WebSockets accept audio.format; WebRTC + and SIP negotiate their media format. Voice and format are immutable after startup. + :vartype audio: ~azure.ai.projects.models.LiveInitialSessionAudioParam + :ivar delegation: Is one of the following types: LiveClientDelegationParam, + LiveResponsesDelegationParam, LiveDecisionsDelegationParam_2 + :vartype delegation: ~azure.ai.projects.models.LiveClientDelegationParam or + ~azure.ai.projects.models.LiveResponsesDelegationParam or + ~azure.ai.projects.models.LiveDecisionsDelegationParam_2 + :ivar triggers: At most one Decisions trigger per transcript event type. Triggers run + independently of delegation. On update, omit triggers to keep the current configuration, send a + list to replace it, or send an empty list to disable triggers. + :vartype triggers: list[~azure.ai.projects.models.LiveDecisionTriggerInputParam_2] + :ivar store: Whether to store the session for later forking and recording download. Defaults to + false for new sessions. + :vartype store: bool + :ivar client: Startup-only capabilities for an untrusted frontend attached to a unified WebRTC + session. Trusted sideband connections are unaffected. + :vartype client: ~azure.ai.projects.models.LiveClientConfigParam """ - event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional client-generated ID used to identify this event.""" - type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``input_audio_buffer.clear``. Required. INPUT_AUDIO_BUFFER_CLEAR.""" + model: Union[str, "_models.ModelIdsLive"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. \"gpt-live-1\"""" + instructions: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + input: Optional[list["_models.LiveInitialItem"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Ordered text-only history supplied before startup. Supports developer, user, and assistant + messages with one text part each; at most 128 messages and a configured rendered-token limit + (8,192 by default).""" + audio: Optional["_models.LiveInitialSessionAudioParam"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Startup audio configuration. Only primary WebSockets accept audio.format; WebRTC and SIP + negotiate their media format. Voice and format are immutable after startup.""" + delegation: Optional[ + Union[ + "_models.LiveClientDelegationParam", + "_models.LiveResponsesDelegationParam", + "_models.LiveDecisionsDelegationParam_2", + ] + ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Is one of the following types: LiveClientDelegationParam, LiveResponsesDelegationParam, + LiveDecisionsDelegationParam_2""" + triggers: Optional[list["_models.LiveDecisionTriggerInputParam_2"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """At most one Decisions trigger per transcript event type. Triggers run independently of + delegation. On update, omit triggers to keep the current configuration, send a list to replace + it, or send an empty list to disable triggers.""" + store: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether to store the session for later forking and recording download. Defaults to false for + new sessions.""" + client: Optional["_models.LiveClientConfigParam"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Startup-only capabilities for an untrusted frontend attached to a unified WebRTC session. + Trusted sideband connections are unaffected.""" @overload def __init__( self, *, - event_id: Optional[str] = None, + model: Union[str, "_models.ModelIdsLive"], + instructions: Optional[str] = None, + input: Optional[list["_models.LiveInitialItem"]] = None, + audio: Optional["_models.LiveInitialSessionAudioParam"] = None, + delegation: Optional[ + Union[ + "_models.LiveClientDelegationParam", + "_models.LiveResponsesDelegationParam", + "_models.LiveDecisionsDelegationParam_2", + ] + ] = None, + triggers: Optional[list["_models.LiveDecisionTriggerInputParam_2"]] = None, + store: Optional[bool] = None, + client: Optional["_models.LiveClientConfigParam"] = None, ) -> None: ... @overload @@ -17575,35 +17836,37 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR # type: ignore -class RealtimeClientEventInputAudioBufferCommit( - RealtimeClientEvent, discriminator="input_audio_buffer.commit" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Send this event to commit the user input audio buffer, which will create a new user message - item in the conversation. This event will produce an error if the input audio buffer is empty. - When in Server VAD mode, the client does not need to send this event, the server will commit - the audio buffer automatically. Committing the input audio buffer will trigger input audio - transcription (if enabled in session configuration), but it will not create a response from - the model. The server will respond with an ``input_audio_buffer.committed`` event. +class LiveSessionStartEvent( + LiveClientEvent, discriminator="session.start" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Start a Live session on a primary WebSocket. Send this event before other commands and wait for + ``session.started``. - :ivar event_id: Optional client-generated ID used to identify this event. + :ivar event_id: :vartype event_id: str - :ivar type: The event type, must be ``input_audio_buffer.commit``. Required. - INPUT_AUDIO_BUFFER_COMMIT. - :vartype type: str or ~azure.ai.projects.models.INPUT_AUDIO_BUFFER_COMMIT + :ivar type: The Live client event type. Always ``session.start``. Required. SESSION_START. + :vartype type: str or ~azure.ai.projects.models.SESSION_START + :ivar session: Initial configuration for a primary WebSocket. Send session.start first and wait + for session.started before application commands. WebRTC creation already starts the session; do + not send this event again on its data channel. Required. + :vartype session: ~azure.ai.projects.models.LiveSessionCreateParams """ event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional client-generated ID used to identify this event.""" - type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``input_audio_buffer.commit``. Required. INPUT_AUDIO_BUFFER_COMMIT.""" + type: Literal[LiveClientEventType.SESSION_START] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The Live client event type. Always ``session.start``. Required. SESSION_START.""" + session: "_models.LiveSessionCreateParams" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Initial configuration for a primary WebSocket. Send session.start first and wait for + session.started before application commands. WebRTC creation already starts the session; do not + send this event again on its data channel. Required.""" @overload def __init__( self, *, + session: "_models.LiveSessionCreateParams", event_id: Optional[str] = None, ) -> None: ... @@ -17616,35 +17879,51 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT # type: ignore + self.type = LiveClientEventType.SESSION_START # type: ignore -class RealtimeClientEventOutputAudioBufferClear( - RealtimeClientEvent, discriminator="output_audio_buffer.clear" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """**WebRTC/SIP Only:** Emit to cut off the current audio response. This will trigger the server - to stop generating audio and emit a ``output_audio_buffer.cleared`` event. This event should be - preceded by a ``response.cancel`` client event to stop the generation of the current response. - `Learn more - `_. +class LiveSessionUpdateParams(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Changes to an active Live session's delegation settings and transcript triggers. - :ivar event_id: The unique ID of the client event used for error handling. - :vartype event_id: str - :ivar type: The event type, must be ``output_audio_buffer.clear``. Required. - OUTPUT_AUDIO_BUFFER_CLEAR. - :vartype type: str or ~azure.ai.projects.models.OUTPUT_AUDIO_BUFFER_CLEAR + :ivar delegation: Is one of the following types: LiveClientDelegationParam, + LiveResponsesDelegationUpdateParam, LiveDecisionsDelegationUpdateParam + :vartype delegation: ~azure.ai.projects.models.LiveClientDelegationParam or + ~azure.ai.projects.models.LiveResponsesDelegationUpdateParam or + ~azure.ai.projects.models.LiveDecisionsDelegationUpdateParam + :ivar triggers: At most one Decisions trigger per transcript event type. Triggers run + independently of delegation. On update, omit triggers to keep the current configuration, send a + list to replace it, or send an empty list to disable triggers. + :vartype triggers: list[~azure.ai.projects.models.LiveDecisionTriggerInputParam_2] """ - event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the client event used for error handling.""" - type: Literal[RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``output_audio_buffer.clear``. Required. OUTPUT_AUDIO_BUFFER_CLEAR.""" + delegation: Optional[ + Union[ + "_models.LiveClientDelegationParam", + "_models.LiveResponsesDelegationUpdateParam", + "_models.LiveDecisionsDelegationUpdateParam", + ] + ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Is one of the following types: LiveClientDelegationParam, LiveResponsesDelegationUpdateParam, + LiveDecisionsDelegationUpdateParam""" + triggers: Optional[list["_models.LiveDecisionTriggerInputParam_2"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """At most one Decisions trigger per transcript event type. Triggers run independently of + delegation. On update, omit triggers to keep the current configuration, send a list to replace + it, or send an empty list to disable triggers.""" @overload def __init__( self, *, - event_id: Optional[str] = None, + delegation: Optional[ + Union[ + "_models.LiveClientDelegationParam", + "_models.LiveResponsesDelegationUpdateParam", + "_models.LiveDecisionsDelegationUpdateParam", + ] + ] = None, + triggers: Optional[list["_models.LiveDecisionTriggerInputParam_2"]] = None, ) -> None: ... @overload @@ -17656,40 +17935,26 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR # type: ignore -class RealtimeClientEventResponseCancel( - RealtimeClientEvent, discriminator="response.cancel" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Send this event to cancel an in-progress response. The server will respond with a - ``response.done`` event with a status of ``response.status=cancelled``. If there is no response - to cancel, the server will respond with an error. It's safe to call ``response.cancel`` even if - no response is in progress, an error will be returned the session will remain unaffected. +class LiveSessionUsage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Cumulative audio duration for a Live session. Values are totals for the session, not increments + to sum across usage events. - :ivar event_id: Optional client-generated ID used to identify this event. - :vartype event_id: str - :ivar type: The event type, must be ``response.cancel``. Required. RESPONSE_CANCEL. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_CANCEL - :ivar response_id: A specific response ID to cancel - if not provided, will cancel an - in-progress response in the default conversation. - :vartype response_id: str + :ivar seconds: The cumulative Live audio duration in seconds. Do not sum this value across + usage events. Required. + :vartype seconds: float """ - event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional client-generated ID used to identify this event.""" - type: Literal[RealtimeClientEventType.RESPONSE_CANCEL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.cancel``. Required. RESPONSE_CANCEL.""" - response_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A specific response ID to cancel - if not provided, will cancel an in-progress response in the - default conversation.""" + seconds: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The cumulative Live audio duration in seconds. Do not sum this value across usage events. + Required.""" @overload def __init__( self, *, - event_id: Optional[str] = None, - response_id: Optional[str] = None, + seconds: float, ) -> None: ... @overload @@ -17701,50 +17966,33 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeClientEventType.RESPONSE_CANCEL # type: ignore -class RealtimeClientEventResponseCreate( - RealtimeClientEvent, discriminator="response.create" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """This event instructs the server to create a Response, which means triggering model inference. - When in Server VAD mode, the server will create Responses automatically. A Response will - include at least one Item, and may have two, in which case the second will be a function call. - These Items will be appended to the conversation history by default. The server will respond - with a ``response.created`` event, events for Items and content created, and finally a - ``response.done`` event to indicate the Response is complete. The ``response.create`` event - includes inference configuration like ``instructions`` and ``tools``. If these are set, they - will override the Session's configuration for this Response only. Responses can be created - out-of-band of the default Conversation, meaning that they can have arbitrary input, and it's - possible to disable writing the output to the Conversation. Only one Response can write to the - default Conversation at a time, but otherwise multiple Responses can be created in parallel. - The ``metadata`` field is a good way to disambiguate multiple simultaneous Responses. Clients - can set ``conversation`` to ``none`` to create a Response that does not write to the default - Conversation. Arbitrary input can be provided with the ``input`` field, which is an array - accepting raw Items and references to existing Items. +class LiveSkillReferenceParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """LiveSkillReferenceParam. - :ivar event_id: Optional client-generated ID used to identify this event. - :vartype event_id: str - :ivar type: The event type, must be ``response.create``. Required. RESPONSE_CREATE. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_CREATE - :ivar response: - :vartype response: ~azure.ai.projects.models.VoiceAgentResponseCreateParams + :ivar type: References a skill created with the /v1/skills endpoint. Required. Default value is + "skill_reference". + :vartype type: str + :ivar skill_id: The ID of the referenced skill. Required. + :vartype skill_id: str + :ivar version: + :vartype version: str """ - event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional client-generated ID used to identify this event.""" - type: Literal[RealtimeClientEventType.RESPONSE_CREATE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.create``. Required. RESPONSE_CREATE.""" - response: Optional["_models.VoiceAgentResponseCreateParams"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) + type: Literal["skill_reference"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """References a skill created with the /v1/skills endpoint. Required. Default value is + \"skill_reference\".""" + skill_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the referenced skill. Required.""" + version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - event_id: Optional[str] = None, - response: Optional["_models.VoiceAgentResponseCreateParams"] = None, + skill_id: str, + version: Optional[str] = None, ) -> None: ... @overload @@ -17756,109 +18004,74 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeClientEventType.RESPONSE_CREATE # type: ignore + self.type: Literal["skill_reference"] = "skill_reference" -class RealtimeConversationItem(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A single item within a Realtime conversation. +class LiveSpecificApplyPatchParam(_Model): # pylint: disable=docstring-missing-param + """Specific apply patch tool choice. - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - RealtimeConversationItemFunctionCall, RealtimeConversationItemFunctionCallOutput, - RealtimeMCPApprovalRequest, RealtimeMCPApprovalResponse, RealtimeMCPToolCall, - RealtimeMCPListTools, RealtimeConversationItemMessage + :ivar type: The tool to call. Always ``apply_patch``. Required. Default value is "apply_patch". + :vartype type: str + """ - :ivar type: Required. Known values are: "function_call", "function_call_output", - "mcp_approval_response", "mcp_list_tools", "mcp_call", "mcp_approval_request", and "message". - :vartype type: str or ~azure.ai.projects.models.RealtimeConversationItemType + type: Literal["apply_patch"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The tool to call. Always ``apply_patch``. Required. Default value is \"apply_patch\".""" + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type: Literal["apply_patch"] = "apply_patch" + + +class LiveSpecificCodeInterpreterParam(_Model): # pylint: disable=docstring-missing-param + """LiveSpecificCodeInterpreterParam. + + :ivar type: The tool to call. Always ``code_interpreter``. Required. Default value is + "code_interpreter". + :vartype type: str """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"function_call\", \"function_call_output\", - \"mcp_approval_response\", \"mcp_list_tools\", \"mcp_call\", \"mcp_approval_request\", and - \"message\".""" + type: Literal["code_interpreter"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The tool to call. Always ``code_interpreter``. Required. Default value is \"code_interpreter\".""" - @overload - def __init__( - self, - *, - type: str, - ) -> None: ... + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type: Literal["code_interpreter"] = "code_interpreter" - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ + +class LiveSpecificComputerParam(_Model): # pylint: disable=docstring-missing-param + """LiveSpecificComputerParam. + + :ivar type: The tool to call. Always ``computer``. Required. Default value is "computer". + :vartype type: str + """ + + type: Literal["computer"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The tool to call. Always ``computer``. Required. Default value is \"computer\".""" def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["computer"] = "computer" -class RealtimeConversationItemFunctionCall( - RealtimeConversationItem, discriminator="function_call" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Realtime function call item. +class LiveSpecificCustomToolParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """LiveSpecificCustomToolParam. - :ivar id: The unique ID of the item. This may be provided by the client or generated by the - server. - :vartype id: str - :ivar object: Identifier for the API object being returned - always ``realtime.item``. Optional - when creating a new item. Default value is "realtime.item". - :vartype object: str - :ivar type: The type of the item. Always ``function_call``. Required. FUNCTION_CALL. - :vartype type: str or ~azure.ai.projects.models.FUNCTION_CALL - :ivar status: The status of the item. Has no effect on the conversation. Is one of the - following types: Literal["completed"], Literal["incomplete"], Literal["in_progress"] - :vartype status: str or str or str - :ivar call_id: The ID of the function call. - :vartype call_id: str - :ivar name: The name of the function being called. Required. + :ivar type: The tool to call. Always ``custom``. Required. Default value is "custom". + :vartype type: str + :ivar name: The name of the custom tool to call. Required. :vartype name: str - :ivar arguments: The arguments of the function call. This is a JSON-encoded string representing - the arguments passed to the function, for example ``{"arg1": "value1", "arg2": 42}``. Required. - :vartype arguments: str - :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. - :vartype created_at: ~datetime.datetime - :ivar response_id: The id of the response that produced this item, when applicable. - :vartype response_id: str """ - id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the item. This may be provided by the client or generated by the server.""" - object: Optional[Literal["realtime.item"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Identifier for the API object being returned - always ``realtime.item``. Optional when creating - a new item. Default value is \"realtime.item\".""" - type: Literal[RealtimeConversationItemType.FUNCTION_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the item. Always ``function_call``. Required. FUNCTION_CALL.""" - status: Optional[Literal["completed", "incomplete", "in_progress"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The status of the item. Has no effect on the conversation. Is one of the following types: - Literal[\"completed\"], Literal[\"incomplete\"], Literal[\"in_progress\"]""" - call_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the function call.""" + type: Literal["custom"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The tool to call. Always ``custom``. Required. Default value is \"custom\".""" name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the function being called. Required.""" - arguments: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The arguments of the function call. This is a JSON-encoded string representing the arguments - passed to the function, for example ``{\"arg1\": \"value1\", \"arg2\": 42}``. Required.""" - created_at: Optional[datetime.datetime] = rest_field(visibility=["read"], format="unix-timestamp") - """The Unix timestamp (in seconds) for when the item was persisted.""" - response_id: Optional[str] = rest_field(visibility=["read"]) - """The id of the response that produced this item, when applicable.""" + """The name of the custom tool to call. Required.""" @overload def __init__( self, *, name: str, - arguments: str, - id: Optional[str] = None, # pylint: disable=redefined-builtin - object: Optional[Literal["realtime.item"]] = None, - status: Optional[Literal["completed", "incomplete", "in_progress"]] = None, - call_id: Optional[str] = None, ) -> None: ... @overload @@ -17870,75 +18083,148 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeConversationItemType.FUNCTION_CALL # type: ignore + self.type: Literal["custom"] = "custom" -class RealtimeConversationItemFunctionCallOutput( - RealtimeConversationItem, discriminator="function_call_output" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Realtime function call output item. +class LiveSpecificFileSearchParam(_Model): # pylint: disable=docstring-missing-param + """LiveSpecificFileSearchParam. - :ivar id: The unique ID of the item. This may be provided by the client or generated by the - server. - :vartype id: str - :ivar object: Identifier for the API object being returned - always ``realtime.item``. Optional - when creating a new item. Default value is "realtime.item". - :vartype object: str - :ivar type: The type of the item. Always ``function_call_output``. Required. - FUNCTION_CALL_OUTPUT. - :vartype type: str or ~azure.ai.projects.models.FUNCTION_CALL_OUTPUT - :ivar status: The status of the item. Has no effect on the conversation. Is one of the - following types: Literal["completed"], Literal["incomplete"], Literal["in_progress"] - :vartype status: str or str or str - :ivar call_id: The ID of the function call this output is for. Required. - :vartype call_id: str - :ivar output: The output of the function call, this is free text and can contain any - information or simply be empty. Required. - :vartype output: str - :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. - :vartype created_at: ~datetime.datetime - :ivar response_id: The id of the response that produced this item, when applicable. - :vartype response_id: str - :ivar name: The name of the function that was called. A Foundry extension: OpenAI's - function_call_output does not carry the function name, only ``call_id``. - :vartype name: str + :ivar type: The tool to call. Always ``file_search``. Required. Default value is "file_search". + :vartype type: str """ - id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the item. This may be provided by the client or generated by the server.""" - object: Optional[Literal["realtime.item"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Identifier for the API object being returned - always ``realtime.item``. Optional when creating - a new item. Default value is \"realtime.item\".""" - type: Literal[RealtimeConversationItemType.FUNCTION_CALL_OUTPUT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the item. Always ``function_call_output``. Required. FUNCTION_CALL_OUTPUT.""" - status: Optional[Literal["completed", "incomplete", "in_progress"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The status of the item. Has no effect on the conversation. Is one of the following types: - Literal[\"completed\"], Literal[\"incomplete\"], Literal[\"in_progress\"]""" - call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the function call this output is for. Required.""" - output: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The output of the function call, this is free text and can contain any information or simply be - empty. Required.""" - created_at: Optional[datetime.datetime] = rest_field(visibility=["read"], format="unix-timestamp") - """The Unix timestamp (in seconds) for when the item was persisted.""" - response_id: Optional[str] = rest_field(visibility=["read"]) - """The id of the response that produced this item, when applicable.""" - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the function that was called. A Foundry extension: OpenAI's function_call_output - does not carry the function name, only ``call_id``.""" + type: Literal["file_search"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The tool to call. Always ``file_search``. Required. Default value is \"file_search\".""" + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type: Literal["file_search"] = "file_search" + + +class LiveSpecificFunctionShellParam(_Model): # pylint: disable=docstring-missing-param + """Specific shell tool choice. + + :ivar type: The tool to call. Always ``shell``. Required. Default value is "shell". + :vartype type: str + """ + + type: Literal["shell"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The tool to call. Always ``shell``. Required. Default value is \"shell\".""" + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type: Literal["shell"] = "shell" + + +class LiveSpecificImageGenParam(_Model): # pylint: disable=docstring-missing-param + """LiveSpecificImageGenParam. + + :ivar type: The tool to call. Always ``image_generation``. Required. Default value is + "image_generation". + :vartype type: str + """ + + type: Literal["image_generation"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The tool to call. Always ``image_generation``. Required. Default value is \"image_generation\".""" + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type: Literal["image_generation"] = "image_generation" + + +class LiveSpecificProgrammaticToolCallingParam(_Model): # pylint: disable=docstring-missing-param + """LiveSpecificProgrammaticToolCallingParam. + + :ivar type: The tool to call. Always ``programmatic_tool_calling``. Required. Default value is + "programmatic_tool_calling". + :vartype type: str + """ + + type: Literal["programmatic_tool_calling"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The tool to call. Always ``programmatic_tool_calling``. Required. Default value is + \"programmatic_tool_calling\".""" + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type: Literal["programmatic_tool_calling"] = "programmatic_tool_calling" + + +class LiveSpecificWebSearchParam(_Model): # pylint: disable=docstring-missing-param + """LiveSpecificWebSearchParam. + + :ivar type: The tool to call. Always ``web_search``. Required. Default value is "web_search". + :vartype type: str + """ + + type: Literal["web_search"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The tool to call. Always ``web_search``. Required. Default value is \"web_search\".""" + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type: Literal["web_search"] = "web_search" + + +class LiveSpecificWebSearchPreviewParam(_Model): # pylint: disable=docstring-missing-param + """LiveSpecificWebSearchPreviewParam. + + :ivar type: The tool to call. Always ``web_search_preview``. Required. Default value is + "web_search_preview". + :vartype type: str + """ + + type: Literal["web_search_preview"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The tool to call. Always ``web_search_preview``. Required. Default value is + \"web_search_preview\".""" + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type: Literal["web_search_preview"] = "web_search_preview" + + +class LiveToolSearchToolInputParam(_Model): # pylint: disable=docstring-missing-param + """LiveToolSearchToolInputParam. + + :ivar type: Required. Default value is "tool_search". + :vartype type: str + """ + + type: Literal["tool_search"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"tool_search\".""" + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type: Literal["tool_search"] = "tool_search" + + +class LiveTransportCallError(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """LiveTransportCallError. + + :ivar type: Required. Default value is "call_error". + :vartype type: str + :ivar code: The call setup failure code. Required. + :vartype code: str + :ivar message: Required. + :vartype message: str + :ivar param: The parameter related to the error, if any. Empty when no parameter applies. + :vartype param: str + """ + + type: Literal["call_error"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"call_error\".""" + code: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The call setup failure code. Required.""" + message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + param: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The parameter related to the error, if any. Empty when no parameter applies.""" @overload def __init__( self, *, - call_id: str, - output: str, - id: Optional[str] = None, # pylint: disable=redefined-builtin - object: Optional[Literal["realtime.item"]] = None, - status: Optional[Literal["completed", "incomplete", "in_progress"]] = None, - name: Optional[str] = None, + code: str, + message: str, + param: Optional[str] = None, ) -> None: ... @overload @@ -17950,35 +18236,35 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeConversationItemType.FUNCTION_CALL_OUTPUT # type: ignore + self.type: Literal["call_error"] = "call_error" -class RealtimeConversationItemMessage( - RealtimeConversationItem, discriminator="message" +class LiveTransportDTMFReceived( + LiveServerEvent, discriminator="transport.dtmf.received" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """RealtimeConversationItemMessage. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - RealtimeConversationItemMessageAssistant, RealtimeConversationItemMessageSystem, - RealtimeConversationItemMessageUser + """A SIP DTMF keypress received from the caller. Delivered only to sideband observers. - :ivar role: Required. Known values are: "system", "user", and "assistant". - :vartype role: str or ~azure.ai.projects.models.RealtimeConversationItemMessageType - :ivar type: Required. MESSAGE. - :vartype type: str or ~azure.ai.projects.models.MESSAGE + :ivar type: Required. TRANSPORT_DTMF_RECEIVED. + :vartype type: str or ~azure.ai.projects.models.TRANSPORT_DTMF_RECEIVED + :ivar event_id: Required. + :vartype event_id: str + :ivar event: Required. + :vartype event: str """ - __mapping__: dict[str, _Model] = {} - role: str = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"system\", \"user\", and \"assistant\".""" - type: Literal[RealtimeConversationItemType.MESSAGE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. MESSAGE.""" + type: Literal[LiveServerEventType.TRANSPORT_DTMF_RECEIVED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. TRANSPORT_DTMF_RECEIVED.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + event: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - role: str, + event_id: str, + event: str, ) -> None: ... @overload @@ -17990,66 +18276,41 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeConversationItemType.MESSAGE # type: ignore + self.type = LiveServerEventType.TRANSPORT_DTMF_RECEIVED # type: ignore -class RealtimeConversationItemMessageAssistant( - RealtimeConversationItemMessage, discriminator="assistant" +class LiveTransportDTMFSend( + LiveServerEvent, discriminator="transport.dtmf.send" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Realtime assistant message item. + """A SIP DTMF keypress successfully sent to the SIP trunk. Delivered only to sideband observers; + this is not a client command. - :ivar id: The unique ID of the item. This may be provided by the client or generated by the - server. - :vartype id: str - :ivar object: Identifier for the API object being returned - always ``realtime.item``. Optional - when creating a new item. Default value is "realtime.item". - :vartype object: str - :ivar type: The type of the item. Always ``message``. Required. MESSAGE. - :vartype type: str or ~azure.ai.projects.models.MESSAGE - :ivar status: The status of the item. Has no effect on the conversation. Is one of the - following types: Literal["completed"], Literal["incomplete"], Literal["in_progress"] - :vartype status: str or str or str - :ivar role: The role of the message sender. Always ``assistant``. Required. ASSISTANT. - :vartype role: str or ~azure.ai.projects.models.ASSISTANT - :ivar content: The content of the message. Required. - :vartype content: - list[~azure.ai.projects.models.RealtimeConversationItemMessageAssistantContent] - :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. - :vartype created_at: ~datetime.datetime - :ivar response_id: The id of the response that produced this item, when applicable. - :vartype response_id: str + :ivar type: Required. TRANSPORT_DTMF_SEND. + :vartype type: str or ~azure.ai.projects.models.TRANSPORT_DTMF_SEND + :ivar event_id: Required. + :vartype event_id: str + :ivar event: Required. + :vartype event: str + :ivar client_event_id: The event_id of the client command, when supplied. + :vartype client_event_id: str """ - id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the item. This may be provided by the client or generated by the server.""" - object: Optional[Literal["realtime.item"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Identifier for the API object being returned - always ``realtime.item``. Optional when creating - a new item. Default value is \"realtime.item\".""" - status: Optional[Literal["completed", "incomplete", "in_progress"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The status of the item. Has no effect on the conversation. Is one of the following types: - Literal[\"completed\"], Literal[\"incomplete\"], Literal[\"in_progress\"]""" - role: Literal[RealtimeConversationItemMessageType.ASSISTANT] = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The role of the message sender. Always ``assistant``. Required. ASSISTANT.""" - content: list["_models.RealtimeConversationItemMessageAssistantContent"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The content of the message. Required.""" - created_at: Optional[datetime.datetime] = rest_field(visibility=["read"], format="unix-timestamp") - """The Unix timestamp (in seconds) for when the item was persisted.""" - response_id: Optional[str] = rest_field(visibility=["read"]) - """The id of the response that produced this item, when applicable.""" + type: Literal[LiveServerEventType.TRANSPORT_DTMF_SEND] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. TRANSPORT_DTMF_SEND.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + event: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command, when supplied.""" @overload def __init__( self, *, - type: Literal[RealtimeConversationItemType.MESSAGE], - content: list["_models.RealtimeConversationItemMessageAssistantContent"], - id: Optional[str] = None, # pylint: disable=redefined-builtin - object: Optional[Literal["realtime.item"]] = None, - status: Optional[Literal["completed", "incomplete", "in_progress"]] = None, + event_id: str, + event: str, + client_event_id: Optional[str] = None, ) -> None: ... @overload @@ -18061,109 +18322,49 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.role = RealtimeConversationItemMessageType.ASSISTANT # type: ignore + self.type = LiveServerEventType.TRANSPORT_DTMF_SEND # type: ignore -class RealtimeConversationItemMessageAssistantContent( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """RealtimeConversationItemMessageAssistantContent. +class LiveWebSearchToolInputParam(_Model): # pylint: disable=docstring-missing-param + """A web search tool available to the Live session’s Responses backend. - :ivar type: Is either a Literal["output_text"] type or a Literal["output_audio"] type. - :vartype type: str or str - :ivar text: - :vartype text: str - :ivar audio: - :vartype audio: str - :ivar transcript: - :vartype transcript: str + :ivar type: The tool type. Always ``web_search``. Required. Default value is "web_search". + :vartype type: str """ - type: Optional[Literal["output_text", "output_audio"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Is either a Literal[\"output_text\"] type or a Literal[\"output_audio\"] type.""" - text: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - audio: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - transcript: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - - @overload - def __init__( - self, - *, - type: Optional[Literal["output_text", "output_audio"]] = None, - text: Optional[str] = None, - audio: Optional[str] = None, - transcript: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ + type: Literal["web_search"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The tool type. Always ``web_search``. Required. Default value is \"web_search\".""" def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["web_search"] = "web_search" -class RealtimeConversationItemMessageSystem( - RealtimeConversationItemMessage, discriminator="system" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Realtime system message item. +class LocalSkillParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """LocalSkillParam. - :ivar id: The unique ID of the item. This may be provided by the client or generated by the - server. - :vartype id: str - :ivar object: Identifier for the API object being returned - always ``realtime.item``. Optional - when creating a new item. Default value is "realtime.item". - :vartype object: str - :ivar type: The type of the item. Always ``message``. Required. MESSAGE. - :vartype type: str or ~azure.ai.projects.models.MESSAGE - :ivar status: The status of the item. Has no effect on the conversation. Is one of the - following types: Literal["completed"], Literal["incomplete"], Literal["in_progress"] - :vartype status: str or str or str - :ivar role: The role of the message sender. Always ``system``. Required. SYSTEM. - :vartype role: str or ~azure.ai.projects.models.SYSTEM - :ivar content: The content of the message. Required. - :vartype content: list[~azure.ai.projects.models.RealtimeConversationItemMessageSystemContent] - :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. - :vartype created_at: ~datetime.datetime - :ivar response_id: The id of the response that produced this item, when applicable. - :vartype response_id: str + :ivar name: The name of the skill. Required. + :vartype name: str + :ivar description: The description of the skill. Required. + :vartype description: str + :ivar path: The path to the directory containing the skill. Required. + :vartype path: str """ - id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the item. This may be provided by the client or generated by the server.""" - object: Optional[Literal["realtime.item"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Identifier for the API object being returned - always ``realtime.item``. Optional when creating - a new item. Default value is \"realtime.item\".""" - status: Optional[Literal["completed", "incomplete", "in_progress"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The status of the item. Has no effect on the conversation. Is one of the following types: - Literal[\"completed\"], Literal[\"incomplete\"], Literal[\"in_progress\"]""" - role: Literal[RealtimeConversationItemMessageType.SYSTEM] = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The role of the message sender. Always ``system``. Required. SYSTEM.""" - content: list["_models.RealtimeConversationItemMessageSystemContent"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The content of the message. Required.""" - created_at: Optional[datetime.datetime] = rest_field(visibility=["read"], format="unix-timestamp") - """The Unix timestamp (in seconds) for when the item was persisted.""" - response_id: Optional[str] = rest_field(visibility=["read"]) - """The id of the response that produced this item, when applicable.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the skill. Required.""" + description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The description of the skill. Required.""" + path: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The path to the directory containing the skill. Required.""" @overload def __init__( self, *, - type: Literal[RealtimeConversationItemType.MESSAGE], - content: list["_models.RealtimeConversationItemMessageSystemContent"], - id: Optional[str] = None, # pylint: disable=redefined-builtin - object: Optional[Literal["realtime.item"]] = None, - status: Optional[Literal["completed", "incomplete", "in_progress"]] = None, + name: str, + description: str, + path: str, ) -> None: ... @overload @@ -18175,30 +18376,33 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.role = RealtimeConversationItemMessageType.SYSTEM # type: ignore -class RealtimeConversationItemMessageSystemContent( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """RealtimeConversationItemMessageSystemContent. +class LogProbProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A log probability object. - :ivar type: Default value is "input_text". - :vartype type: str - :ivar text: - :vartype text: str + :ivar token: The token that was used to generate the log probability. Required. + :vartype token: str + :ivar logprob: The log probability of the token. Required. + :vartype logprob: float + :ivar bytes: The bytes that were used to generate the log probability. Required. + :vartype bytes: list[int] """ - type: Optional[Literal["input_text"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Default value is \"input_text\".""" - text: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + token: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The token that was used to generate the log probability. Required.""" + logprob: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The log probability of the token. Required.""" + bytes: list[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The bytes that were used to generate the log probability. Required.""" @overload def __init__( self, *, - type: Optional[Literal["input_text"]] = None, - text: Optional[str] = None, + token: str, + logprob: float, + bytes: list[int], ) -> None: ... @overload @@ -18212,62 +18416,41 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RealtimeConversationItemMessageUser( - RealtimeConversationItemMessage, discriminator="user" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Realtime user message item. +class LoraConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Adapter-specific metadata for LoRA models. Drives serving engine configuration at deployment + time. - :ivar id: The unique ID of the item. This may be provided by the client or generated by the - server. - :vartype id: str - :ivar object: Identifier for the API object being returned - always ``realtime.item``. Optional - when creating a new item. Default value is "realtime.item". - :vartype object: str - :ivar type: The type of the item. Always ``message``. Required. MESSAGE. - :vartype type: str or ~azure.ai.projects.models.MESSAGE - :ivar status: The status of the item. Has no effect on the conversation. Is one of the - following types: Literal["completed"], Literal["incomplete"], Literal["in_progress"] - :vartype status: str or str or str - :ivar role: The role of the message sender. Always ``user``. Required. USER. - :vartype role: str or ~azure.ai.projects.models.USER - :ivar content: The content of the message. Required. - :vartype content: list[~azure.ai.projects.models.RealtimeConversationItemMessageUserContent] - :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. - :vartype created_at: ~datetime.datetime - :ivar response_id: The id of the response that produced this item, when applicable. - :vartype response_id: str + :ivar rank: LoRA rank (r). Positive integer. Common values: 8, 16, 32, 64. + :vartype rank: int + :ivar alpha: LoRA scaling factor (α). Positive integer; typically 2× the rank. + :vartype alpha: int + :ivar target_modules: Model layers modified by the adapter (e.g., q_proj, v_proj). + Auto-detected from adapter_config.json if omitted. + :vartype target_modules: list[str] + :ivar dropout: Dropout rate used during training. Informational — not used at serving time. + :vartype dropout: float """ - id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the item. This may be provided by the client or generated by the server.""" - object: Optional[Literal["realtime.item"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Identifier for the API object being returned - always ``realtime.item``. Optional when creating - a new item. Default value is \"realtime.item\".""" - status: Optional[Literal["completed", "incomplete", "in_progress"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The status of the item. Has no effect on the conversation. Is one of the following types: - Literal[\"completed\"], Literal[\"incomplete\"], Literal[\"in_progress\"]""" - role: Literal[RealtimeConversationItemMessageType.USER] = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The role of the message sender. Always ``user``. Required. USER.""" - content: list["_models.RealtimeConversationItemMessageUserContent"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + rank: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """LoRA rank (r). Positive integer. Common values: 8, 16, 32, 64.""" + alpha: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """LoRA scaling factor (α). Positive integer; typically 2× the rank.""" + target_modules: Optional[list[str]] = rest_field( + name="targetModules", visibility=["read", "create", "update", "delete", "query"] ) - """The content of the message. Required.""" - created_at: Optional[datetime.datetime] = rest_field(visibility=["read"], format="unix-timestamp") - """The Unix timestamp (in seconds) for when the item was persisted.""" - response_id: Optional[str] = rest_field(visibility=["read"]) - """The id of the response that produced this item, when applicable.""" + """Model layers modified by the adapter (e.g., q_proj, v_proj). Auto-detected from + adapter_config.json if omitted.""" + dropout: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Dropout rate used during training. Informational — not used at serving time.""" @overload def __init__( self, *, - type: Literal[RealtimeConversationItemType.MESSAGE], - content: list["_models.RealtimeConversationItemMessageUserContent"], - id: Optional[str] = None, # pylint: disable=redefined-builtin - object: Optional[Literal["realtime.item"]] = None, - status: Optional[Literal["completed", "incomplete", "in_progress"]] = None, + rank: Optional[int] = None, + alpha: Optional[int] = None, + target_modules: Optional[list[str]] = None, + dropout: Optional[float] = None, ) -> None: ... @overload @@ -18279,53 +18462,29 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.role = RealtimeConversationItemMessageType.USER # type: ignore -class RealtimeConversationItemMessageUserContent( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """RealtimeConversationItemMessageUserContent. +class ManagedAgentIdentityBlueprintReference( + AgentBlueprintReference, discriminator="ManagedAgentIdentityBlueprint" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """ManagedAgentIdentityBlueprintReference. - :ivar type: Is one of the following types: Literal["input_text"], Literal["input_audio"], - Literal["input_image"] - :vartype type: str or str or str - :ivar text: - :vartype text: str - :ivar audio: - :vartype audio: str - :ivar image_url: - :vartype image_url: str - :ivar detail: Is one of the following types: Literal["auto"], Literal["low"], Literal["high"] - :vartype detail: str or str or str - :ivar transcript: - :vartype transcript: str + :ivar type: Required. MANAGED_AGENT_IDENTITY_BLUEPRINT. + :vartype type: str or ~azure.ai.projects.models.MANAGED_AGENT_IDENTITY_BLUEPRINT + :ivar blueprint_id: The ID of the managed blueprint. Required. + :vartype blueprint_id: str """ - type: Optional[Literal["input_text", "input_audio", "input_image"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Is one of the following types: Literal[\"input_text\"], Literal[\"input_audio\"], - Literal[\"input_image\"]""" - text: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - audio: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - image_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - detail: Optional[Literal["auto", "low", "high"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Is one of the following types: Literal[\"auto\"], Literal[\"low\"], Literal[\"high\"]""" - transcript: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. MANAGED_AGENT_IDENTITY_BLUEPRINT.""" + blueprint_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the managed blueprint. Required.""" @overload def __init__( self, *, - type: Optional[Literal["input_text", "input_audio", "input_image"]] = None, - text: Optional[str] = None, - audio: Optional[str] = None, - image_url: Optional[str] = None, - detail: Optional[Literal["auto", "low", "high"]] = None, - transcript: Optional[str] = None, + blueprint_id: str, ) -> None: ... @overload @@ -18337,42 +18496,42 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT # type: ignore -class RealtimeFunctionTool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Function tool. +class ManagedAzureAISearchIndex( + Index, discriminator="ManagedAzureSearch" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Managed Azure AI Search Index Definition. - :ivar type: The type of the tool, i.e. ``function``. Default value is "function". - :vartype type: str - :ivar name: The name of the function. + :ivar id: Asset ID, a unique identifier for the asset. + :vartype id: str + :ivar name: The name of the resource. Required. :vartype name: str - :ivar description: The description of the function, including guidance on when and how to call - it, and guidance about what to tell the user when calling (if anything). + :ivar version: The version of the resource. Required. + :vartype version: str + :ivar description: The asset description text. :vartype description: str - :ivar parameters: Parameters of the function in JSON Schema. - :vartype parameters: ~azure.ai.projects.models.RealtimeFunctionToolParameters + :ivar tags: Tag dictionary. Tags can be added, removed, and updated. + :vartype tags: dict[str, str] + :ivar type: Type of index. Required. Managed Azure Search. + :vartype type: str or ~azure.ai.projects.models.MANAGED_AZURE_SEARCH + :ivar vector_store_id: Vector store id of managed index. Required. + :vartype vector_store_id: str """ - type: Optional[Literal["function"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The type of the tool, i.e. ``function``. Default value is \"function\".""" - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the function.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The description of the function, including guidance on when and how to call it, and guidance - about what to tell the user when calling (if anything).""" - parameters: Optional["_models.RealtimeFunctionToolParameters"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Parameters of the function in JSON Schema.""" + type: Literal[IndexType.MANAGED_AZURE_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Type of index. Required. Managed Azure Search.""" + vector_store_id: str = rest_field(name="vectorStoreId", visibility=["create"]) + """Vector store id of managed index. Required.""" @overload def __init__( self, *, - type: Optional[Literal["function"]] = None, - name: Optional[str] = None, + vector_store_id: str, description: Optional[str] = None, - parameters: Optional["_models.RealtimeFunctionToolParameters"] = None, + tags: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -18384,57 +18543,41 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = IndexType.MANAGED_AZURE_SEARCH # type: ignore -class RealtimeFunctionToolParameters(_Model): - """RealtimeFunctionToolParameters.""" - - -class RealtimeMCPApprovalRequest( - RealtimeConversationItem, discriminator="mcp_approval_request" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Realtime MCP approval request. +class MCPListToolsTool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """MCP list tools tool. - :ivar type: The type of the item. Always ``mcp_approval_request``. Required. - MCP_APPROVAL_REQUEST. - :vartype type: str or ~azure.ai.projects.models.MCP_APPROVAL_REQUEST - :ivar id: The unique ID of the approval request. Required. - :vartype id: str - :ivar server_label: The label of the MCP server making the request. Required. - :vartype server_label: str - :ivar name: The name of the tool to run. Required. + :ivar name: The name of the tool. Required. :vartype name: str - :ivar arguments: A JSON string of arguments for the tool. Required. - :vartype arguments: str - :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. - :vartype created_at: ~datetime.datetime - :ivar response_id: The id of the response that produced this item, when applicable. - :vartype response_id: str + :ivar description: + :vartype description: str + :ivar input_schema: The JSON schema describing the tool's input. Required. + :vartype input_schema: ~azure.ai.projects.models.MCPListToolsToolInputSchema + :ivar annotations: + :vartype annotations: ~azure.ai.projects.models.MCPListToolsToolAnnotations """ - type: Literal[RealtimeConversationItemType.MCP_APPROVAL_REQUEST] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the item. Always ``mcp_approval_request``. Required. MCP_APPROVAL_REQUEST.""" - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the approval request. Required.""" - server_label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The label of the MCP server making the request. Required.""" name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the tool to run. Required.""" - arguments: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A JSON string of arguments for the tool. Required.""" - created_at: Optional[datetime.datetime] = rest_field(visibility=["read"], format="unix-timestamp") - """The Unix timestamp (in seconds) for when the item was persisted.""" - response_id: Optional[str] = rest_field(visibility=["read"]) - """The id of the response that produced this item, when applicable.""" + """The name of the tool. Required.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + input_schema: "_models.MCPListToolsToolInputSchema" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The JSON schema describing the tool's input. Required.""" + annotations: Optional["_models.MCPListToolsToolAnnotations"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - server_label: str, name: str, - arguments: str, + input_schema: "_models.MCPListToolsToolInputSchema", + description: Optional[str] = None, + annotations: Optional["_models.MCPListToolsToolAnnotations"] = None, ) -> None: ... @overload @@ -18446,126 +18589,178 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeConversationItemType.MCP_APPROVAL_REQUEST # type: ignore - - -class RealtimeMCPApprovalResponse( - RealtimeConversationItem, discriminator="mcp_approval_response" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Realtime MCP approval response. - - :ivar type: The type of the item. Always ``mcp_approval_response``. Required. - MCP_APPROVAL_RESPONSE. - :vartype type: str or ~azure.ai.projects.models.MCP_APPROVAL_RESPONSE - :ivar id: The unique ID of the approval response. Required. - :vartype id: str - :ivar approval_request_id: The ID of the approval request being answered. Required. - :vartype approval_request_id: str - :ivar approve: Whether the request was approved. Required. - :vartype approve: bool - :ivar reason: - :vartype reason: str - :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. - :vartype created_at: ~datetime.datetime - :ivar response_id: The id of the response that produced this item, when applicable. - :vartype response_id: str - """ - type: Literal[RealtimeConversationItemType.MCP_APPROVAL_RESPONSE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the item. Always ``mcp_approval_response``. Required. MCP_APPROVAL_RESPONSE.""" - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the approval response. Required.""" - approval_request_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the approval request being answered. Required.""" - approve: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether the request was approved. Required.""" - reason: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - created_at: Optional[datetime.datetime] = rest_field(visibility=["read"], format="unix-timestamp") - """The Unix timestamp (in seconds) for when the item was persisted.""" - response_id: Optional[str] = rest_field(visibility=["read"]) - """The id of the response that produced this item, when applicable.""" - @overload - def __init__( - self, - *, - id: str, # pylint: disable=redefined-builtin - approval_request_id: str, - approve: bool, - reason: Optional[str] = None, - ) -> None: ... +class MCPListToolsToolAnnotations(_Model): + """MCPListToolsToolAnnotations.""" - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type = RealtimeConversationItemType.MCP_APPROVAL_RESPONSE # type: ignore +class MCPListToolsToolInputSchema(_Model): + """MCPListToolsToolInputSchema.""" -class RealtimeMCPError(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """RealtimeMCPError. +class McpProtocolConfiguration(_Model): + """Configuration specific to the MCP protocol.""" - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - RealtimeMCPHTTPError, RealtimeMCPProtocolError, RealtimeMCPToolExecutionError - :ivar type: Required. Known values are: "protocol_error", "tool_execution_error", and - "http_error". - :vartype type: str or ~azure.ai.projects.models.RealtimeMcpErrorType - """ +class MCPTool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """MCP tool. - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"protocol_error\", \"tool_execution_error\", and \"http_error\".""" + :ivar type: The type of the MCP tool. Always ``mcp``. Required. Default value is "mcp". + :vartype type: str + :ivar server_label: A label for this MCP server, used to identify it in tool calls. Required. + :vartype server_label: str + :ivar server_url: The URL for the MCP server. One of ``server_url``, ``connector_id``, or + ``tunnel_id`` must be provided. + :vartype server_url: str + :ivar connector_id: Identifier for service connectors, like those available in ChatGPT. One of + ``server_url``, ``connector_id``, or ``tunnel_id`` must be provided. Learn more about service + connectors `here + `_. This field + is deprecated for models released after September 1, 2026. Use ``server_url`` to connect to a + remote MCP server, or ``tunnel_id`` to connect through a Secure MCP Tunnel. Currently supported + ``connector_id`` values are: - @overload - def __init__( - self, - *, - type: str, - ) -> None: ... + * Dropbox: `connector_dropbox` + * Gmail: `connector_gmail` + * Google Calendar: `connector_googlecalendar` + * Google Drive: `connector_googledrive` + * Microsoft Teams: `connector_microsoftteams` + * Outlook Calendar: `connector_outlookcalendar` + * Outlook Email: `connector_outlookemail` + * SharePoint: `connector_sharepoint`. Is one of the following types: + Literal["connector_dropbox"], Literal["connector_gmail"], Literal["connector_googlecalendar"], + Literal["connector_googledrive"], Literal["connector_microsoftteams"], + Literal["connector_outlookcalendar"], Literal["connector_outlookemail"], + Literal["connector_sharepoint"] - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class RealtimeMCPHTTPError( - RealtimeMCPError, discriminator="http_error" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Realtime MCP HTTP error. - - :ivar type: Required. HTTP_ERROR. - :vartype type: str or ~azure.ai.projects.models.HTTP_ERROR - :ivar code: Required. - :vartype code: int - :ivar message: Required. - :vartype message: str + :vartype connector_id: str or str or str or str or str or str or str or str + :ivar tunnel_id: The Secure MCP Tunnel ID to use instead of a direct server URL. One of + ``server_url``, ``connector_id``, or ``tunnel_id`` must be provided. + :vartype tunnel_id: str + :ivar authorization: An OAuth access token that can be used with a remote MCP server, either + with a custom MCP server URL or a service connector. Your application must handle the OAuth + authorization flow and provide the token here. + :vartype authorization: str + :ivar server_description: Optional description of the MCP server, used to provide more context. + :vartype server_description: str + :ivar headers: + :vartype headers: dict[str, str] + :ivar allowed_tools: Is either a [str] type or a MCPToolFilter type. + :vartype allowed_tools: list[str] or ~azure.ai.projects.models.MCPToolFilter + :ivar allowed_callers: + :vartype allowed_callers: list[str or ~azure.ai.projects.models.CallableToolAllowedCaller] + :ivar require_approval: Is one of the following types: MCPToolRequireApproval, + Literal["always"], Literal["never"] + :vartype require_approval: ~azure.ai.projects.models.MCPToolRequireApproval or str or str + :ivar defer_loading: Whether this MCP tool is deferred and discovered via tool search. + :vartype defer_loading: bool + :ivar project_connection_id: The connection ID in the project for the MCP server. The + connection stores authentication and other connection details needed to connect to the MCP + server. + :vartype project_connection_id: str + :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future + version. + :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] """ - type: Literal[RealtimeMcpErrorType.HTTP_ERROR] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. HTTP_ERROR.""" - code: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + type: Literal["mcp"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of the MCP tool. Always ``mcp``. Required. Default value is \"mcp\".""" + server_label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A label for this MCP server, used to identify it in tool calls. Required.""" + server_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The URL for the MCP server. One of ``server_url``, ``connector_id``, or ``tunnel_id`` must be + provided.""" + connector_id: Optional[ + Literal[ + "connector_dropbox", + "connector_gmail", + "connector_googlecalendar", + "connector_googledrive", + "connector_microsoftteams", + "connector_outlookcalendar", + "connector_outlookemail", + "connector_sharepoint", + ] + ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Identifier for service connectors, like those available in ChatGPT. One of ``server_url``, + ``connector_id``, or ``tunnel_id`` must be provided. Learn more about service connectors `here + `_. This field + is deprecated for models released after September 1, 2026. Use ``server_url`` to connect to a + remote MCP server, or ``tunnel_id`` to connect through a Secure MCP Tunnel. Currently supported + ``connector_id`` values are: + + * Dropbox: `connector_dropbox` + * Gmail: `connector_gmail` + * Google Calendar: `connector_googlecalendar` + * Google Drive: `connector_googledrive` + * Microsoft Teams: `connector_microsoftteams` + * Outlook Calendar: `connector_outlookcalendar` + * Outlook Email: `connector_outlookemail` + * SharePoint: `connector_sharepoint`. Is one of the following types: + Literal[\"connector_dropbox\"], Literal[\"connector_gmail\"], + Literal[\"connector_googlecalendar\"], Literal[\"connector_googledrive\"], + Literal[\"connector_microsoftteams\"], Literal[\"connector_outlookcalendar\"], + Literal[\"connector_outlookemail\"], Literal[\"connector_sharepoint\"]""" + tunnel_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Secure MCP Tunnel ID to use instead of a direct server URL. One of ``server_url``, + ``connector_id``, or ``tunnel_id`` must be provided.""" + authorization: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An OAuth access token that can be used with a remote MCP server, either with a custom MCP + server URL or a service connector. Your application must handle the OAuth authorization flow + and provide the token here.""" + server_description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional description of the MCP server, used to provide more context.""" + headers: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + allowed_tools: Optional[Union[list[str], "_models.MCPToolFilter"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Is either a [str] type or a MCPToolFilter type.""" + allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + require_approval: Optional[Union["_models.MCPToolRequireApproval", Literal["always"], Literal["never"]]] = ( + rest_field(visibility=["read", "create", "update", "delete", "query"]) + ) + """Is one of the following types: MCPToolRequireApproval, Literal[\"always\"], Literal[\"never\"]""" + defer_loading: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether this MCP tool is deferred and discovered via tool search.""" + project_connection_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The connection ID in the project for the MCP server. The connection stores authentication and + other connection details needed to connect to the MCP server.""" + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Deprecated. This property is deprecated and will be removed in a future version.""" @overload def __init__( self, *, - code: int, - message: str, + server_label: str, + server_url: Optional[str] = None, + connector_id: Optional[ + Literal[ + "connector_dropbox", + "connector_gmail", + "connector_googlecalendar", + "connector_googledrive", + "connector_microsoftteams", + "connector_outlookcalendar", + "connector_outlookemail", + "connector_sharepoint", + ] + ] = None, + tunnel_id: Optional[str] = None, + authorization: Optional[str] = None, + server_description: Optional[str] = None, + headers: Optional[dict[str, str]] = None, + allowed_tools: Optional[Union[list[str], "_models.MCPToolFilter"]] = None, + allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = None, + require_approval: Optional[Union["_models.MCPToolRequireApproval", Literal["always"], Literal["never"]]] = None, + defer_loading: Optional[bool] = None, + project_connection_id: Optional[str] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, ) -> None: ... @overload @@ -18577,48 +18772,170 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeMcpErrorType.HTTP_ERROR # type: ignore + self.type: Literal["mcp"] = "mcp" -class RealtimeMCPListTools( - RealtimeConversationItem, discriminator="mcp_list_tools" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Realtime MCP list tools. +class MCPToolboxTool(ToolboxTool, discriminator="mcp"): # pylint: disable=docstring-keyword-should-match-keyword-only + """An MCP tool stored in a toolbox. - :ivar type: The type of the item. Always ``mcp_list_tools``. Required. MCP_LIST_TOOLS. - :vartype type: str or ~azure.ai.projects.models.MCP_LIST_TOOLS - :ivar id: The unique ID of the list. - :vartype id: str - :ivar server_label: The label of the MCP server. Required. + :ivar name: Optional user-defined name for this tool or configuration. + :vartype name: str + :ivar description: Optional user-defined description for this tool or configuration. + :vartype description: str + :ivar tool_configs: Per-tool configuration map. Keys are tool names or ``*`` (catch-all + default). Resolution order: exact tool name match takes priority over ``*``. Unknown tool names + are silently ignored at runtime. + :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] + :ivar type: Required. MCP. + :vartype type: str or ~azure.ai.projects.models.MCP + :ivar server_label: A label for this MCP server, used to identify it in tool calls. Required. :vartype server_label: str - :ivar tools: The tools available on the server. Required. - :vartype tools: list[~azure.ai.projects.models.MCPListToolsTool] - :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. - :vartype created_at: ~datetime.datetime - :ivar response_id: The id of the response that produced this item, when applicable. - :vartype response_id: str + :ivar server_url: The URL for the MCP server. One of ``server_url``, ``connector_id``, or + ``tunnel_id`` must be provided. + :vartype server_url: str + :ivar connector_id: Identifier for service connectors, like those available in ChatGPT. One of + ``server_url``, ``connector_id``, or ``tunnel_id`` must be provided. Learn more about service + connectors `here + `_. This field + is deprecated for models released after September 1, 2026. Use ``server_url`` to connect to a + remote MCP server, or ``tunnel_id`` to connect through a Secure MCP Tunnel. Currently supported + ``connector_id`` values are: + + * Dropbox: `connector_dropbox` + * Gmail: `connector_gmail` + * Google Calendar: `connector_googlecalendar` + * Google Drive: `connector_googledrive` + * Microsoft Teams: `connector_microsoftteams` + * Outlook Calendar: `connector_outlookcalendar` + * Outlook Email: `connector_outlookemail` + * SharePoint: `connector_sharepoint`. Is one of the following types: + Literal["connector_dropbox"], Literal["connector_gmail"], Literal["connector_googlecalendar"], + Literal["connector_googledrive"], Literal["connector_microsoftteams"], + Literal["connector_outlookcalendar"], Literal["connector_outlookemail"], + Literal["connector_sharepoint"] + + :vartype connector_id: str or str or str or str or str or str or str or str + :ivar tunnel_id: The Secure MCP Tunnel ID to use instead of a direct server URL. One of + ``server_url``, ``connector_id``, or ``tunnel_id`` must be provided. + :vartype tunnel_id: str + :ivar authorization: An OAuth access token that can be used with a remote MCP server, either + with a custom MCP server URL or a service connector. Your application must handle the OAuth + authorization flow and provide the token here. + :vartype authorization: str + :ivar server_description: Optional description of the MCP server, used to provide more context. + :vartype server_description: str + :ivar headers: + :vartype headers: dict[str, str] + :ivar allowed_tools: Is either a [str] type or a MCPToolFilter type. + :vartype allowed_tools: list[str] or ~azure.ai.projects.models.MCPToolFilter + :ivar allowed_callers: + :vartype allowed_callers: list[str or ~azure.ai.projects.models.CallableToolAllowedCaller] + :ivar require_approval: Is one of the following types: MCPToolRequireApproval, + Literal["always"], Literal["never"] + :vartype require_approval: ~azure.ai.projects.models.MCPToolRequireApproval or str or str + :ivar defer_loading: Whether this MCP tool is deferred and discovered via tool search. + :vartype defer_loading: bool + :ivar project_connection_id: The connection ID in the project for the MCP server. The + connection stores authentication and other connection details needed to connect to the MCP + server. + :vartype project_connection_id: str """ - type: Literal[RealtimeConversationItemType.MCP_LIST_TOOLS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the item. Always ``mcp_list_tools``. Required. MCP_LIST_TOOLS.""" - id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the list.""" + type: Literal[ToolboxToolType.MCP] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. MCP.""" server_label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The label of the MCP server. Required.""" - tools: list["_models.MCPListToolsTool"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The tools available on the server. Required.""" - created_at: Optional[datetime.datetime] = rest_field(visibility=["read"], format="unix-timestamp") - """The Unix timestamp (in seconds) for when the item was persisted.""" - response_id: Optional[str] = rest_field(visibility=["read"]) - """The id of the response that produced this item, when applicable.""" + """A label for this MCP server, used to identify it in tool calls. Required.""" + server_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The URL for the MCP server. One of ``server_url``, ``connector_id``, or ``tunnel_id`` must be + provided.""" + connector_id: Optional[ + Literal[ + "connector_dropbox", + "connector_gmail", + "connector_googlecalendar", + "connector_googledrive", + "connector_microsoftteams", + "connector_outlookcalendar", + "connector_outlookemail", + "connector_sharepoint", + ] + ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Identifier for service connectors, like those available in ChatGPT. One of ``server_url``, + ``connector_id``, or ``tunnel_id`` must be provided. Learn more about service connectors `here + `_. This field + is deprecated for models released after September 1, 2026. Use ``server_url`` to connect to a + remote MCP server, or ``tunnel_id`` to connect through a Secure MCP Tunnel. Currently supported + ``connector_id`` values are: + + * Dropbox: `connector_dropbox` + * Gmail: `connector_gmail` + * Google Calendar: `connector_googlecalendar` + * Google Drive: `connector_googledrive` + * Microsoft Teams: `connector_microsoftteams` + * Outlook Calendar: `connector_outlookcalendar` + * Outlook Email: `connector_outlookemail` + * SharePoint: `connector_sharepoint`. Is one of the following types: + Literal[\"connector_dropbox\"], Literal[\"connector_gmail\"], + Literal[\"connector_googlecalendar\"], Literal[\"connector_googledrive\"], + Literal[\"connector_microsoftteams\"], Literal[\"connector_outlookcalendar\"], + Literal[\"connector_outlookemail\"], Literal[\"connector_sharepoint\"]""" + tunnel_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Secure MCP Tunnel ID to use instead of a direct server URL. One of ``server_url``, + ``connector_id``, or ``tunnel_id`` must be provided.""" + authorization: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An OAuth access token that can be used with a remote MCP server, either with a custom MCP + server URL or a service connector. Your application must handle the OAuth authorization flow + and provide the token here.""" + server_description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional description of the MCP server, used to provide more context.""" + headers: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + allowed_tools: Optional[Union[list[str], "_models.MCPToolFilter"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Is either a [str] type or a MCPToolFilter type.""" + allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + require_approval: Optional[Union["_models.MCPToolRequireApproval", Literal["always"], Literal["never"]]] = ( + rest_field(visibility=["read", "create", "update", "delete", "query"]) + ) + """Is one of the following types: MCPToolRequireApproval, Literal[\"always\"], Literal[\"never\"]""" + defer_loading: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether this MCP tool is deferred and discovered via tool search.""" + project_connection_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The connection ID in the project for the MCP server. The connection stores authentication and + other connection details needed to connect to the MCP server.""" @overload def __init__( self, *, server_label: str, - tools: list["_models.MCPListToolsTool"], - id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + description: Optional[str] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + server_url: Optional[str] = None, + connector_id: Optional[ + Literal[ + "connector_dropbox", + "connector_gmail", + "connector_googlecalendar", + "connector_googledrive", + "connector_microsoftteams", + "connector_outlookcalendar", + "connector_outlookemail", + "connector_sharepoint", + ] + ] = None, + tunnel_id: Optional[str] = None, + authorization: Optional[str] = None, + server_description: Optional[str] = None, + headers: Optional[dict[str, str]] = None, + allowed_tools: Optional[Union[list[str], "_models.MCPToolFilter"]] = None, + allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = None, + require_approval: Optional[Union["_models.MCPToolRequireApproval", Literal["always"], Literal["never"]]] = None, + defer_loading: Optional[bool] = None, + project_connection_id: Optional[str] = None, ) -> None: ... @overload @@ -18630,35 +18947,35 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeConversationItemType.MCP_LIST_TOOLS # type: ignore + self.type = ToolboxToolType.MCP # type: ignore -class RealtimeMCPProtocolError( - RealtimeMCPError, discriminator="protocol_error" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Realtime MCP protocol error. +class MCPToolFilter(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """MCP tool filter. - :ivar type: Required. PROTOCOL_ERROR. - :vartype type: str or ~azure.ai.projects.models.PROTOCOL_ERROR - :ivar code: Required. - :vartype code: int - :ivar message: Required. - :vartype message: str + :ivar tool_names: MCP allowed tools. + :vartype tool_names: list[str] + :ivar read_only: Indicates whether or not a tool modifies data or is read-only. If an MCP + server is `annotated with `readOnlyHint` + `_, + it will match this filter. + :vartype read_only: bool """ - type: Literal[RealtimeMcpErrorType.PROTOCOL_ERROR] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. PROTOCOL_ERROR.""" - code: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + tool_names: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """MCP allowed tools.""" + read_only: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Indicates whether or not a tool modifies data or is read-only. If an MCP server is `annotated + with `readOnlyHint` + `_, + it will match this filter.""" @overload def __init__( self, *, - code: int, - message: str, + tool_names: Optional[list[str]] = None, + read_only: Optional[bool] = None, ) -> None: ... @overload @@ -18670,65 +18987,26 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeMcpErrorType.PROTOCOL_ERROR # type: ignore -class RealtimeMCPToolCall( - RealtimeConversationItem, discriminator="mcp_call" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Realtime MCP tool call. +class MCPToolRequireApproval(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """MCPToolRequireApproval. - :ivar type: The type of the item. Always ``mcp_call``. Required. MCP_CALL. - :vartype type: str or ~azure.ai.projects.models.MCP_CALL - :ivar id: The unique ID of the tool call. Required. - :vartype id: str - :ivar server_label: The label of the MCP server running the tool. Required. - :vartype server_label: str - :ivar name: The name of the tool that was run. Required. - :vartype name: str - :ivar arguments: A JSON string of the arguments passed to the tool. Required. - :vartype arguments: str - :ivar approval_request_id: - :vartype approval_request_id: str - :ivar output: - :vartype output: str - :ivar error: - :vartype error: ~azure.ai.projects.models.RealtimeMCPError - :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. - :vartype created_at: ~datetime.datetime - :ivar response_id: The id of the response that produced this item, when applicable. - :vartype response_id: str + :ivar always: + :vartype always: ~azure.ai.projects.models.MCPToolFilter + :ivar never: + :vartype never: ~azure.ai.projects.models.MCPToolFilter """ - type: Literal[RealtimeConversationItemType.MCP_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the item. Always ``mcp_call``. Required. MCP_CALL.""" - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the tool call. Required.""" - server_label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The label of the MCP server running the tool. Required.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the tool that was run. Required.""" - arguments: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A JSON string of the arguments passed to the tool. Required.""" - approval_request_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - output: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - error: Optional["_models.RealtimeMCPError"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - created_at: Optional[datetime.datetime] = rest_field(visibility=["read"], format="unix-timestamp") - """The Unix timestamp (in seconds) for when the item was persisted.""" - response_id: Optional[str] = rest_field(visibility=["read"]) - """The id of the response that produced this item, when applicable.""" + always: Optional["_models.MCPToolFilter"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + never: Optional["_models.MCPToolFilter"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - server_label: str, - name: str, - arguments: str, - approval_request_id: Optional[str] = None, - output: Optional[str] = None, - error: Optional["_models.RealtimeMCPError"] = None, + always: Optional["_models.MCPToolFilter"] = None, + never: Optional["_models.MCPToolFilter"] = None, ) -> None: ... @overload @@ -18740,30 +19018,32 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeConversationItemType.MCP_CALL # type: ignore -class RealtimeMCPToolExecutionError( - RealtimeMCPError, discriminator="tool_execution_error" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Realtime MCP tool execution error. +class MemoryOperation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Represents a single memory operation (create, update, or delete) performed on a memory item. - :ivar type: Required. TOOL_EXECUTION_ERROR. - :vartype type: str or ~azure.ai.projects.models.TOOL_EXECUTION_ERROR - :ivar message: Required. - :vartype message: str + :ivar kind: The type of memory operation being performed. Required. Known values are: "create", + "update", and "delete". + :vartype kind: str or ~azure.ai.projects.models.MemoryOperationKind + :ivar memory_item: The memory item to create, update, or delete. Required. + :vartype memory_item: ~azure.ai.projects.models.MemoryItem """ - type: Literal[RealtimeMcpErrorType.TOOL_EXECUTION_ERROR] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. TOOL_EXECUTION_ERROR.""" - message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + kind: Union[str, "_models.MemoryOperationKind"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The type of memory operation being performed. Required. Known values are: \"create\", + \"update\", and \"delete\".""" + memory_item: "_models.MemoryItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The memory item to create, update, or delete. Required.""" @overload def __init__( self, *, - message: str, + kind: Union[str, "_models.MemoryOperationKind"], + memory_item: "_models.MemoryItem", ) -> None: ... @overload @@ -18775,26 +19055,23 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeMcpErrorType.TOOL_EXECUTION_ERROR # type: ignore -class RealtimeReasoning(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Realtime reasoning configuration. +class MemorySearchItem(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A retrieved memory item from memory search. - :ivar effort: Known values are: "minimal", "low", "medium", "high", and "xhigh". - :vartype effort: str or ~azure.ai.projects.models.RealtimeReasoningEffort + :ivar memory_item: Retrieved memory item. Required. + :vartype memory_item: ~azure.ai.projects.models.MemoryItem """ - effort: Optional[Union[str, "_models.RealtimeReasoningEffort"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Known values are: \"minimal\", \"low\", \"medium\", \"high\", and \"xhigh\".""" + memory_item: "_models.MemoryItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Retrieved memory item. Required.""" @overload def __init__( self, *, - effort: Optional[Union[str, "_models.RealtimeReasoningEffort"]] = None, + memory_item: "_models.MemoryItem", ) -> None: ... @overload @@ -18808,40 +19085,21 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RealtimeResponseStatusDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """RealtimeResponseStatusDetails. +class MemorySearchOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Memory search options. - :ivar type: Is one of the following types: Literal["completed"], Literal["cancelled"], - Literal["failed"], Literal["incomplete"] - :vartype type: str or str or str or str - :ivar reason: Is one of the following types: Literal["turn_detected"], - Literal["client_cancelled"], Literal["max_output_tokens"], Literal["content_filter"] - :vartype reason: str or str or str or str - :ivar error: - :vartype error: ~azure.ai.projects.models.RealtimeResponseStatusDetailsError + :ivar max_memories: Maximum number of memory items to return. + :vartype max_memories: int """ - type: Optional[Literal["completed", "cancelled", "failed", "incomplete"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Is one of the following types: Literal[\"completed\"], Literal[\"cancelled\"], - Literal[\"failed\"], Literal[\"incomplete\"]""" - reason: Optional[Literal["turn_detected", "client_cancelled", "max_output_tokens", "content_filter"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Is one of the following types: Literal[\"turn_detected\"], Literal[\"client_cancelled\"], - Literal[\"max_output_tokens\"], Literal[\"content_filter\"]""" - error: Optional["_models.RealtimeResponseStatusDetailsError"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) + max_memories: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Maximum number of memory items to return.""" @overload def __init__( self, *, - type: Optional[Literal["completed", "cancelled", "failed", "incomplete"]] = None, - reason: Optional[Literal["turn_detected", "client_cancelled", "max_output_tokens", "content_filter"]] = None, - error: Optional["_models.RealtimeResponseStatusDetailsError"] = None, + max_memories: Optional[int] = None, ) -> None: ... @overload @@ -18855,24 +19113,50 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RealtimeResponseStatusDetailsError(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """RealtimeResponseStatusDetailsError. +class MemorySearchPreviewTool( + Tool, discriminator="memory_search_preview" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A tool for integrating memories into the agent. - :ivar type: - :vartype type: str - :ivar code: - :vartype code: str + :ivar type: The type of the tool. Always ``memory_search_preview``. Required. + MEMORY_SEARCH_PREVIEW. + :vartype type: str or ~azure.ai.projects.models.MEMORY_SEARCH_PREVIEW + :ivar memory_store_name: The name of the memory store to use. Required. + :vartype memory_store_name: str + :ivar scope: The namespace used to group and isolate memories, such as a user ID. Limits which + memories can be retrieved or updated. Use special variable ``{{$userId}}`` to scope memories to + the current signed-in user. Required. + :vartype scope: str + :ivar search_options: Options for searching the memory store. + :vartype search_options: ~azure.ai.projects.models.MemorySearchOptions + :ivar update_delay: Time to wait before updating memories after inactivity (seconds). Default + 300. + :vartype update_delay: int """ - type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - code: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[ToolType.MEMORY_SEARCH_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the tool. Always ``memory_search_preview``. Required. MEMORY_SEARCH_PREVIEW.""" + memory_store_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the memory store to use. Required.""" + scope: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The namespace used to group and isolate memories, such as a user ID. Limits which memories can + be retrieved or updated. Use special variable ``{{$userId}}`` to scope memories to the current + signed-in user. Required.""" + search_options: Optional["_models.MemorySearchOptions"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Options for searching the memory store.""" + update_delay: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Time to wait before updating memories after inactivity (seconds). Default 300.""" @overload def __init__( self, *, - type: Optional[str] = None, - code: Optional[str] = None, + memory_store_name: str, + scope: str, + search_options: Optional["_models.MemorySearchOptions"] = None, + update_delay: Optional[int] = None, ) -> None: ... @overload @@ -18884,43 +19168,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolType.MEMORY_SEARCH_PREVIEW # type: ignore -class RealtimeResponseUsage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """RealtimeResponseUsage. +class MemoryStoreDefinition(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Base definition for memory store configurations. - :ivar total_tokens: - :vartype total_tokens: int - :ivar input_tokens: - :vartype input_tokens: int - :ivar output_tokens: - :vartype output_tokens: int - :ivar input_token_details: - :vartype input_token_details: ~azure.ai.projects.models.RealtimeResponseUsageInputTokenDetails - :ivar output_token_details: - :vartype output_token_details: - ~azure.ai.projects.models.RealtimeResponseUsageOutputTokenDetails + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + MemoryStoreDefaultDefinition + + :ivar kind: The kind of the memory store. Required. "default" + :vartype kind: str or ~azure.ai.projects.models.MemoryStoreKind """ - total_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - input_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - output_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - input_token_details: Optional["_models.RealtimeResponseUsageInputTokenDetails"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - output_token_details: Optional["_models.RealtimeResponseUsageOutputTokenDetails"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) + __mapping__: dict[str, _Model] = {} + kind: str = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) + """The kind of the memory store. Required. \"default\"""" @overload def __init__( self, *, - total_tokens: Optional[int] = None, - input_tokens: Optional[int] = None, - output_tokens: Optional[int] = None, - input_token_details: Optional["_models.RealtimeResponseUsageInputTokenDetails"] = None, - output_token_details: Optional["_models.RealtimeResponseUsageOutputTokenDetails"] = None, + kind: str, ) -> None: ... @overload @@ -18934,39 +19203,40 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RealtimeResponseUsageInputTokenDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """RealtimeResponseUsageInputTokenDetails. +class MemoryStoreDefaultDefinition( + MemoryStoreDefinition, discriminator="default" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Default memory store implementation. - :ivar cached_tokens: - :vartype cached_tokens: int - :ivar text_tokens: - :vartype text_tokens: int - :ivar image_tokens: - :vartype image_tokens: int - :ivar audio_tokens: - :vartype audio_tokens: int - :ivar cached_tokens_details: - :vartype cached_tokens_details: - ~azure.ai.projects.models.RealtimeResponseUsageInputTokenDetailsCachedTokensDetails + :ivar kind: The kind of the memory store. Required. The default memory store implementation. + :vartype kind: str or ~azure.ai.projects.models.DEFAULT + :ivar chat_model: The name or identifier of the chat completion model deployment used for + memory processing. Required. + :vartype chat_model: str + :ivar embedding_model: The name or identifier of the embedding model deployment used for memory + processing. Required. + :vartype embedding_model: str + :ivar options: Default memory store options. + :vartype options: ~azure.ai.projects.models.MemoryStoreDefaultOptions """ - cached_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - text_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - image_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - audio_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - cached_tokens_details: Optional["_models.RealtimeResponseUsageInputTokenDetailsCachedTokensDetails"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) + kind: Literal[MemoryStoreKind.DEFAULT] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The kind of the memory store. Required. The default memory store implementation.""" + chat_model: str = rest_field(visibility=["read", "create"]) + """The name or identifier of the chat completion model deployment used for memory processing. + Required.""" + embedding_model: str = rest_field(visibility=["read", "create"]) + """The name or identifier of the embedding model deployment used for memory processing. Required.""" + options: Optional["_models.MemoryStoreDefaultOptions"] = rest_field(visibility=["read", "create"]) + """Default memory store options.""" @overload def __init__( self, *, - cached_tokens: Optional[int] = None, - text_tokens: Optional[int] = None, - image_tokens: Optional[int] = None, - audio_tokens: Optional[int] = None, - cached_tokens_details: Optional["_models.RealtimeResponseUsageInputTokenDetailsCachedTokensDetails"] = None, + chat_model: str, + embedding_model: str, + options: Optional["_models.MemoryStoreDefaultOptions"] = None, ) -> None: ... @overload @@ -18978,32 +19248,53 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.kind = MemoryStoreKind.DEFAULT # type: ignore -class RealtimeResponseUsageInputTokenDetailsCachedTokensDetails( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """RealtimeResponseUsageInputTokenDetailsCachedTokensDetails. +class MemoryStoreDefaultOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Default memory store configurations. - :ivar text_tokens: - :vartype text_tokens: int - :ivar image_tokens: - :vartype image_tokens: int - :ivar audio_tokens: - :vartype audio_tokens: int + :ivar user_profile_enabled: Whether to enable user profile extraction and storage. Default is + true. Required. + :vartype user_profile_enabled: bool + :ivar user_profile_details: Specific categories or types of user profile information to extract + and store. + :vartype user_profile_details: str + :ivar chat_summary_enabled: Whether to enable chat summary extraction and storage. Defaults to + ``true``. Required. + :vartype chat_summary_enabled: bool + :ivar procedural_memory_enabled: Whether to enable procedural memory extraction and storage. + The service defaults to ``true`` if a value is not specified by the caller. + :vartype procedural_memory_enabled: bool + :ivar default_ttl_seconds: The default time-to-live for memories in seconds. A value of ``0`` + indicates that memories do not expire. Defaults to ``0``. + :vartype default_ttl_seconds: ~datetime.timedelta """ - text_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - image_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - audio_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + user_profile_enabled: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether to enable user profile extraction and storage. Default is true. Required.""" + user_profile_details: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Specific categories or types of user profile information to extract and store.""" + chat_summary_enabled: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether to enable chat summary extraction and storage. Defaults to ``true``. Required.""" + procedural_memory_enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether to enable procedural memory extraction and storage. The service defaults to ``true`` if + a value is not specified by the caller.""" + default_ttl_seconds: Optional[datetime.timedelta] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-seconds-int" + ) + """The default time-to-live for memories in seconds. A value of ``0`` indicates that memories do + not expire. Defaults to ``0``.""" @overload def __init__( self, *, - text_tokens: Optional[int] = None, - image_tokens: Optional[int] = None, - audio_tokens: Optional[int] = None, + user_profile_enabled: bool, + chat_summary_enabled: bool, + user_profile_details: Optional[str] = None, + procedural_memory_enabled: Optional[bool] = None, + default_ttl_seconds: Optional[datetime.timedelta] = None, ) -> None: ... @overload @@ -19017,24 +19308,39 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RealtimeResponseUsageOutputTokenDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """RealtimeResponseUsageOutputTokenDetails. +class MemoryStoreDeleteScopeResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Response for deleting memories from a scope. - :ivar text_tokens: - :vartype text_tokens: int - :ivar audio_tokens: - :vartype audio_tokens: int + :ivar object: The object type. Always 'memory_store.scope.deleted'. Required. + MEMORY_STORE_SCOPE_DELETED. + :vartype object: str or ~azure.ai.projects.models.MEMORY_STORE_SCOPE_DELETED + :ivar name: The name of the memory store. Required. + :vartype name: str + :ivar scope: The scope from which memories were deleted. Required. + :vartype scope: str + :ivar deleted: Whether the deletion operation was successful. Required. + :vartype deleted: bool """ - text_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - audio_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + object: Literal[MemoryStoreObjectType.MEMORY_STORE_SCOPE_DELETED] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The object type. Always 'memory_store.scope.deleted'. Required. MEMORY_STORE_SCOPE_DELETED.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the memory store. Required.""" + scope: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The scope from which memories were deleted. Required.""" + deleted: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether the deletion operation was successful. Required.""" @overload def __init__( self, *, - text_tokens: Optional[int] = None, - audio_tokens: Optional[int] = None, + object: Literal[MemoryStoreObjectType.MEMORY_STORE_SCOPE_DELETED], + name: str, + scope: str, + deleted: bool, ) -> None: ... @overload @@ -19048,111 +19354,63 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RealtimeServerEvent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A realtime server event. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - RealtimeServerEventConversationItemAdded, RealtimeServerEventConversationItemCreated, - RealtimeServerEventConversationItemDeleted, RealtimeServerEventConversationItemDone, - RealtimeServerEventConversationItemInputAudioTranscriptionCompleted, - RealtimeServerEventConversationItemInputAudioTranscriptionDelta, - RealtimeServerEventConversationItemInputAudioTranscriptionFailed, - RealtimeServerEventConversationItemInputAudioTranscriptionSegment, - RealtimeServerEventConversationItemRetrieved, RealtimeServerEventConversationItemTruncated, - RealtimeServerEventInputAudioBufferCleared, RealtimeServerEventInputAudioBufferCommitted, - RealtimeServerEventInputAudioBufferSpeechStarted, - RealtimeServerEventInputAudioBufferSpeechStopped, - RealtimeServerEventInputAudioBufferTimeoutTriggered, RealtimeServerEventMCPListToolsCompleted, - RealtimeServerEventMCPListToolsFailed, RealtimeServerEventMCPListToolsInProgress, - RealtimeServerEventOutputAudioBufferCleared, RealtimeServerEventRateLimitsUpdated, - VoiceAgentServerEventResponseAnimationBlendshapesDelta, - VoiceAgentServerEventResponseAnimationBlendshapesDone, - VoiceAgentServerEventResponseAnimationVisemeDelta, - VoiceAgentServerEventResponseAnimationVisemeDone, - VoiceAgentServerEventResponseAudioTimestampDelta, - VoiceAgentServerEventResponseAudioTimestampDone, RealtimeServerEventResponseContentPartAdded, - RealtimeServerEventResponseContentPartDone, RealtimeServerEventResponseCreated, - RealtimeServerEventResponseDone, RealtimeServerEventResponseFunctionCallArgumentsDelta, - RealtimeServerEventResponseFunctionCallArgumentsDone, - RealtimeServerEventResponseMCPCallCompleted, RealtimeServerEventResponseMCPCallFailed, - RealtimeServerEventResponseMCPCallInProgress, RealtimeServerEventResponseMCPCallArgumentsDelta, - RealtimeServerEventResponseMCPCallArgumentsDone, RealtimeServerEventResponseAudioDelta, - RealtimeServerEventResponseAudioDone, RealtimeServerEventResponseAudioTranscriptDelta, - RealtimeServerEventResponseAudioTranscriptDone, RealtimeServerEventResponseOutputItemAdded, - RealtimeServerEventResponseOutputItemDone, RealtimeServerEventResponseTextDelta, - RealtimeServerEventResponseTextDone, VoiceAgentServerEventResponseVideoDelta, - VoiceAgentServerEventRtcCallError, VoiceAgentServerEventRtcCallSdpCreated, - VoiceAgentServerEventSessionAvatarConnecting, VoiceAgentServerEventSessionAvatarSwitchToIdle, - VoiceAgentServerEventSessionAvatarSwitchToSpeaking, RealtimeServerEventSessionCreated, - VoiceAgentServerEventSessionSubagentAborted, VoiceAgentServerEventSessionSubagentCompleted, - VoiceAgentServerEventSessionSubagentStarted, RealtimeServerEventSessionUpdated, - VoiceAgentServerEventWarning +class MemoryStoreDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A memory store that can store and retrieve user memories. - :ivar type: Required. Known values are: "conversation.created", "conversation.item.created", - "conversation.item.deleted", "conversation.item.input_audio_transcription.completed", - "conversation.item.input_audio_transcription.delta", - "conversation.item.input_audio_transcription.failed", "conversation.item.retrieved", - "conversation.item.truncated", "error", "input_audio_buffer.cleared", - "input_audio_buffer.committed", "input_audio_buffer.dtmf_event_received", - "input_audio_buffer.speech_started", "input_audio_buffer.speech_stopped", - "rate_limits.updated", "response.output_audio.delta", "response.output_audio.done", - "response.output_audio_transcript.delta", "response.output_audio_transcript.done", - "response.content_part.added", "response.content_part.done", "response.created", - "response.done", "response.function_call_arguments.delta", - "response.function_call_arguments.done", "response.output_item.added", - "response.output_item.done", "response.output_text.delta", "response.output_text.done", - "session.created", "session.updated", "output_audio_buffer.started", - "output_audio_buffer.stopped", "output_audio_buffer.cleared", "conversation.item.added", - "conversation.item.done", "input_audio_buffer.timeout_triggered", - "conversation.item.input_audio_transcription.segment", "mcp_list_tools.in_progress", - "mcp_list_tools.completed", "mcp_list_tools.failed", "response.mcp_call_arguments.delta", - "response.mcp_call_arguments.done", "response.mcp_call.in_progress", - "response.mcp_call.completed", "response.mcp_call.failed", "warning", - "session.subagent.started", "session.subagent.completed", "session.subagent.aborted", - "session.avatar.connecting", "session.avatar.switch_to_speaking", - "session.avatar.switch_to_idle", "rtc.call.sdp.created", "rtc.call.error", - "response.audio_timestamp.delta", "response.audio_timestamp.done", - "response.animation_blendshapes.delta", "response.animation_blendshapes.done", - "response.animation_viseme.delta", "response.animation_viseme.done", and - "response.video.delta". - :vartype type: str or ~azure.ai.projects.models.RealtimeServerEventType + :ivar object: The object type, which is always 'memory_store'. Required. MEMORY_STORE. + :vartype object: str or ~azure.ai.projects.models.MEMORY_STORE + :ivar id: The unique identifier of the memory store. Required. + :vartype id: str + :ivar created_at: The Unix timestamp (seconds) when the memory store was created. Required. + :vartype created_at: ~datetime.datetime + :ivar updated_at: The Unix timestamp (seconds) when the memory store was last updated. + Required. + :vartype updated_at: ~datetime.datetime + :ivar name: The name of the memory store. Required. + :vartype name: str + :ivar description: A human-readable description of the memory store. + :vartype description: str + :ivar metadata: Arbitrary key-value metadata to associate with the memory store. + :vartype metadata: dict[str, str] + :ivar definition: The definition of the memory store. Required. + :vartype definition: ~azure.ai.projects.models.MemoryStoreDefinition """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"conversation.created\", \"conversation.item.created\", - \"conversation.item.deleted\", \"conversation.item.input_audio_transcription.completed\", - \"conversation.item.input_audio_transcription.delta\", - \"conversation.item.input_audio_transcription.failed\", \"conversation.item.retrieved\", - \"conversation.item.truncated\", \"error\", \"input_audio_buffer.cleared\", - \"input_audio_buffer.committed\", \"input_audio_buffer.dtmf_event_received\", - \"input_audio_buffer.speech_started\", \"input_audio_buffer.speech_stopped\", - \"rate_limits.updated\", \"response.output_audio.delta\", \"response.output_audio.done\", - \"response.output_audio_transcript.delta\", \"response.output_audio_transcript.done\", - \"response.content_part.added\", \"response.content_part.done\", \"response.created\", - \"response.done\", \"response.function_call_arguments.delta\", - \"response.function_call_arguments.done\", \"response.output_item.added\", - \"response.output_item.done\", \"response.output_text.delta\", \"response.output_text.done\", - \"session.created\", \"session.updated\", \"output_audio_buffer.started\", - \"output_audio_buffer.stopped\", \"output_audio_buffer.cleared\", \"conversation.item.added\", - \"conversation.item.done\", \"input_audio_buffer.timeout_triggered\", - \"conversation.item.input_audio_transcription.segment\", \"mcp_list_tools.in_progress\", - \"mcp_list_tools.completed\", \"mcp_list_tools.failed\", \"response.mcp_call_arguments.delta\", - \"response.mcp_call_arguments.done\", \"response.mcp_call.in_progress\", - \"response.mcp_call.completed\", \"response.mcp_call.failed\", \"warning\", - \"session.subagent.started\", \"session.subagent.completed\", \"session.subagent.aborted\", - \"session.avatar.connecting\", \"session.avatar.switch_to_speaking\", - \"session.avatar.switch_to_idle\", \"rtc.call.sdp.created\", \"rtc.call.error\", - \"response.audio_timestamp.delta\", \"response.audio_timestamp.done\", - \"response.animation_blendshapes.delta\", \"response.animation_blendshapes.done\", - \"response.animation_viseme.delta\", \"response.animation_viseme.done\", and - \"response.video.delta\".""" + object: Literal[MemoryStoreObjectType.MEMORY_STORE] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The object type, which is always 'memory_store'. Required. MEMORY_STORE.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique identifier of the memory store. Required.""" + created_at: datetime.datetime = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (seconds) when the memory store was created. Required.""" + updated_at: datetime.datetime = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (seconds) when the memory store was last updated. Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the memory store. Required.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A human-readable description of the memory store.""" + metadata: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Arbitrary key-value metadata to associate with the memory store.""" + definition: "_models.MemoryStoreDefinition" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The definition of the memory store. Required.""" @overload def __init__( self, *, - type: str, + object: Literal[MemoryStoreObjectType.MEMORY_STORE], + id: str, # pylint: disable=redefined-builtin + created_at: datetime.datetime, + updated_at: datetime.datetime, + name: str, + definition: "_models.MemoryStoreDefinition", + description: Optional[str] = None, + metadata: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -19166,46 +19424,50 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RealtimeServerEventConversationItemAdded( - RealtimeServerEvent, discriminator="conversation.item.added" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Sent by the server when an Item is added to the default Conversation. This can happen in - several cases: - - * When the client sends a `conversation.item.create` event. - * When the input audio buffer is committed. In this case the item will be a user message containing the audio from - the buffer. - * When the model is generating a Response. In this case the `conversation.item.added` event will be sent when the - model starts generating a specific Item, and thus it will not yet have any content (and `status` will be - `in_progress`). The event will include the full content of the Item (except when model is generating a Response) - except for audio data, which can be retrieved separately with a `conversation.item.retrieve` event if necessary. +class MemoryStoreOperationUsage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Usage statistics of a memory store operation. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``conversation.item.added``. Required. - CONVERSATION_ITEM_ADDED. - :vartype type: str or ~azure.ai.projects.models.CONVERSATION_ITEM_ADDED - :ivar previous_item_id: - :vartype previous_item_id: str - :ivar item: Required. - :vartype item: ~azure.ai.projects.models.RealtimeConversationItem + :ivar embedding_tokens: The number of embedding tokens. Required. + :vartype embedding_tokens: int + :ivar input_tokens: The number of input tokens. Required. + :vartype input_tokens: int + :ivar input_tokens_details: A detailed breakdown of the input tokens. Required. + :vartype input_tokens_details: ~azure.ai.projects.models.ResponseUsageInputTokensDetails + :ivar output_tokens: The number of output tokens. Required. + :vartype output_tokens: int + :ivar output_tokens_details: A detailed breakdown of the output tokens. Required. + :vartype output_tokens_details: ~azure.ai.projects.models.ResponseUsageOutputTokensDetails + :ivar total_tokens: The total number of tokens used. Required. + :vartype total_tokens: int """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``conversation.item.added``. Required. CONVERSATION_ITEM_ADDED.""" - previous_item_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - item: "_models.RealtimeConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + embedding_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The number of embedding tokens. Required.""" + input_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The number of input tokens. Required.""" + input_tokens_details: "_models.ResponseUsageInputTokensDetails" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """A detailed breakdown of the input tokens. Required.""" + output_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The number of output tokens. Required.""" + output_tokens_details: "_models.ResponseUsageOutputTokensDetails" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """A detailed breakdown of the output tokens. Required.""" + total_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The total number of tokens used. Required.""" @overload def __init__( self, *, - event_id: str, - item: "_models.RealtimeConversationItem", - previous_item_id: Optional[str] = None, + embedding_tokens: int, + input_tokens: int, + input_tokens_details: "_models.ResponseUsageInputTokensDetails", + output_tokens: int, + output_tokens_details: "_models.ResponseUsageOutputTokensDetails", + total_tokens: int, ) -> None: ... @overload @@ -19217,47 +19479,35 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.CONVERSATION_ITEM_ADDED # type: ignore - -class RealtimeServerEventConversationItemCreated( - RealtimeServerEvent, discriminator="conversation.item.created" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Returned when a conversation item is created. There are several scenarios that produce this - event: - * The server is generating a Response, which if successful will produce either one or two Items, which will be of - type `message` (role `assistant`) or type `function_call`. - * The input audio buffer has been committed, either by the client or the server (in `server_vad` mode). The server - will take the content of the input audio buffer and add it to a new user message Item. - * The client has sent a `conversation.item.create` event to add a new Item to the Conversation. +class MemoryStoreSearchResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Memory search response. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``conversation.item.created``. Required. - CONVERSATION_ITEM_CREATED. - :vartype type: str or ~azure.ai.projects.models.CONVERSATION_ITEM_CREATED - :ivar previous_item_id: - :vartype previous_item_id: str - :ivar item: Required. - :vartype item: ~azure.ai.projects.models.RealtimeConversationItem + :ivar search_id: The unique ID of this search request. Use this value as previous_search_id in + subsequent requests to perform incremental searches. Required. + :vartype search_id: str + :ivar memories: Related memory items found during the search operation. Required. + :vartype memories: list[~azure.ai.projects.models.MemorySearchItem] + :ivar usage: Usage statistics associated with the memory search operation. Required. + :vartype usage: ~azure.ai.projects.models.MemoryStoreOperationUsage """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``conversation.item.created``. Required. CONVERSATION_ITEM_CREATED.""" - previous_item_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - item: "_models.RealtimeConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + search_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of this search request. Use this value as previous_search_id in subsequent + requests to perform incremental searches. Required.""" + memories: list["_models.MemorySearchItem"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Related memory items found during the search operation. Required.""" + usage: "_models.MemoryStoreOperationUsage" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Usage statistics associated with the memory search operation. Required.""" @overload def __init__( self, *, - event_id: str, - item: "_models.RealtimeConversationItem", - previous_item_id: Optional[str] = None, + search_id: str, + memories: list["_models.MemorySearchItem"], + usage: "_models.MemoryStoreOperationUsage", ) -> None: ... @overload @@ -19269,38 +19519,31 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.CONVERSATION_ITEM_CREATED # type: ignore -class RealtimeServerEventConversationItemDeleted( - RealtimeServerEvent, discriminator="conversation.item.deleted" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Returned when an item in the conversation is deleted by the client with a - ``conversation.item.delete`` event. This event is used to synchronize the server's - understanding of the conversation history with the client's view. +class MemoryStoreUpdateCompletedResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Memory update result. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``conversation.item.deleted``. Required. - CONVERSATION_ITEM_DELETED. - :vartype type: str or ~azure.ai.projects.models.CONVERSATION_ITEM_DELETED - :ivar item_id: The ID of the item that was deleted. Required. - :vartype item_id: str + :ivar memory_operations: A list of individual memory operations that were performed during the + update. Required. + :vartype memory_operations: list[~azure.ai.projects.models.MemoryOperation] + :ivar usage: Usage statistics associated with the memory update operation. Required. + :vartype usage: ~azure.ai.projects.models.MemoryStoreOperationUsage """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DELETED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``conversation.item.deleted``. Required. CONVERSATION_ITEM_DELETED.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the item that was deleted. Required.""" + memory_operations: list["_models.MemoryOperation"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """A list of individual memory operations that were performed during the update. Required.""" + usage: "_models.MemoryStoreOperationUsage" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Usage statistics associated with the memory update operation. Required.""" @overload def __init__( self, *, - event_id: str, - item_id: str, + memory_operations: list["_models.MemoryOperation"], + usage: "_models.MemoryStoreOperationUsage", ) -> None: ... @overload @@ -19312,42 +19555,53 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.CONVERSATION_ITEM_DELETED # type: ignore -class RealtimeServerEventConversationItemDone( - RealtimeServerEvent, discriminator="conversation.item.done" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Returned when a conversation item is finalized. The event will include the full content of the - Item except for audio data, which can be retrieved separately with a - ``conversation.item.retrieve`` event if needed. +class MemoryStoreUpdateResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Provides the status of a memory store update operation. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``conversation.item.done``. Required. - CONVERSATION_ITEM_DONE. - :vartype type: str or ~azure.ai.projects.models.CONVERSATION_ITEM_DONE - :ivar previous_item_id: - :vartype previous_item_id: str - :ivar item: Required. - :vartype item: ~azure.ai.projects.models.RealtimeConversationItem + :ivar update_id: The unique ID of this update request. Use this value as previous_update_id in + subsequent requests to perform incremental updates. Required. + :vartype update_id: str + :ivar status: The status of the memory update operation. One of "queued", "in_progress", + "completed", "failed", or "superseded". Required. Known values are: "queued", "in_progress", + "completed", "failed", and "superseded". + :vartype status: str or ~azure.ai.projects.models.MemoryStoreUpdateStatus + :ivar superseded_by: The update_id the operation was superseded by when status is "superseded". + :vartype superseded_by: str + :ivar result: The result of memory store update operation when status is "completed". + :vartype result: ~azure.ai.projects.models.MemoryStoreUpdateCompletedResult + :ivar error: Error object that describes the error when status is "failed". + :vartype error: ~azure.ai.projects.models.ApiError """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``conversation.item.done``. Required. CONVERSATION_ITEM_DONE.""" - previous_item_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - item: "_models.RealtimeConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + update_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of this update request. Use this value as previous_update_id in subsequent + requests to perform incremental updates. Required.""" + status: Union[str, "_models.MemoryStoreUpdateStatus"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The status of the memory update operation. One of \"queued\", \"in_progress\", \"completed\", + \"failed\", or \"superseded\". Required. Known values are: \"queued\", \"in_progress\", + \"completed\", \"failed\", and \"superseded\".""" + superseded_by: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The update_id the operation was superseded by when status is \"superseded\".""" + result: Optional["_models.MemoryStoreUpdateCompletedResult"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The result of memory store update operation when status is \"completed\".""" + error: Optional["_models.ApiError"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Error object that describes the error when status is \"failed\".""" @overload def __init__( self, *, - event_id: str, - item: "_models.RealtimeConversationItem", - previous_item_id: Optional[str] = None, + update_id: str, + status: Union[str, "_models.MemoryStoreUpdateStatus"], + superseded_by: Optional[str] = None, + result: Optional["_models.MemoryStoreUpdateCompletedResult"] = None, + error: Optional["_models.ApiError"] = None, ) -> None: ... @overload @@ -19359,88 +19613,39 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.CONVERSATION_ITEM_DONE # type: ignore -class RealtimeServerEventConversationItemInputAudioTranscriptionCompleted( - RealtimeServerEvent, discriminator="conversation.item.input_audio_transcription.completed" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """This event is the output of audio transcription for user audio written to the user audio - buffer. Transcription begins when the input audio buffer is committed by the client or server - (when VAD is enabled). Transcription runs asynchronously with Response creation, so this event - may come before or after the Response events. Realtime API models accept audio natively, and - thus input transcription is a separate process run on a separate ASR (Automatic Speech - Recognition) model. The transcript may diverge somewhat from the model's interpretation, and - should be treated as a rough guide. +class Metadata(_Model): + """Set of 16 key-value pairs that can be attached to an object. This can be useful for storing + additional information about the object in a structured format, and querying for objects via + API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are + strings with a maximum length of 512 characters. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``conversation.item.input_audio_transcription.completed``. - Required. CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED. - :vartype type: str or - ~azure.ai.projects.models.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED - :ivar item_id: The ID of the item containing the audio that is being transcribed. Required. - :vartype item_id: str - :ivar content_index: The index of the content part containing the audio. Required. - :vartype content_index: int - :ivar transcript: The transcribed text. Required. - :vartype transcript: str - :ivar languages: The languages detected in the audio. Returned by ``gpt-transcribe``. An empty - array indicates that no language could be reliably detected. - :vartype languages: list[~azure.ai.projects.models.TranscriptionLanguage] - :ivar logprobs: - :vartype logprobs: list[~azure.ai.projects.models.LogProbProperties] - :ivar usage: Usage statistics for the transcription, this is billed according to the ASR - model's pricing rather than the realtime model's pricing. Required. Is either a - TranscriptTextUsageTokens type or a TranscriptTextUsageDuration type. - :vartype usage: ~azure.ai.projects.models.TranscriptTextUsageTokens or - ~azure.ai.projects.models.TranscriptTextUsageDuration - :ivar phrases: Phrase-level transcription timing and confidence details. - :vartype phrases: list[~azure.ai.projects.models.VoiceAgentTranscriptionPhrase] """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``conversation.item.input_audio_transcription.completed``. Required. - CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the item containing the audio that is being transcribed. Required.""" - content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the content part containing the audio. Required.""" - transcript: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The transcribed text. Required.""" - languages: Optional[list["_models.TranscriptionLanguage"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The languages detected in the audio. Returned by ``gpt-transcribe``. An empty array indicates - that no language could be reliably detected.""" - logprobs: Optional[list["_models.LogProbProperties"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - usage: Union["_models.TranscriptTextUsageTokens", "_models.TranscriptTextUsageDuration"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Usage statistics for the transcription, this is billed according to the ASR model's pricing - rather than the realtime model's pricing. Required. Is either a TranscriptTextUsageTokens type - or a TranscriptTextUsageDuration type.""" - phrases: Optional[list["_models.VoiceAgentTranscriptionPhrase"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Phrase-level transcription timing and confidence details.""" + +class Microsoft365PermissionScopes(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A set of delegated permission scopes requested from a single resource application. + + :ivar resource_app_id: Application id of the resource that exposes the requested delegated + scopes. Required. + :vartype resource_app_id: str + :ivar scopes: Delegated scope names requested from the resource application. Must not be empty. + Required. + :vartype scopes: list[str] + """ + + resource_app_id: str = rest_field(name="resourceAppId", visibility=["read", "create", "update", "delete", "query"]) + """Application id of the resource that exposes the requested delegated scopes. Required.""" + scopes: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Delegated scope names requested from the resource application. Must not be empty. Required.""" @overload def __init__( self, *, - event_id: str, - item_id: str, - content_index: int, - transcript: str, - usage: Union["_models.TranscriptTextUsageTokens", "_models.TranscriptTextUsageDuration"], - languages: Optional[list["_models.TranscriptionLanguage"]] = None, - logprobs: Optional[list["_models.LogProbProperties"]] = None, - phrases: Optional[list["_models.VoiceAgentTranscriptionPhrase"]] = None, + resource_app_id: str, + scopes: list[str], ) -> None: ... @overload @@ -19452,55 +19657,125 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED # type: ignore -class RealtimeServerEventConversationItemInputAudioTranscriptionDelta( - RealtimeServerEvent, discriminator="conversation.item.input_audio_transcription.delta" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Returned when the text value of an input audio transcription content part is updated with - incremental transcription results. +class Microsoft365PublishDefaults(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Default and previously-published values used to pre-populate a Microsoft 365 publish request + for a Foundry agent. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``conversation.item.input_audio_transcription.delta``. - Required. CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA. - :vartype type: str or - ~azure.ai.projects.models.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA - :ivar item_id: The ID of the item containing the audio that is being transcribed. Required. - :vartype item_id: str - :ivar content_index: The index of the content part in the item's content array. - :vartype content_index: int - :ivar delta: The text delta. - :vartype delta: str - :ivar logprobs: - :vartype logprobs: list[~azure.ai.projects.models.LogProbProperties] + :ivar app_publish_scope: The publish scope. Known values are: "Personal", "Shared", and + "Tenant". + :vartype app_publish_scope: str or ~azure.ai.projects.models.Microsoft365PublishScope + :ivar agent_name: The agent name. + :vartype agent_name: str + :ivar agent_display_name: The user-facing display name for the agent. Defaults to the agent + name if not previously overridden. + :vartype agent_display_name: str + :ivar app_registration_client_id: The app-registration client id associated with the agent. + :vartype app_registration_client_id: str + :ivar bot_service_arm_id: ARM resource id of the Azure Bot Service associated with the + previously-published app, if any. + :vartype bot_service_arm_id: str + :ivar app_version: The most recently published app version. + :vartype app_version: str + :ivar recommended_next_app_version: The recommended next app version (the most recent app + version, incremented). + :vartype recommended_next_app_version: str + :ivar title_id: The Microsoft 365 title id of the previously-published app, if any. + :vartype title_id: str + :ivar teams_app_id: The Microsoft Teams app id of the previously-published app, if any. + :vartype teams_app_id: str + :ivar short_description: Short, one-line description shown in the Teams app listing. + :vartype short_description: str + :ivar full_description: Full description shown on the Teams app details page. + :vartype full_description: str + :ivar developer_name: Display name of the developer / publisher. + :vartype developer_name: str + :ivar developer_website_url: Developer / publisher website URL. + :vartype developer_website_url: str + :ivar privacy_url: Privacy policy URL. + :vartype privacy_url: str + :ivar terms_of_use_url: Terms-of-use URL. + :vartype terms_of_use_url: str """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``conversation.item.input_audio_transcription.delta``. Required. - CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the item containing the audio that is being transcribed. Required.""" - content_index: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the content part in the item's content array.""" - delta: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The text delta.""" - logprobs: Optional[list["_models.LogProbProperties"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + app_publish_scope: Optional[Union[str, "_models.Microsoft365PublishScope"]] = rest_field( + name="appPublishScope", visibility=["read", "create", "update", "delete", "query"] + ) + """The publish scope. Known values are: \"Personal\", \"Shared\", and \"Tenant\".""" + agent_name: Optional[str] = rest_field(name="agentName", visibility=["read", "create", "update", "delete", "query"]) + """The agent name.""" + agent_display_name: Optional[str] = rest_field( + name="agentDisplayName", visibility=["read", "create", "update", "delete", "query"] + ) + """The user-facing display name for the agent. Defaults to the agent name if not previously + overridden.""" + app_registration_client_id: Optional[str] = rest_field( + name="appRegistrationClientId", visibility=["read", "create", "update", "delete", "query"] + ) + """The app-registration client id associated with the agent.""" + bot_service_arm_id: Optional[str] = rest_field( + name="botServiceArmId", visibility=["read", "create", "update", "delete", "query"] + ) + """ARM resource id of the Azure Bot Service associated with the previously-published app, if any.""" + app_version: Optional[str] = rest_field( + name="appVersion", visibility=["read", "create", "update", "delete", "query"] + ) + """The most recently published app version.""" + recommended_next_app_version: Optional[str] = rest_field( + name="recommendedNextAppVersion", visibility=["read", "create", "update", "delete", "query"] + ) + """The recommended next app version (the most recent app version, incremented).""" + title_id: Optional[str] = rest_field(name="titleId", visibility=["read", "create", "update", "delete", "query"]) + """The Microsoft 365 title id of the previously-published app, if any.""" + teams_app_id: Optional[str] = rest_field( + name="teamsAppId", visibility=["read", "create", "update", "delete", "query"] + ) + """The Microsoft Teams app id of the previously-published app, if any.""" + short_description: Optional[str] = rest_field( + name="shortDescription", visibility=["read", "create", "update", "delete", "query"] + ) + """Short, one-line description shown in the Teams app listing.""" + full_description: Optional[str] = rest_field( + name="fullDescription", visibility=["read", "create", "update", "delete", "query"] ) + """Full description shown on the Teams app details page.""" + developer_name: Optional[str] = rest_field( + name="developerName", visibility=["read", "create", "update", "delete", "query"] + ) + """Display name of the developer / publisher.""" + developer_website_url: Optional[str] = rest_field( + name="developerWebsiteUrl", visibility=["read", "create", "update", "delete", "query"] + ) + """Developer / publisher website URL.""" + privacy_url: Optional[str] = rest_field( + name="privacyUrl", visibility=["read", "create", "update", "delete", "query"] + ) + """Privacy policy URL.""" + terms_of_use_url: Optional[str] = rest_field( + name="termsOfUseUrl", visibility=["read", "create", "update", "delete", "query"] + ) + """Terms-of-use URL.""" @overload def __init__( self, *, - event_id: str, - item_id: str, - content_index: Optional[int] = None, - delta: Optional[str] = None, - logprobs: Optional[list["_models.LogProbProperties"]] = None, + app_publish_scope: Optional[Union[str, "_models.Microsoft365PublishScope"]] = None, + agent_name: Optional[str] = None, + agent_display_name: Optional[str] = None, + app_registration_client_id: Optional[str] = None, + bot_service_arm_id: Optional[str] = None, + app_version: Optional[str] = None, + recommended_next_app_version: Optional[str] = None, + title_id: Optional[str] = None, + teams_app_id: Optional[str] = None, + short_description: Optional[str] = None, + full_description: Optional[str] = None, + developer_name: Optional[str] = None, + developer_website_url: Optional[str] = None, + privacy_url: Optional[str] = None, + terms_of_use_url: Optional[str] = None, ) -> None: ... @overload @@ -19512,53 +19787,30 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA # type: ignore -class RealtimeServerEventConversationItemInputAudioTranscriptionFailed( - RealtimeServerEvent, discriminator="conversation.item.input_audio_transcription.failed" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Returned when input audio transcription is configured, and a transcription request for a user - message failed. These events are separate from other ``error`` events so that the client can - identify the related Item. +class Microsoft365PublishResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Response from publishing an agent to Microsoft 365 / Microsoft Teams. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``conversation.item.input_audio_transcription.failed``. - Required. CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED. - :vartype type: str or - ~azure.ai.projects.models.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED - :ivar item_id: The ID of the user message item. Required. - :vartype item_id: str - :ivar content_index: The index of the content part containing the audio. Required. - :vartype content_index: int - :ivar error: Details of the transcription error. Required. - :vartype error: - ~azure.ai.projects.models.RealtimeServerEventConversationItemInputAudioTranscriptionFailedError + :ivar title_id: The Microsoft 365 title id of the published app. + :vartype title_id: str + :ivar teams_app_id: The Microsoft Teams app id of the published app. + :vartype teams_app_id: str """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``conversation.item.input_audio_transcription.failed``. Required. - CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the user message item. Required.""" - content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the content part containing the audio. Required.""" - error: "_models.RealtimeServerEventConversationItemInputAudioTranscriptionFailedError" = rest_field( - visibility=["read", "create", "update", "delete", "query"] + title_id: Optional[str] = rest_field(name="titleId", visibility=["read", "create", "update", "delete", "query"]) + """The Microsoft 365 title id of the published app.""" + teams_app_id: Optional[str] = rest_field( + name="teamsAppId", visibility=["read", "create", "update", "delete", "query"] ) - """Details of the transcription error. Required.""" + """The Microsoft Teams app id of the published app.""" @overload def __init__( self, *, - event_id: str, - item_id: str, - content_index: int, - error: "_models.RealtimeServerEventConversationItemInputAudioTranscriptionFailedError", + title_id: Optional[str] = None, + teams_app_id: Optional[str] = None, ) -> None: ... @overload @@ -19570,37 +19822,23 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED # type: ignore -class RealtimeServerEventConversationItemInputAudioTranscriptionFailedError( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """RealtimeServerEventConversationItemInputAudioTranscriptionFailedError. +class MicrosoftCopilotHarness(AgentHarness, discriminator="microsoft_copilot_preview"): + """The Microsoft Copilot managed harness for prompt agents. - :ivar type: + :ivar type: The type of managed harness. Always ``microsoft_copilot_preview``. Required. + Default value is "microsoft_copilot_preview". :vartype type: str - :ivar code: - :vartype code: str - :ivar message: - :vartype message: str - :ivar param: - :vartype param: str """ - type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - code: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - param: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal["microsoft_copilot_preview"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of managed harness. Always ``microsoft_copilot_preview``. Required. Default value is + \"microsoft_copilot_preview\".""" @overload def __init__( self, - *, - type: Optional[str] = None, - code: Optional[str] = None, - message: Optional[str] = None, - param: Optional[str] = None, ) -> None: ... @overload @@ -19612,67 +19850,33 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = "microsoft_copilot_preview" # type: ignore -class RealtimeServerEventConversationItemInputAudioTranscriptionSegment( - RealtimeServerEvent, discriminator="conversation.item.input_audio_transcription.segment" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Returned when an input audio transcription segment is identified for an item. +class MicrosoftCopilotToolsetConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """An enablement override for a Microsoft Copilot built-in tool. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``conversation.item.input_audio_transcription.segment``. - Required. CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT. - :vartype type: str or - ~azure.ai.projects.models.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT - :ivar item_id: The ID of the item containing the input audio content. Required. - :vartype item_id: str - :ivar content_index: The index of the input audio content part within the item. Required. - :vartype content_index: int - :ivar text: The text for this segment. Required. - :vartype text: str - :ivar id: The segment identifier. Required. - :vartype id: str - :ivar speaker: The detected speaker label for this segment. Required. - :vartype speaker: str - :ivar start: Start time of the segment in seconds. Required. - :vartype start: float - :ivar end: End time of the segment in seconds. Required. - :vartype end: float + :ivar name: The built-in tool to configure. Required. Known values are: "filesystem_read", + "filesystem_write", "shell", "web", and "subagents". + :vartype name: str or ~azure.ai.projects.models.MicrosoftCopilotBuiltInTool + :ivar enabled: Whether the built-in tool is enabled. If omitted, the toolset default applies. + :vartype enabled: bool """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``conversation.item.input_audio_transcription.segment``. Required. - CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the item containing the input audio content. Required.""" - content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the input audio content part within the item. Required.""" - text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The text for this segment. Required.""" - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The segment identifier. Required.""" - speaker: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The detected speaker label for this segment. Required.""" - start: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Start time of the segment in seconds. Required.""" - end: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """End time of the segment in seconds. Required.""" + name: Union[str, "_models.MicrosoftCopilotBuiltInTool"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The built-in tool to configure. Required. Known values are: \"filesystem_read\", + \"filesystem_write\", \"shell\", \"web\", and \"subagents\".""" + enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether the built-in tool is enabled. If omitted, the toolset default applies.""" @overload def __init__( self, *, - event_id: str, - item_id: str, - content_index: int, - text: str, - id: str, # pylint: disable=redefined-builtin - speaker: str, - start: float, - end: float, + name: Union[str, "_models.MicrosoftCopilotBuiltInTool"], + enabled: Optional[bool] = None, ) -> None: ... @overload @@ -19684,39 +19888,23 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT # type: ignore -class RealtimeServerEventConversationItemRetrieved( - RealtimeServerEvent, discriminator="conversation.item.retrieved" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Returned when a conversation item is retrieved with ``conversation.item.retrieve``. This is - provided as a way to fetch the server's representation of an item, for example to get access to - the post-processed audio data after noise cancellation and VAD. It includes the full content of - the Item, including audio data. +class MicrosoftCopilotToolsetDefaultConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The default enablement setting for Microsoft Copilot built-in tools. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``conversation.item.retrieved``. Required. - CONVERSATION_ITEM_RETRIEVED. - :vartype type: str or ~azure.ai.projects.models.CONVERSATION_ITEM_RETRIEVED - :ivar item: Required. - :vartype item: ~azure.ai.projects.models.RealtimeConversationItem + :ivar enabled: Whether built-in tools are enabled by default. Defaults to true. + :vartype enabled: bool """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``conversation.item.retrieved``. Required. CONVERSATION_ITEM_RETRIEVED.""" - item: "_models.RealtimeConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether built-in tools are enabled by default. Defaults to true.""" @overload def __init__( self, *, - event_id: str, - item: "_models.RealtimeConversationItem", + enabled: Optional[bool] = None, ) -> None: ... @overload @@ -19728,58 +19916,42 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED # type: ignore -class RealtimeServerEventConversationItemTruncated( - RealtimeServerEvent, discriminator="conversation.item.truncated" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Returned when an earlier assistant audio message item is truncated by the client with a - ``conversation.item.truncate`` event. This event is used to synchronize the server's - understanding of the audio with the client's playback. This action will truncate the audio and - remove the server-side text transcript to ensure there is no text in the context that hasn't - been heard by the user. +class MicrosoftCopilotToolsetPreview( + Tool, discriminator="microsoft_copilot_toolset_preview" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Configuration overrides for Microsoft Copilot built-in tools. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``conversation.item.truncated``. Required. - CONVERSATION_ITEM_TRUNCATED. - :vartype type: str or ~azure.ai.projects.models.CONVERSATION_ITEM_TRUNCATED - :ivar item_id: The ID of the assistant message item that was truncated. Required. - :vartype item_id: str - :ivar content_index: The index of the content part that was truncated. Required. - :vartype content_index: int - :ivar audio_end_ms: The duration up to which the audio was truncated, in milliseconds. - Required. - :vartype audio_end_ms: int - :ivar item: The assistant message after truncation, when the service returns the updated item. - :vartype item: ~azure.ai.projects.models.RealtimeConversationItem + :ivar type: The type of the toolset. Always ``microsoft_copilot_toolset_preview``. Required. + MICROSOFT_COPILOT_TOOLSET_PREVIEW. + :vartype type: str or ~azure.ai.projects.models.MICROSOFT_COPILOT_TOOLSET_PREVIEW + :ivar default_config: The default configuration for built-in tools. If omitted, built-in tools + are enabled by default. + :vartype default_config: ~azure.ai.projects.models.MicrosoftCopilotToolsetDefaultConfig + :ivar configs: Per-tool configuration overrides. Duplicate built-in tool names are not allowed. + :vartype configs: list[~azure.ai.projects.models.MicrosoftCopilotToolsetConfig] """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_TRUNCATED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``conversation.item.truncated``. Required. CONVERSATION_ITEM_TRUNCATED.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the assistant message item that was truncated. Required.""" - content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the content part that was truncated. Required.""" - audio_end_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The duration up to which the audio was truncated, in milliseconds. Required.""" - item: Optional["_models.RealtimeConversationItem"] = rest_field( + type: Literal[ToolType.MICROSOFT_COPILOT_TOOLSET_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the toolset. Always ``microsoft_copilot_toolset_preview``. Required. + MICROSOFT_COPILOT_TOOLSET_PREVIEW.""" + default_config: Optional["_models.MicrosoftCopilotToolsetDefaultConfig"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The assistant message after truncation, when the service returns the updated item.""" + """The default configuration for built-in tools. If omitted, built-in tools are enabled by + default.""" + configs: Optional[list["_models.MicrosoftCopilotToolsetConfig"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Per-tool configuration overrides. Duplicate built-in tool names are not allowed.""" @overload def __init__( self, *, - event_id: str, - item_id: str, - content_index: int, - audio_end_ms: int, - item: Optional["_models.RealtimeConversationItem"] = None, + default_config: Optional["_models.MicrosoftCopilotToolsetDefaultConfig"] = None, + configs: Optional[list["_models.MicrosoftCopilotToolsetConfig"]] = None, ) -> None: ... @overload @@ -19791,37 +19963,34 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.CONVERSATION_ITEM_TRUNCATED # type: ignore + self.type = ToolType.MICROSOFT_COPILOT_TOOLSET_PREVIEW # type: ignore -class RealtimeServerEventError(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Returned when an error occurs, which could be a client problem or a server problem. Most errors - are recoverable and the session will stay open, we recommend to implementors to monitor and log - error messages by default. +class MicrosoftFabricPreviewTool( + Tool, discriminator="fabric_dataagent_preview" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """The input definition information for a Microsoft Fabric tool as used to configure an agent. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``error``. Required. Default value is "error". - :vartype type: str - :ivar error: Details of the error. Required. - :vartype error: ~azure.ai.projects.models.RealtimeServerEventErrorError + :ivar type: The object type, which is always 'fabric_dataagent_preview'. Required. + FABRIC_DATAAGENT_PREVIEW. + :vartype type: str or ~azure.ai.projects.models.FABRIC_DATAAGENT_PREVIEW + :ivar fabric_dataagent_preview: The fabric data agent tool parameters. Required. + :vartype fabric_dataagent_preview: ~azure.ai.projects.models.FabricDataAgentToolParameters """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal["error"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The event type, must be ``error``. Required. Default value is \"error\".""" - error: "_models.RealtimeServerEventErrorError" = rest_field( + type: Literal[ToolType.FABRIC_DATAAGENT_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The object type, which is always 'fabric_dataagent_preview'. Required. + FABRIC_DATAAGENT_PREVIEW.""" + fabric_dataagent_preview: "_models.FabricDataAgentToolParameters" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Details of the error. Required.""" + """The fabric data agent tool parameters. Required.""" @overload def __init__( self, *, - event_id: str, - error: "_models.RealtimeServerEventErrorError", + fabric_dataagent_preview: "_models.FabricDataAgentToolParameters", ) -> None: ... @overload @@ -19833,41 +20002,46 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type: Literal["error"] = "error" + self.type = ToolType.FABRIC_DATAAGENT_PREVIEW # type: ignore -class RealtimeServerEventErrorError(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """RealtimeServerEventErrorError. +class MisalignmentErrorDetailsResource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """MisalignmentErrorDetailsResource. - :ivar type: Required. - :vartype type: str - :ivar code: - :vartype code: str - :ivar message: Required. - :vartype message: str - :ivar param: - :vartype param: str - :ivar event_id: - :vartype event_id: str + :ivar review_target: + :vartype review_target: str + :ivar error_type: An optional classification; clients must accept additional values. Known + values are: "potentially_unintended_data_transfer", "potentially_unintended_data_access", + "potentially_unintended_destructive_activity", and "other". + :vartype error_type: str or ~azure.ai.projects.models.MisalignmentErrorType + :ivar detailed_explanation: The public explanation for this block. + :vartype detailed_explanation: str + :ivar steer: An optional public continuation instruction. + :vartype steer: ~azure.ai.projects.models.MisalignmentSteer """ - type: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - code: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - param: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + review_target: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + error_type: Optional[Union[str, "_models.MisalignmentErrorType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """An optional classification; clients must accept additional values. Known values are: + \"potentially_unintended_data_transfer\", \"potentially_unintended_data_access\", + \"potentially_unintended_destructive_activity\", and \"other\".""" + detailed_explanation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The public explanation for this block.""" + steer: Optional["_models.MisalignmentSteer"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """An optional public continuation instruction.""" @overload def __init__( self, *, - type: str, - message: str, - code: Optional[str] = None, - param: Optional[str] = None, - event_id: Optional[str] = None, + review_target: Optional[str] = None, + error_type: Optional[Union[str, "_models.MisalignmentErrorType"]] = None, + detailed_explanation: Optional[str] = None, + steer: Optional["_models.MisalignmentSteer"] = None, ) -> None: ... @overload @@ -19881,29 +20055,21 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RealtimeServerEventInputAudioBufferCleared( - RealtimeServerEvent, discriminator="input_audio_buffer.cleared" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Returned when the input audio buffer is cleared by the client with a - ``input_audio_buffer.clear`` event. +class MisalignmentSteer(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """MisalignmentSteer. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``input_audio_buffer.cleared``. Required. - INPUT_AUDIO_BUFFER_CLEARED. - :vartype type: str or ~azure.ai.projects.models.INPUT_AUDIO_BUFFER_CLEARED + :ivar message: The public continuation instruction. Required. + :vartype message: str """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_CLEARED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``input_audio_buffer.cleared``. Required. INPUT_AUDIO_BUFFER_CLEARED.""" + message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The public continuation instruction. Required.""" @overload def __init__( self, *, - event_id: str, + message: str, ) -> None: ... @overload @@ -19915,43 +20081,23 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.INPUT_AUDIO_BUFFER_CLEARED # type: ignore -class RealtimeServerEventInputAudioBufferCommitted( - RealtimeServerEvent, discriminator="input_audio_buffer.committed" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Returned when an input audio buffer is committed, either by the client or automatically in - server VAD mode. The ``item_id`` property is the ID of the user message item that will be - created, thus a ``conversation.item.created`` event will also be sent to the client. +class ModelCredentialRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Request to fetch credentials for a model asset. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``input_audio_buffer.committed``. Required. - INPUT_AUDIO_BUFFER_COMMITTED. - :vartype type: str or ~azure.ai.projects.models.INPUT_AUDIO_BUFFER_COMMITTED - :ivar previous_item_id: - :vartype previous_item_id: str - :ivar item_id: The ID of the user message item that will be created. Required. - :vartype item_id: str + :ivar blob_uri: Blob URI of the model asset to fetch credentials for. Required. + :vartype blob_uri: str """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_COMMITTED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``input_audio_buffer.committed``. Required. - INPUT_AUDIO_BUFFER_COMMITTED.""" - previous_item_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the user message item that will be created. Required.""" + blob_uri: str = rest_field(name="blobUri", visibility=["read", "create", "update", "delete", "query"]) + """Blob URI of the model asset to fetch credentials for. Required.""" @overload def __init__( self, *, - event_id: str, - item_id: str, - previous_item_id: Optional[str] = None, + blob_uri: str, ) -> None: ... @overload @@ -19963,54 +20109,47 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.INPUT_AUDIO_BUFFER_COMMITTED # type: ignore -class RealtimeServerEventInputAudioBufferSpeechStarted( - RealtimeServerEvent, discriminator="input_audio_buffer.speech_started" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Sent by the server when in ``server_vad`` mode to indicate that speech has been detected in the - audio buffer. This can happen any time audio is added to the buffer (unless speech is already - detected). The client may want to use this event to interrupt audio playback or provide visual - feedback to the user. The client should expect to receive a - ``input_audio_buffer.speech_stopped`` event when speech stops. The ``item_id`` property is the - ID of the user message item that will be created when speech stops and will also be included in - the ``input_audio_buffer.speech_stopped`` event (unless the client manually commits the audio - buffer during VAD activation). +class ModelDeployment(Deployment, discriminator="ModelDeployment"): + """Model Deployment Definition. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``input_audio_buffer.speech_started``. Required. - INPUT_AUDIO_BUFFER_SPEECH_STARTED. - :vartype type: str or ~azure.ai.projects.models.INPUT_AUDIO_BUFFER_SPEECH_STARTED - :ivar audio_start_ms: Milliseconds from the start of all audio written to the buffer during the - session when speech was first detected. This will correspond to the beginning of audio sent to - the model, and thus includes the ``prefix_padding_ms`` configured in the Session. Required. - :vartype audio_start_ms: int - :ivar item_id: The ID of the user message item that will be created when speech stops. - Required. - :vartype item_id: str + :ivar name: Name of the deployment. Required. + :vartype name: str + :ivar type: The type of the deployment. Required. Model deployment. + :vartype type: str or ~azure.ai.projects.models.MODEL_DEPLOYMENT + :ivar model_name: Publisher-specific name of the deployed model. Required. + :vartype model_name: str + :ivar model_version: Publisher-specific version of the deployed model. Required. + :vartype model_version: str + :ivar model_publisher: Name of the deployed model's publisher. Required. + :vartype model_publisher: str + :ivar capabilities: Capabilities of deployed model. Required. + :vartype capabilities: dict[str, str] + :ivar sku: Sku of the model deployment. Required. + :vartype sku: ~azure.ai.projects.models.ModelDeploymentSku + :ivar connection_name: Name of the connection the deployment comes from. + :vartype connection_name: str """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STARTED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``input_audio_buffer.speech_started``. Required. - INPUT_AUDIO_BUFFER_SPEECH_STARTED.""" - audio_start_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Milliseconds from the start of all audio written to the buffer during the session when speech - was first detected. This will correspond to the beginning of audio sent to the model, and thus - includes the ``prefix_padding_ms`` configured in the Session. Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the user message item that will be created when speech stops. Required.""" + type: Literal[DeploymentType.MODEL_DEPLOYMENT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the deployment. Required. Model deployment.""" + model_name: str = rest_field(name="modelName", visibility=["read"]) + """Publisher-specific name of the deployed model. Required.""" + model_version: str = rest_field(name="modelVersion", visibility=["read"]) + """Publisher-specific version of the deployed model. Required.""" + model_publisher: str = rest_field(name="modelPublisher", visibility=["read"]) + """Name of the deployed model's publisher. Required.""" + capabilities: dict[str, str] = rest_field(visibility=["read"]) + """Capabilities of deployed model. Required.""" + sku: "_models.ModelDeploymentSku" = rest_field(visibility=["read"]) + """Sku of the model deployment. Required.""" + connection_name: Optional[str] = rest_field(name="connectionName", visibility=["read"]) + """Name of the connection the deployment comes from.""" @overload def __init__( self, - *, - event_id: str, - audio_start_ms: int, - item_id: str, ) -> None: ... @overload @@ -20022,48 +20161,44 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STARTED # type: ignore + self.type = DeploymentType.MODEL_DEPLOYMENT # type: ignore -class RealtimeServerEventInputAudioBufferSpeechStopped( - RealtimeServerEvent, discriminator="input_audio_buffer.speech_stopped" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Returned in ``server_vad`` mode when the server detects the end of speech in the audio buffer. - The server will also send an ``conversation.item.created`` event with the user message item - that is created from the audio buffer. +class ModelDeploymentSku(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Sku information. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``input_audio_buffer.speech_stopped``. Required. - INPUT_AUDIO_BUFFER_SPEECH_STOPPED. - :vartype type: str or ~azure.ai.projects.models.INPUT_AUDIO_BUFFER_SPEECH_STOPPED - :ivar audio_end_ms: Milliseconds since the session started when speech stopped. This will - correspond to the end of audio sent to the model, and thus includes the - ``min_silence_duration_ms`` configured in the Session. Required. - :vartype audio_end_ms: int - :ivar item_id: The ID of the user message item that will be created. Required. - :vartype item_id: str + :ivar capacity: Sku capacity. Required. + :vartype capacity: int + :ivar family: Sku family. Required. + :vartype family: str + :ivar name: Sku name. Required. + :vartype name: str + :ivar size: Sku size. Required. + :vartype size: str + :ivar tier: Sku tier. Required. + :vartype tier: str """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STOPPED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``input_audio_buffer.speech_stopped``. Required. - INPUT_AUDIO_BUFFER_SPEECH_STOPPED.""" - audio_end_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Milliseconds since the session started when speech stopped. This will correspond to the end of - audio sent to the model, and thus includes the ``min_silence_duration_ms`` configured in the - Session. Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the user message item that will be created. Required.""" + capacity: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Sku capacity. Required.""" + family: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Sku family. Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Sku name. Required.""" + size: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Sku size. Required.""" + tier: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Sku tier. Required.""" @overload def __init__( self, *, - event_id: str, - audio_end_ms: int, - item_id: str, + capacity: int, + family: str, + name: str, + size: str, + tier: str, ) -> None: ... @overload @@ -20075,61 +20210,42 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STOPPED # type: ignore -class RealtimeServerEventInputAudioBufferTimeoutTriggered( - RealtimeServerEvent, discriminator="input_audio_buffer.timeout_triggered" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Returned when the Server VAD timeout is triggered for the input audio buffer. This is - configured with ``idle_timeout_ms`` in the ``turn_detection`` settings of the session, and it - indicates that there hasn't been any speech detected for the configured duration. The - ``audio_start_ms`` and ``audio_end_ms`` fields indicate the segment of audio after the last - model response up to the triggering time, as an offset from the beginning of audio written to - the input audio buffer. This means it demarcates the segment of audio that was silent and the - difference between the start and end values will roughly match the configured timeout. The - empty audio will be committed to the conversation as an ``input_audio`` item (there will be a - ``input_audio_buffer.committed`` event) and a model response will be generated. There may be - speech that didn't trigger VAD but is still detected by the model, so the model may respond - with something relevant to the conversation or a prompt to continue speaking. +class ModelPendingUploadRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Represents a request for a pending upload of a model version. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``input_audio_buffer.timeout_triggered``. Required. - INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED. - :vartype type: str or ~azure.ai.projects.models.INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED - :ivar audio_start_ms: Millisecond offset of audio written to the input audio buffer that was - after the playback time of the last model response. Required. - :vartype audio_start_ms: int - :ivar audio_end_ms: Millisecond offset of audio written to the input audio buffer at the time - the timeout was triggered. Required. - :vartype audio_end_ms: int - :ivar item_id: The ID of the item associated with this segment. Required. - :vartype item_id: str + :ivar pending_upload_id: If PendingUploadId is not provided, a random GUID will be used. + :vartype pending_upload_id: str + :ivar connection_name: Azure Storage Account connection name to use for generating temporary + SAS token. + :vartype connection_name: str + :ivar pending_upload_type: The type of pending upload. Only TemporaryBlobReference is supported + for models. Required. Temporary blob reference. + :vartype pending_upload_type: str or ~azure.ai.projects.models.TEMPORARY_BLOB_REFERENCE """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``input_audio_buffer.timeout_triggered``. Required. - INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED.""" - audio_start_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Millisecond offset of audio written to the input audio buffer that was after the playback time - of the last model response. Required.""" - audio_end_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Millisecond offset of audio written to the input audio buffer at the time the timeout was - triggered. Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the item associated with this segment. Required.""" + pending_upload_id: Optional[str] = rest_field( + name="pendingUploadId", visibility=["read", "create", "update", "delete", "query"] + ) + """If PendingUploadId is not provided, a random GUID will be used.""" + connection_name: Optional[str] = rest_field( + name="connectionName", visibility=["read", "create", "update", "delete", "query"] + ) + """Azure Storage Account connection name to use for generating temporary SAS token.""" + pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE] = rest_field( + name="pendingUploadType", visibility=["read", "create", "update", "delete", "query"] + ) + """The type of pending upload. Only TemporaryBlobReference is supported for models. Required. + Temporary blob reference.""" @overload def __init__( self, *, - event_id: str, - audio_start_ms: int, - audio_end_ms: int, - item_id: str, + pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE], + pending_upload_id: Optional[str] = None, + connection_name: Optional[str] = None, ) -> None: ... @overload @@ -20141,36 +20257,47 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED # type: ignore -class RealtimeServerEventMCPListToolsCompleted( - RealtimeServerEvent, discriminator="mcp_list_tools.completed" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Returned when listing MCP tools has completed for an item. +class ModelPendingUploadResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Represents the response for a model pending upload request. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``mcp_list_tools.completed``. Required. - MCP_LIST_TOOLS_COMPLETED. - :vartype type: str or ~azure.ai.projects.models.MCP_LIST_TOOLS_COMPLETED - :ivar item_id: The ID of the MCP list tools item. Required. - :vartype item_id: str + :ivar blob_reference: Container-level read, write, list SAS. Required. + :vartype blob_reference: ~azure.ai.projects.models.BlobReference + :ivar pending_upload_id: ID for this upload request. Required. + :vartype pending_upload_id: str + :ivar version: Version of asset to be created if user did not specify version when initially + creating upload. + :vartype version: str + :ivar pending_upload_type: The type of pending upload. Only TemporaryBlobReference is supported + for models. Required. Temporary blob reference. + :vartype pending_upload_type: str or ~azure.ai.projects.models.TEMPORARY_BLOB_REFERENCE """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_COMPLETED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``mcp_list_tools.completed``. Required. MCP_LIST_TOOLS_COMPLETED.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the MCP list tools item. Required.""" + blob_reference: "_models.BlobReference" = rest_field( + name="blobReference", visibility=["read", "create", "update", "delete", "query"] + ) + """Container-level read, write, list SAS. Required.""" + pending_upload_id: str = rest_field( + name="pendingUploadId", visibility=["read", "create", "update", "delete", "query"] + ) + """ID for this upload request. Required.""" + version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Version of asset to be created if user did not specify version when initially creating upload.""" + pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE] = rest_field( + name="pendingUploadType", visibility=["read", "create", "update", "delete", "query"] + ) + """The type of pending upload. Only TemporaryBlobReference is supported for models. Required. + Temporary blob reference.""" @overload def __init__( self, *, - event_id: str, - item_id: str, + blob_reference: "_models.BlobReference", + pending_upload_id: str, + pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE], + version: Optional[str] = None, ) -> None: ... @overload @@ -20182,35 +20309,39 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.MCP_LIST_TOOLS_COMPLETED # type: ignore -class RealtimeServerEventMCPListToolsFailed( - RealtimeServerEvent, discriminator="mcp_list_tools.failed" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Returned when listing MCP tools has failed for an item. +class ModelSamplingParams(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Represents a set of parameters used to control the sampling behavior of a language model during + text generation. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``mcp_list_tools.failed``. Required. MCP_LIST_TOOLS_FAILED. - :vartype type: str or ~azure.ai.projects.models.MCP_LIST_TOOLS_FAILED - :ivar item_id: The ID of the MCP list tools item. Required. - :vartype item_id: str + :ivar temperature: The temperature parameter for sampling. Defaults to 1.0. + :vartype temperature: float + :ivar top_p: The top-p parameter for nucleus sampling. Defaults to 1.0. + :vartype top_p: float + :ivar seed: The random seed for reproducibility. Defaults to 42. + :vartype seed: int + :ivar max_completion_tokens: The maximum number of tokens allowed in the completion. + :vartype max_completion_tokens: int """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_FAILED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``mcp_list_tools.failed``. Required. MCP_LIST_TOOLS_FAILED.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the MCP list tools item. Required.""" + temperature: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The temperature parameter for sampling. Defaults to 1.0.""" + top_p: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The top-p parameter for nucleus sampling. Defaults to 1.0.""" + seed: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The random seed for reproducibility. Defaults to 42.""" + max_completion_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The maximum number of tokens allowed in the completion.""" @overload def __init__( self, *, - event_id: str, - item_id: str, + temperature: Optional[float] = None, + top_p: Optional[float] = None, + seed: Optional[int] = None, + max_completion_tokens: Optional[int] = None, ) -> None: ... @overload @@ -20222,36 +20353,31 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.MCP_LIST_TOOLS_FAILED # type: ignore -class RealtimeServerEventMCPListToolsInProgress( - RealtimeServerEvent, discriminator="mcp_list_tools.in_progress" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Returned when listing MCP tools is in progress for an item. +class ModelSourceData(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Source information for the model. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``mcp_list_tools.in_progress``. Required. - MCP_LIST_TOOLS_IN_PROGRESS. - :vartype type: str or ~azure.ai.projects.models.MCP_LIST_TOOLS_IN_PROGRESS - :ivar item_id: The ID of the MCP list tools item. Required. - :vartype item_id: str + :ivar source_type: The source type of the model. Known values are: "LocalUpload" and + "TrainingJob". + :vartype source_type: str or ~azure.ai.projects.models.FoundryModelSourceType + :ivar job_id: The job ID that produced this model. + :vartype job_id: str """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_IN_PROGRESS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``mcp_list_tools.in_progress``. Required. MCP_LIST_TOOLS_IN_PROGRESS.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the MCP list tools item. Required.""" + source_type: Optional[Union[str, "_models.FoundryModelSourceType"]] = rest_field( + name="sourceType", visibility=["read", "create", "update", "delete", "query"] + ) + """The source type of the model. Known values are: \"LocalUpload\" and \"TrainingJob\".""" + job_id: Optional[str] = rest_field(name="jobId", visibility=["read", "create", "update", "delete", "query"]) + """The job ID that produced this model.""" @overload def __init__( self, *, - event_id: str, - item_id: str, + source_type: Optional[Union[str, "_models.FoundryModelSourceType"]] = None, + job_id: Optional[str] = None, ) -> None: ... @overload @@ -20263,40 +20389,80 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.MCP_LIST_TOOLS_IN_PROGRESS # type: ignore - -class RealtimeServerEventOutputAudioBufferCleared( - RealtimeServerEvent, discriminator="output_audio_buffer.cleared" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """**WebRTC/SIP Only:** Emitted when the output audio buffer is cleared. This happens either in - VAD mode when the user has interrupted (``input_audio_buffer.speech_started``), or when the - client has emitted the ``output_audio_buffer.clear`` event to manually cut off the current - audio response. `Learn more - `_. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``output_audio_buffer.cleared``. Required. - OUTPUT_AUDIO_BUFFER_CLEARED. - :vartype type: str or ~azure.ai.projects.models.OUTPUT_AUDIO_BUFFER_CLEARED - :ivar response_id: The unique ID of the response that produced the audio. Required. - :vartype response_id: str - """ +class ModelVersion(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Model Version Definition. - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``output_audio_buffer.cleared``. Required. OUTPUT_AUDIO_BUFFER_CLEARED.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the response that produced the audio. Required.""" + :ivar blob_uri: URI of the model artifact in blob storage. Required. + :vartype blob_uri: str + :ivar weight_type: The weight type of the model. Known values are: "FullWeight", "LoRA", and + "DraftModel". + :vartype weight_type: str or ~azure.ai.projects.models.FoundryModelWeightType + :ivar base_model: Base model asset ID. + :vartype base_model: str + :ivar source: The source of the model. + :vartype source: ~azure.ai.projects.models.ModelSourceData + :ivar lora_config: Adapter-specific configuration. Required when weight_type is lora; ignored + otherwise. May be auto-populated from adapter_config.json when present in the uploaded files — + user-provided values take precedence over auto-detected values. + :vartype lora_config: ~azure.ai.projects.models.LoraConfig + :ivar artifact_profile: The artifact profile of the model. + :vartype artifact_profile: ~azure.ai.projects.models.ArtifactProfile + :ivar warnings: Service-computed advisory warnings derived from the artifact profile. + :vartype warnings: list[~azure.ai.projects.models.FoundryModelWarning] + :ivar id: Asset ID, a unique identifier for the asset. + :vartype id: str + :ivar name: The name of the resource. Required. + :vartype name: str + :ivar version: The version of the resource. Required. + :vartype version: str + :ivar description: The asset description text. + :vartype description: str + :ivar tags: Tag dictionary. Tags can be added, removed, and updated. + :vartype tags: dict[str, str] + """ + + blob_uri: str = rest_field(name="blobUri", visibility=["read", "create", "update", "delete", "query"]) + """URI of the model artifact in blob storage. Required.""" + weight_type: Optional[Union[str, "_models.FoundryModelWeightType"]] = rest_field( + name="weightType", visibility=["read", "create", "update", "delete", "query"] + ) + """The weight type of the model. Known values are: \"FullWeight\", \"LoRA\", and \"DraftModel\".""" + base_model: Optional[str] = rest_field(name="baseModel", visibility=["read", "create"]) + """Base model asset ID.""" + source: Optional["_models.ModelSourceData"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The source of the model.""" + lora_config: Optional["_models.LoraConfig"] = rest_field(name="loraConfig", visibility=["read", "create"]) + """Adapter-specific configuration. Required when weight_type is lora; ignored otherwise. May be + auto-populated from adapter_config.json when present in the uploaded files — user-provided + values take precedence over auto-detected values.""" + artifact_profile: Optional["_models.ArtifactProfile"] = rest_field(name="artifactProfile", visibility=["read"]) + """The artifact profile of the model.""" + warnings: Optional[list["_models.FoundryModelWarning"]] = rest_field(visibility=["read"]) + """Service-computed advisory warnings derived from the artifact profile.""" + id: Optional[str] = rest_field(visibility=["read"]) + """Asset ID, a unique identifier for the asset.""" + name: str = rest_field(visibility=["read"]) + """The name of the resource. Required.""" + version: str = rest_field(visibility=["read"]) + """The version of the resource. Required.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update"]) + """The asset description text.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update"]) + """Tag dictionary. Tags can be added, removed, and updated.""" @overload def __init__( self, *, - event_id: str, - response_id: str, + blob_uri: str, + weight_type: Optional[Union[str, "_models.FoundryModelWeightType"]] = None, + base_model: Optional[str] = None, + source: Optional["_models.ModelSourceData"] = None, + lora_config: Optional["_models.LoraConfig"] = None, + description: Optional[str] = None, + tags: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -20308,40 +20474,31 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED # type: ignore -class RealtimeServerEventRateLimitsUpdated( - RealtimeServerEvent, discriminator="rate_limits.updated" +class MonthlyRecurrenceSchedule( + RecurrenceSchedule, discriminator="Monthly" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Emitted at the beginning of a Response to indicate the updated rate limits. When a Response is - created some tokens will be "reserved" for the output tokens, the rate limits shown here - reflect that reservation, which is then adjusted accordingly once the Response is completed. + """Monthly recurrence schedule. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``rate_limits.updated``. Required. RATE_LIMITS_UPDATED. - :vartype type: str or ~azure.ai.projects.models.RATE_LIMITS_UPDATED - :ivar rate_limits: List of rate limit information. Required. - :vartype rate_limits: - list[~azure.ai.projects.models.RealtimeServerEventRateLimitsUpdatedRateLimits] + :ivar type: Monthly recurrence type. Required. Monthly recurrence pattern. + :vartype type: str or ~azure.ai.projects.models.MONTHLY + :ivar days_of_month: Days of the month for the recurrence schedule. Required. + :vartype days_of_month: list[int] """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.RATE_LIMITS_UPDATED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``rate_limits.updated``. Required. RATE_LIMITS_UPDATED.""" - rate_limits: list["_models.RealtimeServerEventRateLimitsUpdatedRateLimits"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + type: Literal[RecurrenceType.MONTHLY] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Monthly recurrence type. Required. Monthly recurrence pattern.""" + days_of_month: list[int] = rest_field( + name="daysOfMonth", visibility=["read", "create", "update", "delete", "query"] ) - """List of rate limit information. Required.""" + """Days of the month for the recurrence schedule. Required.""" @overload def __init__( self, *, - event_id: str, - rate_limits: list["_models.RealtimeServerEventRateLimitsUpdatedRateLimits"], + days_of_month: list[int], ) -> None: ... @overload @@ -20353,40 +20510,43 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.RATE_LIMITS_UPDATED # type: ignore + self.type = RecurrenceType.MONTHLY # type: ignore -class RealtimeServerEventRateLimitsUpdatedRateLimits( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """RealtimeServerEventRateLimitsUpdatedRateLimits. +class NamespaceToolParam( + Tool, discriminator="namespace" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Namespace. - :ivar name: Is either a Literal["requests"] type or a Literal["tokens"] type. - :vartype name: str or str - :ivar limit: - :vartype limit: int - :ivar remaining: - :vartype remaining: int - :ivar reset_seconds: - :vartype reset_seconds: float + :ivar type: The type of the tool. Always ``namespace``. Required. NAMESPACE. + :vartype type: str or ~azure.ai.projects.models.NAMESPACE + :ivar name: The namespace name used in tool calls (for example, ``crm``). Required. + :vartype name: str + :ivar description: A description of the namespace shown to the model. Required. + :vartype description: str + :ivar tools: The function/custom tools available inside this namespace. Required. + :vartype tools: list[~azure.ai.projects.models.FunctionToolParam or + ~azure.ai.projects.models.CustomToolParam] """ - name: Optional[Literal["requests", "tokens"]] = rest_field( + type: Literal[ToolType.NAMESPACE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the tool. Always ``namespace``. Required. NAMESPACE.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The namespace name used in tool calls (for example, ``crm``). Required.""" + description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A description of the namespace shown to the model. Required.""" + tools: list[Union["_models.FunctionToolParam", "_models.CustomToolParam"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Is either a Literal[\"requests\"] type or a Literal[\"tokens\"] type.""" - limit: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - remaining: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - reset_seconds: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The function/custom tools available inside this namespace. Required.""" @overload def __init__( self, *, - name: Optional[Literal["requests", "tokens"]] = None, - limit: Optional[int] = None, - remaining: Optional[int] = None, - reset_seconds: Optional[float] = None, + name: str, + description: str, + tools: list[Union["_models.FunctionToolParam", "_models.CustomToolParam"]], ) -> None: ... @overload @@ -20398,55 +20558,22 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolType.NAMESPACE # type: ignore -class RealtimeServerEventResponseAudioDelta( - RealtimeServerEvent, discriminator="response.output_audio.delta" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Returned when the model-generated audio is updated. +class NoAuthenticationCredentials(BaseCredentials, discriminator="None"): + """Credentials that do not require authentication. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``response.output_audio.delta``. Required. - RESPONSE_OUTPUT_AUDIO_DELTA. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_OUTPUT_AUDIO_DELTA - :ivar response_id: The ID of the response. Required. - :vartype response_id: str - :ivar item_id: The ID of the item. Required. - :vartype item_id: str - :ivar output_index: The index of the output item in the response. Required. - :vartype output_index: int - :ivar content_index: The index of the content part in the item's content array. Required. - :vartype content_index: int - :ivar delta: Base64-encoded audio data delta. Required. - :vartype delta: bytes + :ivar type: The credential type. Required. No credential. + :vartype type: str or ~azure.ai.projects.models.NONE """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.output_audio.delta``. Required. RESPONSE_OUTPUT_AUDIO_DELTA.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the response. Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the item. Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output item in the response. Required.""" - content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the content part in the item's content array. Required.""" - delta: bytes = rest_field(visibility=["read", "create", "update", "delete", "query"], format="base64") - """Base64-encoded audio data delta. Required.""" + type: Literal[CredentialType.NONE] = rest_discriminator(name="type", visibility=["read"]) # type: ignore + """The credential type. Required. No credential.""" @overload def __init__( self, - *, - event_id: str, - response_id: str, - item_id: str, - output_index: int, - content_index: int, - delta: bytes, ) -> None: ... @overload @@ -20458,52 +20585,35 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DELTA # type: ignore + self.type = CredentialType.NONE # type: ignore -class RealtimeServerEventResponseAudioDone( - RealtimeServerEvent, discriminator="response.output_audio.done" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Returned when the model-generated audio is done. Also emitted when a Response is interrupted, - incomplete, or cancelled. +class OneTimeTrigger(Trigger, discriminator="OneTime"): # pylint: disable=docstring-keyword-should-match-keyword-only + """One-time trigger. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``response.output_audio.done``. Required. - RESPONSE_OUTPUT_AUDIO_DONE. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_OUTPUT_AUDIO_DONE - :ivar response_id: The ID of the response. Required. - :vartype response_id: str - :ivar item_id: The ID of the item. Required. - :vartype item_id: str - :ivar output_index: The index of the output item in the response. Required. - :vartype output_index: int - :ivar content_index: The index of the content part in the item's content array. Required. - :vartype content_index: int + :ivar type: Required. One-time trigger. + :vartype type: str or ~azure.ai.projects.models.ONE_TIME + :ivar trigger_at: Date and time for the one-time trigger in ISO 8601 format. Required. + :vartype trigger_at: ~datetime.datetime + :ivar time_zone: Time zone for the one-time trigger. Defaults to ``UTC``. + :vartype time_zone: str """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.output_audio.done``. Required. RESPONSE_OUTPUT_AUDIO_DONE.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the response. Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the item. Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output item in the response. Required.""" - content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the content part in the item's content array. Required.""" + type: Literal[TriggerType.ONE_TIME] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. One-time trigger.""" + trigger_at: datetime.datetime = rest_field( + name="triggerAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """Date and time for the one-time trigger in ISO 8601 format. Required.""" + time_zone: Optional[str] = rest_field(name="timeZone", visibility=["read", "create", "update", "delete", "query"]) + """Time zone for the one-time trigger. Defaults to ``UTC``.""" @overload def __init__( self, *, - event_id: str, - response_id: str, - item_id: str, - output_index: int, - content_index: int, + trigger_at: datetime.datetime, + time_zone: Optional[str] = None, ) -> None: ... @overload @@ -20515,57 +20625,30 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DONE # type: ignore + self.type = TriggerType.ONE_TIME # type: ignore -class RealtimeServerEventResponseAudioTranscriptDelta( - RealtimeServerEvent, discriminator="response.output_audio_transcript.delta" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Returned when the model-generated transcription of audio output is updated. +class OpenApiAuthDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """authentication details for OpenApiFunctionDefinition. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``response.output_audio_transcript.delta``. Required. - RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA - :ivar response_id: The ID of the response. Required. - :vartype response_id: str - :ivar item_id: The ID of the item. Required. - :vartype item_id: str - :ivar output_index: The index of the output item in the response. Required. - :vartype output_index: int - :ivar content_index: The index of the content part in the item's content array. Required. - :vartype content_index: int - :ivar delta: The transcript delta. Required. - :vartype delta: str + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + OpenApiAnonymousAuthDetails, OpenApiManagedAuthDetails, OpenApiProjectConnectionAuthDetails + + :ivar type: The type of authentication, must be anonymous/project_connection/managed_identity. + Required. Known values are: "anonymous", "project_connection", and "managed_identity". + :vartype type: str or ~azure.ai.projects.models.OpenApiAuthType """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.output_audio_transcript.delta``. Required. - RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the response. Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the item. Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output item in the response. Required.""" - content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the content part in the item's content array. Required.""" - delta: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The transcript delta. Required.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """The type of authentication, must be anonymous/project_connection/managed_identity. Required. + Known values are: \"anonymous\", \"project_connection\", and \"managed_identity\".""" @overload def __init__( self, *, - event_id: str, - response_id: str, - item_id: str, - output_index: int, - content_index: int, - delta: str, + type: str, ) -> None: ... @overload @@ -20577,58 +20660,21 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA # type: ignore -class RealtimeServerEventResponseAudioTranscriptDone( - RealtimeServerEvent, discriminator="response.output_audio_transcript.done" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Returned when the model-generated transcription of audio output is done streaming. Also emitted - when a Response is interrupted, incomplete, or cancelled. +class OpenApiAnonymousAuthDetails(OpenApiAuthDetails, discriminator="anonymous"): + """Security details for OpenApi anonymous authentication. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``response.output_audio_transcript.done``. Required. - RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE - :ivar response_id: The ID of the response. Required. - :vartype response_id: str - :ivar item_id: The ID of the item. Required. - :vartype item_id: str - :ivar output_index: The index of the output item in the response. Required. - :vartype output_index: int - :ivar content_index: The index of the content part in the item's content array. Required. - :vartype content_index: int - :ivar transcript: The final transcript of the audio. Required. - :vartype transcript: str + :ivar type: The object type, which is always 'anonymous'. Required. ANONYMOUS. + :vartype type: str or ~azure.ai.projects.models.ANONYMOUS """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.output_audio_transcript.done``. Required. - RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the response. Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the item. Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output item in the response. Required.""" - content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the content part in the item's content array. Required.""" - transcript: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The final transcript of the audio. Required.""" + type: Literal[OpenApiAuthType.ANONYMOUS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The object type, which is always 'anonymous'. Required. ANONYMOUS.""" @overload def __init__( self, - *, - event_id: str, - response_id: str, - item_id: str, - output_index: int, - content_index: int, - transcript: str, ) -> None: ... @overload @@ -20640,59 +20686,50 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE # type: ignore + self.type = OpenApiAuthType.ANONYMOUS # type: ignore -class RealtimeServerEventResponseContentPartAdded( - RealtimeServerEvent, discriminator="response.content_part.added" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Returned when a new content part is added to an assistant message item during response - generation. +class OpenApiFunctionDefinition(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The input definition information for an openapi function. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``response.content_part.added``. Required. - RESPONSE_CONTENT_PART_ADDED. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_CONTENT_PART_ADDED - :ivar response_id: The ID of the response. Required. - :vartype response_id: str - :ivar item_id: The ID of the item to which the content part was added. Required. - :vartype item_id: str - :ivar output_index: The index of the output item in the response. Required. - :vartype output_index: int - :ivar content_index: The index of the content part in the item's content array. Required. - :vartype content_index: int - :ivar part: The content part that was added. Required. - :vartype part: ~azure.ai.projects.models.RealtimeServerEventResponseContentPartAddedPart + :ivar name: The name of the function to be called. Required. + :vartype name: str + :ivar description: A description of what the function does, used by the model to choose when + and how to call the function. + :vartype description: str + :ivar spec: The openapi function shape, described as a JSON Schema object. Required. + :vartype spec: dict[str, any] + :ivar auth: Open API authentication details. Required. + :vartype auth: ~azure.ai.projects.models.OpenApiAuthDetails + :ivar default_params: List of OpenAPI spec parameters that will use user-provided defaults. + :vartype default_params: list[str] + :ivar functions: List of function definitions used by OpenApi tool. + :vartype functions: list[~azure.ai.projects.models.OpenApiFunctionDefinitionFunction] """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.content_part.added``. Required. RESPONSE_CONTENT_PART_ADDED.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the response. Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the item to which the content part was added. Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output item in the response. Required.""" - content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the content part in the item's content array. Required.""" - part: "_models.RealtimeServerEventResponseContentPartAddedPart" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The content part that was added. Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the function to be called. Required.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A description of what the function does, used by the model to choose when and how to call the + function.""" + spec: dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The openapi function shape, described as a JSON Schema object. Required.""" + auth: "_models.OpenApiAuthDetails" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Open API authentication details. Required.""" + default_params: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """List of OpenAPI spec parameters that will use user-provided defaults.""" + functions: Optional[list["_models.OpenApiFunctionDefinitionFunction"]] = rest_field(visibility=["read"]) + """List of function definitions used by OpenApi tool.""" @overload def __init__( self, *, - event_id: str, - response_id: str, - item_id: str, - output_index: int, - content_index: int, - part: "_models.RealtimeServerEventResponseContentPartAddedPart", + name: str, + spec: dict[str, Any], + auth: "_models.OpenApiAuthDetails", + description: Optional[str] = None, + default_params: Optional[list[str]] = None, ) -> None: ... @overload @@ -20704,38 +20741,36 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED # type: ignore -class RealtimeServerEventResponseContentPartAddedPart( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """RealtimeServerEventResponseContentPartAddedPart. +class OpenApiFunctionDefinitionFunction(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """OpenApiFunctionDefinitionFunction. - :ivar type: Is either a Literal["audio"] type or a Literal["text"] type. - :vartype type: str or str - :ivar text: - :vartype text: str - :ivar audio: - :vartype audio: str - :ivar transcript: - :vartype transcript: str + :ivar name: The name of the function to be called. Required. + :vartype name: str + :ivar description: A description of what the function does, used by the model to choose when + and how to call the function. + :vartype description: str + :ivar parameters: The parameters the functions accepts, described as a JSON Schema object. + Required. + :vartype parameters: dict[str, any] """ - type: Optional[Literal["audio", "text"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Is either a Literal[\"audio\"] type or a Literal[\"text\"] type.""" - text: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - audio: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - transcript: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the function to be called. Required.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A description of what the function does, used by the model to choose when and how to call the + function.""" + parameters: dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The parameters the functions accepts, described as a JSON Schema object. Required.""" @overload def __init__( self, *, - type: Optional[Literal["audio", "text"]] = None, - text: Optional[str] = None, - audio: Optional[str] = None, - transcript: Optional[str] = None, + name: str, + parameters: dict[str, Any], + description: Optional[str] = None, ) -> None: ... @overload @@ -20749,56 +20784,29 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RealtimeServerEventResponseContentPartDone( - RealtimeServerEvent, discriminator="response.content_part.done" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Returned when a content part is done streaming in an assistant message item. Also emitted when - a Response is interrupted, incomplete, or cancelled. +class OpenApiManagedAuthDetails( + OpenApiAuthDetails, discriminator="managed_identity" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Security details for OpenApi managed_identity authentication. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``response.content_part.done``. Required. - RESPONSE_CONTENT_PART_DONE. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_CONTENT_PART_DONE - :ivar response_id: The ID of the response. Required. - :vartype response_id: str - :ivar item_id: The ID of the item. Required. - :vartype item_id: str - :ivar output_index: The index of the output item in the response. Required. - :vartype output_index: int - :ivar content_index: The index of the content part in the item's content array. Required. - :vartype content_index: int - :ivar part: The content part that is done. Required. - :vartype part: ~azure.ai.projects.models.RealtimeServerEventResponseContentPartDonePart + :ivar type: The object type, which is always 'managed_identity'. Required. MANAGED_IDENTITY. + :vartype type: str or ~azure.ai.projects.models.MANAGED_IDENTITY + :ivar security_scheme: Connection auth security details. Required. + :vartype security_scheme: ~azure.ai.projects.models.OpenApiManagedSecurityScheme """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.content_part.done``. Required. RESPONSE_CONTENT_PART_DONE.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the response. Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the item. Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output item in the response. Required.""" - content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the content part in the item's content array. Required.""" - part: "_models.RealtimeServerEventResponseContentPartDonePart" = rest_field( + type: Literal[OpenApiAuthType.MANAGED_IDENTITY] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The object type, which is always 'managed_identity'. Required. MANAGED_IDENTITY.""" + security_scheme: "_models.OpenApiManagedSecurityScheme" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The content part that is done. Required.""" + """Connection auth security details. Required.""" @overload def __init__( self, *, - event_id: str, - response_id: str, - item_id: str, - output_index: int, - content_index: int, - part: "_models.RealtimeServerEventResponseContentPartDonePart", + security_scheme: "_models.OpenApiManagedSecurityScheme", ) -> None: ... @overload @@ -20810,45 +20818,24 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.RESPONSE_CONTENT_PART_DONE # type: ignore + self.type = OpenApiAuthType.MANAGED_IDENTITY # type: ignore -class RealtimeServerEventResponseContentPartDonePart( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """RealtimeServerEventResponseContentPartDonePart. +class OpenApiManagedSecurityScheme(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Security scheme for OpenApi managed_identity authentication. - :ivar type: Is either a Literal["audio"] type or a Literal["text"] type. - :vartype type: str or str - :ivar text: - :vartype text: str - :ivar audio: - :vartype audio: str - :ivar transcript: - :vartype transcript: str - :ivar format: The audio format, when this is an audio content part. - :vartype format: ~azure.ai.projects.models.RealtimeAudioFormats + :ivar audience: Authentication scope for managed_identity auth type. Required. + :vartype audience: str """ - type: Optional[Literal["audio", "text"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Is either a Literal[\"audio\"] type or a Literal[\"text\"] type.""" - text: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - audio: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - transcript: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - format: Optional["_models.RealtimeAudioFormats"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The audio format, when this is an audio content part.""" + audience: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Authentication scope for managed_identity auth type. Required.""" @overload def __init__( self, *, - type: Optional[Literal["audio", "text"]] = None, - text: Optional[str] = None, - audio: Optional[str] = None, - transcript: Optional[str] = None, - format: Optional["_models.RealtimeAudioFormats"] = None, + audience: str, ) -> None: ... @overload @@ -20862,35 +20849,30 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RealtimeServerEventResponseCreated( - RealtimeServerEvent, discriminator="response.created" +class OpenApiProjectConnectionAuthDetails( + OpenApiAuthDetails, discriminator="project_connection" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Returned when a new Response is created. The first event of response creation, where the - response is in an initial state of ``in_progress``. + """Security details for OpenApi project connection authentication. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``response.created``. Required. RESPONSE_CREATED. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_CREATED - :ivar response: Required. - :vartype response: ~azure.ai.projects.models.VoiceAgentRealtimeResponse + :ivar type: The object type, which is always 'project_connection'. Required. + PROJECT_CONNECTION. + :vartype type: str or ~azure.ai.projects.models.PROJECT_CONNECTION + :ivar security_scheme: Project connection auth security details. Required. + :vartype security_scheme: ~azure.ai.projects.models.OpenApiProjectConnectionSecurityScheme """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.RESPONSE_CREATED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.created``. Required. RESPONSE_CREATED.""" - response: "_models.VoiceAgentRealtimeResponse" = rest_field( + type: Literal[OpenApiAuthType.PROJECT_CONNECTION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The object type, which is always 'project_connection'. Required. PROJECT_CONNECTION.""" + security_scheme: "_models.OpenApiProjectConnectionSecurityScheme" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Required.""" + """Project connection auth security details. Required.""" @overload def __init__( self, *, - event_id: str, - response: "_models.VoiceAgentRealtimeResponse", + security_scheme: "_models.OpenApiProjectConnectionSecurityScheme", ) -> None: ... @overload @@ -20902,42 +20884,24 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.RESPONSE_CREATED # type: ignore + self.type = OpenApiAuthType.PROJECT_CONNECTION # type: ignore -class RealtimeServerEventResponseDone( - RealtimeServerEvent, discriminator="response.done" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Returned when a Response is done streaming. Always emitted, no matter the final state. The - Response object included in the ``response.done`` event will include all output Items in the - Response but will omit the raw audio data. Clients should check the ``status`` field of the - Response to determine if it was successful (``completed``) or if there was another outcome: - ``cancelled``, ``failed``, or ``incomplete``. A response will contain all output items that - were generated during the response, excluding any audio content. +class OpenApiProjectConnectionSecurityScheme(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Security scheme for OpenApi managed_identity authentication. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``response.done``. Required. RESPONSE_DONE. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_DONE - :ivar response: Required. - :vartype response: ~azure.ai.projects.models.VoiceAgentRealtimeResponse + :ivar project_connection_id: Project connection id for Project Connection auth type. Required. + :vartype project_connection_id: str """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.RESPONSE_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.done``. Required. RESPONSE_DONE.""" - response: "_models.VoiceAgentRealtimeResponse" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required.""" + project_connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Project connection id for Project Connection auth type. Required.""" @overload def __init__( self, *, - event_id: str, - response: "_models.VoiceAgentRealtimeResponse", + project_connection_id: str, ) -> None: ... @overload @@ -20949,57 +20913,37 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.RESPONSE_DONE # type: ignore -class RealtimeServerEventResponseFunctionCallArgumentsDelta( - RealtimeServerEvent, discriminator="response.function_call_arguments.delta" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Returned when the model-generated function call arguments are updated. +class OpenApiTool(Tool, discriminator="openapi"): # pylint: disable=docstring-keyword-should-match-keyword-only + """The input definition information for an OpenAPI tool as used to configure an agent. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``response.function_call_arguments.delta``. Required. - RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA - :ivar response_id: The ID of the response. Required. - :vartype response_id: str - :ivar item_id: The ID of the function call item. Required. - :vartype item_id: str - :ivar output_index: The index of the output item in the response. Required. - :vartype output_index: int - :ivar call_id: The ID of the function call. Required. - :vartype call_id: str - :ivar delta: The arguments delta as a JSON string. Required. - :vartype delta: str + :ivar type: The object type, which is always 'openapi'. Required. OPENAPI. + :vartype type: str or ~azure.ai.projects.models.OPENAPI + :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future + version. + :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] + :ivar openapi: The openapi function definition. Required. + :vartype openapi: ~azure.ai.projects.models.OpenApiFunctionDefinition """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.function_call_arguments.delta``. Required. - RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the response. Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the function call item. Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output item in the response. Required.""" - call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the function call. Required.""" - delta: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The arguments delta as a JSON string. Required.""" + type: Literal[ToolType.OPENAPI] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The object type, which is always 'openapi'. Required. OPENAPI.""" + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Deprecated. This property is deprecated and will be removed in a future version.""" + openapi: "_models.OpenApiFunctionDefinition" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The openapi function definition. Required.""" @overload def __init__( self, *, - event_id: str, - response_id: str, - item_id: str, - output_index: int, - call_id: str, - delta: str, + openapi: "_models.OpenApiFunctionDefinition", + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, ) -> None: ... @overload @@ -21011,63 +20955,43 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA # type: ignore + self.type = ToolType.OPENAPI # type: ignore -class RealtimeServerEventResponseFunctionCallArgumentsDone( - RealtimeServerEvent, discriminator="response.function_call_arguments.done" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Returned when the model-generated function call arguments are done streaming. Also emitted when - a Response is interrupted, incomplete, or cancelled. +class OpenApiToolboxTool( + ToolboxTool, discriminator="openapi" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """An OpenAPI tool stored in a toolbox. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``response.function_call_arguments.done``. Required. - RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE - :ivar response_id: The ID of the response. Required. - :vartype response_id: str - :ivar item_id: The ID of the function call item. Required. - :vartype item_id: str - :ivar output_index: The index of the output item in the response. Required. - :vartype output_index: int - :ivar call_id: The ID of the function call. Required. - :vartype call_id: str - :ivar name: The name of the function that was called. Required. + :ivar name: Optional user-defined name for this tool or configuration. :vartype name: str - :ivar arguments: The final arguments as a JSON string. Required. - :vartype arguments: str + :ivar description: Optional user-defined description for this tool or configuration. + :vartype description: str + :ivar tool_configs: Per-tool configuration map. Keys are tool names or ``*`` (catch-all + default). Resolution order: exact tool name match takes priority over ``*``. Unknown tool names + are silently ignored at runtime. + :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] + :ivar type: Required. OPENAPI. + :vartype type: str or ~azure.ai.projects.models.OPENAPI + :ivar openapi: The openapi function definition. Required. + :vartype openapi: ~azure.ai.projects.models.OpenApiFunctionDefinition """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.function_call_arguments.done``. Required. - RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the response. Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the function call item. Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output item in the response. Required.""" - call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the function call. Required.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the function that was called. Required.""" - arguments: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The final arguments as a JSON string. Required.""" + type: Literal[ToolboxToolType.OPENAPI] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. OPENAPI.""" + openapi: "_models.OpenApiFunctionDefinition" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The openapi function definition. Required.""" @overload def __init__( self, *, - event_id: str, - response_id: str, - item_id: str, - output_index: int, - call_id: str, - name: str, - arguments: str, + openapi: "_models.OpenApiFunctionDefinition", + name: Optional[str] = None, + description: Optional[str] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, ) -> None: ... @overload @@ -21079,56 +21003,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE # type: ignore + self.type = ToolboxToolType.OPENAPI # type: ignore -class RealtimeServerEventResponseMCPCallArgumentsDelta( - RealtimeServerEvent, discriminator="response.mcp_call_arguments.delta" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Returned when MCP tool call arguments are updated during response generation. +class OptimizationContext(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Base model for typed optimization context. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``response.mcp_call_arguments.delta``. Required. - RESPONSE_MCP_CALL_ARGUMENTS_DELTA. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_MCP_CALL_ARGUMENTS_DELTA - :ivar response_id: The ID of the response. Required. - :vartype response_id: str - :ivar item_id: The ID of the MCP tool call item. Required. - :vartype item_id: str - :ivar output_index: The index of the output item in the response. Required. - :vartype output_index: int - :ivar delta: The JSON-encoded arguments delta. Required. - :vartype delta: str - :ivar obfuscation: - :vartype obfuscation: str + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + SteeringPromptOptimizationContext + + :ivar type: Optimization context type discriminator. Required. "steering_prompt" + :vartype type: str or ~azure.ai.projects.models.OptimizationContextType """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.mcp_call_arguments.delta``. Required. - RESPONSE_MCP_CALL_ARGUMENTS_DELTA.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the response. Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the MCP tool call item. Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output item in the response. Required.""" - delta: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The JSON-encoded arguments delta. Required.""" - obfuscation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Optimization context type discriminator. Required. \"steering_prompt\"""" @overload def __init__( self, *, - event_id: str, - response_id: str, - item_id: str, - output_index: int, - delta: str, - obfuscation: Optional[str] = None, + type: str, ) -> None: ... @overload @@ -21140,52 +21036,42 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DELTA # type: ignore -class RealtimeServerEventResponseMCPCallArgumentsDone( - RealtimeServerEvent, discriminator="response.mcp_call_arguments.done" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Returned when MCP tool call arguments are finalized during response generation. +class TelemetryEndpoint(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A telemetry export endpoint configuration. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``response.mcp_call_arguments.done``. Required. - RESPONSE_MCP_CALL_ARGUMENTS_DONE. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_MCP_CALL_ARGUMENTS_DONE - :ivar response_id: The ID of the response. Required. - :vartype response_id: str - :ivar item_id: The ID of the MCP tool call item. Required. - :vartype item_id: str - :ivar output_index: The index of the output item in the response. Required. - :vartype output_index: int - :ivar arguments: The final JSON-encoded arguments string. Required. - :vartype arguments: str + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + OtlpTelemetryEndpoint + + :ivar kind: The telemetry export endpoint kind. Required. "OTLP" + :vartype kind: str or ~azure.ai.projects.models.TelemetryEndpointKind + :ivar data: Data types to export to this endpoint. Use an empty array to export no data. + Required. + :vartype data: list[str or ~azure.ai.projects.models.TelemetryDataKind] + :ivar auth: Optional authentication configuration. + :vartype auth: ~azure.ai.projects.models.TelemetryEndpointAuth """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.mcp_call_arguments.done``. Required. - RESPONSE_MCP_CALL_ARGUMENTS_DONE.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the response. Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the MCP tool call item. Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output item in the response. Required.""" - arguments: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The final JSON-encoded arguments string. Required.""" + __mapping__: dict[str, _Model] = {} + kind: str = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) + """The telemetry export endpoint kind. Required. \"OTLP\"""" + data: list[Union[str, "_models.TelemetryDataKind"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Data types to export to this endpoint. Use an empty array to export no data. Required.""" + auth: Optional["_models.TelemetryEndpointAuth"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Optional authentication configuration.""" @overload def __init__( self, *, - event_id: str, - response_id: str, - item_id: str, - output_index: int, - arguments: str, + kind: str, + data: list[Union[str, "_models.TelemetryDataKind"]], + auth: Optional["_models.TelemetryEndpointAuth"] = None, ) -> None: ... @overload @@ -21197,41 +21083,47 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DONE # type: ignore -class RealtimeServerEventResponseMCPCallCompleted( - RealtimeServerEvent, discriminator="response.mcp_call.completed" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Returned when an MCP tool call has completed successfully. +class OtlpTelemetryEndpoint( + TelemetryEndpoint, discriminator="OTLP" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """An OTLP (OpenTelemetry Protocol) telemetry export endpoint. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``response.mcp_call.completed``. Required. - RESPONSE_MCP_CALL_COMPLETED. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_MCP_CALL_COMPLETED - :ivar output_index: The index of the output item in the response. Required. - :vartype output_index: int - :ivar item_id: The ID of the MCP tool call item. Required. - :vartype item_id: str + :ivar data: Data types to export to this endpoint. Use an empty array to export no data. + Required. + :vartype data: list[str or ~azure.ai.projects.models.TelemetryDataKind] + :ivar auth: Optional authentication configuration. + :vartype auth: ~azure.ai.projects.models.TelemetryEndpointAuth + :ivar kind: The endpoint kind, always 'OTLP' for OpenTelemetry Protocol endpoints. Required. + OpenTelemetry Protocol (OTLP) endpoint. + :vartype kind: str or ~azure.ai.projects.models.OTLP + :ivar endpoint: The OTLP collector endpoint URL. Required. + :vartype endpoint: str + :ivar protocol: The transport protocol for the OTLP endpoint. Required. Known values are: + "Http" and "Grpc". + :vartype protocol: str or ~azure.ai.projects.models.TelemetryTransportProtocol """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_COMPLETED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.mcp_call.completed``. Required. RESPONSE_MCP_CALL_COMPLETED.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output item in the response. Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the MCP tool call item. Required.""" + kind: Literal[TelemetryEndpointKind.OTLP] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The endpoint kind, always 'OTLP' for OpenTelemetry Protocol endpoints. Required. OpenTelemetry + Protocol (OTLP) endpoint.""" + endpoint: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The OTLP collector endpoint URL. Required.""" + protocol: Union[str, "_models.TelemetryTransportProtocol"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The transport protocol for the OTLP endpoint. Required. Known values are: \"Http\" and + \"Grpc\".""" @overload def __init__( self, *, - event_id: str, - output_index: int, - item_id: str, + data: list[Union[str, "_models.TelemetryDataKind"]], + endpoint: str, + protocol: Union[str, "_models.TelemetryTransportProtocol"], + auth: Optional["_models.TelemetryEndpointAuth"] = None, ) -> None: ... @overload @@ -21243,41 +21135,24 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.RESPONSE_MCP_CALL_COMPLETED # type: ignore + self.kind = TelemetryEndpointKind.OTLP # type: ignore -class RealtimeServerEventResponseMCPCallFailed( - RealtimeServerEvent, discriminator="response.mcp_call.failed" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Returned when an MCP tool call has failed. +class OutputTokensDetailsResource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """OutputTokensDetailsResource. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``response.mcp_call.failed``. Required. - RESPONSE_MCP_CALL_FAILED. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_MCP_CALL_FAILED - :ivar output_index: The index of the output item in the response. Required. - :vartype output_index: int - :ivar item_id: The ID of the MCP tool call item. Required. - :vartype item_id: str + :ivar reasoning_tokens: Required. + :vartype reasoning_tokens: int """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_FAILED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.mcp_call.failed``. Required. RESPONSE_MCP_CALL_FAILED.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output item in the response. Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the MCP tool call item. Required.""" + reasoning_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - event_id: str, - output_index: int, - item_id: str, + reasoning_tokens: int, ) -> None: ... @overload @@ -21289,42 +21164,42 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.RESPONSE_MCP_CALL_FAILED # type: ignore -class RealtimeServerEventResponseMCPCallInProgress( - RealtimeServerEvent, discriminator="response.mcp_call.in_progress" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Returned when an MCP tool call has started and is in progress. +class PendingUploadRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Represents a request for a pending upload. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``response.mcp_call.in_progress``. Required. - RESPONSE_MCP_CALL_IN_PROGRESS. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_MCP_CALL_IN_PROGRESS - :ivar output_index: The index of the output item in the response. Required. - :vartype output_index: int - :ivar item_id: The ID of the MCP tool call item. Required. - :vartype item_id: str + :ivar pending_upload_id: If PendingUploadId is not provided, a random GUID will be used. + :vartype pending_upload_id: str + :ivar connection_name: Azure Storage Account connection name to use for generating temporary + SAS token. + :vartype connection_name: str + :ivar pending_upload_type: The type of pending upload. Required. Deprecated: the service never + read this value and silently ignored it. Use TemporaryBlobReference instead. + :vartype pending_upload_type: str or ~azure.ai.projects.models.BLOB_REFERENCE """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_IN_PROGRESS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.mcp_call.in_progress``. Required. - RESPONSE_MCP_CALL_IN_PROGRESS.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output item in the response. Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the MCP tool call item. Required.""" + pending_upload_id: Optional[str] = rest_field( + name="pendingUploadId", visibility=["read", "create", "update", "delete", "query"] + ) + """If PendingUploadId is not provided, a random GUID will be used.""" + connection_name: Optional[str] = rest_field( + name="connectionName", visibility=["read", "create", "update", "delete", "query"] + ) + """Azure Storage Account connection name to use for generating temporary SAS token.""" + pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE] = rest_field( + name="pendingUploadType", visibility=["read", "create", "update", "delete", "query"] + ) + """The type of pending upload. Required. Deprecated: the service never read this value and + silently ignored it. Use TemporaryBlobReference instead.""" @overload def __init__( self, *, - event_id: str, - output_index: int, - item_id: str, + pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE], + pending_upload_id: Optional[str] = None, + connection_name: Optional[str] = None, ) -> None: ... @overload @@ -21336,46 +21211,47 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.RESPONSE_MCP_CALL_IN_PROGRESS # type: ignore -class RealtimeServerEventResponseOutputItemAdded( - RealtimeServerEvent, discriminator="response.output_item.added" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Returned when a new Item is created during Response generation. +class PendingUploadResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Represents the response for a pending upload request. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``response.output_item.added``. Required. - RESPONSE_OUTPUT_ITEM_ADDED. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_OUTPUT_ITEM_ADDED - :ivar response_id: The ID of the Response to which the item belongs. Required. - :vartype response_id: str - :ivar output_index: The index of the output item in the Response. Required. - :vartype output_index: int - :ivar item: Required. - :vartype item: ~azure.ai.projects.models.RealtimeConversationItem + :ivar blob_reference: Container-level read, write, list SAS. Required. + :vartype blob_reference: ~azure.ai.projects.models.BlobReference + :ivar pending_upload_id: ID for this upload request. Required. + :vartype pending_upload_id: str + :ivar version: Version of asset to be created if user did not specify version when initially + creating upload. + :vartype version: str + :ivar pending_upload_type: The type of pending upload. Required. Deprecated: the service never + read this value and silently ignored it. Use TemporaryBlobReference instead. + :vartype pending_upload_type: str or ~azure.ai.projects.models.BLOB_REFERENCE """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_ADDED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.output_item.added``. Required. RESPONSE_OUTPUT_ITEM_ADDED.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the Response to which the item belongs. Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output item in the Response. Required.""" - item: "_models.RealtimeConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + blob_reference: "_models.BlobReference" = rest_field( + name="blobReference", visibility=["read", "create", "update", "delete", "query"] + ) + """Container-level read, write, list SAS. Required.""" + pending_upload_id: str = rest_field( + name="pendingUploadId", visibility=["read", "create", "update", "delete", "query"] + ) + """ID for this upload request. Required.""" + version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Version of asset to be created if user did not specify version when initially creating upload.""" + pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE] = rest_field( + name="pendingUploadType", visibility=["read", "create", "update", "delete", "query"] + ) + """The type of pending upload. Required. Deprecated: the service never read this value and + silently ignored it. Use TemporaryBlobReference instead.""" @overload def __init__( self, *, - event_id: str, - response_id: str, - output_index: int, - item: "_models.RealtimeConversationItem", + blob_reference: "_models.BlobReference", + pending_upload_id: str, + pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE], + version: Optional[str] = None, ) -> None: ... @overload @@ -21387,47 +21263,25 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_ADDED # type: ignore -class RealtimeServerEventResponseOutputItemDone( - RealtimeServerEvent, discriminator="response.output_item.done" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Returned when an Item is done streaming. Also emitted when a Response is interrupted, - incomplete, or cancelled. +class PickPropertiesVoiceAgentAudioConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The template for picking properties. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``response.output_item.done``. Required. - RESPONSE_OUTPUT_ITEM_DONE. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_OUTPUT_ITEM_DONE - :ivar response_id: The ID of the Response to which the item belongs. Required. - :vartype response_id: str - :ivar output_index: The index of the output item in the Response. Required. - :vartype output_index: int - :ivar item: Required. - :vartype item: ~azure.ai.projects.models.RealtimeConversationItem + :ivar output: Output (agent speech) audio configuration. + :vartype output: ~azure.ai.projects.models.VoiceAgentAudioOutputConfig """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.output_item.done``. Required. RESPONSE_OUTPUT_ITEM_DONE.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the Response to which the item belongs. Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output item in the Response. Required.""" - item: "_models.RealtimeConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + output: Optional["_models.VoiceAgentAudioOutputConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Output (agent speech) audio configuration.""" @overload def __init__( self, *, - event_id: str, - response_id: str, - output_index: int, - item: "_models.RealtimeConversationItem", + output: Optional["_models.VoiceAgentAudioOutputConfig"] = None, ) -> None: ... @overload @@ -21439,56 +21293,38 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_DONE # type: ignore -class RealtimeServerEventResponseTextDelta( - RealtimeServerEvent, discriminator="response.output_text.delta" +class ProceduralMemoryItem( + MemoryItem, discriminator="procedural" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Returned when the text value of an "output_text" content part is updated. + """A memory item containing a procedure extracted from conversations. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``response.output_text.delta``. Required. - RESPONSE_OUTPUT_TEXT_DELTA. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_OUTPUT_TEXT_DELTA - :ivar response_id: The ID of the response. Required. - :vartype response_id: str - :ivar item_id: The ID of the item. Required. - :vartype item_id: str - :ivar output_index: The index of the output item in the response. Required. - :vartype output_index: int - :ivar content_index: The index of the content part in the item's content array. Required. - :vartype content_index: int - :ivar delta: The text delta. Required. - :vartype delta: str + :ivar memory_id: The unique ID of the memory item. Required. + :vartype memory_id: str + :ivar updated_at: The last update time of the memory item. Required. + :vartype updated_at: ~datetime.datetime + :ivar scope: The namespace that logically groups and isolates memories, such as a user ID. + Required. + :vartype scope: str + :ivar content: The content of the memory. Required. + :vartype content: str + :ivar kind: The kind of the memory item. Required. Routine procedures extracted from + conversations. + :vartype kind: str or ~azure.ai.projects.models.PROCEDURAL """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.output_text.delta``. Required. RESPONSE_OUTPUT_TEXT_DELTA.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the response. Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the item. Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output item in the response. Required.""" - content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the content part in the item's content array. Required.""" - delta: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The text delta. Required.""" + kind: Literal[MemoryItemKind.PROCEDURAL] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The kind of the memory item. Required. Routine procedures extracted from conversations.""" @overload def __init__( self, *, - event_id: str, - response_id: str, - item_id: str, - output_index: int, - content_index: int, - delta: str, + memory_id: str, + updated_at: datetime.datetime, + scope: str, + content: str, ) -> None: ... @overload @@ -21500,57 +21336,113 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DELTA # type: ignore + self.kind = MemoryItemKind.PROCEDURAL # type: ignore -class RealtimeServerEventResponseTextDone( - RealtimeServerEvent, discriminator="response.output_text.done" +class PromptAgentDefinition( + AgentDefinition, discriminator="prompt" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Returned when the text value of an "output_text" content part is done streaming. Also emitted - when a Response is interrupted, incomplete, or cancelled. + """The prompt agent definition. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``response.output_text.done``. Required. - RESPONSE_OUTPUT_TEXT_DONE. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_OUTPUT_TEXT_DONE - :ivar response_id: The ID of the response. Required. - :vartype response_id: str - :ivar item_id: The ID of the item. Required. - :vartype item_id: str - :ivar output_index: The index of the output item in the response. Required. - :vartype output_index: int - :ivar content_index: The index of the content part in the item's content array. Required. - :vartype content_index: int - :ivar text: The final text content. Required. - :vartype text: str + :ivar rai_config: Configuration for Responsible AI (RAI) content filtering and safety features. + :vartype rai_config: ~azure.ai.projects.models.RaiConfig + :ivar kind: Required. PROMPT. + :vartype kind: str or ~azure.ai.projects.models.PROMPT + :ivar harness: The managed runtime and agent loop used to execute this prompt agent. + :vartype harness: ~azure.ai.projects.models.AgentHarness + :ivar model: The model deployment to use for this agent. Required. + :vartype model: str + :ivar instructions: A system (or developer) message inserted into the model's context. + :vartype instructions: str + :ivar skills: The Foundry skills available to this prompt agent. An omitted skill version is + resolved and pinned when the agent version is created. + :vartype skills: list[~azure.ai.projects.models.SkillReference] + :ivar temperature: What sampling temperature to use, between 0 and 2. Higher values like 0.8 + will make the output more random, while lower values like 0.2 will make it more focused and + deterministic. We generally recommend altering this or ``top_p`` but not both. Defaults to + ``1``. + :vartype temperature: float + :ivar top_p: An alternative to sampling with temperature, called nucleus sampling, where the + model considers the results of the tokens with top_p probability mass. So 0.1 means only the + tokens comprising the top 10% probability mass are considered. We generally recommend altering + this or ``temperature`` but not both. Defaults to ``1``. + :vartype top_p: float + :ivar reasoning: + :vartype reasoning: ~azure.ai.projects.models.Reasoning + :ivar tools: An array of tools the model may call while generating a response. You can specify + which tool to use by setting the ``tool_choice`` parameter. + :vartype tools: list[~azure.ai.projects.models.Tool] + :ivar tool_choice: How the model should select which tool (or tools) to use when generating a + response. See the ``tools`` parameter to see how to specify which tools the model can call. Is + either a str type or a ToolChoiceParam type. + :vartype tool_choice: str or ~azure.ai.projects.models.ToolChoiceParam + :ivar text: Configuration options for a text response from the model. Can be plain text or + structured JSON data. + :vartype text: ~azure.ai.projects.models.PromptAgentDefinitionTextOptions + :ivar structured_inputs: Set of structured inputs that can participate in prompt template + substitution or tool argument bindings. + :vartype structured_inputs: dict[str, ~azure.ai.projects.models.StructuredInputDefinition] """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.output_text.done``. Required. RESPONSE_OUTPUT_TEXT_DONE.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the response. Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the item. Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output item in the response. Required.""" - content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the content part in the item's content array. Required.""" - text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The final text content. Required.""" + kind: Literal[AgentKind.PROMPT] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. PROMPT.""" + harness: Optional["_models.AgentHarness"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The managed runtime and agent loop used to execute this prompt agent.""" + model: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The model deployment to use for this agent. Required.""" + instructions: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A system (or developer) message inserted into the model's context.""" + skills: Optional[list["_models.SkillReference"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The Foundry skills available to this prompt agent. An omitted skill version is resolved and + pinned when the agent version is created.""" + temperature: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output + more random, while lower values like 0.2 will make it more focused and deterministic. We + generally recommend altering this or ``top_p`` but not both. Defaults to ``1``.""" + top_p: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An alternative to sampling with temperature, called nucleus sampling, where the model considers + the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising + the top 10% probability mass are considered. We generally recommend altering this or + ``temperature`` but not both. Defaults to ``1``.""" + reasoning: Optional["_models.Reasoning"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + tools: Optional[list["_models.Tool"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An array of tools the model may call while generating a response. You can specify which tool to + use by setting the ``tool_choice`` parameter.""" + tool_choice: Optional[Union[str, "_models.ToolChoiceParam"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """How the model should select which tool (or tools) to use when generating a response. See the + ``tools`` parameter to see how to specify which tools the model can call. Is either a str type + or a ToolChoiceParam type.""" + text: Optional["_models.PromptAgentDefinitionTextOptions"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Configuration options for a text response from the model. Can be plain text or structured JSON + data.""" + structured_inputs: Optional[dict[str, "_models.StructuredInputDefinition"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Set of structured inputs that can participate in prompt template substitution or tool argument + bindings.""" @overload def __init__( self, *, - event_id: str, - response_id: str, - item_id: str, - output_index: int, - content_index: int, - text: str, + model: str, + rai_config: Optional["_models.RaiConfig"] = None, + harness: Optional["_models.AgentHarness"] = None, + instructions: Optional[str] = None, + skills: Optional[list["_models.SkillReference"]] = None, + temperature: Optional[float] = None, + top_p: Optional[float] = None, + reasoning: Optional["_models.Reasoning"] = None, + tools: Optional[list["_models.Tool"]] = None, + tool_choice: Optional[Union[str, "_models.ToolChoiceParam"]] = None, + text: Optional["_models.PromptAgentDefinitionTextOptions"] = None, + structured_inputs: Optional[dict[str, "_models.StructuredInputDefinition"]] = None, ) -> None: ... @overload @@ -21562,47 +21454,26 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DONE # type: ignore + self.kind = AgentKind.PROMPT # type: ignore -class RealtimeServerEventSessionCreated( - RealtimeServerEvent, discriminator="session.created" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Returned when a Session is created. Emitted automatically when a new connection is established - as the first server event. This event will contain the default Session configuration. +class PromptAgentDefinitionTextOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Configuration options for a text response from the model. Can be plain text or structured JSON + data. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``session.created``. Required. SESSION_CREATED. - :vartype type: str or ~azure.ai.projects.models.SESSION_CREATED - :ivar session: The session configuration. Required. Is one of the following types: - VoiceAgentSessionResponseConfig - :vartype session: ~azure.ai.projects.models.VoiceAgentSessionResponseConfig - :ivar conversation_id: The session-scoped conversation id. When present, responses attached to - the session conversation use the same value in ``response.created`` and ``response.done``. - :vartype conversation_id: str + :ivar format: + :vartype format: ~azure.ai.projects.models.TextResponseFormat """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.SESSION_CREATED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``session.created``. Required. SESSION_CREATED.""" - session: "_unions.VoiceAgentSessionResponse" = rest_field( + format: Optional["_models.TextResponseFormat"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The session configuration. Required. Is one of the following types: - VoiceAgentSessionResponseConfig""" - conversation_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The session-scoped conversation id. When present, responses attached to the session - conversation use the same value in ``response.created`` and ``response.done``.""" @overload def __init__( self, *, - event_id: str, - session: "_unions.VoiceAgentSessionResponse", - conversation_id: Optional[str] = None, + format: Optional["_models.TextResponseFormat"] = None, ) -> None: ... @overload @@ -21614,39 +21485,40 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.SESSION_CREATED # type: ignore -class RealtimeServerEventSessionUpdated( - RealtimeServerEvent, discriminator="session.updated" +class PromptBasedEvaluatorDefinition( + EvaluatorDefinition, discriminator="prompt" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Returned when a session is updated with a ``session.update`` event, unless there is an error. + """Prompt-based evaluator. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``session.updated``. Required. SESSION_UPDATED. - :vartype type: str or ~azure.ai.projects.models.SESSION_UPDATED - :ivar session: The session configuration. Required. Is one of the following types: - VoiceAgentSessionResponseConfig - :vartype session: ~azure.ai.projects.models.VoiceAgentSessionResponseConfig + :ivar init_parameters: The JSON schema (Draft 2020-12) for the evaluator's input parameters. + This includes parameters like type, properties, required. + :vartype init_parameters: dict[str, any] + :ivar data_schema: The JSON schema (Draft 2020-12) for the evaluator's input data. This + includes parameters like type, properties, required. + :vartype data_schema: dict[str, any] + :ivar metrics: List of output metrics produced by this evaluator. + :vartype metrics: dict[str, ~azure.ai.projects.models.EvaluatorMetric] + :ivar type: Required. Prompt-based definition. + :vartype type: str or ~azure.ai.projects.models.PROMPT + :ivar prompt_text: The prompt text used for evaluation. Required. + :vartype prompt_text: str """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.SESSION_UPDATED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``session.updated``. Required. SESSION_UPDATED.""" - session: "_unions.VoiceAgentSessionResponse" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The session configuration. Required. Is one of the following types: - VoiceAgentSessionResponseConfig""" + type: Literal[EvaluatorDefinitionType.PROMPT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Prompt-based definition.""" + prompt_text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The prompt text used for evaluation. Required.""" @overload def __init__( self, *, - event_id: str, - session: "_unions.VoiceAgentSessionResponse", + prompt_text: str, + init_parameters: Optional[dict[str, Any]] = None, + data_schema: Optional[dict[str, Any]] = None, + metrics: Optional[dict[str, "_models.EvaluatorMetric"]] = None, ) -> None: ... @overload @@ -21658,60 +21530,38 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.SESSION_UPDATED # type: ignore + self.type = EvaluatorDefinitionType.PROMPT # type: ignore -class Reasoning(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Reasoning. +class PromptDataGenerationJobSource( + DataGenerationJobSource, discriminator="prompt" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Prompt source for data generation jobs — inline text provided by the user. - :ivar mode: Controls the reasoning execution mode for the request. When returned on a response, - this is the effective execution mode. Known values are: "standard" and "pro". - :vartype mode: str or ~azure.ai.projects.models.ReasoningModeEnum - :ivar effort: Known values are: "none", "minimal", "low", "medium", "high", "xhigh", and "max". - :vartype effort: str or ~azure.ai.projects.models.ReasoningEffort - :ivar summary: Is one of the following types: Literal["auto"], Literal["concise"], - Literal["detailed"] - :vartype summary: str or str or str - :ivar context: Is one of the following types: Literal["auto"], Literal["current_turn"], - Literal["all_turns"] - :vartype context: str or str or str - :ivar generate_summary: Is one of the following types: Literal["auto"], Literal["concise"], - Literal["detailed"] - :vartype generate_summary: str or str or str + :ivar description: Optional description of what this source represents — helps the pipeline + interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core + capabilities'). + :vartype description: str + :ivar type: The source type for this source, which is Prompt. Required. Prompt source — inline + text provided by the user. + :vartype type: str or ~azure.ai.projects.models.PROMPT + :ivar prompt: Inline prompt text (e.g., agent description, policy text, supplementary context). + Required. + :vartype prompt: str """ - mode: Optional[Union[str, "_models.ReasoningModeEnum"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Controls the reasoning execution mode for the request. When returned on a response, this is the - effective execution mode. Known values are: \"standard\" and \"pro\".""" - effort: Optional[Union[str, "_models.ReasoningEffort"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Known values are: \"none\", \"minimal\", \"low\", \"medium\", \"high\", \"xhigh\", and \"max\".""" - summary: Optional[Literal["auto", "concise", "detailed"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Is one of the following types: Literal[\"auto\"], Literal[\"concise\"], Literal[\"detailed\"]""" - context: Optional[Literal["auto", "current_turn", "all_turns"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Is one of the following types: Literal[\"auto\"], Literal[\"current_turn\"], - Literal[\"all_turns\"]""" - generate_summary: Optional[Literal["auto", "concise", "detailed"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Is one of the following types: Literal[\"auto\"], Literal[\"concise\"], Literal[\"detailed\"]""" + type: Literal[DataGenerationJobSourceType.PROMPT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The source type for this source, which is Prompt. Required. Prompt source — inline text + provided by the user.""" + prompt: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Inline prompt text (e.g., agent description, policy text, supplementary context). Required.""" @overload def __init__( self, *, - mode: Optional[Union[str, "_models.ReasoningModeEnum"]] = None, - effort: Optional[Union[str, "_models.ReasoningEffort"]] = None, - summary: Optional[Literal["auto", "concise", "detailed"]] = None, - context: Optional[Literal["auto", "current_turn", "all_turns"]] = None, - generate_summary: Optional[Literal["auto", "concise", "detailed"]] = None, + prompt: str, + description: Optional[str] = None, ) -> None: ... @overload @@ -21723,53 +21573,41 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = DataGenerationJobSourceType.PROMPT # type: ignore -class RecurrenceTrigger( - Trigger, discriminator="Recurrence" +class PromptEvaluatorGenerationJobSource( + EvaluatorGenerationJobSource, discriminator="prompt" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Recurrence based trigger. + """Prompt source for evaluator generation jobs — inline text provided by the user. - :ivar type: Type of the trigger. Required. Recurrence based trigger. - :vartype type: str or ~azure.ai.projects.models.RECURRENCE - :ivar start_time: Start time for the recurrence schedule in ISO 8601 format. - :vartype start_time: ~datetime.datetime - :ivar end_time: End time for the recurrence schedule in ISO 8601 format. - :vartype end_time: ~datetime.datetime - :ivar time_zone: Time zone for the recurrence schedule. Defaults to ``UTC``. - :vartype time_zone: str - :ivar interval: Interval for the recurrence schedule. Required. - :vartype interval: int - :ivar schedule: Recurrence schedule for the recurrence trigger. Required. - :vartype schedule: ~azure.ai.projects.models.RecurrenceSchedule + :ivar description: Optional description of what this source represents — helps the pipeline + interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core + capabilities'). + :vartype description: str + :ivar type: The source type for this source, which is Prompt. Required. Prompt source — inline + text provided by the user. + :vartype type: str or ~azure.ai.projects.models.PROMPT + :ivar prompt: Inline prompt text (e.g., agent description, policy text, supplementary context). + Required. + :vartype prompt: str """ - type: Literal[TriggerType.RECURRENCE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Type of the trigger. Required. Recurrence based trigger.""" - start_time: Optional[datetime.datetime] = rest_field( - name="startTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" - ) - """Start time for the recurrence schedule in ISO 8601 format.""" - end_time: Optional[datetime.datetime] = rest_field( - name="endTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" - ) - """End time for the recurrence schedule in ISO 8601 format.""" - time_zone: Optional[str] = rest_field(name="timeZone", visibility=["read", "create", "update", "delete", "query"]) - """Time zone for the recurrence schedule. Defaults to ``UTC``.""" - interval: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Interval for the recurrence schedule. Required.""" - schedule: "_models.RecurrenceSchedule" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Recurrence schedule for the recurrence trigger. Required.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional description of what this source represents — helps the pipeline interpret its content + (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities').""" + type: Literal[EvaluatorGenerationJobSourceType.PROMPT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The source type for this source, which is Prompt. Required. Prompt source — inline text + provided by the user.""" + prompt: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Inline prompt text (e.g., agent description, policy text, supplementary context). Required.""" @overload def __init__( self, *, - interval: int, - schedule: "_models.RecurrenceSchedule", - start_time: Optional[datetime.datetime] = None, - end_time: Optional[datetime.datetime] = None, - time_zone: Optional[str] = None, + prompt: str, + description: Optional[str] = None, ) -> None: ... @overload @@ -21781,88 +21619,32 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = TriggerType.RECURRENCE # type: ignore + self.type = EvaluatorGenerationJobSourceType.PROMPT # type: ignore -class RedTeam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Red team details. +class PromptOptimizationConfiguration( + AgentOptimizationConfigurationBase, discriminator="prompt_optimization" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Configuration for a one-shot prompt transformation without comparative evaluation. - :ivar name: Identifier of the red team run. Required. - :vartype name: str - :ivar display_name: Name of the red-team run. - :vartype display_name: str - :ivar num_turns: Number of simulation rounds. - :vartype num_turns: int - :ivar attack_strategies: List of attack strategies or nested lists of attack strategies. - :vartype attack_strategies: list[str or ~azure.ai.projects.models.AttackStrategy] - :ivar simulation_only: Simulation-only or Simulation + Evaluation. If ``true`` the scan outputs - conversation not evaluation result. The service defaults to ``false`` if a value is not - specified by the caller. - :vartype simulation_only: bool - :ivar risk_categories: List of risk categories to generate attack objectives for. - :vartype risk_categories: list[str or ~azure.ai.projects.models.RiskCategory] - :ivar application_scenario: Application scenario for the red team operation, to generate - scenario specific attacks. - :vartype application_scenario: str - :ivar tags: Red team's tags. Unlike properties, tags are fully mutable. - :vartype tags: dict[str, str] - :ivar properties: Red team's properties. Unlike tags, properties are add-only. Once added, a - property cannot be removed. - :vartype properties: dict[str, str] - :ivar status: Status of the red-team. It is set by service and is read-only. - :vartype status: str - :ivar target: Target configuration for the red-team run. Required. - :vartype target: ~azure.ai.projects.models.RedTeamTargetConfig + :ivar type: Optimization type discriminator. Required. One-shot prompt optimization. + :vartype type: str or ~azure.ai.projects.models.PROMPT_OPTIMIZATION + :ivar context: Context used to steer prompt optimization. Omitted when no context is supplied. + :vartype context: list[~azure.ai.projects.models.OptimizationContext] """ - name: str = rest_field(name="id", visibility=["read"]) - """Identifier of the red team run. Required.""" - display_name: Optional[str] = rest_field( - name="displayName", visibility=["read", "create", "update", "delete", "query"] - ) - """Name of the red-team run.""" - num_turns: Optional[int] = rest_field(name="numTurns", visibility=["read", "create", "update", "delete", "query"]) - """Number of simulation rounds.""" - attack_strategies: Optional[list[Union[str, "_models.AttackStrategy"]]] = rest_field( - name="attackStrategies", visibility=["read", "create", "update", "delete", "query"] - ) - """List of attack strategies or nested lists of attack strategies.""" - simulation_only: Optional[bool] = rest_field( - name="simulationOnly", visibility=["read", "create", "update", "delete", "query"] - ) - """Simulation-only or Simulation + Evaluation. If ``true`` the scan outputs conversation not - evaluation result. The service defaults to ``false`` if a value is not specified by the caller.""" - risk_categories: Optional[list[Union[str, "_models.RiskCategory"]]] = rest_field( - name="riskCategories", visibility=["read", "create", "update", "delete", "query"] - ) - """List of risk categories to generate attack objectives for.""" - application_scenario: Optional[str] = rest_field( - name="applicationScenario", visibility=["read", "create", "update", "delete", "query"] + type: Literal[AgentOptimizationConfigurationType.PROMPT_OPTIMIZATION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Optimization type discriminator. Required. One-shot prompt optimization.""" + context: Optional[list["_models.OptimizationContext"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """Application scenario for the red team operation, to generate scenario specific attacks.""" - tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Red team's tags. Unlike properties, tags are fully mutable.""" - properties: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Red team's properties. Unlike tags, properties are add-only. Once added, a property cannot be - removed.""" - status: Optional[str] = rest_field(visibility=["read"]) - """Status of the red-team. It is set by service and is read-only.""" - target: "_models.RedTeamTargetConfig" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Target configuration for the red-team run. Required.""" + """Context used to steer prompt optimization. Omitted when no context is supplied.""" @overload def __init__( self, *, - target: "_models.RedTeamTargetConfig", - display_name: Optional[str] = None, - num_turns: Optional[int] = None, - attack_strategies: Optional[list[Union[str, "_models.AttackStrategy"]]] = None, - simulation_only: Optional[bool] = None, - risk_categories: Optional[list[Union[str, "_models.RiskCategory"]]] = None, - application_scenario: Optional[str] = None, - tags: Optional[dict[str, str]] = None, - properties: Optional[dict[str, str]] = None, + context: Optional[list["_models.OptimizationContext"]] = None, ) -> None: ... @overload @@ -21874,60 +21656,61 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = AgentOptimizationConfigurationType.PROMPT_OPTIMIZATION # type: ignore -class ReinforcementFineTuningDataGenerationJob( - DataGenerationJob, discriminator="reinforcement_finetuning_preview" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Reinforcement fine-tuning data generation job resource. This is a preview feature. +class ProtocolConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Per-protocol configuration for the agent endpoint. - :ivar id: Server-assigned unique identifier. Required. - :vartype id: str - :ivar result: Result produced on success. - :vartype result: ~azure.ai.projects.models.DataGenerationJobResult - :ivar status: Current lifecycle status. Required. Known values are: "queued", "in_progress", - "succeeded", "failed", and "cancelled". - :vartype status: str or ~azure.ai.projects.models.JobStatus - :ivar error: Error details — populated only on failure. - :vartype error: ~azure.ai.projects.models.ApiError - :ivar name: The display name of the data generation job. Required. - :vartype name: str - :ivar sources: The sources used for the data generation job. Required. - :vartype sources: list[~azure.ai.projects.models.DataGenerationJobSource] - :ivar generation_configuration: The generation configuration for the data generation job. - Required. - :vartype generation_configuration: ~azure.ai.projects.models.DataGenerationJobConfiguration - :ivar created_at: The timestamp when the job was created, represented in Unix time (seconds - since January 1, 1970). Required. - :vartype created_at: ~datetime.datetime - :ivar finished_at: The timestamp when the job was finished, represented in Unix time (seconds - since January 1, 1970). - :vartype finished_at: ~datetime.datetime - :ivar scenario: The scenario of the data generation job, which is Reinforcement Fine-tuning - preview for this model. Required. Reinforcement Fine-tuning preview scenario. - :vartype scenario: str or ~azure.ai.projects.models.REINFORCEMENT_FINETUNING_PREVIEW - :ivar output_configuration: Optional file output configuration for the generated reinforcement - fine-tuning data. - :vartype output_configuration: - ~azure.ai.projects.models.ReinforcementFineTuningDataGenerationJobOutputConfiguration + :ivar activity: Configuration for the activity protocol. + :vartype activity: ~azure.ai.projects.models.ActivityProtocolConfiguration + :ivar responses: Configuration for the responses protocol. + :vartype responses: ~azure.ai.projects.models.ResponsesProtocolConfiguration + :ivar a2a: Configuration for the A2A protocol. + :vartype a2a: ~azure.ai.projects.models.A2AProtocolConfiguration + :ivar mcp: Configuration for the MCP protocol. + :vartype mcp: ~azure.ai.projects.models.McpProtocolConfiguration + :ivar invocations: Configuration for the invocations protocol. + :vartype invocations: ~azure.ai.projects.models.InvocationsProtocolConfiguration + :ivar invocations_ws: Configuration for the WebSocket-based invocations protocol. + :vartype invocations_ws: ~azure.ai.projects.models.InvocationsWsProtocolConfiguration """ - scenario: Literal[DataGenerationJobScenario.REINFORCEMENT_FINETUNING_PREVIEW] = rest_discriminator(name="scenario", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The scenario of the data generation job, which is Reinforcement Fine-tuning preview for this - model. Required. Reinforcement Fine-tuning preview scenario.""" - output_configuration: Optional["_models.ReinforcementFineTuningDataGenerationJobOutputConfiguration"] = rest_field( + activity: Optional["_models.ActivityProtocolConfiguration"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Optional file output configuration for the generated reinforcement fine-tuning data.""" + """Configuration for the activity protocol.""" + responses: Optional["_models.ResponsesProtocolConfiguration"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Configuration for the responses protocol.""" + a2a: Optional["_models.A2AProtocolConfiguration"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Configuration for the A2A protocol.""" + mcp: Optional["_models.McpProtocolConfiguration"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Configuration for the MCP protocol.""" + invocations: Optional["_models.InvocationsProtocolConfiguration"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Configuration for the invocations protocol.""" + invocations_ws: Optional["_models.InvocationsWsProtocolConfiguration"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Configuration for the WebSocket-based invocations protocol.""" @overload def __init__( self, *, - name: str, - sources: list["_models.DataGenerationJobSource"], - generation_configuration: "_models.DataGenerationJobConfiguration", - output_configuration: Optional["_models.ReinforcementFineTuningDataGenerationJobOutputConfiguration"] = None, + activity: Optional["_models.ActivityProtocolConfiguration"] = None, + responses: Optional["_models.ResponsesProtocolConfiguration"] = None, + a2a: Optional["_models.A2AProtocolConfiguration"] = None, + mcp: Optional["_models.McpProtocolConfiguration"] = None, + invocations: Optional["_models.InvocationsProtocolConfiguration"] = None, + invocations_ws: Optional["_models.InvocationsWsProtocolConfiguration"] = None, ) -> None: ... @overload @@ -21939,47 +21722,32 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.scenario = DataGenerationJobScenario.REINFORCEMENT_FINETUNING_PREVIEW # type: ignore -class ReinforcementFineTuningDataGenerationJobInputs( - DataGenerationJobInputs, discriminator="reinforcement_finetuning_preview" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Caller-supplied inputs for a reinforcement fine-tuning data generation job. This is a preview - feature. +class ProtocolVersionRecord(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A record mapping for a single protocol and its version. - :ivar name: The display name of the data generation job. Required. - :vartype name: str - :ivar sources: The sources used for the data generation job. Required. - :vartype sources: list[~azure.ai.projects.models.DataGenerationJobSource] - :ivar generation_configuration: The generation configuration for the data generation job. - Required. - :vartype generation_configuration: ~azure.ai.projects.models.DataGenerationJobConfiguration - :ivar scenario: The scenario of the data generation job, which is Reinforcement Fine-tuning - preview for this model. Required. Reinforcement Fine-tuning preview scenario. - :vartype scenario: str or ~azure.ai.projects.models.REINFORCEMENT_FINETUNING_PREVIEW - :ivar output_configuration: Optional file output configuration for the generated reinforcement - fine-tuning data. - :vartype output_configuration: - ~azure.ai.projects.models.ReinforcementFineTuningDataGenerationJobOutputConfiguration + :ivar protocol: The protocol type. Required. Known values are: "activity", "responses", "a2a", + "mcp", "invocations", "voice", "invocations_ws", and "voice_conversation_engine". + :vartype protocol: str or ~azure.ai.projects.models.AgentEndpointProtocol + :ivar version: The version string for the protocol, e.g. 'v0.1.1'. Required. + :vartype version: str """ - scenario: Literal[DataGenerationJobScenario.REINFORCEMENT_FINETUNING_PREVIEW] = rest_discriminator(name="scenario", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The scenario of the data generation job, which is Reinforcement Fine-tuning preview for this - model. Required. Reinforcement Fine-tuning preview scenario.""" - output_configuration: Optional["_models.ReinforcementFineTuningDataGenerationJobOutputConfiguration"] = rest_field( + protocol: Union[str, "_models.AgentEndpointProtocol"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Optional file output configuration for the generated reinforcement fine-tuning data.""" + """The protocol type. Required. Known values are: \"activity\", \"responses\", \"a2a\", \"mcp\", + \"invocations\", \"voice\", \"invocations_ws\", and \"voice_conversation_engine\".""" + version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The version string for the protocol, e.g. 'v0.1.1'. Required.""" @overload def __init__( self, *, - name: str, - sources: list["_models.DataGenerationJobSource"], - generation_configuration: "_models.DataGenerationJobConfiguration", - output_configuration: Optional["_models.ReinforcementFineTuningDataGenerationJobOutputConfiguration"] = None, + protocol: Union[str, "_models.AgentEndpointProtocol"], + version: str, ) -> None: ... @overload @@ -21991,42 +21759,30 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.scenario = DataGenerationJobScenario.REINFORCEMENT_FINETUNING_PREVIEW # type: ignore -class ReinforcementFineTuningDataGenerationJobOutputConfiguration( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """File output configuration for a reinforcement fine-tuning data generation job. This is a - preview feature. +class TelephonyTransferDestination(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A destination for a telephony transfer target. - :ivar name: Filename to assign to the generated fine-tuning file. Required. - :vartype name: str - :ivar write_mode: Controls how file outputs are written. If omitted, defaults to ``overwrite`` - and writes only the newly generated fine-tuning file content. Known values are: "overwrite" and - "merge". - :vartype write_mode: str or ~azure.ai.projects.models.DataGenerationJobOutputWriteMode - :ivar merge_file_id: File ID to merge into when ``write_mode`` is ``merge``. - :vartype merge_file_id: str + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + PSTNTelephonyTransferDestination, SipTelephonyTransferDestination, + TeamsTelephonyTransferDestination + + :ivar kind: The telephony transfer destination type. Required. Known values are: "pstn", + "teams", and "sip". + :vartype kind: str or ~azure.ai.projects.models.TelephonyTransferDestinationKind """ - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Filename to assign to the generated fine-tuning file. Required.""" - write_mode: Optional[Union[str, "_models.DataGenerationJobOutputWriteMode"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Controls how file outputs are written. If omitted, defaults to ``overwrite`` and writes only - the newly generated fine-tuning file content. Known values are: \"overwrite\" and \"merge\".""" - merge_file_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """File ID to merge into when ``write_mode`` is ``merge``.""" + __mapping__: dict[str, _Model] = {} + kind: str = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) + """The telephony transfer destination type. Required. Known values are: \"pstn\", \"teams\", and + \"sip\".""" @overload def __init__( self, *, - name: str, - write_mode: Optional[Union[str, "_models.DataGenerationJobOutputWriteMode"]] = None, - merge_file_id: Optional[str] = None, + kind: str, ) -> None: ... @overload @@ -22040,33 +21796,28 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ReminderPreviewToolboxTool( - ToolboxTool, discriminator="reminder_preview" +class PSTNTelephonyTransferDestination( + TelephonyTransferDestination, discriminator="pstn" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """A reminder tool stored in a toolbox. + """A PSTN destination for a telephony transfer target. - :ivar name: Optional user-defined name for this tool or configuration. - :vartype name: str - :ivar description: Optional user-defined description for this tool or configuration. - :vartype description: str - :ivar tool_configs: Per-tool configuration map. Keys are tool names or ``*`` (catch-all - default). Resolution order: exact tool name match takes priority over ``*``. Unknown tool names - are silently ignored at runtime. - :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] - :ivar type: Required. REMINDER_PREVIEW. - :vartype type: str or ~azure.ai.projects.models.REMINDER_PREVIEW + :ivar kind: The PSTN destination type. Required. A public switched telephone network + destination. + :vartype kind: str or ~azure.ai.projects.models.PSTN + :ivar value: The E.164 phone number to call. Required. + :vartype value: str """ - type: Literal[ToolboxToolType.REMINDER_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. REMINDER_PREVIEW.""" + kind: Literal[TelephonyTransferDestinationKind.PSTN] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The PSTN destination type. Required. A public switched telephone network destination.""" + value: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The E.164 phone number to call. Required.""" @overload def __init__( self, *, - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + value: str, ) -> None: ... @overload @@ -22078,33 +21829,71 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolboxToolType.REMINDER_PREVIEW # type: ignore + self.kind = TelephonyTransferDestinationKind.PSTN # type: ignore -class ResponsesProtocolConfiguration(_Model): - """Configuration specific to the responses protocol.""" +class QuestionParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A question about the request's input, with an optional correlation name. + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + QuestionParamChoice, QuestionParamPredicate, QuestionParamScore -class ResponseUsageInputTokensDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """ResponseUsageInputTokensDetails. + :ivar type: Required. Known values are: "predicate", "choice", and "score". + :vartype type: str or ~azure.ai.projects.models.QuestionParamType + """ - :ivar cached_tokens: Required. - :vartype cached_tokens: int - :ivar cache_write_tokens: Required. - :vartype cache_write_tokens: int + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"predicate\", \"choice\", and \"score\".""" + + @overload + def __init__( + self, + *, + type: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class QuestionParamChoice( + QuestionParam, discriminator="choice" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Choose from the supplied options based on the input. + + :ivar type: The type of the object. Always ``choice``. Required. CHOICE. + :vartype type: str or ~azure.ai.projects.models.CHOICE + :ivar name: + :vartype name: str + :ivar instructions: Required. + :vartype instructions: str + :ivar choices: Provide between 2 and 255 choices. Each choice must be unique. Required. + :vartype choices: list[~azure.ai.projects.models.ChoiceOptionParam] """ - cached_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - cache_write_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[QuestionParamType.CHOICE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the object. Always ``choice``. Required. CHOICE.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + instructions: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Required.""" + choices: list["_models.ChoiceOptionParam"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Provide between 2 and 255 choices. Each choice must be unique. Required.""" @overload def __init__( self, *, - cached_tokens: int, - cache_write_tokens: int, + instructions: str, + choices: list["_models.ChoiceOptionParam"], + name: Optional[str] = None, ) -> None: ... @overload @@ -22116,23 +21905,34 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = QuestionParamType.CHOICE # type: ignore -class ResponseUsageOutputTokensDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """ResponseUsageOutputTokensDetails. +class QuestionParamPredicate( + QuestionParam, discriminator="predicate" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Estimate how likely it is that a statement about the input is true. - :ivar reasoning_tokens: Required. - :vartype reasoning_tokens: int + :ivar type: The type of the object. Always ``predicate``. Required. PREDICATE. + :vartype type: str or ~azure.ai.projects.models.PREDICATE + :ivar name: + :vartype name: str + :ivar instructions: Required. + :vartype instructions: str """ - reasoning_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[QuestionParamType.PREDICATE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the object. Always ``predicate``. Required. PREDICATE.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + instructions: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Required.""" @overload def __init__( self, *, - reasoning_tokens: int, + instructions: str, + name: Optional[str] = None, ) -> None: ... @overload @@ -22144,59 +21944,39 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = QuestionParamType.PREDICATE # type: ignore -class Routine(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A routine definition returned by the service. +class QuestionParamScore( + QuestionParam, discriminator="score" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Rate the input against the supplied ordered levels. - :ivar name: The routine name. + :ivar type: The type of the object. Always ``score``. Required. SCORE. + :vartype type: str or ~azure.ai.projects.models.SCORE + :ivar name: :vartype name: str - :ivar description: A human-readable description of the routine. - :vartype description: str - :ivar enabled: Whether the routine is enabled. Required. - :vartype enabled: bool - :ivar triggers: The triggers configured for the routine. - :vartype triggers: dict[str, ~azure.ai.projects.models.RoutineTrigger] - :ivar action: The action executed when the routine fires. - :vartype action: ~azure.ai.projects.models.RoutineAction - :ivar created_at: The time when the routine was created. - :vartype created_at: ~datetime.datetime - :ivar updated_at: The time when the routine was last updated. - :vartype updated_at: ~datetime.datetime + :ivar instructions: Required. + :vartype instructions: str + :ivar levels: Required. + :vartype levels: list[~azure.ai.projects.models.ScoreLevelParam] """ + type: Literal[QuestionParamType.SCORE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the object. Always ``score``. Required. SCORE.""" name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The routine name.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A human-readable description of the routine.""" - enabled: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether the routine is enabled. Required.""" - triggers: Optional[dict[str, "_models.RoutineTrigger"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The triggers configured for the routine.""" - action: Optional["_models.RoutineAction"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The action executed when the routine fires.""" - created_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The time when the routine was created.""" - updated_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The time when the routine was last updated.""" + instructions: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + levels: list["_models.ScoreLevelParam"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - enabled: bool, + instructions: str, + levels: list["_models.ScoreLevelParam"], name: Optional[str] = None, - description: Optional[str] = None, - triggers: Optional[dict[str, "_models.RoutineTrigger"]] = None, - action: Optional["_models.RoutineAction"] = None, - created_at: Optional[datetime.datetime] = None, - updated_at: Optional[datetime.datetime] = None, ) -> None: ... @overload @@ -22208,29 +21988,37 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = QuestionParamType.SCORE # type: ignore -class RoutineAuthorization(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Optional authorization configuration for a routine dispatch. +class RaiConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Configuration for Responsible AI (RAI) content filtering and safety features. - :ivar identity: The identity used when dispatching the routine. Defaults to agent when omitted; - set to creator only when the customer opts in to creator identity dispatch. Known values are: - "agent" and "creator". - :vartype identity: str or ~azure.ai.projects.models.RoutineDispatchIdentity + :ivar rai_policy_name: The name of the RAI policy to apply. Required. + :vartype rai_policy_name: str + :ivar invocations_moderation: Author-declared configuration telling the platform where + user/agent text lives in the agent-defined invocations request/response bodies, so + content-safety guardrails can extract and moderate it. Optional; a rai_config without it leaves + the invocations path without content-safety moderation. + :vartype invocations_moderation: ~azure.ai.projects.models.RaiInvocationModeration """ - identity: Optional[Union[str, "_models.RoutineDispatchIdentity"]] = rest_field( + rai_policy_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the RAI policy to apply. Required.""" + invocations_moderation: Optional["_models.RaiInvocationModeration"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The identity used when dispatching the routine. Defaults to agent when omitted; set to creator - only when the customer opts in to creator identity dispatch. Known values are: \"agent\" and - \"creator\".""" + """Author-declared configuration telling the platform where user/agent text lives in the + agent-defined invocations request/response bodies, so content-safety guardrails can extract and + moderate it. Optional; a rai_config without it leaves the invocations path without + content-safety moderation.""" @overload def __init__( self, *, - identity: Optional[Union[str, "_models.RoutineDispatchIdentity"]] = None, + rai_policy_name: str, + invocations_moderation: Optional["_models.RaiInvocationModeration"] = None, ) -> None: ... @overload @@ -22244,162 +22032,65 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RoutineRun(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A single routine run returned from the run history API. +class RaiInvocationModeration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Declares where request/response text lives so content-safety guardrails can extract it. - :ivar id: The unique run identifier for the routine attempt. Required. - :vartype id: str - :ivar status: The run status. Is one of the following types: str - :vartype status: str - :ivar phase: The AgentExtensions lifecycle phase for the routine attempt. Known values are: - "queued", "dispatching", "completed", and "failed". - :vartype phase: str or ~azure.ai.projects.models.RoutineRunPhase - :ivar trigger_type: The trigger type that produced the routine attempt. Known values are: - "custom", "github_issue", "schedule", and "timer". - :vartype trigger_type: str or ~azure.ai.projects.models.RoutineTriggerType - :ivar trigger_name: The configured trigger name that produced the routine attempt. - :vartype trigger_name: str - :ivar trigger_event_payload: The event payload captured from the event that triggered the - routine attempt, when available. - :vartype trigger_event_payload: dict[str, any] - :ivar attempt_source: The source path that created the routine attempt. Known values are: - "event_fire", "manual_dispatch", "queued_dispatch", "schedule_delivery", and "timer_delivery". - :vartype attempt_source: str or ~azure.ai.projects.models.RoutineAttemptSource - :ivar action_type: The action type dispatched for the routine attempt. Known values are: - "invoke_agent_responses_api" and "invoke_agent_invocations_api". - :vartype action_type: str or ~azure.ai.projects.models.RoutineActionType - :ivar agent_id: The project-scoped agent identifier recorded for the routine attempt. - :vartype agent_id: str - :ivar agent_endpoint_id: The legacy endpoint-scoped agent identifier recorded for the routine - attempt. - :vartype agent_endpoint_id: str - :ivar conversation_id: The conversation identifier used by a responses API dispatch. - :vartype conversation_id: str - :ivar session_id: The hosted-agent session identifier used by an invocations API dispatch. - :vartype session_id: str - :ivar triggered_at: The logical trigger time recorded for the routine attempt. - :vartype triggered_at: ~datetime.datetime - :ivar scheduled_fire_at: The scheduled fire time recorded for timer and schedule deliveries. - :vartype scheduled_fire_at: ~datetime.datetime - :ivar started_at: The time when the underlying run started. - :vartype started_at: ~datetime.datetime - :ivar ended_at: The time when the underlying run reached a terminal state. - :vartype ended_at: ~datetime.datetime - :ivar dispatch_id: The dispatch identifier associated with the routine attempt. - :vartype dispatch_id: str - :ivar action_correlation_id: The downstream action correlation identifier, when available. - :vartype action_correlation_id: str - :ivar response_id: The downstream response or invocation identifier, when available. - :vartype response_id: str - :ivar task_id: The workspace task identifier linked to the routine attempt, when available. - :vartype task_id: str - :ivar error_status_code: The downstream error status code captured for a failed attempt, when - available. - :vartype error_status_code: int - :ivar error_type: The fully qualified error type captured for a failed attempt, when available. - :vartype error_type: str - :ivar error_message: The truncated failure message captured for a failed attempt, when - available. - :vartype error_message: str + :ivar input_content_type: How the REQUEST body is parsed. When omitted, the service defaults to + ``json``. Known values are: "json" and "text". + :vartype input_content_type: str or ~azure.ai.projects.models.RaiInvocationContentType + :ivar output_content_type: How the RESPONSE body is parsed. When omitted, the service defaults + to ``json``. Known values are: "json" and "text". + :vartype output_content_type: str or ~azure.ai.projects.models.RaiInvocationContentType + :ivar response_mode: Author-declared response shape; drives which output gate runs and which + fields are required. Required. Known values are: "non_streaming", "streaming", and "both". + :vartype response_mode: str or ~azure.ai.projects.models.RaiInvocationMode + :ivar input_paths: Path(s) to user text in the REQUEST body. Required when input_content_type + is ``json``. + :vartype input_paths: list[str] + :ivar output_paths: Path(s) to agent text in a NON-STREAMING response body. Required when + response_mode is non_streaming/both and output_content_type is ``json``. + :vartype output_paths: list[str] + :ivar stream_selectors: One SSE event->field selector per event type carrying text. Required + when response_mode is streaming/both and output_content_type is ``json``. + :vartype stream_selectors: list[~azure.ai.projects.models.RaiSseTextSelector] """ - id: str = rest_field(visibility=["read"]) - """The unique run identifier for the routine attempt. Required.""" - status: Optional["_unions.RoutineRunStatus"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The run status. Is one of the following types: str""" - phase: Optional[Union[str, "_models.RoutineRunPhase"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The AgentExtensions lifecycle phase for the routine attempt. Known values are: \"queued\", - \"dispatching\", \"completed\", and \"failed\".""" - trigger_type: Optional[Union[str, "_models.RoutineTriggerType"]] = rest_field( + input_content_type: Optional[Union[str, "_models.RaiInvocationContentType"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The trigger type that produced the routine attempt. Known values are: \"custom\", - \"github_issue\", \"schedule\", and \"timer\".""" - trigger_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The configured trigger name that produced the routine attempt.""" - trigger_event_payload: Optional[dict[str, Any]] = rest_field( + """How the REQUEST body is parsed. When omitted, the service defaults to ``json``. Known values + are: \"json\" and \"text\".""" + output_content_type: Optional[Union[str, "_models.RaiInvocationContentType"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The event payload captured from the event that triggered the routine attempt, when available.""" - attempt_source: Optional[Union[str, "_models.RoutineAttemptSource"]] = rest_field( + """How the RESPONSE body is parsed. When omitted, the service defaults to ``json``. Known values + are: \"json\" and \"text\".""" + response_mode: Union[str, "_models.RaiInvocationMode"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The source path that created the routine attempt. Known values are: \"event_fire\", - \"manual_dispatch\", \"queued_dispatch\", \"schedule_delivery\", and \"timer_delivery\".""" - action_type: Optional[Union[str, "_models.RoutineActionType"]] = rest_field( + """Author-declared response shape; drives which output gate runs and which fields are required. + Required. Known values are: \"non_streaming\", \"streaming\", and \"both\".""" + input_paths: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Path(s) to user text in the REQUEST body. Required when input_content_type is ``json``.""" + output_paths: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Path(s) to agent text in a NON-STREAMING response body. Required when response_mode is + non_streaming/both and output_content_type is ``json``.""" + stream_selectors: Optional[list["_models.RaiSseTextSelector"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The action type dispatched for the routine attempt. Known values are: - \"invoke_agent_responses_api\" and \"invoke_agent_invocations_api\".""" - agent_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The project-scoped agent identifier recorded for the routine attempt.""" - agent_endpoint_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The legacy endpoint-scoped agent identifier recorded for the routine attempt.""" - conversation_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The conversation identifier used by a responses API dispatch.""" - session_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The hosted-agent session identifier used by an invocations API dispatch.""" - triggered_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The logical trigger time recorded for the routine attempt.""" - scheduled_fire_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The scheduled fire time recorded for timer and schedule deliveries.""" - started_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The time when the underlying run started.""" - ended_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The time when the underlying run reached a terminal state.""" - dispatch_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The dispatch identifier associated with the routine attempt.""" - action_correlation_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The downstream action correlation identifier, when available.""" - response_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The downstream response or invocation identifier, when available.""" - task_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The workspace task identifier linked to the routine attempt, when available.""" - error_status_code: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The downstream error status code captured for a failed attempt, when available.""" - error_type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The fully qualified error type captured for a failed attempt, when available.""" - error_message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The truncated failure message captured for a failed attempt, when available.""" + """One SSE event->field selector per event type carrying text. Required when response_mode is + streaming/both and output_content_type is ``json``.""" @overload def __init__( self, *, - status: Optional["_unions.RoutineRunStatus"] = None, - phase: Optional[Union[str, "_models.RoutineRunPhase"]] = None, - trigger_type: Optional[Union[str, "_models.RoutineTriggerType"]] = None, - trigger_name: Optional[str] = None, - trigger_event_payload: Optional[dict[str, Any]] = None, - attempt_source: Optional[Union[str, "_models.RoutineAttemptSource"]] = None, - action_type: Optional[Union[str, "_models.RoutineActionType"]] = None, - agent_id: Optional[str] = None, - agent_endpoint_id: Optional[str] = None, - conversation_id: Optional[str] = None, - session_id: Optional[str] = None, - triggered_at: Optional[datetime.datetime] = None, - scheduled_fire_at: Optional[datetime.datetime] = None, - started_at: Optional[datetime.datetime] = None, - ended_at: Optional[datetime.datetime] = None, - dispatch_id: Optional[str] = None, - action_correlation_id: Optional[str] = None, - response_id: Optional[str] = None, - task_id: Optional[str] = None, - error_status_code: Optional[int] = None, - error_type: Optional[str] = None, - error_message: Optional[str] = None, + response_mode: Union[str, "_models.RaiInvocationMode"], + input_content_type: Optional[Union[str, "_models.RaiInvocationContentType"]] = None, + output_content_type: Optional[Union[str, "_models.RaiInvocationContentType"]] = None, + input_paths: Optional[list[str]] = None, + output_paths: Optional[list[str]] = None, + stream_selectors: Optional[list["_models.RaiSseTextSelector"]] = None, ) -> None: ... @overload @@ -22413,61 +22104,28 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RubricBasedEvaluatorDefinition( - EvaluatorDefinition, discriminator="rubric" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Rubric-based evaluator definition — stores dimensions produced by the generate API. Used for - both quality and safety evaluators. +class RaiSseTextSelector(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """An SSE event-type to text-field selector for streaming invocation output. - :ivar init_parameters: The JSON schema (Draft 2020-12) for the evaluator's input parameters. - This includes parameters like type, properties, required. - :vartype init_parameters: dict[str, any] - :ivar data_schema: The JSON schema (Draft 2020-12) for the evaluator's input data. This - includes parameters like type, properties, required. - :vartype data_schema: dict[str, any] - :ivar metrics: List of output metrics produced by this evaluator. - :vartype metrics: dict[str, ~azure.ai.projects.models.EvaluatorMetric] - :ivar type: Required. Rubric-based evaluator definition. Stores dimensions (the scoring - blueprint) for both quality and safety evaluators. Can be created via the generate API or - manually via createVersion. - :vartype type: str or ~azure.ai.projects.models.RUBRIC - :ivar dimensions: The set of dimensions — the scoring blueprint used by the LLM judge. Quality - evaluators include a non-editable residual dimension with id 'general_quality' - (always_applicable: true); safety evaluators include 'general_policy_compliance'. Both use the - same Dimension structure. Required. - :vartype dimensions: list[~azure.ai.projects.models.Dimension] - :ivar pass_threshold: Pass/fail threshold for the aggregate rubric score, on the same - normalized 0.0-1.0 scale as the emitted ``score``. When the runtime weighted average meets or - exceeds this value, the result is ``pass``. Defaults to 0.5 (equivalent to a raw 1-5 weighted - average of 3.0). The 'any dimension scored 1 → fail' rule still applies regardless of this - threshold. - :vartype pass_threshold: float + :ivar event_type: The SSE event ``type`` value that carries text. Required. + :vartype event_type: str + :ivar text_field: The field on a matched event holding the text delta. When omitted, the + service defaults to ``delta``. + :vartype text_field: str """ - type: Literal[EvaluatorDefinitionType.RUBRIC] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Rubric-based evaluator definition. Stores dimensions (the scoring blueprint) for both - quality and safety evaluators. Can be created via the generate API or manually via - createVersion.""" - dimensions: list["_models.Dimension"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The set of dimensions — the scoring blueprint used by the LLM judge. Quality evaluators include - a non-editable residual dimension with id 'general_quality' (always_applicable: true); safety - evaluators include 'general_policy_compliance'. Both use the same Dimension structure. - Required.""" - pass_threshold: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Pass/fail threshold for the aggregate rubric score, on the same normalized 0.0-1.0 scale as the - emitted ``score``. When the runtime weighted average meets or exceeds this value, the result is - ``pass``. Defaults to 0.5 (equivalent to a raw 1-5 weighted average of 3.0). The 'any dimension - scored 1 → fail' rule still applies regardless of this threshold.""" + event_type: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The SSE event ``type`` value that carries text. Required.""" + text_field: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The field on a matched event holding the text delta. When omitted, the service defaults to + ``delta``.""" @overload def __init__( self, *, - dimensions: list["_models.Dimension"], - init_parameters: Optional[dict[str, Any]] = None, - data_schema: Optional[dict[str, Any]] = None, - metrics: Optional[dict[str, "_models.EvaluatorMetric"]] = None, - pass_threshold: Optional[float] = None, + event_type: str, + text_field: Optional[str] = None, ) -> None: ... @overload @@ -22479,66 +22137,43 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = EvaluatorDefinitionType.RUBRIC # type: ignore -class RubricGenerationInputQualityWarning(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A non-fatal advisory produced during rubric evaluator generation when resolved inputs are - technically valid but likely too weak to produce a high-quality rubric. Read-only; - service-generated. Persisted with the terminal EvaluatorGenerationJob. +class RankingOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """RankingOptions. - :ivar code: Stable searchable machine-readable warning code. Required. Known values are: - "empty_prompt", "short_prompt", "empty_agent_instructions", "short_agent_instructions", - "empty_dataset_content", "short_dataset_content", "low_trace_count", and - "insufficient_total_input". - :vartype code: str or ~azure.ai.projects.models.RubricGenerationInputQualityWarningCode - :ivar severity: Advisory severity. Initial values: ``warning``. Required. "warning" - :vartype severity: str or ~azure.ai.projects.models.RubricGenerationInputQualityWarningSeverity - :ivar message: Human-readable message suitable for direct SDK/CLI/UI display. Must not include - raw prompt, instruction, dataset, or trace text. Required. - :vartype message: str - :ivar source: Which source category the warning applies to. ``aggregate`` is used only for - cross-source warnings. Required. Known values are: "prompt", "agent", "dataset", and - "aggregate". - :vartype source: str or ~azure.ai.projects.models.RubricGenerationInputQualityWarningSource - :ivar source_index: Zero-based index into ``EvaluatorGenerationJob.sources`` when the warning - applies to a specific source. Omitted for aggregate warnings and for warnings not tied to one - source. - :vartype source_index: int + :ivar ranker: The ranker to use for the file search. Known values are: "auto" and + "default-2024-11-15". + :vartype ranker: str or ~azure.ai.projects.models.RankerVersionType + :ivar score_threshold: The score threshold for the file search, a number between 0 and 1. + Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer + results. + :vartype score_threshold: float + :ivar hybrid_search: Weights that control how reciprocal rank fusion balances semantic + embedding matches versus sparse keyword matches when hybrid search is enabled. + :vartype hybrid_search: ~azure.ai.projects.models.HybridSearchOptions """ - code: Union[str, "_models.RubricGenerationInputQualityWarningCode"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Stable searchable machine-readable warning code. Required. Known values are: \"empty_prompt\", - \"short_prompt\", \"empty_agent_instructions\", \"short_agent_instructions\", - \"empty_dataset_content\", \"short_dataset_content\", \"low_trace_count\", and - \"insufficient_total_input\".""" - severity: Union[str, "_models.RubricGenerationInputQualityWarningSeverity"] = rest_field( + ranker: Optional[Union[str, "_models.RankerVersionType"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Advisory severity. Initial values: ``warning``. Required. \"warning\"""" - message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Human-readable message suitable for direct SDK/CLI/UI display. Must not include raw prompt, - instruction, dataset, or trace text. Required.""" - source: Union[str, "_models.RubricGenerationInputQualityWarningSource"] = rest_field( + """The ranker to use for the file search. Known values are: \"auto\" and \"default-2024-11-15\".""" + score_threshold: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will + attempt to return only the most relevant results, but may return fewer results.""" + hybrid_search: Optional["_models.HybridSearchOptions"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Which source category the warning applies to. ``aggregate`` is used only for cross-source - warnings. Required. Known values are: \"prompt\", \"agent\", \"dataset\", and \"aggregate\".""" - source_index: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Zero-based index into ``EvaluatorGenerationJob.sources`` when the warning applies to a specific - source. Omitted for aggregate warnings and for warnings not tied to one source.""" + """Weights that control how reciprocal rank fusion balances semantic embedding matches versus + sparse keyword matches when hybrid search is enabled.""" @overload def __init__( self, *, - code: Union[str, "_models.RubricGenerationInputQualityWarningCode"], - severity: Union[str, "_models.RubricGenerationInputQualityWarningSeverity"], - message: str, - source: Union[str, "_models.RubricGenerationInputQualityWarningSource"], - source_index: Optional[int] = None, + ranker: Optional[Union[str, "_models.RankerVersionType"]] = None, + score_threshold: Optional[float] = None, + hybrid_search: Optional["_models.HybridSearchOptions"] = None, ) -> None: ... @overload @@ -22552,23 +22187,25 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SASCredentials(BaseCredentials, discriminator="SAS"): - """Shared Access Signature (SAS) credential definition. +class RealtimeAudioFormats(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """RealtimeAudioFormats. - :ivar type: The credential type. Required. Shared Access Signature (SAS) credential. - :vartype type: str or ~azure.ai.projects.models.SAS - :ivar sas_token: SAS token. - :vartype sas_token: str + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + RealtimeAudioFormatsAudioPcm, RealtimeAudioFormatsAudioPcma, RealtimeAudioFormatsAudioPcmu + + :ivar type: Required. Known values are: "audio/pcm", "audio/pcmu", and "audio/pcma". + :vartype type: str or ~azure.ai.projects.models.RealtimeAudioFormatsType """ - type: Literal[CredentialType.SAS] = rest_discriminator(name="type", visibility=["read"]) # type: ignore - """The credential type. Required. Shared Access Signature (SAS) credential.""" - sas_token: Optional[str] = rest_field(name="SAS", visibility=["read"]) - """SAS token.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"audio/pcm\", \"audio/pcmu\", and \"audio/pcma\".""" @overload def __init__( self, + *, + type: str, ) -> None: ... @overload @@ -22580,74 +22217,29 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = CredentialType.SAS # type: ignore -class Schedule(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Schedule model. +class RealtimeAudioFormatsAudioPcm( + RealtimeAudioFormats, discriminator="audio/pcm" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """RealtimeAudioFormatsAudioPcm. - :ivar schedule_id: Identifier of the schedule. Required. - :vartype schedule_id: str - :ivar display_name: Name of the schedule. - :vartype display_name: str - :ivar description: Description of the schedule. - :vartype description: str - :ivar enabled: Enabled status of the schedule. Required. - :vartype enabled: bool - :ivar provisioning_status: Provisioning status of the schedule. Known values are: "Creating", - "Updating", "Deleting", "Succeeded", and "Failed". - :vartype provisioning_status: str or ~azure.ai.projects.models.ScheduleProvisioningStatus - :ivar trigger: Trigger for the schedule. Required. - :vartype trigger: ~azure.ai.projects.models.Trigger - :ivar task: Task for the schedule. Required. - :vartype task: ~azure.ai.projects.models.ScheduleTask - :ivar tags: Schedule's tags. Unlike properties, tags are fully mutable. - :vartype tags: dict[str, str] - :ivar properties: Schedule's properties. Unlike tags, properties are add-only. Once added, a - property cannot be removed. - :vartype properties: dict[str, str] - :ivar system_data: System metadata for the resource. Required. - :vartype system_data: dict[str, str] + :ivar type: Required. AUDIO_PCM. + :vartype type: str or ~azure.ai.projects.models.AUDIO_PCM + :ivar rate: Default value is 24000. + :vartype rate: int """ - schedule_id: str = rest_field(name="id", visibility=["read"]) - """Identifier of the schedule. Required.""" - display_name: Optional[str] = rest_field( - name="displayName", visibility=["read", "create", "update", "delete", "query"] - ) - """Name of the schedule.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Description of the schedule.""" - enabled: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Enabled status of the schedule. Required.""" - provisioning_status: Optional[Union[str, "_models.ScheduleProvisioningStatus"]] = rest_field( - name="provisioningStatus", visibility=["read"] - ) - """Provisioning status of the schedule. Known values are: \"Creating\", \"Updating\", - \"Deleting\", \"Succeeded\", and \"Failed\".""" - trigger: "_models.Trigger" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Trigger for the schedule. Required.""" - task: "_models.ScheduleTask" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Task for the schedule. Required.""" - tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Schedule's tags. Unlike properties, tags are fully mutable.""" - properties: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Schedule's properties. Unlike tags, properties are add-only. Once added, a property cannot be - removed.""" - system_data: dict[str, str] = rest_field(name="systemData", visibility=["read"]) - """System metadata for the resource. Required.""" + type: Literal[RealtimeAudioFormatsType.AUDIO_PCM] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. AUDIO_PCM.""" + rate: Optional[Literal[24000]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Default value is 24000.""" @overload def __init__( self, *, - enabled: bool, - trigger: "_models.Trigger", - task: "_models.ScheduleTask", - display_name: Optional[str] = None, - description: Optional[str] = None, - tags: Optional[dict[str, str]] = None, - properties: Optional[dict[str, str]] = None, + rate: Optional[Literal[24000]] = None, ) -> None: ... @overload @@ -22659,36 +22251,22 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RealtimeAudioFormatsType.AUDIO_PCM # type: ignore -class ScheduleRoutineTrigger( - RoutineTrigger, discriminator="schedule" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A recurring cron-based routine trigger. +class RealtimeAudioFormatsAudioPcma(RealtimeAudioFormats, discriminator="audio/pcma"): + """RealtimeAudioFormatsAudioPcma. - :ivar type: The trigger type. Required. A recurring cron-based trigger. - :vartype type: str or ~azure.ai.projects.models.SCHEDULE - :ivar cron_expression: A 5-field cron expression. The service enforces a minimum interval of - five minutes by default. Required. - :vartype cron_expression: str - :ivar time_zone: An IANA or Windows time zone identifier for the schedule. Required. - :vartype time_zone: str + :ivar type: Required. AUDIO_PCMA. + :vartype type: str or ~azure.ai.projects.models.AUDIO_PCMA """ - type: Literal[RoutineTriggerType.SCHEDULE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The trigger type. Required. A recurring cron-based trigger.""" - cron_expression: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A 5-field cron expression. The service enforces a minimum interval of five minutes by default. - Required.""" - time_zone: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """An IANA or Windows time zone identifier for the schedule. Required.""" + type: Literal[RealtimeAudioFormatsType.AUDIO_PCMA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. AUDIO_PCMA.""" @overload def __init__( self, - *, - cron_expression: str, - time_zone: str, ) -> None: ... @overload @@ -22700,47 +22278,22 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RoutineTriggerType.SCHEDULE # type: ignore + self.type = RealtimeAudioFormatsType.AUDIO_PCMA # type: ignore -class ScheduleRun(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Schedule run model. +class RealtimeAudioFormatsAudioPcmu(RealtimeAudioFormats, discriminator="audio/pcmu"): + """RealtimeAudioFormatsAudioPcmu. - :ivar run_id: Identifier of the schedule run. Required. - :vartype run_id: str - :ivar schedule_id: Identifier of the schedule. Required. - :vartype schedule_id: str - :ivar success: Trigger success status of the schedule run. Required. - :vartype success: bool - :ivar trigger_time: Trigger time of the schedule run. - :vartype trigger_time: ~datetime.datetime - :ivar error: Error information for the schedule run. - :vartype error: str - :ivar properties: Properties of the schedule run. Required. - :vartype properties: dict[str, str] + :ivar type: Required. AUDIO_PCMU. + :vartype type: str or ~azure.ai.projects.models.AUDIO_PCMU """ - run_id: str = rest_field(name="id", visibility=["read"]) - """Identifier of the schedule run. Required.""" - schedule_id: str = rest_field(name="scheduleId", visibility=["read", "create", "update", "delete", "query"]) - """Identifier of the schedule. Required.""" - success: bool = rest_field(visibility=["read"]) - """Trigger success status of the schedule run. Required.""" - trigger_time: Optional[datetime.datetime] = rest_field( - name="triggerTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" - ) - """Trigger time of the schedule run.""" - error: Optional[str] = rest_field(visibility=["read"]) - """Error information for the schedule run.""" - properties: dict[str, str] = rest_field(visibility=["read"]) - """Properties of the schedule run. Required.""" + type: Literal[RealtimeAudioFormatsType.AUDIO_PCMU] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. AUDIO_PCMU.""" @overload def __init__( self, - *, - schedule_id: str, - trigger_time: Optional[datetime.datetime] = None, ) -> None: ... @overload @@ -22752,28 +22305,41 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RealtimeAudioFormatsType.AUDIO_PCMU # type: ignore -class SessionConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Session defaults applied to sessions created for a hosted agent version. +class RealtimeClientEvent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A realtime client event. - :ivar idle_timeout_seconds: The idle duration, in seconds, before a session's sandbox is - suspended. When omitted, the server defaults to 900 seconds. Must be between 120 and 14400 - seconds (4 hours). - :vartype idle_timeout_seconds: ~datetime.timedelta + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + RealtimeClientEventConversationItemCreate, RealtimeClientEventConversationItemDelete, + RealtimeClientEventConversationItemRetrieve, RealtimeClientEventConversationItemTruncate, + RealtimeClientEventInputAudioBufferAppend, RealtimeClientEventInputAudioBufferClear, + RealtimeClientEventInputAudioBufferCommit, RealtimeClientEventOutputAudioBufferClear, + RealtimeClientEventResponseCancel, RealtimeClientEventResponseCreate, + VoiceAgentClientEventRtcCallSdpCreate, VoiceAgentClientEventSessionAvatarConnect + + :ivar type: Required. Known values are: "conversation.item.create", "conversation.item.delete", + "conversation.item.retrieve", "conversation.item.truncate", "input_audio_buffer.append", + "input_audio_buffer.clear", "output_audio_buffer.clear", "input_audio_buffer.commit", + "response.cancel", "response.create", "session.update", "session.avatar.connect", and + "rtc.call.sdp.create". + :vartype type: str or ~azure.ai.projects.models.RealtimeClientEventType """ - idle_timeout_seconds: Optional[datetime.timedelta] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="duration-seconds-int" - ) - """The idle duration, in seconds, before a session's sandbox is suspended. When omitted, the - server defaults to 900 seconds. Must be between 120 and 14400 seconds (4 hours).""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"conversation.item.create\", \"conversation.item.delete\", + \"conversation.item.retrieve\", \"conversation.item.truncate\", \"input_audio_buffer.append\", + \"input_audio_buffer.clear\", \"output_audio_buffer.clear\", \"input_audio_buffer.commit\", + \"response.cancel\", \"response.create\", \"session.update\", \"session.avatar.connect\", and + \"rtc.call.sdp.create\".""" @overload def __init__( self, *, - idle_timeout_seconds: Optional[datetime.timedelta] = None, + type: str, ) -> None: ... @overload @@ -22787,38 +22353,51 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SessionDirectoryEntry(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A single entry in a directory listing. +class RealtimeClientEventConversationItemCreate( + RealtimeClientEvent, discriminator="conversation.item.create" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Add a new Item to the Conversation's context, including messages, function calls, and function + call responses. This event can be used both to populate a "history" of the conversation and to + add new items mid-stream, but has the current limitation that it cannot populate assistant + audio messages. If successful, the server will emit a ``conversation.item.added`` event and, + when the item is finalized, a ``conversation.item.done`` event. Otherwise, an ``error`` event + will be sent. - :ivar name: The name of the file or directory. Required. - :vartype name: str - :ivar size: The size in bytes (0 for directories). Required. - :vartype size: int - :ivar is_directory: Whether this entry is a directory. Required. - :vartype is_directory: bool - :ivar modified_time: The Unix timestamp (in seconds) when the file was last modified. Required. - :vartype modified_time: ~datetime.datetime + :ivar event_id: Optional client-generated ID used to identify this event. + :vartype event_id: str + :ivar type: The event type, must be ``conversation.item.create``. Required. + CONVERSATION_ITEM_CREATE. + :vartype type: str or ~azure.ai.projects.models.CONVERSATION_ITEM_CREATE + :ivar previous_item_id: The ID of the preceding item after which the new item will be inserted. + If not set, the new item will be appended to the end of the conversation. If set to ``root``, + the new item will be added to the beginning of the conversation. If set to an existing ID, it + allows an item to be inserted mid-conversation. If the ID cannot be found, an error will be + returned and the item will not be added. + :vartype previous_item_id: str + :ivar item: Required. + :vartype item: ~azure.ai.projects.models.RealtimeConversationItem """ - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the file or directory. Required.""" - size: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The size in bytes (0 for directories). Required.""" - is_directory: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether this entry is a directory. Required.""" - modified_time: datetime.datetime = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp (in seconds) when the file was last modified. Required.""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional client-generated ID used to identify this event.""" + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_CREATE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``conversation.item.create``. Required. CONVERSATION_ITEM_CREATE.""" + previous_item_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the preceding item after which the new item will be inserted. If not set, the new + item will be appended to the end of the conversation. If set to ``root``, the new item will be + added to the beginning of the conversation. If set to an existing ID, it allows an item to be + inserted mid-conversation. If the ID cannot be found, an error will be returned and the item + will not be added.""" + item: "_models.RealtimeConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - name: str, - size: int, - is_directory: bool, - modified_time: datetime.datetime, + item: "_models.RealtimeConversationItem", + event_id: Optional[str] = None, + previous_item_id: Optional[str] = None, ) -> None: ... @overload @@ -22830,29 +22409,38 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RealtimeClientEventType.CONVERSATION_ITEM_CREATE # type: ignore -class SessionFileWriteResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Response from uploading a file to a session sandbox. +class RealtimeClientEventConversationItemDelete( + RealtimeClientEvent, discriminator="conversation.item.delete" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Send this event when you want to remove any item from the conversation history. The server will + respond with a ``conversation.item.deleted`` event, unless the item does not exist in the + conversation history, in which case the server will respond with an error. - :ivar path: The path where the file was written, relative to the session home directory. - Required. - :vartype path: str - :ivar bytes_written: Number of bytes written. Required. - :vartype bytes_written: int + :ivar event_id: Optional client-generated ID used to identify this event. + :vartype event_id: str + :ivar type: The event type, must be ``conversation.item.delete``. Required. + CONVERSATION_ITEM_DELETE. + :vartype type: str or ~azure.ai.projects.models.CONVERSATION_ITEM_DELETE + :ivar item_id: The ID of the item to delete. Required. + :vartype item_id: str """ - path: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The path where the file was written, relative to the session home directory. Required.""" - bytes_written: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Number of bytes written. Required.""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional client-generated ID used to identify this event.""" + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_DELETE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``conversation.item.delete``. Required. CONVERSATION_ITEM_DELETE.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the item to delete. Required.""" @overload def __init__( self, *, - path: str, - bytes_written: int, + item_id: str, + event_id: Optional[str] = None, ) -> None: ... @overload @@ -22864,53 +22452,40 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RealtimeClientEventType.CONVERSATION_ITEM_DELETE # type: ignore -class SessionLogEvent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A single Server-Sent Event frame emitted by the hosted agent session log stream. +class RealtimeClientEventConversationItemRetrieve( + RealtimeClientEvent, discriminator="conversation.item.retrieve" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Send this event when you want to retrieve the server's representation of a specific item in the + conversation history. This is useful, for example, to inspect user audio after noise + cancellation and VAD. The server will respond with a ``conversation.item.retrieved`` event, + unless the item does not exist in the conversation history, in which case the server will + respond with an error. - Each frame contains an ``event`` field identifying the event type and a ``data`` - field carrying the payload as plain text. Although the current ``data`` payload - is JSON-formatted, its schema is not contractual — additional keys may appear - and the format may change over time. Clients should treat ``data`` as an - opaque string and optionally attempt JSON parsing. - - New event types may be added in the future. Clients should gracefully - ignore unrecognized event types. - - Wire format: - - .. code-block:: - - event: log - data: {"timestamp":"2026-03-10T09:33:17.121Z","stream":"stdout","message":"Starting server on port 18080"} - - event: log - data: {"timestamp":"2026-03-10T09:34:52.714Z","stream":"status","message":"Successfully connected to container"} - - :ivar event: The SSE event type. Currently ``log``, but additional event types may be added in - the future. Clients should ignore unrecognized event types. Required. "log" - :vartype event: str or ~azure.ai.projects.models.SessionLogEventType - :ivar data: The event payload as plain text. Currently JSON-formatted but the schema is not - contractual and may change. Required. - :vartype data: str + :ivar event_id: Optional client-generated ID used to identify this event. + :vartype event_id: str + :ivar type: The event type, must be ``conversation.item.retrieve``. Required. + CONVERSATION_ITEM_RETRIEVE. + :vartype type: str or ~azure.ai.projects.models.CONVERSATION_ITEM_RETRIEVE + :ivar item_id: The ID of the item to retrieve. Required. + :vartype item_id: str """ - event: Union[str, "_models.SessionLogEventType"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The SSE event type. Currently ``log``, but additional event types may be added in the future. - Clients should ignore unrecognized event types. Required. \"log\"""" - data: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The event payload as plain text. Currently JSON-formatted but the schema is not contractual and - may change. Required.""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional client-generated ID used to identify this event.""" + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``conversation.item.retrieve``. Required. CONVERSATION_ITEM_RETRIEVE.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the item to retrieve. Required.""" @overload def __init__( self, *, - event: Union[str, "_models.SessionLogEventType"], - data: str, + item_id: str, + event_id: Optional[str] = None, ) -> None: ... @overload @@ -22922,27 +22497,57 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE # type: ignore -class SharepointGroundingToolParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The sharepoint grounding tool parameters. +class RealtimeClientEventConversationItemTruncate( + RealtimeClientEvent, discriminator="conversation.item.truncate" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Send this event to truncate a previous assistant message’s audio. The server will produce audio + faster than realtime, so this event is useful when the user interrupts to truncate audio that + has already been sent to the client but not yet played. This will synchronize the server's + understanding of the audio with the client's playback. Truncating audio will delete the + server-side text transcript to ensure there is not text in the context that hasn't been heard + by the user. If successful, the server will respond with a ``conversation.item.truncated`` + event. - :ivar project_connections: The project connections attached to this tool. There can be a - maximum of 1 connection resource attached to the tool. - :vartype project_connections: list[~azure.ai.projects.models.ToolProjectConnection] + :ivar event_id: Optional client-generated ID used to identify this event. + :vartype event_id: str + :ivar type: The event type, must be ``conversation.item.truncate``. Required. + CONVERSATION_ITEM_TRUNCATE. + :vartype type: str or ~azure.ai.projects.models.CONVERSATION_ITEM_TRUNCATE + :ivar item_id: The ID of the assistant message item to truncate. Only assistant message items + can be truncated. Required. + :vartype item_id: str + :ivar content_index: The index of the content part to truncate. Set this to ``0``. Required. + :vartype content_index: int + :ivar audio_end_ms: Inclusive duration up to which audio is truncated, in milliseconds. If the + audio_end_ms is greater than the actual audio duration, the server will respond with an error. + Required. + :vartype audio_end_ms: int """ - project_connections: Optional[list["_models.ToolProjectConnection"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The project connections attached to this tool. There can be a maximum of 1 connection resource - attached to the tool.""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional client-generated ID used to identify this event.""" + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_TRUNCATE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``conversation.item.truncate``. Required. CONVERSATION_ITEM_TRUNCATE.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the assistant message item to truncate. Only assistant message items can be + truncated. Required.""" + content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the content part to truncate. Set this to ``0``. Required.""" + audio_end_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Inclusive duration up to which audio is truncated, in milliseconds. If the audio_end_ms is + greater than the actual audio duration, the server will respond with an error. Required.""" @overload def __init__( self, *, - project_connections: Optional[list["_models.ToolProjectConnection"]] = None, + item_id: str, + content_index: int, + audio_end_ms: int, + event_id: Optional[str] = None, ) -> None: ... @overload @@ -22954,34 +22559,47 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RealtimeClientEventType.CONVERSATION_ITEM_TRUNCATE # type: ignore -class SharepointPreviewTool( - Tool, discriminator="sharepoint_grounding_preview" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """The input definition information for a sharepoint tool as used to configure an agent. +class RealtimeClientEventInputAudioBufferAppend( + RealtimeClientEvent, discriminator="input_audio_buffer.append" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Send this event to append audio bytes to the input audio buffer. The audio buffer is temporary + storage you can write to and later commit. A "commit" will create a new user message item in + the conversation history from the buffer content and clear the buffer. Input audio + transcription (if enabled) will be generated when the buffer is committed. If VAD is enabled + the audio buffer is used to detect speech and the server will decide when to commit. When + Server VAD is disabled, you must commit the audio buffer manually. Input audio noise reduction + operates on writes to the audio buffer. The client may choose how much audio to place in each + event up to a maximum of 15 MiB, for example streaming smaller chunks from the client may allow + the VAD to be more responsive. Unlike most other client events, the server will not send a + confirmation response to this event. - :ivar type: The object type, which is always 'sharepoint_grounding_preview'. Required. - SHAREPOINT_GROUNDING_PREVIEW. - :vartype type: str or ~azure.ai.projects.models.SHAREPOINT_GROUNDING_PREVIEW - :ivar sharepoint_grounding_preview: The sharepoint grounding tool parameters. Required. - :vartype sharepoint_grounding_preview: - ~azure.ai.projects.models.SharepointGroundingToolParameters + :ivar event_id: Optional client-generated ID used to identify this event. + :vartype event_id: str + :ivar type: The event type, must be ``input_audio_buffer.append``. Required. + INPUT_AUDIO_BUFFER_APPEND. + :vartype type: str or ~azure.ai.projects.models.INPUT_AUDIO_BUFFER_APPEND + :ivar audio: Base64-encoded audio bytes. This must be in the format specified by the + ``input_audio_format`` field in the session configuration. Required. + :vartype audio: str """ - type: Literal[ToolType.SHAREPOINT_GROUNDING_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The object type, which is always 'sharepoint_grounding_preview'. Required. - SHAREPOINT_GROUNDING_PREVIEW.""" - sharepoint_grounding_preview: "_models.SharepointGroundingToolParameters" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The sharepoint grounding tool parameters. Required.""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional client-generated ID used to identify this event.""" + type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_APPEND] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``input_audio_buffer.append``. Required. INPUT_AUDIO_BUFFER_APPEND.""" + audio: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Base64-encoded audio bytes. This must be in the format specified by the ``input_audio_format`` + field in the session configuration. Required.""" @overload def __init__( self, *, - sharepoint_grounding_preview: "_models.SharepointGroundingToolParameters", + audio: str, + event_id: Optional[str] = None, ) -> None: ... @overload @@ -22993,52 +22611,32 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.SHAREPOINT_GROUNDING_PREVIEW # type: ignore + self.type = RealtimeClientEventType.INPUT_AUDIO_BUFFER_APPEND # type: ignore -class ShellToolboxTool( - ToolboxTool, discriminator="shell" +class RealtimeClientEventInputAudioBufferClear( + RealtimeClientEvent, discriminator="input_audio_buffer.clear" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """A shell tool stored in a toolbox. This model is additive to toolbox configuration and does not - modify the OpenAI tool contract or existing toolbox tool definitions. + """Send this event to clear the audio bytes in the buffer. The server will respond with an + ``input_audio_buffer.cleared`` event. - :ivar name: Optional user-defined name for this tool or configuration. - :vartype name: str - :ivar description: Optional user-defined description for this tool or configuration. - :vartype description: str - :ivar tool_configs: Per-tool configuration map. Keys are tool names or ``*`` (catch-all - default). Resolution order: exact tool name match takes priority over ``*``. Unknown tool names - are silently ignored at runtime. - :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] - :ivar type: The type of the tool. Always ``shell``. Required. SHELL. - :vartype type: str or ~azure.ai.projects.models.SHELL - :ivar allowed_callers: - :vartype allowed_callers: list[str or ~azure.ai.projects.models.CallableToolAllowedCaller] - :ivar environment: The environment in which shell commands are executed. Specify an - automatically provisioned container or an existing container. Required. - :vartype environment: ~azure.ai.projects.models.ToolboxShellEnvironment + :ivar event_id: Optional client-generated ID used to identify this event. + :vartype event_id: str + :ivar type: The event type, must be ``input_audio_buffer.clear``. Required. + INPUT_AUDIO_BUFFER_CLEAR. + :vartype type: str or ~azure.ai.projects.models.INPUT_AUDIO_BUFFER_CLEAR """ - type: Literal[ToolboxToolType.SHELL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the tool. Always ``shell``. Required. SHELL.""" - allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - environment: "_models.ToolboxShellEnvironment" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The environment in which shell commands are executed. Specify an automatically provisioned - container or an existing container. Required.""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional client-generated ID used to identify this event.""" + type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``input_audio_buffer.clear``. Required. INPUT_AUDIO_BUFFER_CLEAR.""" @overload def __init__( self, *, - environment: "_models.ToolboxShellEnvironment", - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, - allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = None, + event_id: Optional[str] = None, ) -> None: ... @overload @@ -23050,47 +22648,36 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolboxToolType.SHELL # type: ignore + self.type = RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR # type: ignore -class SimpleQnADataGenerationJobConfiguration( - DataGenerationJobConfiguration, discriminator="simple_qna" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """The configuration for a data generation job with SimpleQnA type. +class RealtimeClientEventInputAudioBufferCommit( + RealtimeClientEvent, discriminator="input_audio_buffer.commit" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Send this event to commit the user input audio buffer, which will create a new user message + item in the conversation. This event will produce an error if the input audio buffer is empty. + When in Server VAD mode, the client does not need to send this event, the server will commit + the audio buffer automatically. Committing the input audio buffer will trigger input audio + transcription (if enabled in session configuration), but it will not create a response from + the model. The server will respond with an ``input_audio_buffer.committed`` event. - :ivar train_split: The proportion of the generated data to be used for training when the data - is used for fine-tuning. The rest will be used for validation. Value should be between 0 and 1. - :vartype train_split: float - :ivar model_options: The LLM model options. - :vartype model_options: ~azure.ai.projects.models.DataGenerationModelOptions - :ivar type: The data generation job type, which is SimpleQnA for this model. Required. Simple - question and answers between user and agent. - :vartype type: str or ~azure.ai.projects.models.SIMPLE_QNA - :ivar max_samples: Maximum number of samples to generate, up to service-defined limits. - Required. - :vartype max_samples: int - :ivar question_types: The question types to generate. Used only for fine-tuning scenarios. - :vartype question_types: list[str or ~azure.ai.projects.models.SimpleQnAFineTuningQuestionType] + :ivar event_id: Optional client-generated ID used to identify this event. + :vartype event_id: str + :ivar type: The event type, must be ``input_audio_buffer.commit``. Required. + INPUT_AUDIO_BUFFER_COMMIT. + :vartype type: str or ~azure.ai.projects.models.INPUT_AUDIO_BUFFER_COMMIT """ - type: Literal[DataGenerationJobType.SIMPLE_QNA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The data generation job type, which is SimpleQnA for this model. Required. Simple question and - answers between user and agent.""" - max_samples: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Maximum number of samples to generate, up to service-defined limits. Required.""" - question_types: Optional[list[Union[str, "_models.SimpleQnAFineTuningQuestionType"]]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The question types to generate. Used only for fine-tuning scenarios.""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional client-generated ID used to identify this event.""" + type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``input_audio_buffer.commit``. Required. INPUT_AUDIO_BUFFER_COMMIT.""" @overload def __init__( self, *, - max_samples: int, - train_split: Optional[float] = None, - model_options: Optional["_models.DataGenerationModelOptions"] = None, - question_types: Optional[list[Union[str, "_models.SimpleQnAFineTuningQuestionType"]]] = None, + event_id: Optional[str] = None, ) -> None: ... @overload @@ -23102,36 +22689,35 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = DataGenerationJobType.SIMPLE_QNA # type: ignore + self.type = RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT # type: ignore -class SimulationSeedDataGenerationJobConfiguration( - DataGenerationJobConfiguration, discriminator="simulation_seed" +class RealtimeClientEventOutputAudioBufferClear( + RealtimeClientEvent, discriminator="output_audio_buffer.clear" ): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The configuration for a task generation data generation job. Use with multiturn evaluation - scenarios and with prompt, file, or agent sources. Generated dataset rows include fields such - as ``id``, ``category``, ``test_case_description``, and ``desired_num_turns``. + """**WebRTC/SIP Only:** Emit to cut off the current audio response. This will trigger the server + to stop generating audio and emit a ``output_audio_buffer.cleared`` event. This event should be + preceded by a ``response.cancel`` client event to stop the generation of the current response. + `Learn more + `_. - :ivar train_split: The proportion of the generated data to be used for training when the data - is used for fine-tuning. The rest will be used for validation. Value should be between 0 and 1. - :vartype train_split: float - :ivar model_options: The LLM model options. - :vartype model_options: ~azure.ai.projects.models.DataGenerationModelOptions - :ivar type: The data generation job type, which is SimulationSeed for this model. Required. - Simulation seed for evaluation scenarios. - :vartype type: str or ~azure.ai.projects.models.SIMULATION_SEED + :ivar event_id: The unique ID of the client event used for error handling. + :vartype event_id: str + :ivar type: The event type, must be ``output_audio_buffer.clear``. Required. + OUTPUT_AUDIO_BUFFER_CLEAR. + :vartype type: str or ~azure.ai.projects.models.OUTPUT_AUDIO_BUFFER_CLEAR """ - type: Literal[DataGenerationJobType.SIMULATION_SEED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The data generation job type, which is SimulationSeed for this model. Required. Simulation seed - for evaluation scenarios.""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the client event used for error handling.""" + type: Literal[RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``output_audio_buffer.clear``. Required. OUTPUT_AUDIO_BUFFER_CLEAR.""" @overload def __init__( self, *, - train_split: Optional[float] = None, - model_options: Optional["_models.DataGenerationModelOptions"] = None, + event_id: Optional[str] = None, ) -> None: ... @overload @@ -23143,30 +22729,40 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = DataGenerationJobType.SIMULATION_SEED # type: ignore + self.type = RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR # type: ignore -class SipTelephonyTransferDestination( - TelephonyTransferDestination, discriminator="sip" +class RealtimeClientEventResponseCancel( + RealtimeClientEvent, discriminator="response.cancel" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """A SIP destination for a telephony transfer target. + """Send this event to cancel an in-progress response. The server will respond with a + ``response.done`` event with a status of ``response.status=cancelled``. If there is no response + to cancel, the server will respond with an error. It's safe to call ``response.cancel`` even if + no response is in progress, an error will be returned the session will remain unaffected. - :ivar kind: The SIP destination type. Required. A Session Initiation Protocol destination. - :vartype kind: str or ~azure.ai.projects.models.SIP - :ivar value: The SIP or SIPS URI to call. Required. - :vartype value: str + :ivar event_id: Optional client-generated ID used to identify this event. + :vartype event_id: str + :ivar type: The event type, must be ``response.cancel``. Required. RESPONSE_CANCEL. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_CANCEL + :ivar response_id: A specific response ID to cancel - if not provided, will cancel an + in-progress response in the default conversation. + :vartype response_id: str """ - kind: Literal[TelephonyTransferDestinationKind.SIP] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The SIP destination type. Required. A Session Initiation Protocol destination.""" - value: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The SIP or SIPS URI to call. Required.""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional client-generated ID used to identify this event.""" + type: Literal[RealtimeClientEventType.RESPONSE_CANCEL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``response.cancel``. Required. RESPONSE_CANCEL.""" + response_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A specific response ID to cancel - if not provided, will cancel an in-progress response in the + default conversation.""" @overload def __init__( self, *, - value: str, + event_id: Optional[str] = None, + response_id: Optional[str] = None, ) -> None: ... @overload @@ -23178,52 +22774,50 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.kind = TelephonyTransferDestinationKind.SIP # type: ignore + self.type = RealtimeClientEventType.RESPONSE_CANCEL # type: ignore -class SkillDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A skill resource. +class RealtimeClientEventResponseCreate( + RealtimeClientEvent, discriminator="response.create" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """This event instructs the server to create a Response, which means triggering model inference. + When in Server VAD mode, the server will create Responses automatically. A Response will + include at least one Item, and may have two, in which case the second will be a function call. + These Items will be appended to the conversation history by default. The server will respond + with a ``response.created`` event, events for Items and content created, and finally a + ``response.done`` event to indicate the Response is complete. The ``response.create`` event + includes inference configuration like ``instructions`` and ``tools``. If these are set, they + will override the Session's configuration for this Response only. Responses can be created + out-of-band of the default Conversation, meaning that they can have arbitrary input, and it's + possible to disable writing the output to the Conversation. Only one Response can write to the + default Conversation at a time, but otherwise multiple Responses can be created in parallel. + The ``metadata`` field is a good way to disambiguate multiple simultaneous Responses. Clients + can set ``conversation`` to ``none`` to create a Response that does not write to the default + Conversation. Arbitrary input can be provided with the ``input`` field, which is an array + accepting raw Items and references to existing Items. - :ivar id: The unique identifier of the skill. Required. - :vartype id: str - :ivar name: The unique name of the skill. Required. - :vartype name: str - :ivar description: A human-readable description of the skill. Required. - :vartype description: str - :ivar created_at: The Unix timestamp (seconds) when the skill was created. Required. - :vartype created_at: ~datetime.datetime - :ivar default_version: The default version for the skill. Can be changed via updateSkill. - Required. - :vartype default_version: str - :ivar latest_version: The latest version for the skill. Required. - :vartype latest_version: str + :ivar event_id: Optional client-generated ID used to identify this event. + :vartype event_id: str + :ivar type: The event type, must be ``response.create``. Required. RESPONSE_CREATE. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_CREATE + :ivar response: + :vartype response: ~azure.ai.projects.models.VoiceAgentResponseCreateParams """ - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique identifier of the skill. Required.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique name of the skill. Required.""" - description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A human-readable description of the skill. Required.""" - created_at: datetime.datetime = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional client-generated ID used to identify this event.""" + type: Literal[RealtimeClientEventType.RESPONSE_CREATE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``response.create``. Required. RESPONSE_CREATE.""" + response: Optional["_models.VoiceAgentResponseCreateParams"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """The Unix timestamp (seconds) when the skill was created. Required.""" - default_version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The default version for the skill. Can be changed via updateSkill. Required.""" - latest_version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The latest version for the skill. Required.""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - name: str, - description: str, - created_at: datetime.datetime, - default_version: str, - latest_version: str, + event_id: Optional[str] = None, + response: Optional["_models.VoiceAgentResponseCreateParams"] = None, ) -> None: ... @overload @@ -23235,52 +22829,33 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RealtimeClientEventType.RESPONSE_CREATE # type: ignore -class SkillInlineContent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Inline content for defining a simple skill without uploading files. Follows the agentskills.io - SKILL.md specification. +class RealtimeConversationItem(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A single item within a Realtime conversation. - :ivar description: A human-readable description of what the skill does and when to use it. - Required. - :vartype description: str - :ivar instructions: The skill instructions in markdown format. This is the body content of the - SKILL.md file. Required. - :vartype instructions: str - :ivar license: License name or reference to a bundled license file. - :vartype license: str - :ivar compatibility: Environment requirements or compatibility notes for the skill. - :vartype compatibility: str - :ivar metadata: Arbitrary key-value metadata for additional properties. - :vartype metadata: dict[str, str] - :ivar allowed_tools: List of pre-approved tools the skill may use. Experimental. - :vartype allowed_tools: list[str] + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + RealtimeConversationItemFunctionCall, RealtimeConversationItemFunctionCallOutput, + RealtimeMCPApprovalRequest, RealtimeMCPApprovalResponse, RealtimeMCPToolCall, + RealtimeMCPListTools, RealtimeConversationItemMessage + + :ivar type: Required. Known values are: "function_call", "function_call_output", + "mcp_approval_response", "mcp_list_tools", "mcp_call", "mcp_approval_request", and "message". + :vartype type: str or ~azure.ai.projects.models.RealtimeConversationItemType """ - description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A human-readable description of what the skill does and when to use it. Required.""" - instructions: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The skill instructions in markdown format. This is the body content of the SKILL.md file. - Required.""" - license: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """License name or reference to a bundled license file.""" - compatibility: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Environment requirements or compatibility notes for the skill.""" - metadata: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Arbitrary key-value metadata for additional properties.""" - allowed_tools: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """List of pre-approved tools the skill may use. Experimental.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"function_call\", \"function_call_output\", + \"mcp_approval_response\", \"mcp_list_tools\", \"mcp_call\", \"mcp_approval_request\", and + \"message\".""" @overload def __init__( self, *, - description: str, - instructions: str, - license: Optional[str] = None, - compatibility: Optional[str] = None, - metadata: Optional[dict[str, str]] = None, - allowed_tools: Optional[list[str]] = None, + type: str, ) -> None: ... @overload @@ -23294,28 +22869,69 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SkillReference(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A reference to a versioned Foundry skill. +class RealtimeConversationItemFunctionCall( + RealtimeConversationItem, discriminator="function_call" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Realtime function call item. - :ivar name: The name of the skill. Required. + :ivar id: The unique ID of the item. This may be provided by the client or generated by the + server. + :vartype id: str + :ivar object: Identifier for the API object being returned - always ``realtime.item``. Optional + when creating a new item. Default value is "realtime.item". + :vartype object: str + :ivar type: The type of the item. Always ``function_call``. Required. FUNCTION_CALL. + :vartype type: str or ~azure.ai.projects.models.FUNCTION_CALL + :ivar status: The status of the item. Has no effect on the conversation. Is one of the + following types: Literal["completed"], Literal["incomplete"], Literal["in_progress"] + :vartype status: str or str or str + :ivar call_id: The ID of the function call. + :vartype call_id: str + :ivar name: The name of the function being called. Required. :vartype name: str - :ivar version: The skill version. If omitted, the current default version is resolved and - pinned when the agent version is created. - :vartype version: str + :ivar arguments: The arguments of the function call. This is a JSON-encoded string representing + the arguments passed to the function, for example ``{"arg1": "value1", "arg2": 42}``. Required. + :vartype arguments: str + :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. + :vartype created_at: ~datetime.datetime + :ivar response_id: The id of the response that produced this item, when applicable. + :vartype response_id: str """ + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the item. This may be provided by the client or generated by the server.""" + object: Optional[Literal["realtime.item"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Identifier for the API object being returned - always ``realtime.item``. Optional when creating + a new item. Default value is \"realtime.item\".""" + type: Literal[RealtimeConversationItemType.FUNCTION_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the item. Always ``function_call``. Required. FUNCTION_CALL.""" + status: Optional[Literal["completed", "incomplete", "in_progress"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The status of the item. Has no effect on the conversation. Is one of the following types: + Literal[\"completed\"], Literal[\"incomplete\"], Literal[\"in_progress\"]""" + call_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the function call.""" name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the skill. Required.""" - version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The skill version. If omitted, the current default version is resolved and pinned when the - agent version is created.""" + """The name of the function being called. Required.""" + arguments: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The arguments of the function call. This is a JSON-encoded string representing the arguments + passed to the function, for example ``{\"arg1\": \"value1\", \"arg2\": 42}``. Required.""" + created_at: Optional[datetime.datetime] = rest_field(visibility=["read"], format="unix-timestamp") + """The Unix timestamp (in seconds) for when the item was persisted.""" + response_id: Optional[str] = rest_field(visibility=["read"]) + """The id of the response that produced this item, when applicable.""" @overload def __init__( self, *, name: str, - version: Optional[str] = None, + arguments: str, + id: Optional[str] = None, # pylint: disable=redefined-builtin + object: Optional[Literal["realtime.item"]] = None, + status: Optional[Literal["completed", "incomplete", "in_progress"]] = None, + call_id: Optional[str] = None, ) -> None: ... @overload @@ -23327,34 +22943,75 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RealtimeConversationItemType.FUNCTION_CALL # type: ignore -class SkillReferenceParam( - ContainerSkill, discriminator="skill_reference" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """SkillReferenceParam. +class RealtimeConversationItemFunctionCallOutput( + RealtimeConversationItem, discriminator="function_call_output" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Realtime function call output item. - :ivar type: References a skill created with the /v1/skills endpoint. Required. SKILL_REFERENCE. - :vartype type: str or ~azure.ai.projects.models.SKILL_REFERENCE - :ivar skill_id: The ID of the referenced skill. Required. - :vartype skill_id: str - :ivar version: Optional skill version. Use a positive integer or 'latest'. Omit for default. - :vartype version: str + :ivar id: The unique ID of the item. This may be provided by the client or generated by the + server. + :vartype id: str + :ivar object: Identifier for the API object being returned - always ``realtime.item``. Optional + when creating a new item. Default value is "realtime.item". + :vartype object: str + :ivar type: The type of the item. Always ``function_call_output``. Required. + FUNCTION_CALL_OUTPUT. + :vartype type: str or ~azure.ai.projects.models.FUNCTION_CALL_OUTPUT + :ivar status: The status of the item. Has no effect on the conversation. Is one of the + following types: Literal["completed"], Literal["incomplete"], Literal["in_progress"] + :vartype status: str or str or str + :ivar call_id: The ID of the function call this output is for. Required. + :vartype call_id: str + :ivar output: The output of the function call, this is free text and can contain any + information or simply be empty. Required. + :vartype output: str + :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. + :vartype created_at: ~datetime.datetime + :ivar response_id: The id of the response that produced this item, when applicable. + :vartype response_id: str + :ivar name: The name of the function that was called. A Foundry extension: OpenAI's + function_call_output does not carry the function name, only ``call_id``. + :vartype name: str """ - type: Literal[ContainerSkillType.SKILL_REFERENCE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """References a skill created with the /v1/skills endpoint. Required. SKILL_REFERENCE.""" - skill_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the referenced skill. Required.""" - version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional skill version. Use a positive integer or 'latest'. Omit for default.""" + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the item. This may be provided by the client or generated by the server.""" + object: Optional[Literal["realtime.item"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Identifier for the API object being returned - always ``realtime.item``. Optional when creating + a new item. Default value is \"realtime.item\".""" + type: Literal[RealtimeConversationItemType.FUNCTION_CALL_OUTPUT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the item. Always ``function_call_output``. Required. FUNCTION_CALL_OUTPUT.""" + status: Optional[Literal["completed", "incomplete", "in_progress"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The status of the item. Has no effect on the conversation. Is one of the following types: + Literal[\"completed\"], Literal[\"incomplete\"], Literal[\"in_progress\"]""" + call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the function call this output is for. Required.""" + output: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The output of the function call, this is free text and can contain any information or simply be + empty. Required.""" + created_at: Optional[datetime.datetime] = rest_field(visibility=["read"], format="unix-timestamp") + """The Unix timestamp (in seconds) for when the item was persisted.""" + response_id: Optional[str] = rest_field(visibility=["read"]) + """The id of the response that produced this item, when applicable.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the function that was called. A Foundry extension: OpenAI's function_call_output + does not carry the function name, only ``call_id``.""" @overload def __init__( self, *, - skill_id: str, - version: Optional[str] = None, + call_id: str, + output: str, + id: Optional[str] = None, # pylint: disable=redefined-builtin + object: Optional[Literal["realtime.item"]] = None, + status: Optional[Literal["completed", "incomplete", "in_progress"]] = None, + name: Optional[str] = None, ) -> None: ... @overload @@ -23366,51 +23023,35 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ContainerSkillType.SKILL_REFERENCE # type: ignore + self.type = RealtimeConversationItemType.FUNCTION_CALL_OUTPUT # type: ignore -class SkillVersion(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A specific version of a skill. +class RealtimeConversationItemMessage( + RealtimeConversationItem, discriminator="message" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """RealtimeConversationItemMessage. - :ivar id: The unique identifier of the skill version. Required. - :vartype id: str - :ivar skill_id: The identifier of the parent skill. Required. - :vartype skill_id: str - :ivar name: The name of the skill version. Required. - :vartype name: str - :ivar version: The version identifier. Skill versions are immutable. Required. - :vartype version: str - :ivar description: A human-readable description of the skill version. Required. - :vartype description: str - :ivar created_at: The Unix timestamp (seconds) when the skill version was created. Required. - :vartype created_at: ~datetime.datetime + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + RealtimeConversationItemMessageAssistant, RealtimeConversationItemMessageSystem, + RealtimeConversationItemMessageUser + + :ivar role: Required. Known values are: "system", "user", and "assistant". + :vartype role: str or ~azure.ai.projects.models.RealtimeConversationItemMessageType + :ivar type: Required. MESSAGE. + :vartype type: str or ~azure.ai.projects.models.MESSAGE """ - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique identifier of the skill version. Required.""" - skill_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The identifier of the parent skill. Required.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the skill version. Required.""" - version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The version identifier. Skill versions are immutable. Required.""" - description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A human-readable description of the skill version. Required.""" - created_at: datetime.datetime = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp (seconds) when the skill version was created. Required.""" + __mapping__: dict[str, _Model] = {} + role: str = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"system\", \"user\", and \"assistant\".""" + type: Literal[RealtimeConversationItemType.MESSAGE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. MESSAGE.""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - skill_id: str, - name: str, - version: str, - description: str, - created_at: datetime.datetime, + role: str, ) -> None: ... @overload @@ -23422,38 +23063,66 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RealtimeConversationItemType.MESSAGE # type: ignore -class ToolChoiceParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """How the model should select which tool (or tools) to use when generating a response. See the - ``tools`` parameter to see how to specify which tools the model can call. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ToolChoiceAllowed, SpecificApplyPatchParam, ToolChoiceCodeInterpreter, ToolChoiceComputer, - ToolChoiceComputerUse, ToolChoiceComputerUsePreview, ToolChoiceCustom, ToolChoiceFileSearch, - ToolChoiceFunction, ToolChoiceImageGeneration, ToolChoiceMCP, - SpecificProgrammaticToolCallingParam, SpecificFunctionShellParam, ToolChoiceWebSearchPreview, - ToolChoiceWebSearchPreview20250311 +class RealtimeConversationItemMessageAssistant( + RealtimeConversationItemMessage, discriminator="assistant" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Realtime assistant message item. - :ivar type: Required. Known values are: "allowed_tools", "function", "mcp", "custom", - "programmatic_tool_calling", "apply_patch", "shell", "file_search", "web_search_preview", - "computer_use_preview", "web_search_preview_2025_03_11", "image_generation", - "code_interpreter", "computer", and "computer_use". - :vartype type: str or ~azure.ai.projects.models.ToolChoiceParamType + :ivar id: The unique ID of the item. This may be provided by the client or generated by the + server. + :vartype id: str + :ivar object: Identifier for the API object being returned - always ``realtime.item``. Optional + when creating a new item. Default value is "realtime.item". + :vartype object: str + :ivar type: The type of the item. Always ``message``. Required. MESSAGE. + :vartype type: str or ~azure.ai.projects.models.MESSAGE + :ivar status: The status of the item. Has no effect on the conversation. Is one of the + following types: Literal["completed"], Literal["incomplete"], Literal["in_progress"] + :vartype status: str or str or str + :ivar role: The role of the message sender. Always ``assistant``. Required. ASSISTANT. + :vartype role: str or ~azure.ai.projects.models.ASSISTANT + :ivar content: The content of the message. Required. + :vartype content: + list[~azure.ai.projects.models.RealtimeConversationItemMessageAssistantContent] + :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. + :vartype created_at: ~datetime.datetime + :ivar response_id: The id of the response that produced this item, when applicable. + :vartype response_id: str """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"allowed_tools\", \"function\", \"mcp\", \"custom\", - \"programmatic_tool_calling\", \"apply_patch\", \"shell\", \"file_search\", - \"web_search_preview\", \"computer_use_preview\", \"web_search_preview_2025_03_11\", - \"image_generation\", \"code_interpreter\", \"computer\", and \"computer_use\".""" + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the item. This may be provided by the client or generated by the server.""" + object: Optional[Literal["realtime.item"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Identifier for the API object being returned - always ``realtime.item``. Optional when creating + a new item. Default value is \"realtime.item\".""" + status: Optional[Literal["completed", "incomplete", "in_progress"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The status of the item. Has no effect on the conversation. Is one of the following types: + Literal[\"completed\"], Literal[\"incomplete\"], Literal[\"in_progress\"]""" + role: Literal[RealtimeConversationItemMessageType.ASSISTANT] = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The role of the message sender. Always ``assistant``. Required. ASSISTANT.""" + content: list["_models.RealtimeConversationItemMessageAssistantContent"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The content of the message. Required.""" + created_at: Optional[datetime.datetime] = rest_field(visibility=["read"], format="unix-timestamp") + """The Unix timestamp (in seconds) for when the item was persisted.""" + response_id: Optional[str] = rest_field(visibility=["read"]) + """The id of the response that produced this item, when applicable.""" @overload def __init__( self, *, - type: str, + type: Literal[RealtimeConversationItemType.MESSAGE], + content: list["_models.RealtimeConversationItemMessageAssistantContent"], + id: Optional[str] = None, # pylint: disable=redefined-builtin + object: Optional[Literal["realtime.item"]] = None, + status: Optional[Literal["completed", "incomplete", "in_progress"]] = None, ) -> None: ... @overload @@ -23465,21 +23134,40 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.role = RealtimeConversationItemMessageType.ASSISTANT # type: ignore -class SpecificApplyPatchParam(ToolChoiceParam, discriminator="apply_patch"): - """Specific apply patch tool choice. +class RealtimeConversationItemMessageAssistantContent( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """RealtimeConversationItemMessageAssistantContent. - :ivar type: The tool to call. Always ``apply_patch``. Required. APPLY_PATCH. - :vartype type: str or ~azure.ai.projects.models.APPLY_PATCH + :ivar type: Is either a Literal["output_text"] type or a Literal["output_audio"] type. + :vartype type: str or str + :ivar text: + :vartype text: str + :ivar audio: + :vartype audio: str + :ivar transcript: + :vartype transcript: str """ - type: Literal[ToolChoiceParamType.APPLY_PATCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The tool to call. Always ``apply_patch``. Required. APPLY_PATCH.""" + type: Optional[Literal["output_text", "output_audio"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Is either a Literal[\"output_text\"] type or a Literal[\"output_audio\"] type.""" + text: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + audio: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + transcript: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, + *, + type: Optional[Literal["output_text", "output_audio"]] = None, + text: Optional[str] = None, + audio: Optional[str] = None, + transcript: Optional[str] = None, ) -> None: ... @overload @@ -23491,22 +23179,64 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolChoiceParamType.APPLY_PATCH # type: ignore -class SpecificFunctionShellParam(ToolChoiceParam, discriminator="shell"): - """Specific shell tool choice. +class RealtimeConversationItemMessageSystem( + RealtimeConversationItemMessage, discriminator="system" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Realtime system message item. - :ivar type: The tool to call. Always ``shell``. Required. SHELL. - :vartype type: str or ~azure.ai.projects.models.SHELL + :ivar id: The unique ID of the item. This may be provided by the client or generated by the + server. + :vartype id: str + :ivar object: Identifier for the API object being returned - always ``realtime.item``. Optional + when creating a new item. Default value is "realtime.item". + :vartype object: str + :ivar type: The type of the item. Always ``message``. Required. MESSAGE. + :vartype type: str or ~azure.ai.projects.models.MESSAGE + :ivar status: The status of the item. Has no effect on the conversation. Is one of the + following types: Literal["completed"], Literal["incomplete"], Literal["in_progress"] + :vartype status: str or str or str + :ivar role: The role of the message sender. Always ``system``. Required. SYSTEM. + :vartype role: str or ~azure.ai.projects.models.SYSTEM + :ivar content: The content of the message. Required. + :vartype content: list[~azure.ai.projects.models.RealtimeConversationItemMessageSystemContent] + :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. + :vartype created_at: ~datetime.datetime + :ivar response_id: The id of the response that produced this item, when applicable. + :vartype response_id: str """ - type: Literal[ToolChoiceParamType.SHELL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The tool to call. Always ``shell``. Required. SHELL.""" + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the item. This may be provided by the client or generated by the server.""" + object: Optional[Literal["realtime.item"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Identifier for the API object being returned - always ``realtime.item``. Optional when creating + a new item. Default value is \"realtime.item\".""" + status: Optional[Literal["completed", "incomplete", "in_progress"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The status of the item. Has no effect on the conversation. Is one of the following types: + Literal[\"completed\"], Literal[\"incomplete\"], Literal[\"in_progress\"]""" + role: Literal[RealtimeConversationItemMessageType.SYSTEM] = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The role of the message sender. Always ``system``. Required. SYSTEM.""" + content: list["_models.RealtimeConversationItemMessageSystemContent"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The content of the message. Required.""" + created_at: Optional[datetime.datetime] = rest_field(visibility=["read"], format="unix-timestamp") + """The Unix timestamp (in seconds) for when the item was persisted.""" + response_id: Optional[str] = rest_field(visibility=["read"]) + """The id of the response that produced this item, when applicable.""" @overload def __init__( self, + *, + type: Literal[RealtimeConversationItemType.MESSAGE], + content: list["_models.RealtimeConversationItemMessageSystemContent"], + id: Optional[str] = None, # pylint: disable=redefined-builtin + object: Optional[Literal["realtime.item"]] = None, + status: Optional[Literal["completed", "incomplete", "in_progress"]] = None, ) -> None: ... @overload @@ -23518,23 +23248,30 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolChoiceParamType.SHELL # type: ignore + self.role = RealtimeConversationItemMessageType.SYSTEM # type: ignore -class SpecificProgrammaticToolCallingParam(ToolChoiceParam, discriminator="programmatic_tool_calling"): - """SpecificProgrammaticToolCallingParam. +class RealtimeConversationItemMessageSystemContent( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """RealtimeConversationItemMessageSystemContent. - :ivar type: The tool to call. Always ``programmatic_tool_calling``. Required. - PROGRAMMATIC_TOOL_CALLING. - :vartype type: str or ~azure.ai.projects.models.PROGRAMMATIC_TOOL_CALLING + :ivar type: Default value is "input_text". + :vartype type: str + :ivar text: + :vartype text: str """ - type: Literal[ToolChoiceParamType.PROGRAMMATIC_TOOL_CALLING] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The tool to call. Always ``programmatic_tool_calling``. Required. PROGRAMMATIC_TOOL_CALLING.""" + type: Optional[Literal["input_text"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Default value is \"input_text\".""" + text: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, + *, + type: Optional[Literal["input_text"]] = None, + text: Optional[str] = None, ) -> None: ... @overload @@ -23546,32 +23283,64 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolChoiceParamType.PROGRAMMATIC_TOOL_CALLING # type: ignore -class SteeringPromptOptimizationContext( - OptimizationContext, discriminator="steering_prompt" +class RealtimeConversationItemMessageUser( + RealtimeConversationItemMessage, discriminator="user" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Natural-language guidance for the desired optimization. + """Realtime user message item. - :ivar type: Optimization context type discriminator. Required. Natural-language guidance that - steers the desired optimization. - :vartype type: str or ~azure.ai.projects.models.STEERING_PROMPT - :ivar prompt: Developer guidance describing the desired changes. Required. - :vartype prompt: str + :ivar id: The unique ID of the item. This may be provided by the client or generated by the + server. + :vartype id: str + :ivar object: Identifier for the API object being returned - always ``realtime.item``. Optional + when creating a new item. Default value is "realtime.item". + :vartype object: str + :ivar type: The type of the item. Always ``message``. Required. MESSAGE. + :vartype type: str or ~azure.ai.projects.models.MESSAGE + :ivar status: The status of the item. Has no effect on the conversation. Is one of the + following types: Literal["completed"], Literal["incomplete"], Literal["in_progress"] + :vartype status: str or str or str + :ivar role: The role of the message sender. Always ``user``. Required. USER. + :vartype role: str or ~azure.ai.projects.models.USER + :ivar content: The content of the message. Required. + :vartype content: list[~azure.ai.projects.models.RealtimeConversationItemMessageUserContent] + :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. + :vartype created_at: ~datetime.datetime + :ivar response_id: The id of the response that produced this item, when applicable. + :vartype response_id: str """ - type: Literal[OptimizationContextType.STEERING_PROMPT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Optimization context type discriminator. Required. Natural-language guidance that steers the - desired optimization.""" - prompt: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Developer guidance describing the desired changes. Required.""" + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the item. This may be provided by the client or generated by the server.""" + object: Optional[Literal["realtime.item"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Identifier for the API object being returned - always ``realtime.item``. Optional when creating + a new item. Default value is \"realtime.item\".""" + status: Optional[Literal["completed", "incomplete", "in_progress"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The status of the item. Has no effect on the conversation. Is one of the following types: + Literal[\"completed\"], Literal[\"incomplete\"], Literal[\"in_progress\"]""" + role: Literal[RealtimeConversationItemMessageType.USER] = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The role of the message sender. Always ``user``. Required. USER.""" + content: list["_models.RealtimeConversationItemMessageUserContent"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The content of the message. Required.""" + created_at: Optional[datetime.datetime] = rest_field(visibility=["read"], format="unix-timestamp") + """The Unix timestamp (in seconds) for when the item was persisted.""" + response_id: Optional[str] = rest_field(visibility=["read"]) + """The id of the response that produced this item, when applicable.""" @overload def __init__( self, *, - prompt: str, + type: Literal[RealtimeConversationItemType.MESSAGE], + content: list["_models.RealtimeConversationItemMessageUserContent"], + id: Optional[str] = None, # pylint: disable=redefined-builtin + object: Optional[Literal["realtime.item"]] = None, + status: Optional[Literal["completed", "incomplete", "in_progress"]] = None, ) -> None: ... @overload @@ -23583,42 +23352,53 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = OptimizationContextType.STEERING_PROMPT # type: ignore + self.role = RealtimeConversationItemMessageType.USER # type: ignore -class StructuredInputDefinition(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """An structured input that can participate in prompt template substitutions and tool argument - binding. +class RealtimeConversationItemMessageUserContent( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """RealtimeConversationItemMessageUserContent. - :ivar description: A human-readable description of the input. - :vartype description: str - :ivar default_value: The default value for the input if no run-time value is provided. - :vartype default_value: any - :ivar schema: The JSON schema for the structured input (optional). - :vartype schema: dict[str, any] - :ivar required: Whether the input property is required when the agent is invoked. The service - defaults to ``false`` if a value is not specified by the caller. - :vartype required: bool + :ivar type: Is one of the following types: Literal["input_text"], Literal["input_audio"], + Literal["input_image"] + :vartype type: str or str or str + :ivar text: + :vartype text: str + :ivar audio: + :vartype audio: str + :ivar image_url: + :vartype image_url: str + :ivar detail: Is one of the following types: Literal["auto"], Literal["low"], Literal["high"] + :vartype detail: str or str or str + :ivar transcript: + :vartype transcript: str """ - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A human-readable description of the input.""" - default_value: Optional[Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The default value for the input if no run-time value is provided.""" - schema: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The JSON schema for the structured input (optional).""" - required: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether the input property is required when the agent is invoked. The service defaults to - ``false`` if a value is not specified by the caller.""" + type: Optional[Literal["input_text", "input_audio", "input_image"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Is one of the following types: Literal[\"input_text\"], Literal[\"input_audio\"], + Literal[\"input_image\"]""" + text: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + audio: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + image_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + detail: Optional[Literal["auto", "low", "high"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Is one of the following types: Literal[\"auto\"], Literal[\"low\"], Literal[\"high\"]""" + transcript: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - description: Optional[str] = None, - default_value: Optional[Any] = None, - schema: Optional[dict[str, Any]] = None, - required: Optional[bool] = None, + type: Optional[Literal["input_text", "input_audio", "input_image"]] = None, + text: Optional[str] = None, + audio: Optional[str] = None, + image_url: Optional[str] = None, + detail: Optional[Literal["auto", "low", "high"]] = None, + transcript: Optional[str] = None, ) -> None: ... @overload @@ -23632,38 +23412,40 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class StructuredOutputDefinition(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A structured output that can be produced by the agent. +class RealtimeFunctionTool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Function tool. - :ivar name: The name of the structured output. Required. + :ivar type: The type of the tool, i.e. ``function``. Default value is "function". + :vartype type: str + :ivar name: The name of the function. :vartype name: str - :ivar description: A description of the output to emit. Used by the model to determine when to - emit the output. Required. + :ivar description: The description of the function, including guidance on when and how to call + it, and guidance about what to tell the user when calling (if anything). :vartype description: str - :ivar schema: The JSON schema for the structured output. Required. - :vartype schema: dict[str, any] - :ivar strict: Whether to enforce strict validation. Default ``true``. Required. - :vartype strict: bool + :ivar parameters: Parameters of the function in JSON Schema. + :vartype parameters: ~azure.ai.projects.models.RealtimeFunctionToolParameters """ - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the structured output. Required.""" - description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A description of the output to emit. Used by the model to determine when to emit the output. - Required.""" - schema: dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The JSON schema for the structured output. Required.""" - strict: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether to enforce strict validation. Default ``true``. Required.""" + type: Optional[Literal["function"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of the tool, i.e. ``function``. Default value is \"function\".""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the function.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The description of the function, including guidance on when and how to call it, and guidance + about what to tell the user when calling (if anything).""" + parameters: Optional["_models.RealtimeFunctionToolParameters"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Parameters of the function in JSON Schema.""" @overload def __init__( self, *, - name: str, - description: str, - schema: dict[str, Any], - strict: bool, + type: Optional[Literal["function"]] = None, + name: Optional[str] = None, + description: Optional[str] = None, + parameters: Optional["_models.RealtimeFunctionToolParameters"] = None, ) -> None: ... @overload @@ -23677,58 +23459,55 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SupervisedFineTuningDataGenerationJob( - DataGenerationJob, discriminator="supervised_finetuning_preview" +class RealtimeFunctionToolParameters(_Model): + """RealtimeFunctionToolParameters.""" + + +class RealtimeMCPApprovalRequest( + RealtimeConversationItem, discriminator="mcp_approval_request" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Supervised fine-tuning data generation job resource. This is a preview feature. + """Realtime MCP approval request. - :ivar id: Server-assigned unique identifier. Required. + :ivar type: The type of the item. Always ``mcp_approval_request``. Required. + MCP_APPROVAL_REQUEST. + :vartype type: str or ~azure.ai.projects.models.MCP_APPROVAL_REQUEST + :ivar id: The unique ID of the approval request. Required. :vartype id: str - :ivar result: Result produced on success. - :vartype result: ~azure.ai.projects.models.DataGenerationJobResult - :ivar status: Current lifecycle status. Required. Known values are: "queued", "in_progress", - "succeeded", "failed", and "cancelled". - :vartype status: str or ~azure.ai.projects.models.JobStatus - :ivar error: Error details — populated only on failure. - :vartype error: ~azure.ai.projects.models.ApiError - :ivar name: The display name of the data generation job. Required. + :ivar server_label: The label of the MCP server making the request. Required. + :vartype server_label: str + :ivar name: The name of the tool to run. Required. :vartype name: str - :ivar sources: The sources used for the data generation job. Required. - :vartype sources: list[~azure.ai.projects.models.DataGenerationJobSource] - :ivar generation_configuration: The generation configuration for the data generation job. - Required. - :vartype generation_configuration: ~azure.ai.projects.models.DataGenerationJobConfiguration - :ivar created_at: The timestamp when the job was created, represented in Unix time (seconds - since January 1, 1970). Required. + :ivar arguments: A JSON string of arguments for the tool. Required. + :vartype arguments: str + :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. :vartype created_at: ~datetime.datetime - :ivar finished_at: The timestamp when the job was finished, represented in Unix time (seconds - since January 1, 1970). - :vartype finished_at: ~datetime.datetime - :ivar scenario: The scenario of the data generation job, which is Supervised Fine-tuning - preview for this model. Required. Supervised Fine-tuning preview scenario. - :vartype scenario: str or ~azure.ai.projects.models.SUPERVISED_FINETUNING_PREVIEW - :ivar output_configuration: Optional file output configuration for the generated supervised - fine-tuning data. - :vartype output_configuration: - ~azure.ai.projects.models.SupervisedFineTuningDataGenerationJobOutputConfiguration + :ivar response_id: The id of the response that produced this item, when applicable. + :vartype response_id: str """ - scenario: Literal[DataGenerationJobScenario.SUPERVISED_FINETUNING_PREVIEW] = rest_discriminator(name="scenario", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The scenario of the data generation job, which is Supervised Fine-tuning preview for this - model. Required. Supervised Fine-tuning preview scenario.""" - output_configuration: Optional["_models.SupervisedFineTuningDataGenerationJobOutputConfiguration"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Optional file output configuration for the generated supervised fine-tuning data.""" + type: Literal[RealtimeConversationItemType.MCP_APPROVAL_REQUEST] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the item. Always ``mcp_approval_request``. Required. MCP_APPROVAL_REQUEST.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the approval request. Required.""" + server_label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The label of the MCP server making the request. Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the tool to run. Required.""" + arguments: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A JSON string of arguments for the tool. Required.""" + created_at: Optional[datetime.datetime] = rest_field(visibility=["read"], format="unix-timestamp") + """The Unix timestamp (in seconds) for when the item was persisted.""" + response_id: Optional[str] = rest_field(visibility=["read"]) + """The id of the response that produced this item, when applicable.""" @overload def __init__( self, *, + id: str, # pylint: disable=redefined-builtin + server_label: str, name: str, - sources: list["_models.DataGenerationJobSource"], - generation_configuration: "_models.DataGenerationJobConfiguration", - output_configuration: Optional["_models.SupervisedFineTuningDataGenerationJobOutputConfiguration"] = None, + arguments: str, ) -> None: ... @overload @@ -23740,47 +23519,53 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.scenario = DataGenerationJobScenario.SUPERVISED_FINETUNING_PREVIEW # type: ignore + self.type = RealtimeConversationItemType.MCP_APPROVAL_REQUEST # type: ignore -class SupervisedFineTuningDataGenerationJobInputs( - DataGenerationJobInputs, discriminator="supervised_finetuning_preview" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Caller-supplied inputs for a supervised fine-tuning data generation job. This is a preview - feature. +class RealtimeMCPApprovalResponse( + RealtimeConversationItem, discriminator="mcp_approval_response" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Realtime MCP approval response. - :ivar name: The display name of the data generation job. Required. - :vartype name: str - :ivar sources: The sources used for the data generation job. Required. - :vartype sources: list[~azure.ai.projects.models.DataGenerationJobSource] - :ivar generation_configuration: The generation configuration for the data generation job. - Required. - :vartype generation_configuration: ~azure.ai.projects.models.DataGenerationJobConfiguration - :ivar scenario: The scenario of the data generation job, which is Supervised Fine-tuning - preview for this model. Required. Supervised Fine-tuning preview scenario. - :vartype scenario: str or ~azure.ai.projects.models.SUPERVISED_FINETUNING_PREVIEW - :ivar output_configuration: Optional file output configuration for the generated supervised - fine-tuning data. - :vartype output_configuration: - ~azure.ai.projects.models.SupervisedFineTuningDataGenerationJobOutputConfiguration + :ivar type: The type of the item. Always ``mcp_approval_response``. Required. + MCP_APPROVAL_RESPONSE. + :vartype type: str or ~azure.ai.projects.models.MCP_APPROVAL_RESPONSE + :ivar id: The unique ID of the approval response. Required. + :vartype id: str + :ivar approval_request_id: The ID of the approval request being answered. Required. + :vartype approval_request_id: str + :ivar approve: Whether the request was approved. Required. + :vartype approve: bool + :ivar reason: + :vartype reason: str + :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. + :vartype created_at: ~datetime.datetime + :ivar response_id: The id of the response that produced this item, when applicable. + :vartype response_id: str """ - scenario: Literal[DataGenerationJobScenario.SUPERVISED_FINETUNING_PREVIEW] = rest_discriminator(name="scenario", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The scenario of the data generation job, which is Supervised Fine-tuning preview for this - model. Required. Supervised Fine-tuning preview scenario.""" - output_configuration: Optional["_models.SupervisedFineTuningDataGenerationJobOutputConfiguration"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Optional file output configuration for the generated supervised fine-tuning data.""" + type: Literal[RealtimeConversationItemType.MCP_APPROVAL_RESPONSE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the item. Always ``mcp_approval_response``. Required. MCP_APPROVAL_RESPONSE.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the approval response. Required.""" + approval_request_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the approval request being answered. Required.""" + approve: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether the request was approved. Required.""" + reason: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + created_at: Optional[datetime.datetime] = rest_field(visibility=["read"], format="unix-timestamp") + """The Unix timestamp (in seconds) for when the item was persisted.""" + response_id: Optional[str] = rest_field(visibility=["read"]) + """The id of the response that produced this item, when applicable.""" @overload def __init__( self, *, - name: str, - sources: list["_models.DataGenerationJobSource"], - generation_configuration: "_models.DataGenerationJobConfiguration", - output_configuration: Optional["_models.SupervisedFineTuningDataGenerationJobOutputConfiguration"] = None, + id: str, # pylint: disable=redefined-builtin + approval_request_id: str, + approve: bool, + reason: Optional[str] = None, ) -> None: ... @overload @@ -23792,42 +23577,29 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.scenario = DataGenerationJobScenario.SUPERVISED_FINETUNING_PREVIEW # type: ignore + self.type = RealtimeConversationItemType.MCP_APPROVAL_RESPONSE # type: ignore -class SupervisedFineTuningDataGenerationJobOutputConfiguration( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """File output configuration for a supervised fine-tuning data generation job. This is a preview - feature. +class RealtimeMCPError(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """RealtimeMCPError. - :ivar name: Filename to assign to the generated fine-tuning file. Required. - :vartype name: str - :ivar write_mode: Controls how file outputs are written. If omitted, defaults to ``overwrite`` - and writes only the newly generated fine-tuning file content. Known values are: "overwrite" and - "merge". - :vartype write_mode: str or ~azure.ai.projects.models.DataGenerationJobOutputWriteMode - :ivar merge_file_id: File ID to merge into when ``write_mode`` is ``merge``. - :vartype merge_file_id: str + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + RealtimeMCPHTTPError, RealtimeMCPProtocolError, RealtimeMCPToolExecutionError + + :ivar type: Required. Known values are: "protocol_error", "tool_execution_error", and + "http_error". + :vartype type: str or ~azure.ai.projects.models.RealtimeMcpErrorType """ - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Filename to assign to the generated fine-tuning file. Required.""" - write_mode: Optional[Union[str, "_models.DataGenerationJobOutputWriteMode"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Controls how file outputs are written. If omitted, defaults to ``overwrite`` and writes only - the newly generated fine-tuning file content. Known values are: \"overwrite\" and \"merge\".""" - merge_file_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """File ID to merge into when ``write_mode`` is ``merge``.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"protocol_error\", \"tool_execution_error\", and \"http_error\".""" @overload def __init__( self, *, - name: str, - write_mode: Optional[Union[str, "_models.DataGenerationJobOutputWriteMode"]] = None, - merge_file_id: Optional[str] = None, + type: str, ) -> None: ... @overload @@ -23841,56 +23613,32 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class TaxonomyCategory(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Taxonomy category definition. +class RealtimeMCPHTTPError( + RealtimeMCPError, discriminator="http_error" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Realtime MCP HTTP error. - :ivar id: Unique identifier of the taxonomy category. Required. - :vartype id: str - :ivar name: Name of the taxonomy category. Required. - :vartype name: str - :ivar description: Description of the taxonomy category. - :vartype description: str - :ivar risk_category: Risk category associated with this taxonomy category. Required. Known - values are: "HateUnfairness", "Violence", "Sexual", "SelfHarm", "ProtectedMaterial", - "CodeVulnerability", "UngroundedAttributes", "ProhibitedActions", "SensitiveDataLeakage", and - "TaskAdherence". - :vartype risk_category: str or ~azure.ai.projects.models.RiskCategory - :ivar sub_categories: List of taxonomy sub categories. Required. - :vartype sub_categories: list[~azure.ai.projects.models.TaxonomySubCategory] - :ivar properties: Additional properties for the taxonomy category. - :vartype properties: dict[str, str] + :ivar type: Required. HTTP_ERROR. + :vartype type: str or ~azure.ai.projects.models.HTTP_ERROR + :ivar code: Required. + :vartype code: int + :ivar message: Required. + :vartype message: str """ - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Unique identifier of the taxonomy category. Required.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Name of the taxonomy category. Required.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Description of the taxonomy category.""" - risk_category: Union[str, "_models.RiskCategory"] = rest_field( - name="riskCategory", visibility=["read", "create", "update", "delete", "query"] - ) - """Risk category associated with this taxonomy category. Required. Known values are: - \"HateUnfairness\", \"Violence\", \"Sexual\", \"SelfHarm\", \"ProtectedMaterial\", - \"CodeVulnerability\", \"UngroundedAttributes\", \"ProhibitedActions\", - \"SensitiveDataLeakage\", and \"TaskAdherence\".""" - sub_categories: list["_models.TaxonomySubCategory"] = rest_field( - name="subCategories", visibility=["read", "create", "update", "delete", "query"] - ) - """List of taxonomy sub categories. Required.""" - properties: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Additional properties for the taxonomy category.""" + type: Literal[RealtimeMcpErrorType.HTTP_ERROR] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. HTTP_ERROR.""" + code: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - name: str, - risk_category: Union[str, "_models.RiskCategory"], - sub_categories: list["_models.TaxonomySubCategory"], - description: Optional[str] = None, - properties: Optional[dict[str, str]] = None, + code: int, + message: str, ) -> None: ... @overload @@ -23902,43 +23650,48 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RealtimeMcpErrorType.HTTP_ERROR # type: ignore -class TaxonomySubCategory(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Taxonomy sub-category definition. +class RealtimeMCPListTools( + RealtimeConversationItem, discriminator="mcp_list_tools" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Realtime MCP list tools. - :ivar id: Unique identifier of the taxonomy sub-category. Required. + :ivar type: The type of the item. Always ``mcp_list_tools``. Required. MCP_LIST_TOOLS. + :vartype type: str or ~azure.ai.projects.models.MCP_LIST_TOOLS + :ivar id: The unique ID of the list. :vartype id: str - :ivar name: Name of the taxonomy sub-category. Required. - :vartype name: str - :ivar description: Description of the taxonomy sub-category. - :vartype description: str - :ivar enabled: List of taxonomy items under this sub-category. Required. - :vartype enabled: bool - :ivar properties: Additional properties for the taxonomy sub-category. - :vartype properties: dict[str, str] + :ivar server_label: The label of the MCP server. Required. + :vartype server_label: str + :ivar tools: The tools available on the server. Required. + :vartype tools: list[~azure.ai.projects.models.MCPListToolsTool] + :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. + :vartype created_at: ~datetime.datetime + :ivar response_id: The id of the response that produced this item, when applicable. + :vartype response_id: str """ - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Unique identifier of the taxonomy sub-category. Required.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Name of the taxonomy sub-category. Required.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Description of the taxonomy sub-category.""" - enabled: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """List of taxonomy items under this sub-category. Required.""" - properties: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Additional properties for the taxonomy sub-category.""" + type: Literal[RealtimeConversationItemType.MCP_LIST_TOOLS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the item. Always ``mcp_list_tools``. Required. MCP_LIST_TOOLS.""" + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the list.""" + server_label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The label of the MCP server. Required.""" + tools: list["_models.MCPListToolsTool"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The tools available on the server. Required.""" + created_at: Optional[datetime.datetime] = rest_field(visibility=["read"], format="unix-timestamp") + """The Unix timestamp (in seconds) for when the item was persisted.""" + response_id: Optional[str] = rest_field(visibility=["read"]) + """The id of the response that produced this item, when applicable.""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - name: str, - enabled: bool, - description: Optional[str] = None, - properties: Optional[dict[str, str]] = None, + server_label: str, + tools: list["_models.MCPListToolsTool"], + id: Optional[str] = None, # pylint: disable=redefined-builtin ) -> None: ... @overload @@ -23950,57 +23703,35 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RealtimeConversationItemType.MCP_LIST_TOOLS # type: ignore -class TelephonyBinding(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A telephony binding owned by a voice agent. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - TeamsPhoneExtensibilityTelephonyBinding, TwilioTelephonyBinding +class RealtimeMCPProtocolError( + RealtimeMCPError, discriminator="protocol_error" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Realtime MCP protocol error. - :ivar id: The service-generated binding identifier. Required. - :vartype id: str - :ivar provider: The telephony provider. Required. Known values are: "teams_phone_extensibility" - and "twilio". - :vartype provider: str or ~azure.ai.projects.models.TelephonyProvider - :ivar connection_name: The Foundry connection name for the telephony provider. Required. - :vartype connection_name: str - :ivar label: The optional display label for the binding. - :vartype label: str - :ivar status: The lifecycle status. Required. Known values are: "active" and "suspended". - :vartype status: str or ~azure.ai.projects.models.TelephonyBindingStatus - :ivar incoming_call_url: The service-generated webhook URL to configure with the telephony - provider. Required. - :vartype incoming_call_url: str + :ivar type: Required. PROTOCOL_ERROR. + :vartype type: str or ~azure.ai.projects.models.PROTOCOL_ERROR + :ivar code: Required. + :vartype code: int + :ivar message: Required. + :vartype message: str """ - __mapping__: dict[str, _Model] = {} - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The service-generated binding identifier. Required.""" - provider: str = rest_discriminator(name="provider", visibility=["read", "create", "update", "delete", "query"]) - """The telephony provider. Required. Known values are: \"teams_phone_extensibility\" and - \"twilio\".""" - connection_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The Foundry connection name for the telephony provider. Required.""" - label: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The optional display label for the binding.""" - status: Union[str, "_models.TelephonyBindingStatus"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The lifecycle status. Required. Known values are: \"active\" and \"suspended\".""" - incoming_call_url: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The service-generated webhook URL to configure with the telephony provider. Required.""" + type: Literal[RealtimeMcpErrorType.PROTOCOL_ERROR] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. PROTOCOL_ERROR.""" + code: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - provider: str, - connection_name: str, - status: Union[str, "_models.TelephonyBindingStatus"], - incoming_call_url: str, - label: Optional[str] = None, + code: int, + message: str, ) -> None: ... @overload @@ -24012,53 +23743,65 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RealtimeMcpErrorType.PROTOCOL_ERROR # type: ignore -class TeamsPhoneExtensibilityTelephonyBinding( - TelephonyBinding, discriminator="teams_phone_extensibility" +class RealtimeMCPToolCall( + RealtimeConversationItem, discriminator="mcp_call" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """A Microsoft Teams Phone extensibility binding owned by a voice agent. + """Realtime MCP tool call. - :ivar id: The service-generated binding identifier. Required. + :ivar type: The type of the item. Always ``mcp_call``. Required. MCP_CALL. + :vartype type: str or ~azure.ai.projects.models.MCP_CALL + :ivar id: The unique ID of the tool call. Required. :vartype id: str - :ivar connection_name: The Foundry connection name for the telephony provider. Required. - :vartype connection_name: str - :ivar label: The optional display label for the binding. - :vartype label: str - :ivar status: The lifecycle status. Required. Known values are: "active" and "suspended". - :vartype status: str or ~azure.ai.projects.models.TelephonyBindingStatus - :ivar incoming_call_url: The service-generated webhook URL to configure with the telephony - provider. Required. - :vartype incoming_call_url: str - :ivar provider: The Microsoft Teams Phone extensibility provider. Required. Microsoft Teams - Phone extensibility. - :vartype provider: str or ~azure.ai.projects.models.TEAMS_PHONE_EXTENSIBILITY - :ivar phone_number: The optional display phone number for the Teams resource account. - :vartype phone_number: str - :ivar resource_account_object_id: The Microsoft Teams resource-account object identifier as a - GUID. Required. - :vartype resource_account_object_id: str + :ivar server_label: The label of the MCP server running the tool. Required. + :vartype server_label: str + :ivar name: The name of the tool that was run. Required. + :vartype name: str + :ivar arguments: A JSON string of the arguments passed to the tool. Required. + :vartype arguments: str + :ivar approval_request_id: + :vartype approval_request_id: str + :ivar output: + :vartype output: str + :ivar error: + :vartype error: ~azure.ai.projects.models.RealtimeMCPError + :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. + :vartype created_at: ~datetime.datetime + :ivar response_id: The id of the response that produced this item, when applicable. + :vartype response_id: str """ - provider: Literal[TelephonyProvider.TEAMS_PHONE_EXTENSIBILITY] = rest_discriminator(name="provider", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The Microsoft Teams Phone extensibility provider. Required. Microsoft Teams Phone - extensibility.""" - phone_number: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The optional display phone number for the Teams resource account.""" - resource_account_object_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The Microsoft Teams resource-account object identifier as a GUID. Required.""" + type: Literal[RealtimeConversationItemType.MCP_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the item. Always ``mcp_call``. Required. MCP_CALL.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the tool call. Required.""" + server_label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The label of the MCP server running the tool. Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the tool that was run. Required.""" + arguments: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A JSON string of the arguments passed to the tool. Required.""" + approval_request_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + output: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + error: Optional["_models.RealtimeMCPError"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + created_at: Optional[datetime.datetime] = rest_field(visibility=["read"], format="unix-timestamp") + """The Unix timestamp (in seconds) for when the item was persisted.""" + response_id: Optional[str] = rest_field(visibility=["read"]) + """The id of the response that produced this item, when applicable.""" @overload def __init__( self, *, id: str, # pylint: disable=redefined-builtin - connection_name: str, - status: Union[str, "_models.TelephonyBindingStatus"], - incoming_call_url: str, - resource_account_object_id: str, - label: Optional[str] = None, - phone_number: Optional[str] = None, + server_label: str, + name: str, + arguments: str, + approval_request_id: Optional[str] = None, + output: Optional[str] = None, + error: Optional["_models.RealtimeMCPError"] = None, ) -> None: ... @overload @@ -24070,64 +23813,30 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.provider = TelephonyProvider.TEAMS_PHONE_EXTENSIBILITY # type: ignore - + self.type = RealtimeConversationItemType.MCP_CALL # type: ignore -class TelephonyBindingListItem(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A telephony binding returned in a list, including its entity tag. - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - TeamsPhoneExtensibilityTelephonyBindingListItem, TwilioTelephonyBindingListItem +class RealtimeMCPToolExecutionError( + RealtimeMCPError, discriminator="tool_execution_error" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Realtime MCP tool execution error. - :ivar id: The service-generated binding identifier. Required. - :vartype id: str - :ivar provider: The telephony provider. Required. Known values are: "teams_phone_extensibility" - and "twilio". - :vartype provider: str or ~azure.ai.projects.models.TelephonyProvider - :ivar connection_name: The Foundry connection name for the telephony provider. Required. - :vartype connection_name: str - :ivar label: The optional display label for the binding. - :vartype label: str - :ivar status: The lifecycle status. Required. Known values are: "active" and "suspended". - :vartype status: str or ~azure.ai.projects.models.TelephonyBindingStatus - :ivar incoming_call_url: The service-generated webhook URL to configure with the telephony - provider. Required. - :vartype incoming_call_url: str - :ivar etag: The entity tag to send in the ``If-Match`` header when updating or deleting this - binding. Required. - :vartype etag: str + :ivar type: Required. TOOL_EXECUTION_ERROR. + :vartype type: str or ~azure.ai.projects.models.TOOL_EXECUTION_ERROR + :ivar message: Required. + :vartype message: str """ - __mapping__: dict[str, _Model] = {} - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The service-generated binding identifier. Required.""" - provider: str = rest_discriminator(name="provider", visibility=["read", "create", "update", "delete", "query"]) - """The telephony provider. Required. Known values are: \"teams_phone_extensibility\" and - \"twilio\".""" - connection_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The Foundry connection name for the telephony provider. Required.""" - label: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The optional display label for the binding.""" - status: Union[str, "_models.TelephonyBindingStatus"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The lifecycle status. Required. Known values are: \"active\" and \"suspended\".""" - incoming_call_url: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The service-generated webhook URL to configure with the telephony provider. Required.""" - etag: str = rest_field(visibility=["read"]) - """The entity tag to send in the ``If-Match`` header when updating or deleting this binding. - Required.""" + type: Literal[RealtimeMcpErrorType.TOOL_EXECUTION_ERROR] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. TOOL_EXECUTION_ERROR.""" + message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - provider: str, - connection_name: str, - status: Union[str, "_models.TelephonyBindingStatus"], - incoming_call_url: str, - label: Optional[str] = None, + message: str, ) -> None: ... @overload @@ -24139,56 +23848,26 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RealtimeMcpErrorType.TOOL_EXECUTION_ERROR # type: ignore -class TeamsPhoneExtensibilityTelephonyBindingListItem( - TelephonyBindingListItem, discriminator="teams_phone_extensibility" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """A Microsoft Teams Phone extensibility binding returned in a list, including its entity tag. +class RealtimeReasoning(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Realtime reasoning configuration. - :ivar id: The service-generated binding identifier. Required. - :vartype id: str - :ivar connection_name: The Foundry connection name for the telephony provider. Required. - :vartype connection_name: str - :ivar label: The optional display label for the binding. - :vartype label: str - :ivar status: The lifecycle status. Required. Known values are: "active" and "suspended". - :vartype status: str or ~azure.ai.projects.models.TelephonyBindingStatus - :ivar incoming_call_url: The service-generated webhook URL to configure with the telephony - provider. Required. - :vartype incoming_call_url: str - :ivar etag: The entity tag to send in the ``If-Match`` header when updating or deleting this - binding. Required. - :vartype etag: str - :ivar provider: The Microsoft Teams Phone extensibility provider. Required. Microsoft Teams - Phone extensibility. - :vartype provider: str or ~azure.ai.projects.models.TEAMS_PHONE_EXTENSIBILITY - :ivar phone_number: The optional display phone number for the Teams resource account. - :vartype phone_number: str - :ivar resource_account_object_id: The Microsoft Teams resource-account object identifier as a - GUID. Required. - :vartype resource_account_object_id: str + :ivar effort: Known values are: "minimal", "low", "medium", "high", and "xhigh". + :vartype effort: str or ~azure.ai.projects.models.RealtimeReasoningEffort """ - provider: Literal[TelephonyProvider.TEAMS_PHONE_EXTENSIBILITY] = rest_discriminator(name="provider", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The Microsoft Teams Phone extensibility provider. Required. Microsoft Teams Phone - extensibility.""" - phone_number: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The optional display phone number for the Teams resource account.""" - resource_account_object_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The Microsoft Teams resource-account object identifier as a GUID. Required.""" + effort: Optional[Union[str, "_models.RealtimeReasoningEffort"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Known values are: \"minimal\", \"low\", \"medium\", \"high\", and \"xhigh\".""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - connection_name: str, - status: Union[str, "_models.TelephonyBindingStatus"], - incoming_call_url: str, - resource_account_object_id: str, - label: Optional[str] = None, - phone_number: Optional[str] = None, + effort: Optional[Union[str, "_models.RealtimeReasoningEffort"]] = None, ) -> None: ... @overload @@ -24200,32 +23879,42 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.provider = TelephonyProvider.TEAMS_PHONE_EXTENSIBILITY # type: ignore -class TeamsTelephonyTransferDestination( - TelephonyTransferDestination, discriminator="teams" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A Microsoft Teams destination for a telephony transfer target. +class RealtimeResponseStatusDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """RealtimeResponseStatusDetails. - :ivar kind: The Microsoft Teams destination type. Required. A Microsoft Teams user or - resource-account destination. - :vartype kind: str or ~azure.ai.projects.models.TEAMS - :ivar value: The Microsoft Teams user or resource-account identifier. Required. - :vartype value: str + :ivar type: Is one of the following types: Literal["completed"], Literal["cancelled"], + Literal["failed"], Literal["incomplete"] + :vartype type: str or str or str or str + :ivar reason: Is one of the following types: Literal["turn_detected"], + Literal["client_cancelled"], Literal["max_output_tokens"], Literal["content_filter"] + :vartype reason: str or str or str or str + :ivar error: + :vartype error: ~azure.ai.projects.models.RealtimeResponseStatusDetailsError """ - kind: Literal[TelephonyTransferDestinationKind.TEAMS] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The Microsoft Teams destination type. Required. A Microsoft Teams user or resource-account - destination.""" - value: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The Microsoft Teams user or resource-account identifier. Required.""" + type: Optional[Literal["completed", "cancelled", "failed", "incomplete"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Is one of the following types: Literal[\"completed\"], Literal[\"cancelled\"], + Literal[\"failed\"], Literal[\"incomplete\"]""" + reason: Optional[Literal["turn_detected", "client_cancelled", "max_output_tokens", "content_filter"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Is one of the following types: Literal[\"turn_detected\"], Literal[\"client_cancelled\"], + Literal[\"max_output_tokens\"], Literal[\"content_filter\"]""" + error: Optional["_models.RealtimeResponseStatusDetailsError"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) @overload def __init__( self, *, - value: str, + type: Optional[Literal["completed", "cancelled", "failed", "incomplete"]] = None, + reason: Optional[Literal["turn_detected", "client_cancelled", "max_output_tokens", "content_filter"]] = None, + error: Optional["_models.RealtimeResponseStatusDetailsError"] = None, ) -> None: ... @overload @@ -24237,26 +23926,30 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.kind = TelephonyTransferDestinationKind.TEAMS # type: ignore -class TelemetryConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Customer-supplied telemetry configuration for exporting container logs, traces, and metrics. +class RealtimeResponseStatusDetailsError(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """RealtimeResponseStatusDetailsError. - :ivar endpoints: Customer-supplied telemetry export endpoint configurations. Required. - :vartype endpoints: list[~azure.ai.projects.models.TelemetryEndpoint] + :ivar type: + :vartype type: str + :ivar code: + :vartype code: str + :ivar message: + :vartype message: str """ - endpoints: list["_models.TelemetryEndpoint"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Customer-supplied telemetry export endpoint configurations. Required.""" + type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + code: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - endpoints: list["_models.TelemetryEndpoint"], + type: Optional[str] = None, + code: Optional[str] = None, + message: Optional[str] = None, ) -> None: ... @overload @@ -24270,167 +23963,41 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class TelephonyCallJob(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A durable direct or campaign-created outbound call intent. +class RealtimeResponseUsage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """RealtimeResponseUsage. - :ivar destination: The phone destination to call. Required. - :vartype destination: ~azure.ai.projects.models.TelephonyOutboundDestination - :ivar connection_name: The Foundry connection name in the current project used to originate the - call. Its category selects Twilio or Azure Communication Services / Teams Phone extensibility. - No inbound telephony binding is required. Required. - :vartype connection_name: str - :ivar source: The caller identity used to originate the call. For a Twilio connection, provide - an authorized E.164 phone number. For an Azure Communication Services / Teams Phone - extensibility connection, provide the Teams Resource Account object ID. The identity type is - inferred from the connection category; originating does not change inbound routing. Required. - :vartype source: str - :ivar purpose: An optional customer-declared purpose for placing the call. - :vartype purpose: str - :ivar structured_inputs: Structured input values available to the agent and greeting for this - call. Agent-declared inputs are validated against their schemas; omitted optional inputs may - use their Agent-defined default values, while omitted required inputs are rejected. Additional - inputs remain available as dynamic template variables. - :vartype structured_inputs: dict[str, any] - :ivar schedule: The optional execution window. - :vartype schedule: ~azure.ai.projects.models.TelephonyCallJobSchedule - :ivar id: The service-generated call-job identifier. Required. - :vartype id: str - :ivar object: The object type. Always ``telephony.call_job``. Required. Default value is - "telephony.call_job". - :vartype object: str - :ivar agent_name: The name of the voice agent used at execution time. Required. - :vartype agent_name: str - :ivar status: The current call-job lifecycle status. Required. Known values are: "accepted", - "waiting_for_schedule", "queued", "dispatching", "in_progress", "waiting_for_retry", - "cancellation_requested", "completed", "blocked", "expired", "failed", and "cancelled". - :vartype status: str or ~azure.ai.projects.models.TelephonyCallJobStatus - :ivar cancellation: The recorded cancellation request, when cancellation was requested. - :vartype cancellation: ~azure.ai.projects.models.TelephonyCallJobCancellation - :ivar retry_policy: The frozen provider-attempt retry policy. Required. - :vartype retry_policy: ~azure.ai.projects.models.TelephonyOutboundRetryPolicy - :ivar attempt_count: The number of provider attempts created so far. Required. - :vartype attempt_count: int - :ivar next_attempt_at: The Unix timestamp in seconds at which the next retry becomes eligible. - :vartype next_attempt_at: ~datetime.datetime - :ivar terminal_reason: The stable service-generated reason for the overall outbound call job, - which can span multiple provider attempts, when available. Interpret this with ``status``: a - queued job can retain a temporary dispatch-deferral reason. Additional string codes may be - returned. Known values are: "no_answer", "no_answer_timeout", "answer_failed", - "bridge_cancelled", "bridge_failed", "voice_session_configuration_invalid", - "connection_project_mismatch", "outbound_connection_changed", - "outbound_connection_unavailable", "telephony_binding_invalid", "telephony_binding_not_found", - "telephony_binding_inactive", "telephony_binding_changed", "campaign_not_found", - "campaign_cancelled", "campaign_completed", "campaign_failed", - "origination_fence_not_recorded", "origination_reconciliation_timeout", - "cancellation_reconciliation_timeout", and - "provider_callback_timeout_cancellation_reconciliation_timeout". - :vartype terminal_reason: str or ~azure.ai.projects.models.TelephonyCallJobTerminalReason - :ivar revision: The monotonically increasing optimistic-concurrency revision. Required. - :vartype revision: int - :ivar created_at: The Unix timestamp in seconds when the call job was created. Required. - :vartype created_at: ~datetime.datetime - :ivar updated_at: The Unix timestamp in seconds when the call job was last updated. Required. - :vartype updated_at: ~datetime.datetime + :ivar total_tokens: + :vartype total_tokens: int + :ivar input_tokens: + :vartype input_tokens: int + :ivar output_tokens: + :vartype output_tokens: int + :ivar input_token_details: + :vartype input_token_details: ~azure.ai.projects.models.RealtimeResponseUsageInputTokenDetails + :ivar output_token_details: + :vartype output_token_details: + ~azure.ai.projects.models.RealtimeResponseUsageOutputTokenDetails """ - destination: "_models.TelephonyOutboundDestination" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The phone destination to call. Required.""" - connection_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The Foundry connection name in the current project used to originate the call. Its category - selects Twilio or Azure Communication Services / Teams Phone extensibility. No inbound - telephony binding is required. Required.""" - source: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The caller identity used to originate the call. For a Twilio connection, provide an authorized - E.164 phone number. For an Azure Communication Services / Teams Phone extensibility connection, - provide the Teams Resource Account object ID. The identity type is inferred from the connection - category; originating does not change inbound routing. Required.""" - purpose: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """An optional customer-declared purpose for placing the call.""" - structured_inputs: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Structured input values available to the agent and greeting for this call. Agent-declared - inputs are validated against their schemas; omitted optional inputs may use their Agent-defined - default values, while omitted required inputs are rejected. Additional inputs remain available - as dynamic template variables.""" - schedule: Optional["_models.TelephonyCallJobSchedule"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The optional execution window.""" - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The service-generated call-job identifier. Required.""" - object: Literal["telephony.call_job"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The object type. Always ``telephony.call_job``. Required. Default value is - \"telephony.call_job\".""" - agent_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the voice agent used at execution time. Required.""" - status: Union[str, "_models.TelephonyCallJobStatus"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The current call-job lifecycle status. Required. Known values are: \"accepted\", - \"waiting_for_schedule\", \"queued\", \"dispatching\", \"in_progress\", \"waiting_for_retry\", - \"cancellation_requested\", \"completed\", \"blocked\", \"expired\", \"failed\", and - \"cancelled\".""" - cancellation: Optional["_models.TelephonyCallJobCancellation"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The recorded cancellation request, when cancellation was requested.""" - retry_policy: "_models.TelephonyOutboundRetryPolicy" = rest_field( + total_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + input_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + output_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + input_token_details: Optional["_models.RealtimeResponseUsageInputTokenDetails"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The frozen provider-attempt retry policy. Required.""" - attempt_count: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The number of provider attempts created so far. Required.""" - next_attempt_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp in seconds at which the next retry becomes eligible.""" - terminal_reason: Optional[Union[str, "_models.TelephonyCallJobTerminalReason"]] = rest_field( + output_token_details: Optional["_models.RealtimeResponseUsageOutputTokenDetails"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The stable service-generated reason for the overall outbound call job, which can span multiple - provider attempts, when available. Interpret this with ``status``: a queued job can retain a - temporary dispatch-deferral reason. Additional string codes may be returned. Known values are: - \"no_answer\", \"no_answer_timeout\", \"answer_failed\", \"bridge_cancelled\", - \"bridge_failed\", \"voice_session_configuration_invalid\", \"connection_project_mismatch\", - \"outbound_connection_changed\", \"outbound_connection_unavailable\", - \"telephony_binding_invalid\", \"telephony_binding_not_found\", \"telephony_binding_inactive\", - \"telephony_binding_changed\", \"campaign_not_found\", \"campaign_cancelled\", - \"campaign_completed\", \"campaign_failed\", \"origination_fence_not_recorded\", - \"origination_reconciliation_timeout\", \"cancellation_reconciliation_timeout\", and - \"provider_callback_timeout_cancellation_reconciliation_timeout\".""" - revision: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The monotonically increasing optimistic-concurrency revision. Required.""" - created_at: datetime.datetime = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp in seconds when the call job was created. Required.""" - updated_at: datetime.datetime = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp in seconds when the call job was last updated. Required.""" @overload def __init__( self, *, - destination: "_models.TelephonyOutboundDestination", - connection_name: str, - source: str, - id: str, # pylint: disable=redefined-builtin - agent_name: str, - status: Union[str, "_models.TelephonyCallJobStatus"], - retry_policy: "_models.TelephonyOutboundRetryPolicy", - attempt_count: int, - revision: int, - created_at: datetime.datetime, - updated_at: datetime.datetime, - purpose: Optional[str] = None, - structured_inputs: Optional[dict[str, Any]] = None, - schedule: Optional["_models.TelephonyCallJobSchedule"] = None, - cancellation: Optional["_models.TelephonyCallJobCancellation"] = None, - next_attempt_at: Optional[datetime.datetime] = None, - terminal_reason: Optional[Union[str, "_models.TelephonyCallJobTerminalReason"]] = None, + total_tokens: Optional[int] = None, + input_tokens: Optional[int] = None, + output_tokens: Optional[int] = None, + input_token_details: Optional["_models.RealtimeResponseUsageInputTokenDetails"] = None, + output_token_details: Optional["_models.RealtimeResponseUsageOutputTokenDetails"] = None, ) -> None: ... @overload @@ -24442,41 +24009,41 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.object: Literal["telephony.call_job"] = "telephony.call_job" -class TelephonyCallJobCancellation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A cancellation request recorded for an outbound call job. +class RealtimeResponseUsageInputTokenDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """RealtimeResponseUsageInputTokenDetails. - :ivar requested_by: The authenticated principal that requested cancellation. Required. - :vartype requested_by: str - :ivar mode: The cancellation mode applied to the call job. Required. - :vartype mode: str - :ivar requested_at: The Unix timestamp in seconds when cancellation was requested. Required. - :vartype requested_at: ~datetime.datetime - :ivar revision: The call-job revision at which cancellation was recorded. Required. - :vartype revision: int + :ivar cached_tokens: + :vartype cached_tokens: int + :ivar text_tokens: + :vartype text_tokens: int + :ivar image_tokens: + :vartype image_tokens: int + :ivar audio_tokens: + :vartype audio_tokens: int + :ivar cached_tokens_details: + :vartype cached_tokens_details: + ~azure.ai.projects.models.RealtimeResponseUsageInputTokenDetailsCachedTokensDetails """ - requested_by: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The authenticated principal that requested cancellation. Required.""" - mode: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The cancellation mode applied to the call job. Required.""" - requested_at: datetime.datetime = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + cached_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + text_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + image_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + audio_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + cached_tokens_details: Optional["_models.RealtimeResponseUsageInputTokenDetailsCachedTokensDetails"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """The Unix timestamp in seconds when cancellation was requested. Required.""" - revision: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The call-job revision at which cancellation was recorded. Required.""" @overload def __init__( self, *, - requested_by: str, - mode: str, - requested_at: datetime.datetime, - revision: int, + cached_tokens: Optional[int] = None, + text_tokens: Optional[int] = None, + image_tokens: Optional[int] = None, + audio_tokens: Optional[int] = None, + cached_tokens_details: Optional["_models.RealtimeResponseUsageInputTokenDetailsCachedTokensDetails"] = None, ) -> None: ... @overload @@ -24490,30 +24057,30 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class TelephonyCallJobSchedule(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The optional execution window for a direct outbound call. +class RealtimeResponseUsageInputTokenDetailsCachedTokensDetails( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """RealtimeResponseUsageInputTokenDetailsCachedTokensDetails. - :ivar not_before: The earliest instant at which dispatch may begin. - :vartype not_before: ~datetime.datetime - :ivar expires_at: The instant after which the call job expires without dispatch. - :vartype expires_at: ~datetime.datetime + :ivar text_tokens: + :vartype text_tokens: int + :ivar image_tokens: + :vartype image_tokens: int + :ivar audio_tokens: + :vartype audio_tokens: int """ - not_before: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The earliest instant at which dispatch may begin.""" - expires_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The instant after which the call job expires without dispatch.""" + text_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + image_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + audio_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - not_before: Optional[datetime.datetime] = None, - expires_at: Optional[datetime.datetime] = None, + text_tokens: Optional[int] = None, + image_tokens: Optional[int] = None, + audio_tokens: Optional[int] = None, ) -> None: ... @overload @@ -24527,127 +24094,24 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class TelephonyCallLifecycleEvent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A bounded durable observation in the lifecycle of one telephony call. +class RealtimeResponseUsageOutputTokenDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """RealtimeResponseUsageOutputTokenDetails. - :ivar sequence: The service-assigned order of the event within the call record. Required. - :vartype sequence: int - :ivar name: The stable provider-neutral event name. Required. Known values are: - "telephony.webhook.received", "telephony.webhook.validation", "telephony.binding.resolve", - "telephony.provider.answer", "telephony.media.connect", "telephony.agent_session.connect", - "telephony.media.first_caller_audio", "telephony.media.first_agent_audio", - "telephony.call.transfer", "telephony.call.hangup", and "telephony.call.disconnect". - :vartype name: str or ~azure.ai.projects.models.TelephonyCallLifecycleEventName - :ivar source: The component that supplied the observation. Required. Known values are: - "gateway", "teams_phone_extensibility", "twilio", and "voice_agent". - :vartype source: str or ~azure.ai.projects.models.TelephonyCallLifecycleEventSource - :ivar outcome: The outcome of the observed lifecycle operation. Required. Known values are: - "observed", "started", "succeeded", "failed", "rejected", and "cancelled". - :vartype outcome: str or ~azure.ai.projects.models.TelephonyCallLifecycleEventOutcome - :ivar observed_at: The Unix timestamp (in seconds) for when the service observed the event. - Required. - :vartype observed_at: ~datetime.datetime - :ivar occurred_at: The Unix timestamp (in seconds) for when the event occurred according to the - provider. - :vartype occurred_at: ~datetime.datetime - :ivar timestamp_source: The source of the event timestamp. Required. Known values are: - "provider", "gateway", and "derived". - :vartype timestamp_source: str or ~azure.ai.projects.models.TelephonyCallTimestampSource - :ivar reason: A stable service-generated reason associated with this lifecycle event, not - necessarily the final outcome of the call. Additional string codes may be returned. Known - values are: "invalid_webhook_payload", "webhook_validation_failed", "binding_not_found", - "binding_suspended", "admission_rejected", "admission_check_failed", "route_agent_mismatch", - "invalid_binding_configuration", "credential_resolution_failed", "provider_resource_mismatch", - "endpoint_resolution_failed", "ingress_setup_failed", "live_call_conflict", - "live_call_persistence_failed", "answer_failed", "provider_disconnected", "provider_busy", - "provider_no_answer", "provider_cancelled", "provider_failed", "provider_stream_error", - "provider_stream_stopped", "agent_session_connect_failed", "media_stream_ended", - "bridge_cancelled", "bridge_failed", "managed_hangup", "managed_transfer", - "manage_hangup_failed", and "manage_transfer_failed". - :vartype reason: str or ~azure.ai.projects.models.TelephonyCallLifecycleEventReason - :ivar provider_event_id: The provider event identifier used for idempotency, when supplied. - :vartype provider_event_id: str - :ivar provider_sequence: The provider event sequence, when supplied. - :vartype provider_sequence: int - :ivar provider_status_code: The provider status code associated with the event. - :vartype provider_status_code: int - :ivar provider_sub_code: The provider subcode associated with the event. - :vartype provider_sub_code: int + :ivar text_tokens: + :vartype text_tokens: int + :ivar audio_tokens: + :vartype audio_tokens: int """ - sequence: int = rest_field(visibility=["read"]) - """The service-assigned order of the event within the call record. Required.""" - name: Union[str, "_models.TelephonyCallLifecycleEventName"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The stable provider-neutral event name. Required. Known values are: - \"telephony.webhook.received\", \"telephony.webhook.validation\", - \"telephony.binding.resolve\", \"telephony.provider.answer\", \"telephony.media.connect\", - \"telephony.agent_session.connect\", \"telephony.media.first_caller_audio\", - \"telephony.media.first_agent_audio\", \"telephony.call.transfer\", \"telephony.call.hangup\", - and \"telephony.call.disconnect\".""" - source: Union[str, "_models.TelephonyCallLifecycleEventSource"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The component that supplied the observation. Required. Known values are: \"gateway\", - \"teams_phone_extensibility\", \"twilio\", and \"voice_agent\".""" - outcome: Union[str, "_models.TelephonyCallLifecycleEventOutcome"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The outcome of the observed lifecycle operation. Required. Known values are: \"observed\", - \"started\", \"succeeded\", \"failed\", \"rejected\", and \"cancelled\".""" - observed_at: datetime.datetime = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp (in seconds) for when the service observed the event. Required.""" - occurred_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp (in seconds) for when the event occurred according to the provider.""" - timestamp_source: Union[str, "_models.TelephonyCallTimestampSource"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The source of the event timestamp. Required. Known values are: \"provider\", \"gateway\", and - \"derived\".""" - reason: Optional[Union[str, "_models.TelephonyCallLifecycleEventReason"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """A stable service-generated reason associated with this lifecycle event, not necessarily the - final outcome of the call. Additional string codes may be returned. Known values are: - \"invalid_webhook_payload\", \"webhook_validation_failed\", \"binding_not_found\", - \"binding_suspended\", \"admission_rejected\", \"admission_check_failed\", - \"route_agent_mismatch\", \"invalid_binding_configuration\", \"credential_resolution_failed\", - \"provider_resource_mismatch\", \"endpoint_resolution_failed\", \"ingress_setup_failed\", - \"live_call_conflict\", \"live_call_persistence_failed\", \"answer_failed\", - \"provider_disconnected\", \"provider_busy\", \"provider_no_answer\", \"provider_cancelled\", - \"provider_failed\", \"provider_stream_error\", \"provider_stream_stopped\", - \"agent_session_connect_failed\", \"media_stream_ended\", \"bridge_cancelled\", - \"bridge_failed\", \"managed_hangup\", \"managed_transfer\", \"manage_hangup_failed\", and - \"manage_transfer_failed\".""" - provider_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The provider event identifier used for idempotency, when supplied.""" - provider_sequence: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The provider event sequence, when supplied.""" - provider_status_code: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The provider status code associated with the event.""" - provider_sub_code: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The provider subcode associated with the event.""" + text_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + audio_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - name: Union[str, "_models.TelephonyCallLifecycleEventName"], - source: Union[str, "_models.TelephonyCallLifecycleEventSource"], - outcome: Union[str, "_models.TelephonyCallLifecycleEventOutcome"], - observed_at: datetime.datetime, - timestamp_source: Union[str, "_models.TelephonyCallTimestampSource"], - occurred_at: Optional[datetime.datetime] = None, - reason: Optional[Union[str, "_models.TelephonyCallLifecycleEventReason"]] = None, - provider_event_id: Optional[str] = None, - provider_sequence: Optional[int] = None, - provider_status_code: Optional[int] = None, - provider_sub_code: Optional[int] = None, + text_tokens: Optional[int] = None, + audio_tokens: Optional[int] = None, ) -> None: ... @overload @@ -24661,180 +24125,7056 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class TelephonyCallRecord(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Detailed diagnostics for a durable inbound call to a voice agent. +class RealtimeServerEvent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A realtime server event. - :ivar id: The service-generated call identifier. Required. - :vartype id: str - :ivar provider: The telephony provider. Required. Known values are: "teams_phone_extensibility" - and "twilio". - :vartype provider: str or ~azure.ai.projects.models.TelephonyProvider - :ivar provider_call_id: The provider-assigned call identifier, when available. - :vartype provider_call_id: str - :ivar caller_number: The caller's phone number, when supplied by the provider. - :vartype caller_number: str - :ivar provider_number: The Teams Phone extensibility or Twilio number that received the call. - :vartype provider_number: str - :ivar status: The lifecycle status of the call. Required. Known values are: "in_progress", - "success", and "failed". - :vartype status: str or ~azure.ai.projects.models.TelephonyCallStatus - :ivar phase: The provider-neutral lifecycle phase reached by the call. Required. Known values - are: "received", "validated", "admitted", "answering", "answered", "media_connected", - "agent_session_ready", "bridging", "managing", "completed", "rejected", and "failed". - :vartype phase: str or ~azure.ai.projects.models.TelephonyCallPhase - :ivar started_at: The Unix timestamp (in seconds) for when the inbound webhook was received. - Required. - :vartype started_at: ~datetime.datetime - :ivar answered_at: The Unix timestamp (in seconds) for when the provider reported the call as - answered. - :vartype answered_at: ~datetime.datetime - :ivar media_connected_at: The Unix timestamp (in seconds) for when the provider media channel - connected. - :vartype media_connected_at: ~datetime.datetime - :ivar agent_session_ready_at: The Unix timestamp (in seconds) for when the voice-agent session - became ready. - :vartype agent_session_ready_at: ~datetime.datetime - :ivar ended_at: The Unix timestamp (in seconds) for when the call ended. - :vartype ended_at: ~datetime.datetime - :ivar duration_ms: The call duration. - :vartype duration_ms: ~datetime.timedelta - :ivar end_reason: The service-generated reason that this single call ended, rather than the - outcome of an overall outbound call job. Additional string codes may be returned. Known values - are: "invalid_webhook_payload", "webhook_validation_failed", "binding_not_found", - "binding_suspended", "admission_rejected", "admission_check_failed", "route_agent_mismatch", - "invalid_binding_configuration", "credential_resolution_failed", "provider_resource_mismatch", - "endpoint_resolution_failed", "ingress_setup_failed", "live_call_conflict", - "live_call_persistence_failed", "answer_failed", "provider_disconnected", "provider_busy", - "provider_no_answer", "provider_cancelled", "provider_failed", "provider_stream_error", - "provider_stream_stopped", "agent_session_connect_failed", "media_stream_ended", - "bridge_cancelled", "bridge_failed", "managed_hangup", "managed_transfer", - "manage_hangup_failed", and "manage_transfer_failed". - :vartype end_reason: str or ~azure.ai.projects.models.TelephonyCallEndReason - :ivar provider_status_code: The provider status code associated with the terminal result. - :vartype provider_status_code: int - :ivar provider_sub_code: The provider subcode associated with the terminal result. - :vartype provider_sub_code: int - :ivar provider_message: The provider message associated with the terminal result. - :vartype provider_message: str - :ivar timing: Detailed provider-neutral call timing. Required. - :vartype timing: ~azure.ai.projects.models.TelephonyCallTiming - :ivar trace: Correlation to the customer-facing Foundry trace. - :vartype trace: ~azure.ai.projects.models.TelephonyCallTrace - :ivar events: The lifecycle timeline. Required. - :vartype events: list[~azure.ai.projects.models.TelephonyCallLifecycleEvent] - :ivar events_truncated: Whether older lifecycle events were omitted from the timeline. - Required. - :vartype events_truncated: bool + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + RealtimeServerEventConversationItemAdded, RealtimeServerEventConversationItemCreated, + RealtimeServerEventConversationItemDeleted, RealtimeServerEventConversationItemDone, + RealtimeServerEventConversationItemInputAudioTranscriptionCompleted, + RealtimeServerEventConversationItemInputAudioTranscriptionDelta, + RealtimeServerEventConversationItemInputAudioTranscriptionFailed, + RealtimeServerEventConversationItemInputAudioTranscriptionSegment, + RealtimeServerEventConversationItemRetrieved, RealtimeServerEventConversationItemTruncated, + RealtimeServerEventInputAudioBufferCleared, RealtimeServerEventInputAudioBufferCommitted, + RealtimeServerEventInputAudioBufferSpeechStarted, + RealtimeServerEventInputAudioBufferSpeechStopped, + RealtimeServerEventInputAudioBufferTimeoutTriggered, RealtimeServerEventMCPListToolsCompleted, + RealtimeServerEventMCPListToolsFailed, RealtimeServerEventMCPListToolsInProgress, + RealtimeServerEventOutputAudioBufferCleared, RealtimeServerEventRateLimitsUpdated, + VoiceAgentServerEventResponseAnimationBlendshapesDelta, + VoiceAgentServerEventResponseAnimationBlendshapesDone, + VoiceAgentServerEventResponseAnimationVisemeDelta, + VoiceAgentServerEventResponseAnimationVisemeDone, + VoiceAgentServerEventResponseAudioTimestampDelta, + VoiceAgentServerEventResponseAudioTimestampDone, RealtimeServerEventResponseContentPartAdded, + RealtimeServerEventResponseContentPartDone, RealtimeServerEventResponseCreated, + RealtimeServerEventResponseDone, RealtimeServerEventResponseFunctionCallArgumentsDelta, + RealtimeServerEventResponseFunctionCallArgumentsDone, + RealtimeServerEventResponseMCPCallCompleted, RealtimeServerEventResponseMCPCallFailed, + RealtimeServerEventResponseMCPCallInProgress, RealtimeServerEventResponseMCPCallArgumentsDelta, + RealtimeServerEventResponseMCPCallArgumentsDone, RealtimeServerEventResponseAudioDelta, + RealtimeServerEventResponseAudioDone, RealtimeServerEventResponseAudioTranscriptDelta, + RealtimeServerEventResponseAudioTranscriptDone, RealtimeServerEventResponseOutputItemAdded, + RealtimeServerEventResponseOutputItemDone, RealtimeServerEventResponseTextDelta, + RealtimeServerEventResponseTextDone, VoiceAgentServerEventResponseVideoDelta, + VoiceAgentServerEventRtcCallError, VoiceAgentServerEventRtcCallSdpCreated, + VoiceAgentServerEventSessionAvatarConnecting, VoiceAgentServerEventSessionAvatarSwitchToIdle, + VoiceAgentServerEventSessionAvatarSwitchToSpeaking, RealtimeServerEventSessionCreated, + VoiceAgentServerEventSessionSubagentAborted, VoiceAgentServerEventSessionSubagentCompleted, + VoiceAgentServerEventSessionSubagentStarted, RealtimeServerEventSessionUpdated, + VoiceAgentServerEventWarning + + :ivar type: Required. Known values are: "conversation.created", "conversation.item.created", + "conversation.item.deleted", "conversation.item.input_audio_transcription.completed", + "conversation.item.input_audio_transcription.delta", + "conversation.item.input_audio_transcription.failed", "conversation.item.retrieved", + "conversation.item.truncated", "error", "input_audio_buffer.cleared", + "input_audio_buffer.committed", "input_audio_buffer.dtmf_event_received", + "input_audio_buffer.speech_started", "input_audio_buffer.speech_stopped", + "rate_limits.updated", "response.output_audio.delta", "response.output_audio.done", + "response.output_audio_transcript.delta", "response.output_audio_transcript.done", + "response.content_part.added", "response.content_part.done", "response.created", + "response.done", "response.function_call_arguments.delta", + "response.function_call_arguments.done", "response.output_item.added", + "response.output_item.done", "response.output_text.delta", "response.output_text.done", + "session.created", "session.updated", "output_audio_buffer.started", + "output_audio_buffer.stopped", "output_audio_buffer.cleared", "conversation.item.added", + "conversation.item.done", "input_audio_buffer.timeout_triggered", + "conversation.item.input_audio_transcription.segment", "mcp_list_tools.in_progress", + "mcp_list_tools.completed", "mcp_list_tools.failed", "response.mcp_call_arguments.delta", + "response.mcp_call_arguments.done", "response.mcp_call.in_progress", + "response.mcp_call.completed", "response.mcp_call.failed", "warning", + "session.subagent.started", "session.subagent.completed", "session.subagent.aborted", + "session.avatar.connecting", "session.avatar.switch_to_speaking", + "session.avatar.switch_to_idle", "rtc.call.sdp.created", "rtc.call.error", + "response.audio_timestamp.delta", "response.audio_timestamp.done", + "response.animation_blendshapes.delta", "response.animation_blendshapes.done", + "response.animation_viseme.delta", "response.animation_viseme.done", and + "response.video.delta". + :vartype type: str or ~azure.ai.projects.models.RealtimeServerEventType + """ + + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"conversation.created\", \"conversation.item.created\", + \"conversation.item.deleted\", \"conversation.item.input_audio_transcription.completed\", + \"conversation.item.input_audio_transcription.delta\", + \"conversation.item.input_audio_transcription.failed\", \"conversation.item.retrieved\", + \"conversation.item.truncated\", \"error\", \"input_audio_buffer.cleared\", + \"input_audio_buffer.committed\", \"input_audio_buffer.dtmf_event_received\", + \"input_audio_buffer.speech_started\", \"input_audio_buffer.speech_stopped\", + \"rate_limits.updated\", \"response.output_audio.delta\", \"response.output_audio.done\", + \"response.output_audio_transcript.delta\", \"response.output_audio_transcript.done\", + \"response.content_part.added\", \"response.content_part.done\", \"response.created\", + \"response.done\", \"response.function_call_arguments.delta\", + \"response.function_call_arguments.done\", \"response.output_item.added\", + \"response.output_item.done\", \"response.output_text.delta\", \"response.output_text.done\", + \"session.created\", \"session.updated\", \"output_audio_buffer.started\", + \"output_audio_buffer.stopped\", \"output_audio_buffer.cleared\", \"conversation.item.added\", + \"conversation.item.done\", \"input_audio_buffer.timeout_triggered\", + \"conversation.item.input_audio_transcription.segment\", \"mcp_list_tools.in_progress\", + \"mcp_list_tools.completed\", \"mcp_list_tools.failed\", \"response.mcp_call_arguments.delta\", + \"response.mcp_call_arguments.done\", \"response.mcp_call.in_progress\", + \"response.mcp_call.completed\", \"response.mcp_call.failed\", \"warning\", + \"session.subagent.started\", \"session.subagent.completed\", \"session.subagent.aborted\", + \"session.avatar.connecting\", \"session.avatar.switch_to_speaking\", + \"session.avatar.switch_to_idle\", \"rtc.call.sdp.created\", \"rtc.call.error\", + \"response.audio_timestamp.delta\", \"response.audio_timestamp.done\", + \"response.animation_blendshapes.delta\", \"response.animation_blendshapes.done\", + \"response.animation_viseme.delta\", \"response.animation_viseme.done\", and + \"response.video.delta\".""" + + @overload + def __init__( + self, + *, + type: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class RealtimeServerEventConversationItemAdded( + RealtimeServerEvent, discriminator="conversation.item.added" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Sent by the server when an Item is added to the default Conversation. This can happen in + several cases: + + * When the client sends a `conversation.item.create` event. + * When the input audio buffer is committed. In this case the item will be a user message containing the audio from + the buffer. + * When the model is generating a Response. In this case the `conversation.item.added` event will be sent when the + model starts generating a specific Item, and thus it will not yet have any content (and `status` will be + `in_progress`). The event will include the full content of the Item (except when model is generating a Response) + except for audio data, which can be retrieved separately with a `conversation.item.retrieve` event if necessary. + + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``conversation.item.added``. Required. + CONVERSATION_ITEM_ADDED. + :vartype type: str or ~azure.ai.projects.models.CONVERSATION_ITEM_ADDED + :ivar previous_item_id: + :vartype previous_item_id: str + :ivar item: Required. + :vartype item: ~azure.ai.projects.models.RealtimeConversationItem + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``conversation.item.added``. Required. CONVERSATION_ITEM_ADDED.""" + previous_item_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + item: "_models.RealtimeConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + item: "_models.RealtimeConversationItem", + previous_item_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.CONVERSATION_ITEM_ADDED # type: ignore + + +class RealtimeServerEventConversationItemCreated( + RealtimeServerEvent, discriminator="conversation.item.created" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Returned when a conversation item is created. There are several scenarios that produce this + event: + + * The server is generating a Response, which if successful will produce either one or two Items, which will be of + type `message` (role `assistant`) or type `function_call`. + * The input audio buffer has been committed, either by the client or the server (in `server_vad` mode). The server + will take the content of the input audio buffer and add it to a new user message Item. + * The client has sent a `conversation.item.create` event to add a new Item to the Conversation. + + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``conversation.item.created``. Required. + CONVERSATION_ITEM_CREATED. + :vartype type: str or ~azure.ai.projects.models.CONVERSATION_ITEM_CREATED + :ivar previous_item_id: + :vartype previous_item_id: str + :ivar item: Required. + :vartype item: ~azure.ai.projects.models.RealtimeConversationItem + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``conversation.item.created``. Required. CONVERSATION_ITEM_CREATED.""" + previous_item_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + item: "_models.RealtimeConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + item: "_models.RealtimeConversationItem", + previous_item_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.CONVERSATION_ITEM_CREATED # type: ignore + + +class RealtimeServerEventConversationItemDeleted( + RealtimeServerEvent, discriminator="conversation.item.deleted" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Returned when an item in the conversation is deleted by the client with a + ``conversation.item.delete`` event. This event is used to synchronize the server's + understanding of the conversation history with the client's view. + + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``conversation.item.deleted``. Required. + CONVERSATION_ITEM_DELETED. + :vartype type: str or ~azure.ai.projects.models.CONVERSATION_ITEM_DELETED + :ivar item_id: The ID of the item that was deleted. Required. + :vartype item_id: str + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DELETED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``conversation.item.deleted``. Required. CONVERSATION_ITEM_DELETED.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the item that was deleted. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + item_id: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.CONVERSATION_ITEM_DELETED # type: ignore + + +class RealtimeServerEventConversationItemDone( + RealtimeServerEvent, discriminator="conversation.item.done" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Returned when a conversation item is finalized. The event will include the full content of the + Item except for audio data, which can be retrieved separately with a + ``conversation.item.retrieve`` event if needed. + + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``conversation.item.done``. Required. + CONVERSATION_ITEM_DONE. + :vartype type: str or ~azure.ai.projects.models.CONVERSATION_ITEM_DONE + :ivar previous_item_id: + :vartype previous_item_id: str + :ivar item: Required. + :vartype item: ~azure.ai.projects.models.RealtimeConversationItem + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``conversation.item.done``. Required. CONVERSATION_ITEM_DONE.""" + previous_item_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + item: "_models.RealtimeConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + item: "_models.RealtimeConversationItem", + previous_item_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.CONVERSATION_ITEM_DONE # type: ignore + + +class RealtimeServerEventConversationItemInputAudioTranscriptionCompleted( + RealtimeServerEvent, discriminator="conversation.item.input_audio_transcription.completed" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """This event is the output of audio transcription for user audio written to the user audio + buffer. Transcription begins when the input audio buffer is committed by the client or server + (when VAD is enabled). Transcription runs asynchronously with Response creation, so this event + may come before or after the Response events. Realtime API models accept audio natively, and + thus input transcription is a separate process run on a separate ASR (Automatic Speech + Recognition) model. The transcript may diverge somewhat from the model's interpretation, and + should be treated as a rough guide. + + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``conversation.item.input_audio_transcription.completed``. + Required. CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED. + :vartype type: str or + ~azure.ai.projects.models.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED + :ivar item_id: The ID of the item containing the audio that is being transcribed. Required. + :vartype item_id: str + :ivar content_index: The index of the content part containing the audio. Required. + :vartype content_index: int + :ivar transcript: The transcribed text. Required. + :vartype transcript: str + :ivar languages: The languages detected in the audio. Returned by ``gpt-transcribe``. An empty + array indicates that no language could be reliably detected. + :vartype languages: list[~azure.ai.projects.models.TranscriptionLanguage] + :ivar logprobs: + :vartype logprobs: list[~azure.ai.projects.models.LogProbProperties] + :ivar usage: Usage statistics for the transcription, this is billed according to the ASR + model's pricing rather than the realtime model's pricing. Required. Is either a + TranscriptTextUsageTokens type or a TranscriptTextUsageDuration type. + :vartype usage: ~azure.ai.projects.models.TranscriptTextUsageTokens or + ~azure.ai.projects.models.TranscriptTextUsageDuration + :ivar phrases: Phrase-level transcription timing and confidence details. + :vartype phrases: list[~azure.ai.projects.models.VoiceAgentTranscriptionPhrase] + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``conversation.item.input_audio_transcription.completed``. Required. + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the item containing the audio that is being transcribed. Required.""" + content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the content part containing the audio. Required.""" + transcript: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The transcribed text. Required.""" + languages: Optional[list["_models.TranscriptionLanguage"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The languages detected in the audio. Returned by ``gpt-transcribe``. An empty array indicates + that no language could be reliably detected.""" + logprobs: Optional[list["_models.LogProbProperties"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + usage: Union["_models.TranscriptTextUsageTokens", "_models.TranscriptTextUsageDuration"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Usage statistics for the transcription, this is billed according to the ASR model's pricing + rather than the realtime model's pricing. Required. Is either a TranscriptTextUsageTokens type + or a TranscriptTextUsageDuration type.""" + phrases: Optional[list["_models.VoiceAgentTranscriptionPhrase"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Phrase-level transcription timing and confidence details.""" + + @overload + def __init__( + self, + *, + event_id: str, + item_id: str, + content_index: int, + transcript: str, + usage: Union["_models.TranscriptTextUsageTokens", "_models.TranscriptTextUsageDuration"], + languages: Optional[list["_models.TranscriptionLanguage"]] = None, + logprobs: Optional[list["_models.LogProbProperties"]] = None, + phrases: Optional[list["_models.VoiceAgentTranscriptionPhrase"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED # type: ignore + + +class RealtimeServerEventConversationItemInputAudioTranscriptionDelta( + RealtimeServerEvent, discriminator="conversation.item.input_audio_transcription.delta" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Returned when the text value of an input audio transcription content part is updated with + incremental transcription results. + + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``conversation.item.input_audio_transcription.delta``. + Required. CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA. + :vartype type: str or + ~azure.ai.projects.models.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA + :ivar item_id: The ID of the item containing the audio that is being transcribed. Required. + :vartype item_id: str + :ivar content_index: The index of the content part in the item's content array. + :vartype content_index: int + :ivar delta: The text delta. + :vartype delta: str + :ivar logprobs: + :vartype logprobs: list[~azure.ai.projects.models.LogProbProperties] + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``conversation.item.input_audio_transcription.delta``. Required. + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the item containing the audio that is being transcribed. Required.""" + content_index: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the content part in the item's content array.""" + delta: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The text delta.""" + logprobs: Optional[list["_models.LogProbProperties"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + + @overload + def __init__( + self, + *, + event_id: str, + item_id: str, + content_index: Optional[int] = None, + delta: Optional[str] = None, + logprobs: Optional[list["_models.LogProbProperties"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA # type: ignore + + +class RealtimeServerEventConversationItemInputAudioTranscriptionFailed( + RealtimeServerEvent, discriminator="conversation.item.input_audio_transcription.failed" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Returned when input audio transcription is configured, and a transcription request for a user + message failed. These events are separate from other ``error`` events so that the client can + identify the related Item. + + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``conversation.item.input_audio_transcription.failed``. + Required. CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED. + :vartype type: str or + ~azure.ai.projects.models.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED + :ivar item_id: The ID of the user message item. Required. + :vartype item_id: str + :ivar content_index: The index of the content part containing the audio. Required. + :vartype content_index: int + :ivar error: Details of the transcription error. Required. + :vartype error: + ~azure.ai.projects.models.RealtimeServerEventConversationItemInputAudioTranscriptionFailedError + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``conversation.item.input_audio_transcription.failed``. Required. + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the user message item. Required.""" + content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the content part containing the audio. Required.""" + error: "_models.RealtimeServerEventConversationItemInputAudioTranscriptionFailedError" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Details of the transcription error. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + item_id: str, + content_index: int, + error: "_models.RealtimeServerEventConversationItemInputAudioTranscriptionFailedError", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED # type: ignore + + +class RealtimeServerEventConversationItemInputAudioTranscriptionFailedError( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """RealtimeServerEventConversationItemInputAudioTranscriptionFailedError. + + :ivar type: + :vartype type: str + :ivar code: + :vartype code: str + :ivar message: + :vartype message: str + :ivar param: + :vartype param: str + """ + + type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + code: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + param: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + + @overload + def __init__( + self, + *, + type: Optional[str] = None, + code: Optional[str] = None, + message: Optional[str] = None, + param: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class RealtimeServerEventConversationItemInputAudioTranscriptionSegment( + RealtimeServerEvent, discriminator="conversation.item.input_audio_transcription.segment" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Returned when an input audio transcription segment is identified for an item. + + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``conversation.item.input_audio_transcription.segment``. + Required. CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT. + :vartype type: str or + ~azure.ai.projects.models.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT + :ivar item_id: The ID of the item containing the input audio content. Required. + :vartype item_id: str + :ivar content_index: The index of the input audio content part within the item. Required. + :vartype content_index: int + :ivar text: The text for this segment. Required. + :vartype text: str + :ivar id: The segment identifier. Required. + :vartype id: str + :ivar speaker: The detected speaker label for this segment. Required. + :vartype speaker: str + :ivar start: Start time of the segment in seconds. Required. + :vartype start: float + :ivar end: End time of the segment in seconds. Required. + :vartype end: float + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``conversation.item.input_audio_transcription.segment``. Required. + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the item containing the input audio content. Required.""" + content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the input audio content part within the item. Required.""" + text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The text for this segment. Required.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The segment identifier. Required.""" + speaker: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The detected speaker label for this segment. Required.""" + start: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Start time of the segment in seconds. Required.""" + end: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """End time of the segment in seconds. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + item_id: str, + content_index: int, + text: str, + id: str, # pylint: disable=redefined-builtin + speaker: str, + start: float, + end: float, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT # type: ignore + + +class RealtimeServerEventConversationItemRetrieved( + RealtimeServerEvent, discriminator="conversation.item.retrieved" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Returned when a conversation item is retrieved with ``conversation.item.retrieve``. This is + provided as a way to fetch the server's representation of an item, for example to get access to + the post-processed audio data after noise cancellation and VAD. It includes the full content of + the Item, including audio data. + + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``conversation.item.retrieved``. Required. + CONVERSATION_ITEM_RETRIEVED. + :vartype type: str or ~azure.ai.projects.models.CONVERSATION_ITEM_RETRIEVED + :ivar item: Required. + :vartype item: ~azure.ai.projects.models.RealtimeConversationItem + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``conversation.item.retrieved``. Required. CONVERSATION_ITEM_RETRIEVED.""" + item: "_models.RealtimeConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + item: "_models.RealtimeConversationItem", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED # type: ignore + + +class RealtimeServerEventConversationItemTruncated( + RealtimeServerEvent, discriminator="conversation.item.truncated" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Returned when an earlier assistant audio message item is truncated by the client with a + ``conversation.item.truncate`` event. This event is used to synchronize the server's + understanding of the audio with the client's playback. This action will truncate the audio and + remove the server-side text transcript to ensure there is no text in the context that hasn't + been heard by the user. + + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``conversation.item.truncated``. Required. + CONVERSATION_ITEM_TRUNCATED. + :vartype type: str or ~azure.ai.projects.models.CONVERSATION_ITEM_TRUNCATED + :ivar item_id: The ID of the assistant message item that was truncated. Required. + :vartype item_id: str + :ivar content_index: The index of the content part that was truncated. Required. + :vartype content_index: int + :ivar audio_end_ms: The duration up to which the audio was truncated, in milliseconds. + Required. + :vartype audio_end_ms: int + :ivar item: The assistant message after truncation, when the service returns the updated item. + :vartype item: ~azure.ai.projects.models.RealtimeConversationItem + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_TRUNCATED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``conversation.item.truncated``. Required. CONVERSATION_ITEM_TRUNCATED.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the assistant message item that was truncated. Required.""" + content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the content part that was truncated. Required.""" + audio_end_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The duration up to which the audio was truncated, in milliseconds. Required.""" + item: Optional["_models.RealtimeConversationItem"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The assistant message after truncation, when the service returns the updated item.""" + + @overload + def __init__( + self, + *, + event_id: str, + item_id: str, + content_index: int, + audio_end_ms: int, + item: Optional["_models.RealtimeConversationItem"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.CONVERSATION_ITEM_TRUNCATED # type: ignore + + +class RealtimeServerEventError(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Returned when an error occurs, which could be a client problem or a server problem. Most errors + are recoverable and the session will stay open, we recommend to implementors to monitor and log + error messages by default. + + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``error``. Required. Default value is "error". + :vartype type: str + :ivar error: Details of the error. Required. + :vartype error: ~azure.ai.projects.models.RealtimeServerEventErrorError + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal["error"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event type, must be ``error``. Required. Default value is \"error\".""" + error: "_models.RealtimeServerEventErrorError" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Details of the error. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + error: "_models.RealtimeServerEventErrorError", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type: Literal["error"] = "error" + + +class RealtimeServerEventErrorError(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """RealtimeServerEventErrorError. + + :ivar type: Required. + :vartype type: str + :ivar code: + :vartype code: str + :ivar message: Required. + :vartype message: str + :ivar param: + :vartype param: str + :ivar event_id: + :vartype event_id: str + """ + + type: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + code: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + param: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + + @overload + def __init__( + self, + *, + type: str, + message: str, + code: Optional[str] = None, + param: Optional[str] = None, + event_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class RealtimeServerEventInputAudioBufferCleared( + RealtimeServerEvent, discriminator="input_audio_buffer.cleared" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Returned when the input audio buffer is cleared by the client with a + ``input_audio_buffer.clear`` event. + + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``input_audio_buffer.cleared``. Required. + INPUT_AUDIO_BUFFER_CLEARED. + :vartype type: str or ~azure.ai.projects.models.INPUT_AUDIO_BUFFER_CLEARED + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_CLEARED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``input_audio_buffer.cleared``. Required. INPUT_AUDIO_BUFFER_CLEARED.""" + + @overload + def __init__( + self, + *, + event_id: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.INPUT_AUDIO_BUFFER_CLEARED # type: ignore + + +class RealtimeServerEventInputAudioBufferCommitted( + RealtimeServerEvent, discriminator="input_audio_buffer.committed" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Returned when an input audio buffer is committed, either by the client or automatically in + server VAD mode. The ``item_id`` property is the ID of the user message item that will be + created, thus a ``conversation.item.created`` event will also be sent to the client. + + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``input_audio_buffer.committed``. Required. + INPUT_AUDIO_BUFFER_COMMITTED. + :vartype type: str or ~azure.ai.projects.models.INPUT_AUDIO_BUFFER_COMMITTED + :ivar previous_item_id: + :vartype previous_item_id: str + :ivar item_id: The ID of the user message item that will be created. Required. + :vartype item_id: str + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_COMMITTED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``input_audio_buffer.committed``. Required. + INPUT_AUDIO_BUFFER_COMMITTED.""" + previous_item_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the user message item that will be created. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + item_id: str, + previous_item_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.INPUT_AUDIO_BUFFER_COMMITTED # type: ignore + + +class RealtimeServerEventInputAudioBufferSpeechStarted( + RealtimeServerEvent, discriminator="input_audio_buffer.speech_started" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Sent by the server when in ``server_vad`` mode to indicate that speech has been detected in the + audio buffer. This can happen any time audio is added to the buffer (unless speech is already + detected). The client may want to use this event to interrupt audio playback or provide visual + feedback to the user. The client should expect to receive a + ``input_audio_buffer.speech_stopped`` event when speech stops. The ``item_id`` property is the + ID of the user message item that will be created when speech stops and will also be included in + the ``input_audio_buffer.speech_stopped`` event (unless the client manually commits the audio + buffer during VAD activation). + + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``input_audio_buffer.speech_started``. Required. + INPUT_AUDIO_BUFFER_SPEECH_STARTED. + :vartype type: str or ~azure.ai.projects.models.INPUT_AUDIO_BUFFER_SPEECH_STARTED + :ivar audio_start_ms: Milliseconds from the start of all audio written to the buffer during the + session when speech was first detected. This will correspond to the beginning of audio sent to + the model, and thus includes the ``prefix_padding_ms`` configured in the Session. Required. + :vartype audio_start_ms: int + :ivar item_id: The ID of the user message item that will be created when speech stops. + Required. + :vartype item_id: str + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STARTED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``input_audio_buffer.speech_started``. Required. + INPUT_AUDIO_BUFFER_SPEECH_STARTED.""" + audio_start_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Milliseconds from the start of all audio written to the buffer during the session when speech + was first detected. This will correspond to the beginning of audio sent to the model, and thus + includes the ``prefix_padding_ms`` configured in the Session. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the user message item that will be created when speech stops. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + audio_start_ms: int, + item_id: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STARTED # type: ignore + + +class RealtimeServerEventInputAudioBufferSpeechStopped( + RealtimeServerEvent, discriminator="input_audio_buffer.speech_stopped" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Returned in ``server_vad`` mode when the server detects the end of speech in the audio buffer. + The server will also send an ``conversation.item.created`` event with the user message item + that is created from the audio buffer. + + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``input_audio_buffer.speech_stopped``. Required. + INPUT_AUDIO_BUFFER_SPEECH_STOPPED. + :vartype type: str or ~azure.ai.projects.models.INPUT_AUDIO_BUFFER_SPEECH_STOPPED + :ivar audio_end_ms: Milliseconds since the session started when speech stopped. This will + correspond to the end of audio sent to the model, and thus includes the + ``min_silence_duration_ms`` configured in the Session. Required. + :vartype audio_end_ms: int + :ivar item_id: The ID of the user message item that will be created. Required. + :vartype item_id: str + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STOPPED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``input_audio_buffer.speech_stopped``. Required. + INPUT_AUDIO_BUFFER_SPEECH_STOPPED.""" + audio_end_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Milliseconds since the session started when speech stopped. This will correspond to the end of + audio sent to the model, and thus includes the ``min_silence_duration_ms`` configured in the + Session. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the user message item that will be created. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + audio_end_ms: int, + item_id: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STOPPED # type: ignore + + +class RealtimeServerEventInputAudioBufferTimeoutTriggered( + RealtimeServerEvent, discriminator="input_audio_buffer.timeout_triggered" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Returned when the Server VAD timeout is triggered for the input audio buffer. This is + configured with ``idle_timeout_ms`` in the ``turn_detection`` settings of the session, and it + indicates that there hasn't been any speech detected for the configured duration. The + ``audio_start_ms`` and ``audio_end_ms`` fields indicate the segment of audio after the last + model response up to the triggering time, as an offset from the beginning of audio written to + the input audio buffer. This means it demarcates the segment of audio that was silent and the + difference between the start and end values will roughly match the configured timeout. The + empty audio will be committed to the conversation as an ``input_audio`` item (there will be a + ``input_audio_buffer.committed`` event) and a model response will be generated. There may be + speech that didn't trigger VAD but is still detected by the model, so the model may respond + with something relevant to the conversation or a prompt to continue speaking. + + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``input_audio_buffer.timeout_triggered``. Required. + INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED. + :vartype type: str or ~azure.ai.projects.models.INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED + :ivar audio_start_ms: Millisecond offset of audio written to the input audio buffer that was + after the playback time of the last model response. Required. + :vartype audio_start_ms: int + :ivar audio_end_ms: Millisecond offset of audio written to the input audio buffer at the time + the timeout was triggered. Required. + :vartype audio_end_ms: int + :ivar item_id: The ID of the item associated with this segment. Required. + :vartype item_id: str + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``input_audio_buffer.timeout_triggered``. Required. + INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED.""" + audio_start_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Millisecond offset of audio written to the input audio buffer that was after the playback time + of the last model response. Required.""" + audio_end_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Millisecond offset of audio written to the input audio buffer at the time the timeout was + triggered. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the item associated with this segment. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + audio_start_ms: int, + audio_end_ms: int, + item_id: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED # type: ignore + + +class RealtimeServerEventMCPListToolsCompleted( + RealtimeServerEvent, discriminator="mcp_list_tools.completed" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Returned when listing MCP tools has completed for an item. + + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``mcp_list_tools.completed``. Required. + MCP_LIST_TOOLS_COMPLETED. + :vartype type: str or ~azure.ai.projects.models.MCP_LIST_TOOLS_COMPLETED + :ivar item_id: The ID of the MCP list tools item. Required. + :vartype item_id: str + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_COMPLETED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``mcp_list_tools.completed``. Required. MCP_LIST_TOOLS_COMPLETED.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the MCP list tools item. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + item_id: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.MCP_LIST_TOOLS_COMPLETED # type: ignore + + +class RealtimeServerEventMCPListToolsFailed( + RealtimeServerEvent, discriminator="mcp_list_tools.failed" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Returned when listing MCP tools has failed for an item. + + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``mcp_list_tools.failed``. Required. MCP_LIST_TOOLS_FAILED. + :vartype type: str or ~azure.ai.projects.models.MCP_LIST_TOOLS_FAILED + :ivar item_id: The ID of the MCP list tools item. Required. + :vartype item_id: str + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_FAILED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``mcp_list_tools.failed``. Required. MCP_LIST_TOOLS_FAILED.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the MCP list tools item. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + item_id: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.MCP_LIST_TOOLS_FAILED # type: ignore + + +class RealtimeServerEventMCPListToolsInProgress( + RealtimeServerEvent, discriminator="mcp_list_tools.in_progress" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Returned when listing MCP tools is in progress for an item. + + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``mcp_list_tools.in_progress``. Required. + MCP_LIST_TOOLS_IN_PROGRESS. + :vartype type: str or ~azure.ai.projects.models.MCP_LIST_TOOLS_IN_PROGRESS + :ivar item_id: The ID of the MCP list tools item. Required. + :vartype item_id: str + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_IN_PROGRESS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``mcp_list_tools.in_progress``. Required. MCP_LIST_TOOLS_IN_PROGRESS.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the MCP list tools item. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + item_id: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.MCP_LIST_TOOLS_IN_PROGRESS # type: ignore + + +class RealtimeServerEventOutputAudioBufferCleared( + RealtimeServerEvent, discriminator="output_audio_buffer.cleared" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """**WebRTC/SIP Only:** Emitted when the output audio buffer is cleared. This happens either in + VAD mode when the user has interrupted (``input_audio_buffer.speech_started``), or when the + client has emitted the ``output_audio_buffer.clear`` event to manually cut off the current + audio response. `Learn more + `_. + + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``output_audio_buffer.cleared``. Required. + OUTPUT_AUDIO_BUFFER_CLEARED. + :vartype type: str or ~azure.ai.projects.models.OUTPUT_AUDIO_BUFFER_CLEARED + :ivar response_id: The unique ID of the response that produced the audio. Required. + :vartype response_id: str + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``output_audio_buffer.cleared``. Required. OUTPUT_AUDIO_BUFFER_CLEARED.""" + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the response that produced the audio. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + response_id: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED # type: ignore + + +class RealtimeServerEventRateLimitsUpdated( + RealtimeServerEvent, discriminator="rate_limits.updated" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Emitted at the beginning of a Response to indicate the updated rate limits. When a Response is + created some tokens will be "reserved" for the output tokens, the rate limits shown here + reflect that reservation, which is then adjusted accordingly once the Response is completed. + + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``rate_limits.updated``. Required. RATE_LIMITS_UPDATED. + :vartype type: str or ~azure.ai.projects.models.RATE_LIMITS_UPDATED + :ivar rate_limits: List of rate limit information. Required. + :vartype rate_limits: + list[~azure.ai.projects.models.RealtimeServerEventRateLimitsUpdatedRateLimits] + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.RATE_LIMITS_UPDATED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``rate_limits.updated``. Required. RATE_LIMITS_UPDATED.""" + rate_limits: list["_models.RealtimeServerEventRateLimitsUpdatedRateLimits"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """List of rate limit information. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + rate_limits: list["_models.RealtimeServerEventRateLimitsUpdatedRateLimits"], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.RATE_LIMITS_UPDATED # type: ignore + + +class RealtimeServerEventRateLimitsUpdatedRateLimits( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """RealtimeServerEventRateLimitsUpdatedRateLimits. + + :ivar name: Is either a Literal["requests"] type or a Literal["tokens"] type. + :vartype name: str or str + :ivar limit: + :vartype limit: int + :ivar remaining: + :vartype remaining: int + :ivar reset_seconds: + :vartype reset_seconds: float + """ + + name: Optional[Literal["requests", "tokens"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Is either a Literal[\"requests\"] type or a Literal[\"tokens\"] type.""" + limit: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + remaining: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + reset_seconds: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + + @overload + def __init__( + self, + *, + name: Optional[Literal["requests", "tokens"]] = None, + limit: Optional[int] = None, + remaining: Optional[int] = None, + reset_seconds: Optional[float] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class RealtimeServerEventResponseAudioDelta( + RealtimeServerEvent, discriminator="response.output_audio.delta" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Returned when the model-generated audio is updated. + + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``response.output_audio.delta``. Required. + RESPONSE_OUTPUT_AUDIO_DELTA. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_OUTPUT_AUDIO_DELTA + :ivar response_id: The ID of the response. Required. + :vartype response_id: str + :ivar item_id: The ID of the item. Required. + :vartype item_id: str + :ivar output_index: The index of the output item in the response. Required. + :vartype output_index: int + :ivar content_index: The index of the content part in the item's content array. Required. + :vartype content_index: int + :ivar delta: Base64-encoded audio data delta. Required. + :vartype delta: bytes + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``response.output_audio.delta``. Required. RESPONSE_OUTPUT_AUDIO_DELTA.""" + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the response. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the item. Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item in the response. Required.""" + content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the content part in the item's content array. Required.""" + delta: bytes = rest_field(visibility=["read", "create", "update", "delete", "query"], format="base64") + """Base64-encoded audio data delta. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + response_id: str, + item_id: str, + output_index: int, + content_index: int, + delta: bytes, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DELTA # type: ignore + + +class RealtimeServerEventResponseAudioDone( + RealtimeServerEvent, discriminator="response.output_audio.done" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Returned when the model-generated audio is done. Also emitted when a Response is interrupted, + incomplete, or cancelled. + + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``response.output_audio.done``. Required. + RESPONSE_OUTPUT_AUDIO_DONE. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_OUTPUT_AUDIO_DONE + :ivar response_id: The ID of the response. Required. + :vartype response_id: str + :ivar item_id: The ID of the item. Required. + :vartype item_id: str + :ivar output_index: The index of the output item in the response. Required. + :vartype output_index: int + :ivar content_index: The index of the content part in the item's content array. Required. + :vartype content_index: int + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``response.output_audio.done``. Required. RESPONSE_OUTPUT_AUDIO_DONE.""" + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the response. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the item. Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item in the response. Required.""" + content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the content part in the item's content array. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + response_id: str, + item_id: str, + output_index: int, + content_index: int, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DONE # type: ignore + + +class RealtimeServerEventResponseAudioTranscriptDelta( + RealtimeServerEvent, discriminator="response.output_audio_transcript.delta" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Returned when the model-generated transcription of audio output is updated. + + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``response.output_audio_transcript.delta``. Required. + RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA + :ivar response_id: The ID of the response. Required. + :vartype response_id: str + :ivar item_id: The ID of the item. Required. + :vartype item_id: str + :ivar output_index: The index of the output item in the response. Required. + :vartype output_index: int + :ivar content_index: The index of the content part in the item's content array. Required. + :vartype content_index: int + :ivar delta: The transcript delta. Required. + :vartype delta: str + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``response.output_audio_transcript.delta``. Required. + RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA.""" + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the response. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the item. Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item in the response. Required.""" + content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the content part in the item's content array. Required.""" + delta: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The transcript delta. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + response_id: str, + item_id: str, + output_index: int, + content_index: int, + delta: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA # type: ignore + + +class RealtimeServerEventResponseAudioTranscriptDone( + RealtimeServerEvent, discriminator="response.output_audio_transcript.done" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Returned when the model-generated transcription of audio output is done streaming. Also emitted + when a Response is interrupted, incomplete, or cancelled. + + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``response.output_audio_transcript.done``. Required. + RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE + :ivar response_id: The ID of the response. Required. + :vartype response_id: str + :ivar item_id: The ID of the item. Required. + :vartype item_id: str + :ivar output_index: The index of the output item in the response. Required. + :vartype output_index: int + :ivar content_index: The index of the content part in the item's content array. Required. + :vartype content_index: int + :ivar transcript: The final transcript of the audio. Required. + :vartype transcript: str + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``response.output_audio_transcript.done``. Required. + RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE.""" + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the response. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the item. Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item in the response. Required.""" + content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the content part in the item's content array. Required.""" + transcript: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The final transcript of the audio. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + response_id: str, + item_id: str, + output_index: int, + content_index: int, + transcript: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE # type: ignore + + +class RealtimeServerEventResponseContentPartAdded( + RealtimeServerEvent, discriminator="response.content_part.added" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Returned when a new content part is added to an assistant message item during response + generation. + + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``response.content_part.added``. Required. + RESPONSE_CONTENT_PART_ADDED. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_CONTENT_PART_ADDED + :ivar response_id: The ID of the response. Required. + :vartype response_id: str + :ivar item_id: The ID of the item to which the content part was added. Required. + :vartype item_id: str + :ivar output_index: The index of the output item in the response. Required. + :vartype output_index: int + :ivar content_index: The index of the content part in the item's content array. Required. + :vartype content_index: int + :ivar part: The content part that was added. Required. + :vartype part: ~azure.ai.projects.models.RealtimeServerEventResponseContentPartAddedPart + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``response.content_part.added``. Required. RESPONSE_CONTENT_PART_ADDED.""" + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the response. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the item to which the content part was added. Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item in the response. Required.""" + content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the content part in the item's content array. Required.""" + part: "_models.RealtimeServerEventResponseContentPartAddedPart" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The content part that was added. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + response_id: str, + item_id: str, + output_index: int, + content_index: int, + part: "_models.RealtimeServerEventResponseContentPartAddedPart", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED # type: ignore + + +class RealtimeServerEventResponseContentPartAddedPart( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """RealtimeServerEventResponseContentPartAddedPart. + + :ivar type: Is either a Literal["audio"] type or a Literal["text"] type. + :vartype type: str or str + :ivar text: + :vartype text: str + :ivar audio: + :vartype audio: str + :ivar transcript: + :vartype transcript: str + """ + + type: Optional[Literal["audio", "text"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Is either a Literal[\"audio\"] type or a Literal[\"text\"] type.""" + text: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + audio: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + transcript: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + + @overload + def __init__( + self, + *, + type: Optional[Literal["audio", "text"]] = None, + text: Optional[str] = None, + audio: Optional[str] = None, + transcript: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class RealtimeServerEventResponseContentPartDone( + RealtimeServerEvent, discriminator="response.content_part.done" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Returned when a content part is done streaming in an assistant message item. Also emitted when + a Response is interrupted, incomplete, or cancelled. + + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``response.content_part.done``. Required. + RESPONSE_CONTENT_PART_DONE. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_CONTENT_PART_DONE + :ivar response_id: The ID of the response. Required. + :vartype response_id: str + :ivar item_id: The ID of the item. Required. + :vartype item_id: str + :ivar output_index: The index of the output item in the response. Required. + :vartype output_index: int + :ivar content_index: The index of the content part in the item's content array. Required. + :vartype content_index: int + :ivar part: The content part that is done. Required. + :vartype part: ~azure.ai.projects.models.RealtimeServerEventResponseContentPartDonePart + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``response.content_part.done``. Required. RESPONSE_CONTENT_PART_DONE.""" + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the response. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the item. Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item in the response. Required.""" + content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the content part in the item's content array. Required.""" + part: "_models.RealtimeServerEventResponseContentPartDonePart" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The content part that is done. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + response_id: str, + item_id: str, + output_index: int, + content_index: int, + part: "_models.RealtimeServerEventResponseContentPartDonePart", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.RESPONSE_CONTENT_PART_DONE # type: ignore + + +class RealtimeServerEventResponseContentPartDonePart( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """RealtimeServerEventResponseContentPartDonePart. + + :ivar type: Is either a Literal["audio"] type or a Literal["text"] type. + :vartype type: str or str + :ivar text: + :vartype text: str + :ivar audio: + :vartype audio: str + :ivar transcript: + :vartype transcript: str + :ivar format: The audio format, when this is an audio content part. + :vartype format: ~azure.ai.projects.models.RealtimeAudioFormats + """ + + type: Optional[Literal["audio", "text"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Is either a Literal[\"audio\"] type or a Literal[\"text\"] type.""" + text: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + audio: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + transcript: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + format: Optional["_models.RealtimeAudioFormats"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The audio format, when this is an audio content part.""" + + @overload + def __init__( + self, + *, + type: Optional[Literal["audio", "text"]] = None, + text: Optional[str] = None, + audio: Optional[str] = None, + transcript: Optional[str] = None, + format: Optional["_models.RealtimeAudioFormats"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class RealtimeServerEventResponseCreated( + RealtimeServerEvent, discriminator="response.created" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Returned when a new Response is created. The first event of response creation, where the + response is in an initial state of ``in_progress``. + + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``response.created``. Required. RESPONSE_CREATED. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_CREATED + :ivar response: Required. + :vartype response: ~azure.ai.projects.models.VoiceAgentRealtimeResponse + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.RESPONSE_CREATED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``response.created``. Required. RESPONSE_CREATED.""" + response: "_models.VoiceAgentRealtimeResponse" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + response: "_models.VoiceAgentRealtimeResponse", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.RESPONSE_CREATED # type: ignore + + +class RealtimeServerEventResponseDone( + RealtimeServerEvent, discriminator="response.done" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Returned when a Response is done streaming. Always emitted, no matter the final state. The + Response object included in the ``response.done`` event will include all output Items in the + Response but will omit the raw audio data. Clients should check the ``status`` field of the + Response to determine if it was successful (``completed``) or if there was another outcome: + ``cancelled``, ``failed``, or ``incomplete``. A response will contain all output items that + were generated during the response, excluding any audio content. + + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``response.done``. Required. RESPONSE_DONE. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_DONE + :ivar response: Required. + :vartype response: ~azure.ai.projects.models.VoiceAgentRealtimeResponse + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.RESPONSE_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``response.done``. Required. RESPONSE_DONE.""" + response: "_models.VoiceAgentRealtimeResponse" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + response: "_models.VoiceAgentRealtimeResponse", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.RESPONSE_DONE # type: ignore + + +class RealtimeServerEventResponseFunctionCallArgumentsDelta( + RealtimeServerEvent, discriminator="response.function_call_arguments.delta" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Returned when the model-generated function call arguments are updated. + + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``response.function_call_arguments.delta``. Required. + RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA + :ivar response_id: The ID of the response. Required. + :vartype response_id: str + :ivar item_id: The ID of the function call item. Required. + :vartype item_id: str + :ivar output_index: The index of the output item in the response. Required. + :vartype output_index: int + :ivar call_id: The ID of the function call. Required. + :vartype call_id: str + :ivar delta: The arguments delta as a JSON string. Required. + :vartype delta: str + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``response.function_call_arguments.delta``. Required. + RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA.""" + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the response. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the function call item. Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item in the response. Required.""" + call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the function call. Required.""" + delta: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The arguments delta as a JSON string. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + response_id: str, + item_id: str, + output_index: int, + call_id: str, + delta: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA # type: ignore + + +class RealtimeServerEventResponseFunctionCallArgumentsDone( + RealtimeServerEvent, discriminator="response.function_call_arguments.done" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Returned when the model-generated function call arguments are done streaming. Also emitted when + a Response is interrupted, incomplete, or cancelled. + + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``response.function_call_arguments.done``. Required. + RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE + :ivar response_id: The ID of the response. Required. + :vartype response_id: str + :ivar item_id: The ID of the function call item. Required. + :vartype item_id: str + :ivar output_index: The index of the output item in the response. Required. + :vartype output_index: int + :ivar call_id: The ID of the function call. Required. + :vartype call_id: str + :ivar name: The name of the function that was called. Required. + :vartype name: str + :ivar arguments: The final arguments as a JSON string. Required. + :vartype arguments: str + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``response.function_call_arguments.done``. Required. + RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE.""" + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the response. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the function call item. Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item in the response. Required.""" + call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the function call. Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the function that was called. Required.""" + arguments: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The final arguments as a JSON string. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + response_id: str, + item_id: str, + output_index: int, + call_id: str, + name: str, + arguments: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE # type: ignore + + +class RealtimeServerEventResponseMCPCallArgumentsDelta( + RealtimeServerEvent, discriminator="response.mcp_call_arguments.delta" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Returned when MCP tool call arguments are updated during response generation. + + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``response.mcp_call_arguments.delta``. Required. + RESPONSE_MCP_CALL_ARGUMENTS_DELTA. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_MCP_CALL_ARGUMENTS_DELTA + :ivar response_id: The ID of the response. Required. + :vartype response_id: str + :ivar item_id: The ID of the MCP tool call item. Required. + :vartype item_id: str + :ivar output_index: The index of the output item in the response. Required. + :vartype output_index: int + :ivar delta: The JSON-encoded arguments delta. Required. + :vartype delta: str + :ivar obfuscation: + :vartype obfuscation: str + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``response.mcp_call_arguments.delta``. Required. + RESPONSE_MCP_CALL_ARGUMENTS_DELTA.""" + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the response. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the MCP tool call item. Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item in the response. Required.""" + delta: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The JSON-encoded arguments delta. Required.""" + obfuscation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + + @overload + def __init__( + self, + *, + event_id: str, + response_id: str, + item_id: str, + output_index: int, + delta: str, + obfuscation: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DELTA # type: ignore + + +class RealtimeServerEventResponseMCPCallArgumentsDone( + RealtimeServerEvent, discriminator="response.mcp_call_arguments.done" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Returned when MCP tool call arguments are finalized during response generation. + + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``response.mcp_call_arguments.done``. Required. + RESPONSE_MCP_CALL_ARGUMENTS_DONE. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_MCP_CALL_ARGUMENTS_DONE + :ivar response_id: The ID of the response. Required. + :vartype response_id: str + :ivar item_id: The ID of the MCP tool call item. Required. + :vartype item_id: str + :ivar output_index: The index of the output item in the response. Required. + :vartype output_index: int + :ivar arguments: The final JSON-encoded arguments string. Required. + :vartype arguments: str + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``response.mcp_call_arguments.done``. Required. + RESPONSE_MCP_CALL_ARGUMENTS_DONE.""" + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the response. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the MCP tool call item. Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item in the response. Required.""" + arguments: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The final JSON-encoded arguments string. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + response_id: str, + item_id: str, + output_index: int, + arguments: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DONE # type: ignore + + +class RealtimeServerEventResponseMCPCallCompleted( + RealtimeServerEvent, discriminator="response.mcp_call.completed" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Returned when an MCP tool call has completed successfully. + + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``response.mcp_call.completed``. Required. + RESPONSE_MCP_CALL_COMPLETED. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_MCP_CALL_COMPLETED + :ivar output_index: The index of the output item in the response. Required. + :vartype output_index: int + :ivar item_id: The ID of the MCP tool call item. Required. + :vartype item_id: str + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_COMPLETED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``response.mcp_call.completed``. Required. RESPONSE_MCP_CALL_COMPLETED.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item in the response. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the MCP tool call item. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + output_index: int, + item_id: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.RESPONSE_MCP_CALL_COMPLETED # type: ignore + + +class RealtimeServerEventResponseMCPCallFailed( + RealtimeServerEvent, discriminator="response.mcp_call.failed" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Returned when an MCP tool call has failed. + + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``response.mcp_call.failed``. Required. + RESPONSE_MCP_CALL_FAILED. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_MCP_CALL_FAILED + :ivar output_index: The index of the output item in the response. Required. + :vartype output_index: int + :ivar item_id: The ID of the MCP tool call item. Required. + :vartype item_id: str + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_FAILED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``response.mcp_call.failed``. Required. RESPONSE_MCP_CALL_FAILED.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item in the response. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the MCP tool call item. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + output_index: int, + item_id: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.RESPONSE_MCP_CALL_FAILED # type: ignore + + +class RealtimeServerEventResponseMCPCallInProgress( + RealtimeServerEvent, discriminator="response.mcp_call.in_progress" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Returned when an MCP tool call has started and is in progress. + + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``response.mcp_call.in_progress``. Required. + RESPONSE_MCP_CALL_IN_PROGRESS. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_MCP_CALL_IN_PROGRESS + :ivar output_index: The index of the output item in the response. Required. + :vartype output_index: int + :ivar item_id: The ID of the MCP tool call item. Required. + :vartype item_id: str + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_IN_PROGRESS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``response.mcp_call.in_progress``. Required. + RESPONSE_MCP_CALL_IN_PROGRESS.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item in the response. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the MCP tool call item. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + output_index: int, + item_id: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.RESPONSE_MCP_CALL_IN_PROGRESS # type: ignore + + +class RealtimeServerEventResponseOutputItemAdded( + RealtimeServerEvent, discriminator="response.output_item.added" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Returned when a new Item is created during Response generation. + + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``response.output_item.added``. Required. + RESPONSE_OUTPUT_ITEM_ADDED. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_OUTPUT_ITEM_ADDED + :ivar response_id: The ID of the Response to which the item belongs. Required. + :vartype response_id: str + :ivar output_index: The index of the output item in the Response. Required. + :vartype output_index: int + :ivar item: Required. + :vartype item: ~azure.ai.projects.models.RealtimeConversationItem + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_ADDED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``response.output_item.added``. Required. RESPONSE_OUTPUT_ITEM_ADDED.""" + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the Response to which the item belongs. Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item in the Response. Required.""" + item: "_models.RealtimeConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + response_id: str, + output_index: int, + item: "_models.RealtimeConversationItem", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_ADDED # type: ignore + + +class RealtimeServerEventResponseOutputItemDone( + RealtimeServerEvent, discriminator="response.output_item.done" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Returned when an Item is done streaming. Also emitted when a Response is interrupted, + incomplete, or cancelled. + + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``response.output_item.done``. Required. + RESPONSE_OUTPUT_ITEM_DONE. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_OUTPUT_ITEM_DONE + :ivar response_id: The ID of the Response to which the item belongs. Required. + :vartype response_id: str + :ivar output_index: The index of the output item in the Response. Required. + :vartype output_index: int + :ivar item: Required. + :vartype item: ~azure.ai.projects.models.RealtimeConversationItem + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``response.output_item.done``. Required. RESPONSE_OUTPUT_ITEM_DONE.""" + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the Response to which the item belongs. Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item in the Response. Required.""" + item: "_models.RealtimeConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + response_id: str, + output_index: int, + item: "_models.RealtimeConversationItem", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_DONE # type: ignore + + +class RealtimeServerEventResponseTextDelta( + RealtimeServerEvent, discriminator="response.output_text.delta" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Returned when the text value of an "output_text" content part is updated. + + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``response.output_text.delta``. Required. + RESPONSE_OUTPUT_TEXT_DELTA. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_OUTPUT_TEXT_DELTA + :ivar response_id: The ID of the response. Required. + :vartype response_id: str + :ivar item_id: The ID of the item. Required. + :vartype item_id: str + :ivar output_index: The index of the output item in the response. Required. + :vartype output_index: int + :ivar content_index: The index of the content part in the item's content array. Required. + :vartype content_index: int + :ivar delta: The text delta. Required. + :vartype delta: str + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``response.output_text.delta``. Required. RESPONSE_OUTPUT_TEXT_DELTA.""" + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the response. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the item. Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item in the response. Required.""" + content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the content part in the item's content array. Required.""" + delta: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The text delta. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + response_id: str, + item_id: str, + output_index: int, + content_index: int, + delta: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DELTA # type: ignore + + +class RealtimeServerEventResponseTextDone( + RealtimeServerEvent, discriminator="response.output_text.done" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Returned when the text value of an "output_text" content part is done streaming. Also emitted + when a Response is interrupted, incomplete, or cancelled. + + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``response.output_text.done``. Required. + RESPONSE_OUTPUT_TEXT_DONE. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_OUTPUT_TEXT_DONE + :ivar response_id: The ID of the response. Required. + :vartype response_id: str + :ivar item_id: The ID of the item. Required. + :vartype item_id: str + :ivar output_index: The index of the output item in the response. Required. + :vartype output_index: int + :ivar content_index: The index of the content part in the item's content array. Required. + :vartype content_index: int + :ivar text: The final text content. Required. + :vartype text: str + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``response.output_text.done``. Required. RESPONSE_OUTPUT_TEXT_DONE.""" + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the response. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the item. Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item in the response. Required.""" + content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the content part in the item's content array. Required.""" + text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The final text content. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + response_id: str, + item_id: str, + output_index: int, + content_index: int, + text: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DONE # type: ignore + + +class RealtimeServerEventSessionCreated( + RealtimeServerEvent, discriminator="session.created" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Returned when a Session is created. Emitted automatically when a new connection is established + as the first server event. This event will contain the default Session configuration. + + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``session.created``. Required. SESSION_CREATED. + :vartype type: str or ~azure.ai.projects.models.SESSION_CREATED + :ivar session: The session configuration. Required. Is one of the following types: + VoiceAgentSessionResponseConfig + :vartype session: ~azure.ai.projects.models.VoiceAgentSessionResponseConfig + :ivar conversation_id: The session-scoped conversation id. When present, responses attached to + the session conversation use the same value in ``response.created`` and ``response.done``. + :vartype conversation_id: str + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.SESSION_CREATED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``session.created``. Required. SESSION_CREATED.""" + session: "_unions.VoiceAgentSessionResponse" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The session configuration. Required. Is one of the following types: + VoiceAgentSessionResponseConfig""" + conversation_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The session-scoped conversation id. When present, responses attached to the session + conversation use the same value in ``response.created`` and ``response.done``.""" + + @overload + def __init__( + self, + *, + event_id: str, + session: "_unions.VoiceAgentSessionResponse", + conversation_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.SESSION_CREATED # type: ignore + + +class RealtimeServerEventSessionUpdated( + RealtimeServerEvent, discriminator="session.updated" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Returned when a session is updated with a ``session.update`` event, unless there is an error. + + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``session.updated``. Required. SESSION_UPDATED. + :vartype type: str or ~azure.ai.projects.models.SESSION_UPDATED + :ivar session: The session configuration. Required. Is one of the following types: + VoiceAgentSessionResponseConfig + :vartype session: ~azure.ai.projects.models.VoiceAgentSessionResponseConfig + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.SESSION_UPDATED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``session.updated``. Required. SESSION_UPDATED.""" + session: "_unions.VoiceAgentSessionResponse" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The session configuration. Required. Is one of the following types: + VoiceAgentSessionResponseConfig""" + + @overload + def __init__( + self, + *, + event_id: str, + session: "_unions.VoiceAgentSessionResponse", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.SESSION_UPDATED # type: ignore + + +class Reasoning(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Reasoning. + + :ivar mode: Controls the reasoning execution mode for the request. When returned on a response, + this is the effective execution mode. Known values are: "standard" and "pro". + :vartype mode: str or ~azure.ai.projects.models.ReasoningModeEnum + :ivar effort: Known values are: "none", "minimal", "low", "medium", "high", "xhigh", and "max". + :vartype effort: str or ~azure.ai.projects.models.ReasoningEffort + :ivar summary: Is one of the following types: Literal["auto"], Literal["concise"], + Literal["detailed"] + :vartype summary: str or str or str + :ivar context: Is one of the following types: Literal["auto"], Literal["current_turn"], + Literal["all_turns"] + :vartype context: str or str or str + :ivar generate_summary: Is one of the following types: Literal["auto"], Literal["concise"], + Literal["detailed"] + :vartype generate_summary: str or str or str + """ + + mode: Optional[Union[str, "_models.ReasoningModeEnum"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Controls the reasoning execution mode for the request. When returned on a response, this is the + effective execution mode. Known values are: \"standard\" and \"pro\".""" + effort: Optional[Union[str, "_models.ReasoningEffort"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Known values are: \"none\", \"minimal\", \"low\", \"medium\", \"high\", \"xhigh\", and \"max\".""" + summary: Optional[Literal["auto", "concise", "detailed"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Is one of the following types: Literal[\"auto\"], Literal[\"concise\"], Literal[\"detailed\"]""" + context: Optional[Literal["auto", "current_turn", "all_turns"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Is one of the following types: Literal[\"auto\"], Literal[\"current_turn\"], + Literal[\"all_turns\"]""" + generate_summary: Optional[Literal["auto", "concise", "detailed"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Is one of the following types: Literal[\"auto\"], Literal[\"concise\"], Literal[\"detailed\"]""" + + @overload + def __init__( + self, + *, + mode: Optional[Union[str, "_models.ReasoningModeEnum"]] = None, + effort: Optional[Union[str, "_models.ReasoningEffort"]] = None, + summary: Optional[Literal["auto", "concise", "detailed"]] = None, + context: Optional[Literal["auto", "current_turn", "all_turns"]] = None, + generate_summary: Optional[Literal["auto", "concise", "detailed"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class RecurrenceTrigger( + Trigger, discriminator="Recurrence" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Recurrence based trigger. + + :ivar type: Type of the trigger. Required. Recurrence based trigger. + :vartype type: str or ~azure.ai.projects.models.RECURRENCE + :ivar start_time: Start time for the recurrence schedule in ISO 8601 format. + :vartype start_time: ~datetime.datetime + :ivar end_time: End time for the recurrence schedule in ISO 8601 format. + :vartype end_time: ~datetime.datetime + :ivar time_zone: Time zone for the recurrence schedule. Defaults to ``UTC``. + :vartype time_zone: str + :ivar interval: Interval for the recurrence schedule. Required. + :vartype interval: int + :ivar schedule: Recurrence schedule for the recurrence trigger. Required. + :vartype schedule: ~azure.ai.projects.models.RecurrenceSchedule + """ + + type: Literal[TriggerType.RECURRENCE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Type of the trigger. Required. Recurrence based trigger.""" + start_time: Optional[datetime.datetime] = rest_field( + name="startTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """Start time for the recurrence schedule in ISO 8601 format.""" + end_time: Optional[datetime.datetime] = rest_field( + name="endTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """End time for the recurrence schedule in ISO 8601 format.""" + time_zone: Optional[str] = rest_field(name="timeZone", visibility=["read", "create", "update", "delete", "query"]) + """Time zone for the recurrence schedule. Defaults to ``UTC``.""" + interval: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Interval for the recurrence schedule. Required.""" + schedule: "_models.RecurrenceSchedule" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Recurrence schedule for the recurrence trigger. Required.""" + + @overload + def __init__( + self, + *, + interval: int, + schedule: "_models.RecurrenceSchedule", + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + time_zone: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = TriggerType.RECURRENCE # type: ignore + + +class RedTeam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Red team details. + + :ivar name: Identifier of the red team run. Required. + :vartype name: str + :ivar display_name: Name of the red-team run. + :vartype display_name: str + :ivar num_turns: Number of simulation rounds. + :vartype num_turns: int + :ivar attack_strategies: List of attack strategies or nested lists of attack strategies. + :vartype attack_strategies: list[str or ~azure.ai.projects.models.AttackStrategy] + :ivar simulation_only: Simulation-only or Simulation + Evaluation. If ``true`` the scan outputs + conversation not evaluation result. The service defaults to ``false`` if a value is not + specified by the caller. + :vartype simulation_only: bool + :ivar risk_categories: List of risk categories to generate attack objectives for. + :vartype risk_categories: list[str or ~azure.ai.projects.models.RiskCategory] + :ivar application_scenario: Application scenario for the red team operation, to generate + scenario specific attacks. + :vartype application_scenario: str + :ivar tags: Red team's tags. Unlike properties, tags are fully mutable. + :vartype tags: dict[str, str] + :ivar properties: Red team's properties. Unlike tags, properties are add-only. Once added, a + property cannot be removed. + :vartype properties: dict[str, str] + :ivar status: Status of the red-team. It is set by service and is read-only. + :vartype status: str + :ivar target: Target configuration for the red-team run. Required. + :vartype target: ~azure.ai.projects.models.RedTeamTargetConfig + """ + + name: str = rest_field(name="id", visibility=["read"]) + """Identifier of the red team run. Required.""" + display_name: Optional[str] = rest_field( + name="displayName", visibility=["read", "create", "update", "delete", "query"] + ) + """Name of the red-team run.""" + num_turns: Optional[int] = rest_field(name="numTurns", visibility=["read", "create", "update", "delete", "query"]) + """Number of simulation rounds.""" + attack_strategies: Optional[list[Union[str, "_models.AttackStrategy"]]] = rest_field( + name="attackStrategies", visibility=["read", "create", "update", "delete", "query"] + ) + """List of attack strategies or nested lists of attack strategies.""" + simulation_only: Optional[bool] = rest_field( + name="simulationOnly", visibility=["read", "create", "update", "delete", "query"] + ) + """Simulation-only or Simulation + Evaluation. If ``true`` the scan outputs conversation not + evaluation result. The service defaults to ``false`` if a value is not specified by the caller.""" + risk_categories: Optional[list[Union[str, "_models.RiskCategory"]]] = rest_field( + name="riskCategories", visibility=["read", "create", "update", "delete", "query"] + ) + """List of risk categories to generate attack objectives for.""" + application_scenario: Optional[str] = rest_field( + name="applicationScenario", visibility=["read", "create", "update", "delete", "query"] + ) + """Application scenario for the red team operation, to generate scenario specific attacks.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Red team's tags. Unlike properties, tags are fully mutable.""" + properties: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Red team's properties. Unlike tags, properties are add-only. Once added, a property cannot be + removed.""" + status: Optional[str] = rest_field(visibility=["read"]) + """Status of the red-team. It is set by service and is read-only.""" + target: "_models.RedTeamTargetConfig" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Target configuration for the red-team run. Required.""" + + @overload + def __init__( + self, + *, + target: "_models.RedTeamTargetConfig", + display_name: Optional[str] = None, + num_turns: Optional[int] = None, + attack_strategies: Optional[list[Union[str, "_models.AttackStrategy"]]] = None, + simulation_only: Optional[bool] = None, + risk_categories: Optional[list[Union[str, "_models.RiskCategory"]]] = None, + application_scenario: Optional[str] = None, + tags: Optional[dict[str, str]] = None, + properties: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ReinforcementFineTuningDataGenerationJob( + DataGenerationJob, discriminator="reinforcement_finetuning_preview" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Reinforcement fine-tuning data generation job resource. This is a preview feature. + + :ivar id: Server-assigned unique identifier. Required. + :vartype id: str + :ivar result: Result produced on success. + :vartype result: ~azure.ai.projects.models.DataGenerationJobResult + :ivar status: Current lifecycle status. Required. Known values are: "queued", "in_progress", + "succeeded", "failed", and "cancelled". + :vartype status: str or ~azure.ai.projects.models.JobStatus + :ivar error: Error details — populated only on failure. + :vartype error: ~azure.ai.projects.models.ApiError + :ivar name: The display name of the data generation job. Required. + :vartype name: str + :ivar sources: The sources used for the data generation job. Required. + :vartype sources: list[~azure.ai.projects.models.DataGenerationJobSource] + :ivar generation_configuration: The generation configuration for the data generation job. + Required. + :vartype generation_configuration: ~azure.ai.projects.models.DataGenerationJobConfiguration + :ivar created_at: The timestamp when the job was created, represented in Unix time (seconds + since January 1, 1970). Required. + :vartype created_at: ~datetime.datetime + :ivar finished_at: The timestamp when the job was finished, represented in Unix time (seconds + since January 1, 1970). + :vartype finished_at: ~datetime.datetime + :ivar scenario: The scenario of the data generation job, which is Reinforcement Fine-tuning + preview for this model. Required. Reinforcement Fine-tuning preview scenario. + :vartype scenario: str or ~azure.ai.projects.models.REINFORCEMENT_FINETUNING_PREVIEW + :ivar output_configuration: Optional file output configuration for the generated reinforcement + fine-tuning data. + :vartype output_configuration: + ~azure.ai.projects.models.ReinforcementFineTuningDataGenerationJobOutputConfiguration + """ + + scenario: Literal[DataGenerationJobScenario.REINFORCEMENT_FINETUNING_PREVIEW] = rest_discriminator(name="scenario", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The scenario of the data generation job, which is Reinforcement Fine-tuning preview for this + model. Required. Reinforcement Fine-tuning preview scenario.""" + output_configuration: Optional["_models.ReinforcementFineTuningDataGenerationJobOutputConfiguration"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Optional file output configuration for the generated reinforcement fine-tuning data.""" + + @overload + def __init__( + self, + *, + name: str, + sources: list["_models.DataGenerationJobSource"], + generation_configuration: "_models.DataGenerationJobConfiguration", + output_configuration: Optional["_models.ReinforcementFineTuningDataGenerationJobOutputConfiguration"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.scenario = DataGenerationJobScenario.REINFORCEMENT_FINETUNING_PREVIEW # type: ignore + + +class ReinforcementFineTuningDataGenerationJobInputs( + DataGenerationJobInputs, discriminator="reinforcement_finetuning_preview" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Caller-supplied inputs for a reinforcement fine-tuning data generation job. This is a preview + feature. + + :ivar name: The display name of the data generation job. Required. + :vartype name: str + :ivar sources: The sources used for the data generation job. Required. + :vartype sources: list[~azure.ai.projects.models.DataGenerationJobSource] + :ivar generation_configuration: The generation configuration for the data generation job. + Required. + :vartype generation_configuration: ~azure.ai.projects.models.DataGenerationJobConfiguration + :ivar scenario: The scenario of the data generation job, which is Reinforcement Fine-tuning + preview for this model. Required. Reinforcement Fine-tuning preview scenario. + :vartype scenario: str or ~azure.ai.projects.models.REINFORCEMENT_FINETUNING_PREVIEW + :ivar output_configuration: Optional file output configuration for the generated reinforcement + fine-tuning data. + :vartype output_configuration: + ~azure.ai.projects.models.ReinforcementFineTuningDataGenerationJobOutputConfiguration + """ + + scenario: Literal[DataGenerationJobScenario.REINFORCEMENT_FINETUNING_PREVIEW] = rest_discriminator(name="scenario", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The scenario of the data generation job, which is Reinforcement Fine-tuning preview for this + model. Required. Reinforcement Fine-tuning preview scenario.""" + output_configuration: Optional["_models.ReinforcementFineTuningDataGenerationJobOutputConfiguration"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Optional file output configuration for the generated reinforcement fine-tuning data.""" + + @overload + def __init__( + self, + *, + name: str, + sources: list["_models.DataGenerationJobSource"], + generation_configuration: "_models.DataGenerationJobConfiguration", + output_configuration: Optional["_models.ReinforcementFineTuningDataGenerationJobOutputConfiguration"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.scenario = DataGenerationJobScenario.REINFORCEMENT_FINETUNING_PREVIEW # type: ignore + + +class ReinforcementFineTuningDataGenerationJobOutputConfiguration( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """File output configuration for a reinforcement fine-tuning data generation job. This is a + preview feature. + + :ivar name: Filename to assign to the generated fine-tuning file. Required. + :vartype name: str + :ivar write_mode: Controls how file outputs are written. If omitted, defaults to ``overwrite`` + and writes only the newly generated fine-tuning file content. Known values are: "overwrite" and + "merge". + :vartype write_mode: str or ~azure.ai.projects.models.DataGenerationJobOutputWriteMode + :ivar merge_file_id: File ID to merge into when ``write_mode`` is ``merge``. + :vartype merge_file_id: str + """ + + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Filename to assign to the generated fine-tuning file. Required.""" + write_mode: Optional[Union[str, "_models.DataGenerationJobOutputWriteMode"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Controls how file outputs are written. If omitted, defaults to ``overwrite`` and writes only + the newly generated fine-tuning file content. Known values are: \"overwrite\" and \"merge\".""" + merge_file_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """File ID to merge into when ``write_mode`` is ``merge``.""" + + @overload + def __init__( + self, + *, + name: str, + write_mode: Optional[Union[str, "_models.DataGenerationJobOutputWriteMode"]] = None, + merge_file_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ReminderPreviewToolboxTool( + ToolboxTool, discriminator="reminder_preview" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A reminder tool stored in a toolbox. + + :ivar name: Optional user-defined name for this tool or configuration. + :vartype name: str + :ivar description: Optional user-defined description for this tool or configuration. + :vartype description: str + :ivar tool_configs: Per-tool configuration map. Keys are tool names or ``*`` (catch-all + default). Resolution order: exact tool name match takes priority over ``*``. Unknown tool names + are silently ignored at runtime. + :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] + :ivar type: Required. REMINDER_PREVIEW. + :vartype type: str or ~azure.ai.projects.models.REMINDER_PREVIEW + """ + + type: Literal[ToolboxToolType.REMINDER_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. REMINDER_PREVIEW.""" + + @overload + def __init__( + self, + *, + name: Optional[str] = None, + description: Optional[str] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = ToolboxToolType.REMINDER_PREVIEW # type: ignore + + +class ResponsesProtocolConfiguration(_Model): + """Configuration specific to the responses protocol.""" + + +class ResponseUsageInputTokensDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """ResponseUsageInputTokensDetails. + + :ivar cached_tokens: Required. + :vartype cached_tokens: int + :ivar cache_write_tokens: Required. + :vartype cache_write_tokens: int + """ + + cached_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + cache_write_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + cached_tokens: int, + cache_write_tokens: int, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ResponseUsageOutputTokensDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """ResponseUsageOutputTokensDetails. + + :ivar reasoning_tokens: Required. + :vartype reasoning_tokens: int + """ + + reasoning_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + reasoning_tokens: int, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ResponseUsageResource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """ResponseUsageResource. + + :ivar input_tokens: Required. + :vartype input_tokens: int + :ivar input_tokens_details: Required. + :vartype input_tokens_details: ~azure.ai.projects.models.InputTokensDetailsResource + :ivar output_tokens: Required. + :vartype output_tokens: int + :ivar output_tokens_details: Required. + :vartype output_tokens_details: ~azure.ai.projects.models.OutputTokensDetailsResource + :ivar total_tokens: Required. + :vartype total_tokens: int + """ + + input_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + input_tokens_details: "_models.InputTokensDetailsResource" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required.""" + output_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + output_tokens_details: "_models.OutputTokensDetailsResource" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required.""" + total_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + input_tokens: int, + input_tokens_details: "_models.InputTokensDetailsResource", + output_tokens: int, + output_tokens_details: "_models.OutputTokensDetailsResource", + total_tokens: int, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Routine(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A routine definition returned by the service. + + :ivar name: The routine name. + :vartype name: str + :ivar description: A human-readable description of the routine. + :vartype description: str + :ivar enabled: Whether the routine is enabled. Required. + :vartype enabled: bool + :ivar triggers: The triggers configured for the routine. + :vartype triggers: dict[str, ~azure.ai.projects.models.RoutineTrigger] + :ivar action: The action executed when the routine fires. + :vartype action: ~azure.ai.projects.models.RoutineAction + :ivar created_at: The time when the routine was created. + :vartype created_at: ~datetime.datetime + :ivar updated_at: The time when the routine was last updated. + :vartype updated_at: ~datetime.datetime + """ + + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The routine name.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A human-readable description of the routine.""" + enabled: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether the routine is enabled. Required.""" + triggers: Optional[dict[str, "_models.RoutineTrigger"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The triggers configured for the routine.""" + action: Optional["_models.RoutineAction"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The action executed when the routine fires.""" + created_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The time when the routine was created.""" + updated_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The time when the routine was last updated.""" + + @overload + def __init__( + self, + *, + enabled: bool, + name: Optional[str] = None, + description: Optional[str] = None, + triggers: Optional[dict[str, "_models.RoutineTrigger"]] = None, + action: Optional["_models.RoutineAction"] = None, + created_at: Optional[datetime.datetime] = None, + updated_at: Optional[datetime.datetime] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class RoutineAuthorization(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Optional authorization configuration for a routine dispatch. + + :ivar identity: The identity used when dispatching the routine. Defaults to agent when omitted; + set to creator only when the customer opts in to creator identity dispatch. Known values are: + "agent" and "creator". + :vartype identity: str or ~azure.ai.projects.models.RoutineDispatchIdentity + """ + + identity: Optional[Union[str, "_models.RoutineDispatchIdentity"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The identity used when dispatching the routine. Defaults to agent when omitted; set to creator + only when the customer opts in to creator identity dispatch. Known values are: \"agent\" and + \"creator\".""" + + @overload + def __init__( + self, + *, + identity: Optional[Union[str, "_models.RoutineDispatchIdentity"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class RoutineRun(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A single routine run returned from the run history API. + + :ivar id: The unique run identifier for the routine attempt. Required. + :vartype id: str + :ivar status: The run status. Is one of the following types: str + :vartype status: str + :ivar phase: The AgentExtensions lifecycle phase for the routine attempt. Known values are: + "queued", "dispatching", "completed", and "failed". + :vartype phase: str or ~azure.ai.projects.models.RoutineRunPhase + :ivar trigger_type: The trigger type that produced the routine attempt. Known values are: + "custom", "github_issue", "schedule", and "timer". + :vartype trigger_type: str or ~azure.ai.projects.models.RoutineTriggerType + :ivar trigger_name: The configured trigger name that produced the routine attempt. + :vartype trigger_name: str + :ivar trigger_event_payload: The event payload captured from the event that triggered the + routine attempt, when available. + :vartype trigger_event_payload: dict[str, any] + :ivar attempt_source: The source path that created the routine attempt. Known values are: + "event_fire", "manual_dispatch", "queued_dispatch", "schedule_delivery", and "timer_delivery". + :vartype attempt_source: str or ~azure.ai.projects.models.RoutineAttemptSource + :ivar action_type: The action type dispatched for the routine attempt. Known values are: + "invoke_agent_responses_api" and "invoke_agent_invocations_api". + :vartype action_type: str or ~azure.ai.projects.models.RoutineActionType + :ivar agent_id: The project-scoped agent identifier recorded for the routine attempt. + :vartype agent_id: str + :ivar agent_endpoint_id: The legacy endpoint-scoped agent identifier recorded for the routine + attempt. + :vartype agent_endpoint_id: str + :ivar conversation_id: The conversation identifier used by a responses API dispatch. + :vartype conversation_id: str + :ivar session_id: The hosted-agent session identifier used by an invocations API dispatch. + :vartype session_id: str + :ivar triggered_at: The logical trigger time recorded for the routine attempt. + :vartype triggered_at: ~datetime.datetime + :ivar scheduled_fire_at: The scheduled fire time recorded for timer and schedule deliveries. + :vartype scheduled_fire_at: ~datetime.datetime + :ivar started_at: The time when the underlying run started. + :vartype started_at: ~datetime.datetime + :ivar ended_at: The time when the underlying run reached a terminal state. + :vartype ended_at: ~datetime.datetime + :ivar dispatch_id: The dispatch identifier associated with the routine attempt. + :vartype dispatch_id: str + :ivar action_correlation_id: The downstream action correlation identifier, when available. + :vartype action_correlation_id: str + :ivar response_id: The downstream response or invocation identifier, when available. + :vartype response_id: str + :ivar task_id: The workspace task identifier linked to the routine attempt, when available. + :vartype task_id: str + :ivar error_status_code: The downstream error status code captured for a failed attempt, when + available. + :vartype error_status_code: int + :ivar error_type: The fully qualified error type captured for a failed attempt, when available. + :vartype error_type: str + :ivar error_message: The truncated failure message captured for a failed attempt, when + available. + :vartype error_message: str + """ + + id: str = rest_field(visibility=["read"]) + """The unique run identifier for the routine attempt. Required.""" + status: Optional["_unions.RoutineRunStatus"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The run status. Is one of the following types: str""" + phase: Optional[Union[str, "_models.RoutineRunPhase"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The AgentExtensions lifecycle phase for the routine attempt. Known values are: \"queued\", + \"dispatching\", \"completed\", and \"failed\".""" + trigger_type: Optional[Union[str, "_models.RoutineTriggerType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The trigger type that produced the routine attempt. Known values are: \"custom\", + \"github_issue\", \"schedule\", and \"timer\".""" + trigger_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The configured trigger name that produced the routine attempt.""" + trigger_event_payload: Optional[dict[str, Any]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The event payload captured from the event that triggered the routine attempt, when available.""" + attempt_source: Optional[Union[str, "_models.RoutineAttemptSource"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The source path that created the routine attempt. Known values are: \"event_fire\", + \"manual_dispatch\", \"queued_dispatch\", \"schedule_delivery\", and \"timer_delivery\".""" + action_type: Optional[Union[str, "_models.RoutineActionType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The action type dispatched for the routine attempt. Known values are: + \"invoke_agent_responses_api\" and \"invoke_agent_invocations_api\".""" + agent_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The project-scoped agent identifier recorded for the routine attempt.""" + agent_endpoint_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The legacy endpoint-scoped agent identifier recorded for the routine attempt.""" + conversation_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The conversation identifier used by a responses API dispatch.""" + session_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The hosted-agent session identifier used by an invocations API dispatch.""" + triggered_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The logical trigger time recorded for the routine attempt.""" + scheduled_fire_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The scheduled fire time recorded for timer and schedule deliveries.""" + started_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The time when the underlying run started.""" + ended_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The time when the underlying run reached a terminal state.""" + dispatch_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The dispatch identifier associated with the routine attempt.""" + action_correlation_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The downstream action correlation identifier, when available.""" + response_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The downstream response or invocation identifier, when available.""" + task_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The workspace task identifier linked to the routine attempt, when available.""" + error_status_code: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The downstream error status code captured for a failed attempt, when available.""" + error_type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The fully qualified error type captured for a failed attempt, when available.""" + error_message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The truncated failure message captured for a failed attempt, when available.""" + + @overload + def __init__( + self, + *, + status: Optional["_unions.RoutineRunStatus"] = None, + phase: Optional[Union[str, "_models.RoutineRunPhase"]] = None, + trigger_type: Optional[Union[str, "_models.RoutineTriggerType"]] = None, + trigger_name: Optional[str] = None, + trigger_event_payload: Optional[dict[str, Any]] = None, + attempt_source: Optional[Union[str, "_models.RoutineAttemptSource"]] = None, + action_type: Optional[Union[str, "_models.RoutineActionType"]] = None, + agent_id: Optional[str] = None, + agent_endpoint_id: Optional[str] = None, + conversation_id: Optional[str] = None, + session_id: Optional[str] = None, + triggered_at: Optional[datetime.datetime] = None, + scheduled_fire_at: Optional[datetime.datetime] = None, + started_at: Optional[datetime.datetime] = None, + ended_at: Optional[datetime.datetime] = None, + dispatch_id: Optional[str] = None, + action_correlation_id: Optional[str] = None, + response_id: Optional[str] = None, + task_id: Optional[str] = None, + error_status_code: Optional[int] = None, + error_type: Optional[str] = None, + error_message: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class RubricBasedEvaluatorDefinition( + EvaluatorDefinition, discriminator="rubric" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Rubric-based evaluator definition — stores dimensions produced by the generate API. Used for + both quality and safety evaluators. + + :ivar init_parameters: The JSON schema (Draft 2020-12) for the evaluator's input parameters. + This includes parameters like type, properties, required. + :vartype init_parameters: dict[str, any] + :ivar data_schema: The JSON schema (Draft 2020-12) for the evaluator's input data. This + includes parameters like type, properties, required. + :vartype data_schema: dict[str, any] + :ivar metrics: List of output metrics produced by this evaluator. + :vartype metrics: dict[str, ~azure.ai.projects.models.EvaluatorMetric] + :ivar type: Required. Rubric-based evaluator definition. Stores dimensions (the scoring + blueprint) for both quality and safety evaluators. Can be created via the generate API or + manually via createVersion. + :vartype type: str or ~azure.ai.projects.models.RUBRIC + :ivar dimensions: The set of dimensions — the scoring blueprint used by the LLM judge. Quality + evaluators include a non-editable residual dimension with id 'general_quality' + (always_applicable: true); safety evaluators include 'general_policy_compliance'. Both use the + same Dimension structure. Required. + :vartype dimensions: list[~azure.ai.projects.models.Dimension] + :ivar pass_threshold: Pass/fail threshold for the aggregate rubric score, on the same + normalized 0.0-1.0 scale as the emitted ``score``. When the runtime weighted average meets or + exceeds this value, the result is ``pass``. Defaults to 0.5 (equivalent to a raw 1-5 weighted + average of 3.0). The 'any dimension scored 1 → fail' rule still applies regardless of this + threshold. + :vartype pass_threshold: float + """ + + type: Literal[EvaluatorDefinitionType.RUBRIC] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Rubric-based evaluator definition. Stores dimensions (the scoring blueprint) for both + quality and safety evaluators. Can be created via the generate API or manually via + createVersion.""" + dimensions: list["_models.Dimension"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The set of dimensions — the scoring blueprint used by the LLM judge. Quality evaluators include + a non-editable residual dimension with id 'general_quality' (always_applicable: true); safety + evaluators include 'general_policy_compliance'. Both use the same Dimension structure. + Required.""" + pass_threshold: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Pass/fail threshold for the aggregate rubric score, on the same normalized 0.0-1.0 scale as the + emitted ``score``. When the runtime weighted average meets or exceeds this value, the result is + ``pass``. Defaults to 0.5 (equivalent to a raw 1-5 weighted average of 3.0). The 'any dimension + scored 1 → fail' rule still applies regardless of this threshold.""" + + @overload + def __init__( + self, + *, + dimensions: list["_models.Dimension"], + init_parameters: Optional[dict[str, Any]] = None, + data_schema: Optional[dict[str, Any]] = None, + metrics: Optional[dict[str, "_models.EvaluatorMetric"]] = None, + pass_threshold: Optional[float] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = EvaluatorDefinitionType.RUBRIC # type: ignore + + +class RubricGenerationInputQualityWarning(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A non-fatal advisory produced during rubric evaluator generation when resolved inputs are + technically valid but likely too weak to produce a high-quality rubric. Read-only; + service-generated. Persisted with the terminal EvaluatorGenerationJob. + + :ivar code: Stable searchable machine-readable warning code. Required. Known values are: + "empty_prompt", "short_prompt", "empty_agent_instructions", "short_agent_instructions", + "empty_dataset_content", "short_dataset_content", "low_trace_count", and + "insufficient_total_input". + :vartype code: str or ~azure.ai.projects.models.RubricGenerationInputQualityWarningCode + :ivar severity: Advisory severity. Initial values: ``warning``. Required. "warning" + :vartype severity: str or ~azure.ai.projects.models.RubricGenerationInputQualityWarningSeverity + :ivar message: Human-readable message suitable for direct SDK/CLI/UI display. Must not include + raw prompt, instruction, dataset, or trace text. Required. + :vartype message: str + :ivar source: Which source category the warning applies to. ``aggregate`` is used only for + cross-source warnings. Required. Known values are: "prompt", "agent", "dataset", and + "aggregate". + :vartype source: str or ~azure.ai.projects.models.RubricGenerationInputQualityWarningSource + :ivar source_index: Zero-based index into ``EvaluatorGenerationJob.sources`` when the warning + applies to a specific source. Omitted for aggregate warnings and for warnings not tied to one + source. + :vartype source_index: int + """ + + code: Union[str, "_models.RubricGenerationInputQualityWarningCode"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Stable searchable machine-readable warning code. Required. Known values are: \"empty_prompt\", + \"short_prompt\", \"empty_agent_instructions\", \"short_agent_instructions\", + \"empty_dataset_content\", \"short_dataset_content\", \"low_trace_count\", and + \"insufficient_total_input\".""" + severity: Union[str, "_models.RubricGenerationInputQualityWarningSeverity"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Advisory severity. Initial values: ``warning``. Required. \"warning\"""" + message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Human-readable message suitable for direct SDK/CLI/UI display. Must not include raw prompt, + instruction, dataset, or trace text. Required.""" + source: Union[str, "_models.RubricGenerationInputQualityWarningSource"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Which source category the warning applies to. ``aggregate`` is used only for cross-source + warnings. Required. Known values are: \"prompt\", \"agent\", \"dataset\", and \"aggregate\".""" + source_index: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Zero-based index into ``EvaluatorGenerationJob.sources`` when the warning applies to a specific + source. Omitted for aggregate warnings and for warnings not tied to one source.""" + + @overload + def __init__( + self, + *, + code: Union[str, "_models.RubricGenerationInputQualityWarningCode"], + severity: Union[str, "_models.RubricGenerationInputQualityWarningSeverity"], + message: str, + source: Union[str, "_models.RubricGenerationInputQualityWarningSource"], + source_index: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SASCredentials(BaseCredentials, discriminator="SAS"): + """Shared Access Signature (SAS) credential definition. + + :ivar type: The credential type. Required. Shared Access Signature (SAS) credential. + :vartype type: str or ~azure.ai.projects.models.SAS + :ivar sas_token: SAS token. + :vartype sas_token: str + """ + + type: Literal[CredentialType.SAS] = rest_discriminator(name="type", visibility=["read"]) # type: ignore + """The credential type. Required. Shared Access Signature (SAS) credential.""" + sas_token: Optional[str] = rest_field(name="SAS", visibility=["read"]) + """SAS token.""" + + @overload + def __init__( + self, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = CredentialType.SAS # type: ignore + + +class Schedule(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Schedule model. + + :ivar schedule_id: Identifier of the schedule. Required. + :vartype schedule_id: str + :ivar display_name: Name of the schedule. + :vartype display_name: str + :ivar description: Description of the schedule. + :vartype description: str + :ivar enabled: Enabled status of the schedule. Required. + :vartype enabled: bool + :ivar provisioning_status: Provisioning status of the schedule. Known values are: "Creating", + "Updating", "Deleting", "Succeeded", and "Failed". + :vartype provisioning_status: str or ~azure.ai.projects.models.ScheduleProvisioningStatus + :ivar trigger: Trigger for the schedule. Required. + :vartype trigger: ~azure.ai.projects.models.Trigger + :ivar task: Task for the schedule. Required. + :vartype task: ~azure.ai.projects.models.ScheduleTask + :ivar tags: Schedule's tags. Unlike properties, tags are fully mutable. + :vartype tags: dict[str, str] + :ivar properties: Schedule's properties. Unlike tags, properties are add-only. Once added, a + property cannot be removed. + :vartype properties: dict[str, str] + :ivar system_data: System metadata for the resource. Required. + :vartype system_data: dict[str, str] + """ + + schedule_id: str = rest_field(name="id", visibility=["read"]) + """Identifier of the schedule. Required.""" + display_name: Optional[str] = rest_field( + name="displayName", visibility=["read", "create", "update", "delete", "query"] + ) + """Name of the schedule.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Description of the schedule.""" + enabled: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Enabled status of the schedule. Required.""" + provisioning_status: Optional[Union[str, "_models.ScheduleProvisioningStatus"]] = rest_field( + name="provisioningStatus", visibility=["read"] + ) + """Provisioning status of the schedule. Known values are: \"Creating\", \"Updating\", + \"Deleting\", \"Succeeded\", and \"Failed\".""" + trigger: "_models.Trigger" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Trigger for the schedule. Required.""" + task: "_models.ScheduleTask" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Task for the schedule. Required.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Schedule's tags. Unlike properties, tags are fully mutable.""" + properties: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Schedule's properties. Unlike tags, properties are add-only. Once added, a property cannot be + removed.""" + system_data: dict[str, str] = rest_field(name="systemData", visibility=["read"]) + """System metadata for the resource. Required.""" + + @overload + def __init__( + self, + *, + enabled: bool, + trigger: "_models.Trigger", + task: "_models.ScheduleTask", + display_name: Optional[str] = None, + description: Optional[str] = None, + tags: Optional[dict[str, str]] = None, + properties: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ScheduleRoutineTrigger( + RoutineTrigger, discriminator="schedule" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A recurring cron-based routine trigger. + + :ivar type: The trigger type. Required. A recurring cron-based trigger. + :vartype type: str or ~azure.ai.projects.models.SCHEDULE + :ivar cron_expression: A 5-field cron expression. The service enforces a minimum interval of + five minutes by default. Required. + :vartype cron_expression: str + :ivar time_zone: An IANA or Windows time zone identifier for the schedule. Required. + :vartype time_zone: str + """ + + type: Literal[RoutineTriggerType.SCHEDULE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The trigger type. Required. A recurring cron-based trigger.""" + cron_expression: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A 5-field cron expression. The service enforces a minimum interval of five minutes by default. + Required.""" + time_zone: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An IANA or Windows time zone identifier for the schedule. Required.""" + + @overload + def __init__( + self, + *, + cron_expression: str, + time_zone: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = RoutineTriggerType.SCHEDULE # type: ignore + + +class ScheduleRun(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Schedule run model. + + :ivar run_id: Identifier of the schedule run. Required. + :vartype run_id: str + :ivar schedule_id: Identifier of the schedule. Required. + :vartype schedule_id: str + :ivar success: Trigger success status of the schedule run. Required. + :vartype success: bool + :ivar trigger_time: Trigger time of the schedule run. + :vartype trigger_time: ~datetime.datetime + :ivar error: Error information for the schedule run. + :vartype error: str + :ivar properties: Properties of the schedule run. Required. + :vartype properties: dict[str, str] + """ + + run_id: str = rest_field(name="id", visibility=["read"]) + """Identifier of the schedule run. Required.""" + schedule_id: str = rest_field(name="scheduleId", visibility=["read", "create", "update", "delete", "query"]) + """Identifier of the schedule. Required.""" + success: bool = rest_field(visibility=["read"]) + """Trigger success status of the schedule run. Required.""" + trigger_time: Optional[datetime.datetime] = rest_field( + name="triggerTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """Trigger time of the schedule run.""" + error: Optional[str] = rest_field(visibility=["read"]) + """Error information for the schedule run.""" + properties: dict[str, str] = rest_field(visibility=["read"]) + """Properties of the schedule run. Required.""" + + @overload + def __init__( + self, + *, + schedule_id: str, + trigger_time: Optional[datetime.datetime] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ScoreLevelParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """ScoreLevelParam. + + :ivar label: Required. + :vartype label: str + :ivar description: + :vartype description: str + """ + + label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + + @overload + def __init__( + self, + *, + label: str, + description: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ScoreProbabilityResource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """ScoreProbabilityResource. + + :ivar value: Required. + :vartype value: int + :ivar label: Required. + :vartype label: str + :ivar probability: Required. + :vartype probability: float + """ + + value: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + probability: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + value: int, + label: str, + probability: float, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SessionConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Session defaults applied to sessions created for a hosted agent version. + + :ivar idle_timeout_seconds: The idle duration, in seconds, before a session's sandbox is + suspended. When omitted, the server defaults to 900 seconds. Must be between 120 and 14400 + seconds (4 hours). + :vartype idle_timeout_seconds: ~datetime.timedelta + """ + + idle_timeout_seconds: Optional[datetime.timedelta] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-seconds-int" + ) + """The idle duration, in seconds, before a session's sandbox is suspended. When omitted, the + server defaults to 900 seconds. Must be between 120 and 14400 seconds (4 hours).""" + + @overload + def __init__( + self, + *, + idle_timeout_seconds: Optional[datetime.timedelta] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SessionDirectoryEntry(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A single entry in a directory listing. + + :ivar name: The name of the file or directory. Required. + :vartype name: str + :ivar size: The size in bytes (0 for directories). Required. + :vartype size: int + :ivar is_directory: Whether this entry is a directory. Required. + :vartype is_directory: bool + :ivar modified_time: The Unix timestamp (in seconds) when the file was last modified. Required. + :vartype modified_time: ~datetime.datetime + """ + + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the file or directory. Required.""" + size: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The size in bytes (0 for directories). Required.""" + is_directory: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether this entry is a directory. Required.""" + modified_time: datetime.datetime = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (in seconds) when the file was last modified. Required.""" + + @overload + def __init__( + self, + *, + name: str, + size: int, + is_directory: bool, + modified_time: datetime.datetime, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SessionFileWriteResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Response from uploading a file to a session sandbox. + + :ivar path: The path where the file was written, relative to the session home directory. + Required. + :vartype path: str + :ivar bytes_written: Number of bytes written. Required. + :vartype bytes_written: int + """ + + path: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The path where the file was written, relative to the session home directory. Required.""" + bytes_written: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Number of bytes written. Required.""" + + @overload + def __init__( + self, + *, + path: str, + bytes_written: int, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SessionLogEvent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A single Server-Sent Event frame emitted by the hosted agent session log stream. + + Each frame contains an ``event`` field identifying the event type and a ``data`` + field carrying the payload as plain text. Although the current ``data`` payload + is JSON-formatted, its schema is not contractual — additional keys may appear + and the format may change over time. Clients should treat ``data`` as an + opaque string and optionally attempt JSON parsing. + + New event types may be added in the future. Clients should gracefully + ignore unrecognized event types. + + Wire format: + + .. code-block:: + + event: log + data: {"timestamp":"2026-03-10T09:33:17.121Z","stream":"stdout","message":"Starting server on port 18080"} + + event: log + data: {"timestamp":"2026-03-10T09:34:52.714Z","stream":"status","message":"Successfully connected to container"} + + :ivar event: The SSE event type. Currently ``log``, but additional event types may be added in + the future. Clients should ignore unrecognized event types. Required. "log" + :vartype event: str or ~azure.ai.projects.models.SessionLogEventType + :ivar data: The event payload as plain text. Currently JSON-formatted but the schema is not + contractual and may change. Required. + :vartype data: str + """ + + event: Union[str, "_models.SessionLogEventType"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The SSE event type. Currently ``log``, but additional event types may be added in the future. + Clients should ignore unrecognized event types. Required. \"log\"""" + data: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event payload as plain text. Currently JSON-formatted but the schema is not contractual and + may change. Required.""" + + @overload + def __init__( + self, + *, + event: Union[str, "_models.SessionLogEventType"], + data: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SharepointGroundingToolParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The sharepoint grounding tool parameters. + + :ivar project_connections: The project connections attached to this tool. There can be a + maximum of 1 connection resource attached to the tool. + :vartype project_connections: list[~azure.ai.projects.models.ToolProjectConnection] + """ + + project_connections: Optional[list["_models.ToolProjectConnection"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The project connections attached to this tool. There can be a maximum of 1 connection resource + attached to the tool.""" + + @overload + def __init__( + self, + *, + project_connections: Optional[list["_models.ToolProjectConnection"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SharepointPreviewTool( + Tool, discriminator="sharepoint_grounding_preview" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """The input definition information for a sharepoint tool as used to configure an agent. + + :ivar type: The object type, which is always 'sharepoint_grounding_preview'. Required. + SHAREPOINT_GROUNDING_PREVIEW. + :vartype type: str or ~azure.ai.projects.models.SHAREPOINT_GROUNDING_PREVIEW + :ivar sharepoint_grounding_preview: The sharepoint grounding tool parameters. Required. + :vartype sharepoint_grounding_preview: + ~azure.ai.projects.models.SharepointGroundingToolParameters + """ + + type: Literal[ToolType.SHAREPOINT_GROUNDING_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The object type, which is always 'sharepoint_grounding_preview'. Required. + SHAREPOINT_GROUNDING_PREVIEW.""" + sharepoint_grounding_preview: "_models.SharepointGroundingToolParameters" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The sharepoint grounding tool parameters. Required.""" + + @overload + def __init__( + self, + *, + sharepoint_grounding_preview: "_models.SharepointGroundingToolParameters", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = ToolType.SHAREPOINT_GROUNDING_PREVIEW # type: ignore + + +class ShellToolboxTool( + ToolboxTool, discriminator="shell" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A shell tool stored in a toolbox. This model is additive to toolbox configuration and does not + modify the OpenAI tool contract or existing toolbox tool definitions. + + :ivar name: Optional user-defined name for this tool or configuration. + :vartype name: str + :ivar description: Optional user-defined description for this tool or configuration. + :vartype description: str + :ivar tool_configs: Per-tool configuration map. Keys are tool names or ``*`` (catch-all + default). Resolution order: exact tool name match takes priority over ``*``. Unknown tool names + are silently ignored at runtime. + :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] + :ivar type: The type of the tool. Always ``shell``. Required. SHELL. + :vartype type: str or ~azure.ai.projects.models.SHELL + :ivar allowed_callers: + :vartype allowed_callers: list[str or ~azure.ai.projects.models.CallableToolAllowedCaller] + :ivar environment: The environment in which shell commands are executed. Specify an + automatically provisioned container or an existing container. Required. + :vartype environment: ~azure.ai.projects.models.ToolboxShellEnvironment + """ + + type: Literal[ToolboxToolType.SHELL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the tool. Always ``shell``. Required. SHELL.""" + allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + environment: "_models.ToolboxShellEnvironment" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The environment in which shell commands are executed. Specify an automatically provisioned + container or an existing container. Required.""" + + @overload + def __init__( + self, + *, + environment: "_models.ToolboxShellEnvironment", + name: Optional[str] = None, + description: Optional[str] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = ToolboxToolType.SHELL # type: ignore + + +class SimpleQnADataGenerationJobConfiguration( + DataGenerationJobConfiguration, discriminator="simple_qna" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """The configuration for a data generation job with SimpleQnA type. + + :ivar train_split: The proportion of the generated data to be used for training when the data + is used for fine-tuning. The rest will be used for validation. Value should be between 0 and 1. + :vartype train_split: float + :ivar model_options: The LLM model options. + :vartype model_options: ~azure.ai.projects.models.DataGenerationModelOptions + :ivar type: The data generation job type, which is SimpleQnA for this model. Required. Simple + question and answers between user and agent. + :vartype type: str or ~azure.ai.projects.models.SIMPLE_QNA + :ivar max_samples: Maximum number of samples to generate, up to service-defined limits. + Required. + :vartype max_samples: int + :ivar question_types: The question types to generate. Used only for fine-tuning scenarios. + :vartype question_types: list[str or ~azure.ai.projects.models.SimpleQnAFineTuningQuestionType] + """ + + type: Literal[DataGenerationJobType.SIMPLE_QNA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The data generation job type, which is SimpleQnA for this model. Required. Simple question and + answers between user and agent.""" + max_samples: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Maximum number of samples to generate, up to service-defined limits. Required.""" + question_types: Optional[list[Union[str, "_models.SimpleQnAFineTuningQuestionType"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The question types to generate. Used only for fine-tuning scenarios.""" + + @overload + def __init__( + self, + *, + max_samples: int, + train_split: Optional[float] = None, + model_options: Optional["_models.DataGenerationModelOptions"] = None, + question_types: Optional[list[Union[str, "_models.SimpleQnAFineTuningQuestionType"]]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = DataGenerationJobType.SIMPLE_QNA # type: ignore + + +class SimulationSeedDataGenerationJobConfiguration( + DataGenerationJobConfiguration, discriminator="simulation_seed" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The configuration for a task generation data generation job. Use with multiturn evaluation + scenarios and with prompt, file, or agent sources. Generated dataset rows include fields such + as ``id``, ``category``, ``test_case_description``, and ``desired_num_turns``. + + :ivar train_split: The proportion of the generated data to be used for training when the data + is used for fine-tuning. The rest will be used for validation. Value should be between 0 and 1. + :vartype train_split: float + :ivar model_options: The LLM model options. + :vartype model_options: ~azure.ai.projects.models.DataGenerationModelOptions + :ivar type: The data generation job type, which is SimulationSeed for this model. Required. + Simulation seed for evaluation scenarios. + :vartype type: str or ~azure.ai.projects.models.SIMULATION_SEED + """ + + type: Literal[DataGenerationJobType.SIMULATION_SEED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The data generation job type, which is SimulationSeed for this model. Required. Simulation seed + for evaluation scenarios.""" + + @overload + def __init__( + self, + *, + train_split: Optional[float] = None, + model_options: Optional["_models.DataGenerationModelOptions"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = DataGenerationJobType.SIMULATION_SEED # type: ignore + + +class SipTelephonyTransferDestination( + TelephonyTransferDestination, discriminator="sip" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A SIP destination for a telephony transfer target. + + :ivar kind: The SIP destination type. Required. A Session Initiation Protocol destination. + :vartype kind: str or ~azure.ai.projects.models.SIP + :ivar value: The SIP or SIPS URI to call. Required. + :vartype value: str + """ + + kind: Literal[TelephonyTransferDestinationKind.SIP] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The SIP destination type. Required. A Session Initiation Protocol destination.""" + value: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The SIP or SIPS URI to call. Required.""" + + @overload + def __init__( + self, + *, + value: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.kind = TelephonyTransferDestinationKind.SIP # type: ignore + + +class SkillDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A skill resource. + + :ivar id: The unique identifier of the skill. Required. + :vartype id: str + :ivar name: The unique name of the skill. Required. + :vartype name: str + :ivar description: A human-readable description of the skill. Required. + :vartype description: str + :ivar created_at: The Unix timestamp (seconds) when the skill was created. Required. + :vartype created_at: ~datetime.datetime + :ivar default_version: The default version for the skill. Can be changed via updateSkill. + Required. + :vartype default_version: str + :ivar latest_version: The latest version for the skill. Required. + :vartype latest_version: str + """ + + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique identifier of the skill. Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique name of the skill. Required.""" + description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A human-readable description of the skill. Required.""" + created_at: datetime.datetime = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (seconds) when the skill was created. Required.""" + default_version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The default version for the skill. Can be changed via updateSkill. Required.""" + latest_version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The latest version for the skill. Required.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + name: str, + description: str, + created_at: datetime.datetime, + default_version: str, + latest_version: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SkillInlineContent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Inline content for defining a simple skill without uploading files. Follows the agentskills.io + SKILL.md specification. + + :ivar description: A human-readable description of what the skill does and when to use it. + Required. + :vartype description: str + :ivar instructions: The skill instructions in markdown format. This is the body content of the + SKILL.md file. Required. + :vartype instructions: str + :ivar license: License name or reference to a bundled license file. + :vartype license: str + :ivar compatibility: Environment requirements or compatibility notes for the skill. + :vartype compatibility: str + :ivar metadata: Arbitrary key-value metadata for additional properties. + :vartype metadata: dict[str, str] + :ivar allowed_tools: List of pre-approved tools the skill may use. Experimental. + :vartype allowed_tools: list[str] + """ + + description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A human-readable description of what the skill does and when to use it. Required.""" + instructions: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The skill instructions in markdown format. This is the body content of the SKILL.md file. + Required.""" + license: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """License name or reference to a bundled license file.""" + compatibility: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Environment requirements or compatibility notes for the skill.""" + metadata: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Arbitrary key-value metadata for additional properties.""" + allowed_tools: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """List of pre-approved tools the skill may use. Experimental.""" + + @overload + def __init__( + self, + *, + description: str, + instructions: str, + license: Optional[str] = None, + compatibility: Optional[str] = None, + metadata: Optional[dict[str, str]] = None, + allowed_tools: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SkillReference(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A reference to a versioned Foundry skill. + + :ivar name: The name of the skill. Required. + :vartype name: str + :ivar version: The skill version. If omitted, the current default version is resolved and + pinned when the agent version is created. + :vartype version: str + """ + + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the skill. Required.""" + version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The skill version. If omitted, the current default version is resolved and pinned when the + agent version is created.""" + + @overload + def __init__( + self, + *, + name: str, + version: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SkillReferenceParam( + ContainerSkill, discriminator="skill_reference" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """SkillReferenceParam. + + :ivar type: References a skill created with the /v1/skills endpoint. Required. SKILL_REFERENCE. + :vartype type: str or ~azure.ai.projects.models.SKILL_REFERENCE + :ivar skill_id: The ID of the referenced skill. Required. + :vartype skill_id: str + :ivar version: Optional skill version. Use a positive integer or 'latest'. Omit for default. + :vartype version: str + """ + + type: Literal[ContainerSkillType.SKILL_REFERENCE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """References a skill created with the /v1/skills endpoint. Required. SKILL_REFERENCE.""" + skill_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the referenced skill. Required.""" + version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional skill version. Use a positive integer or 'latest'. Omit for default.""" + + @overload + def __init__( + self, + *, + skill_id: str, + version: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = ContainerSkillType.SKILL_REFERENCE # type: ignore + + +class SkillVersion(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A specific version of a skill. + + :ivar id: The unique identifier of the skill version. Required. + :vartype id: str + :ivar skill_id: The identifier of the parent skill. Required. + :vartype skill_id: str + :ivar name: The name of the skill version. Required. + :vartype name: str + :ivar version: The version identifier. Skill versions are immutable. Required. + :vartype version: str + :ivar description: A human-readable description of the skill version. Required. + :vartype description: str + :ivar created_at: The Unix timestamp (seconds) when the skill version was created. Required. + :vartype created_at: ~datetime.datetime + """ + + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique identifier of the skill version. Required.""" + skill_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The identifier of the parent skill. Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the skill version. Required.""" + version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The version identifier. Skill versions are immutable. Required.""" + description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A human-readable description of the skill version. Required.""" + created_at: datetime.datetime = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (seconds) when the skill version was created. Required.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + skill_id: str, + name: str, + version: str, + description: str, + created_at: datetime.datetime, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ToolChoiceParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """How the model should select which tool (or tools) to use when generating a response. See the + ``tools`` parameter to see how to specify which tools the model can call. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + ToolChoiceAllowed, SpecificApplyPatchParam, ToolChoiceCodeInterpreter, ToolChoiceComputer, + ToolChoiceComputerUse, ToolChoiceComputerUsePreview, ToolChoiceCustom, ToolChoiceFileSearch, + ToolChoiceFunction, ToolChoiceImageGeneration, ToolChoiceMCP, + SpecificProgrammaticToolCallingParam, SpecificFunctionShellParam, ToolChoiceWebSearchPreview, + ToolChoiceWebSearchPreview20250311 + + :ivar type: Required. Known values are: "allowed_tools", "function", "mcp", "custom", + "programmatic_tool_calling", "apply_patch", "shell", "file_search", "web_search_preview", + "computer_use_preview", "web_search_preview_2025_03_11", "image_generation", + "code_interpreter", "computer", and "computer_use". + :vartype type: str or ~azure.ai.projects.models.ToolChoiceParamType + """ + + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"allowed_tools\", \"function\", \"mcp\", \"custom\", + \"programmatic_tool_calling\", \"apply_patch\", \"shell\", \"file_search\", + \"web_search_preview\", \"computer_use_preview\", \"web_search_preview_2025_03_11\", + \"image_generation\", \"code_interpreter\", \"computer\", and \"computer_use\".""" + + @overload + def __init__( + self, + *, + type: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SpecificApplyPatchParam(ToolChoiceParam, discriminator="apply_patch"): + """Specific apply patch tool choice. + + :ivar type: The tool to call. Always ``apply_patch``. Required. APPLY_PATCH. + :vartype type: str or ~azure.ai.projects.models.APPLY_PATCH + """ + + type: Literal[ToolChoiceParamType.APPLY_PATCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The tool to call. Always ``apply_patch``. Required. APPLY_PATCH.""" + + @overload + def __init__( + self, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = ToolChoiceParamType.APPLY_PATCH # type: ignore + + +class SpecificFunctionShellParam(ToolChoiceParam, discriminator="shell"): + """Specific shell tool choice. + + :ivar type: The tool to call. Always ``shell``. Required. SHELL. + :vartype type: str or ~azure.ai.projects.models.SHELL + """ + + type: Literal[ToolChoiceParamType.SHELL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The tool to call. Always ``shell``. Required. SHELL.""" + + @overload + def __init__( + self, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = ToolChoiceParamType.SHELL # type: ignore + + +class SpecificProgrammaticToolCallingParam(ToolChoiceParam, discriminator="programmatic_tool_calling"): + """SpecificProgrammaticToolCallingParam. + + :ivar type: The tool to call. Always ``programmatic_tool_calling``. Required. + PROGRAMMATIC_TOOL_CALLING. + :vartype type: str or ~azure.ai.projects.models.PROGRAMMATIC_TOOL_CALLING + """ + + type: Literal[ToolChoiceParamType.PROGRAMMATIC_TOOL_CALLING] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The tool to call. Always ``programmatic_tool_calling``. Required. PROGRAMMATIC_TOOL_CALLING.""" + + @overload + def __init__( + self, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = ToolChoiceParamType.PROGRAMMATIC_TOOL_CALLING # type: ignore + + +class SteeringPromptOptimizationContext( + OptimizationContext, discriminator="steering_prompt" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Natural-language guidance for the desired optimization. + + :ivar type: Optimization context type discriminator. Required. Natural-language guidance that + steers the desired optimization. + :vartype type: str or ~azure.ai.projects.models.STEERING_PROMPT + :ivar prompt: Developer guidance describing the desired changes. Required. + :vartype prompt: str + """ + + type: Literal[OptimizationContextType.STEERING_PROMPT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Optimization context type discriminator. Required. Natural-language guidance that steers the + desired optimization.""" + prompt: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Developer guidance describing the desired changes. Required.""" + + @overload + def __init__( + self, + *, + prompt: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = OptimizationContextType.STEERING_PROMPT # type: ignore + + +class StructuredInputDefinition(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """An structured input that can participate in prompt template substitutions and tool argument + binding. + + :ivar description: A human-readable description of the input. + :vartype description: str + :ivar default_value: The default value for the input if no run-time value is provided. + :vartype default_value: any + :ivar schema: The JSON schema for the structured input (optional). + :vartype schema: dict[str, any] + :ivar required: Whether the input property is required when the agent is invoked. The service + defaults to ``false`` if a value is not specified by the caller. + :vartype required: bool + """ + + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A human-readable description of the input.""" + default_value: Optional[Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The default value for the input if no run-time value is provided.""" + schema: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The JSON schema for the structured input (optional).""" + required: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether the input property is required when the agent is invoked. The service defaults to + ``false`` if a value is not specified by the caller.""" + + @overload + def __init__( + self, + *, + description: Optional[str] = None, + default_value: Optional[Any] = None, + schema: Optional[dict[str, Any]] = None, + required: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class StructuredOutputDefinition(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A structured output that can be produced by the agent. + + :ivar name: The name of the structured output. Required. + :vartype name: str + :ivar description: A description of the output to emit. Used by the model to determine when to + emit the output. Required. + :vartype description: str + :ivar schema: The JSON schema for the structured output. Required. + :vartype schema: dict[str, any] + :ivar strict: Whether to enforce strict validation. Default ``true``. Required. + :vartype strict: bool + """ + + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the structured output. Required.""" + description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A description of the output to emit. Used by the model to determine when to emit the output. + Required.""" + schema: dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The JSON schema for the structured output. Required.""" + strict: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether to enforce strict validation. Default ``true``. Required.""" + + @overload + def __init__( + self, + *, + name: str, + description: str, + schema: dict[str, Any], + strict: bool, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SupervisedFineTuningDataGenerationJob( + DataGenerationJob, discriminator="supervised_finetuning_preview" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Supervised fine-tuning data generation job resource. This is a preview feature. + + :ivar id: Server-assigned unique identifier. Required. + :vartype id: str + :ivar result: Result produced on success. + :vartype result: ~azure.ai.projects.models.DataGenerationJobResult + :ivar status: Current lifecycle status. Required. Known values are: "queued", "in_progress", + "succeeded", "failed", and "cancelled". + :vartype status: str or ~azure.ai.projects.models.JobStatus + :ivar error: Error details — populated only on failure. + :vartype error: ~azure.ai.projects.models.ApiError + :ivar name: The display name of the data generation job. Required. + :vartype name: str + :ivar sources: The sources used for the data generation job. Required. + :vartype sources: list[~azure.ai.projects.models.DataGenerationJobSource] + :ivar generation_configuration: The generation configuration for the data generation job. + Required. + :vartype generation_configuration: ~azure.ai.projects.models.DataGenerationJobConfiguration + :ivar created_at: The timestamp when the job was created, represented in Unix time (seconds + since January 1, 1970). Required. + :vartype created_at: ~datetime.datetime + :ivar finished_at: The timestamp when the job was finished, represented in Unix time (seconds + since January 1, 1970). + :vartype finished_at: ~datetime.datetime + :ivar scenario: The scenario of the data generation job, which is Supervised Fine-tuning + preview for this model. Required. Supervised Fine-tuning preview scenario. + :vartype scenario: str or ~azure.ai.projects.models.SUPERVISED_FINETUNING_PREVIEW + :ivar output_configuration: Optional file output configuration for the generated supervised + fine-tuning data. + :vartype output_configuration: + ~azure.ai.projects.models.SupervisedFineTuningDataGenerationJobOutputConfiguration + """ + + scenario: Literal[DataGenerationJobScenario.SUPERVISED_FINETUNING_PREVIEW] = rest_discriminator(name="scenario", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The scenario of the data generation job, which is Supervised Fine-tuning preview for this + model. Required. Supervised Fine-tuning preview scenario.""" + output_configuration: Optional["_models.SupervisedFineTuningDataGenerationJobOutputConfiguration"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Optional file output configuration for the generated supervised fine-tuning data.""" + + @overload + def __init__( + self, + *, + name: str, + sources: list["_models.DataGenerationJobSource"], + generation_configuration: "_models.DataGenerationJobConfiguration", + output_configuration: Optional["_models.SupervisedFineTuningDataGenerationJobOutputConfiguration"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.scenario = DataGenerationJobScenario.SUPERVISED_FINETUNING_PREVIEW # type: ignore + + +class SupervisedFineTuningDataGenerationJobInputs( + DataGenerationJobInputs, discriminator="supervised_finetuning_preview" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Caller-supplied inputs for a supervised fine-tuning data generation job. This is a preview + feature. + + :ivar name: The display name of the data generation job. Required. + :vartype name: str + :ivar sources: The sources used for the data generation job. Required. + :vartype sources: list[~azure.ai.projects.models.DataGenerationJobSource] + :ivar generation_configuration: The generation configuration for the data generation job. + Required. + :vartype generation_configuration: ~azure.ai.projects.models.DataGenerationJobConfiguration + :ivar scenario: The scenario of the data generation job, which is Supervised Fine-tuning + preview for this model. Required. Supervised Fine-tuning preview scenario. + :vartype scenario: str or ~azure.ai.projects.models.SUPERVISED_FINETUNING_PREVIEW + :ivar output_configuration: Optional file output configuration for the generated supervised + fine-tuning data. + :vartype output_configuration: + ~azure.ai.projects.models.SupervisedFineTuningDataGenerationJobOutputConfiguration + """ + + scenario: Literal[DataGenerationJobScenario.SUPERVISED_FINETUNING_PREVIEW] = rest_discriminator(name="scenario", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The scenario of the data generation job, which is Supervised Fine-tuning preview for this + model. Required. Supervised Fine-tuning preview scenario.""" + output_configuration: Optional["_models.SupervisedFineTuningDataGenerationJobOutputConfiguration"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Optional file output configuration for the generated supervised fine-tuning data.""" + + @overload + def __init__( + self, + *, + name: str, + sources: list["_models.DataGenerationJobSource"], + generation_configuration: "_models.DataGenerationJobConfiguration", + output_configuration: Optional["_models.SupervisedFineTuningDataGenerationJobOutputConfiguration"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.scenario = DataGenerationJobScenario.SUPERVISED_FINETUNING_PREVIEW # type: ignore + + +class SupervisedFineTuningDataGenerationJobOutputConfiguration( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """File output configuration for a supervised fine-tuning data generation job. This is a preview + feature. + + :ivar name: Filename to assign to the generated fine-tuning file. Required. + :vartype name: str + :ivar write_mode: Controls how file outputs are written. If omitted, defaults to ``overwrite`` + and writes only the newly generated fine-tuning file content. Known values are: "overwrite" and + "merge". + :vartype write_mode: str or ~azure.ai.projects.models.DataGenerationJobOutputWriteMode + :ivar merge_file_id: File ID to merge into when ``write_mode`` is ``merge``. + :vartype merge_file_id: str + """ + + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Filename to assign to the generated fine-tuning file. Required.""" + write_mode: Optional[Union[str, "_models.DataGenerationJobOutputWriteMode"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Controls how file outputs are written. If omitted, defaults to ``overwrite`` and writes only + the newly generated fine-tuning file content. Known values are: \"overwrite\" and \"merge\".""" + merge_file_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """File ID to merge into when ``write_mode`` is ``merge``.""" + + @overload + def __init__( + self, + *, + name: str, + write_mode: Optional[Union[str, "_models.DataGenerationJobOutputWriteMode"]] = None, + merge_file_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TaxonomyCategory(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Taxonomy category definition. + + :ivar id: Unique identifier of the taxonomy category. Required. + :vartype id: str + :ivar name: Name of the taxonomy category. Required. + :vartype name: str + :ivar description: Description of the taxonomy category. + :vartype description: str + :ivar risk_category: Risk category associated with this taxonomy category. Required. Known + values are: "HateUnfairness", "Violence", "Sexual", "SelfHarm", "ProtectedMaterial", + "CodeVulnerability", "UngroundedAttributes", "ProhibitedActions", "SensitiveDataLeakage", and + "TaskAdherence". + :vartype risk_category: str or ~azure.ai.projects.models.RiskCategory + :ivar sub_categories: List of taxonomy sub categories. Required. + :vartype sub_categories: list[~azure.ai.projects.models.TaxonomySubCategory] + :ivar properties: Additional properties for the taxonomy category. + :vartype properties: dict[str, str] + """ + + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Unique identifier of the taxonomy category. Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the taxonomy category. Required.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Description of the taxonomy category.""" + risk_category: Union[str, "_models.RiskCategory"] = rest_field( + name="riskCategory", visibility=["read", "create", "update", "delete", "query"] + ) + """Risk category associated with this taxonomy category. Required. Known values are: + \"HateUnfairness\", \"Violence\", \"Sexual\", \"SelfHarm\", \"ProtectedMaterial\", + \"CodeVulnerability\", \"UngroundedAttributes\", \"ProhibitedActions\", + \"SensitiveDataLeakage\", and \"TaskAdherence\".""" + sub_categories: list["_models.TaxonomySubCategory"] = rest_field( + name="subCategories", visibility=["read", "create", "update", "delete", "query"] + ) + """List of taxonomy sub categories. Required.""" + properties: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Additional properties for the taxonomy category.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + name: str, + risk_category: Union[str, "_models.RiskCategory"], + sub_categories: list["_models.TaxonomySubCategory"], + description: Optional[str] = None, + properties: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TaxonomySubCategory(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Taxonomy sub-category definition. + + :ivar id: Unique identifier of the taxonomy sub-category. Required. + :vartype id: str + :ivar name: Name of the taxonomy sub-category. Required. + :vartype name: str + :ivar description: Description of the taxonomy sub-category. + :vartype description: str + :ivar enabled: List of taxonomy items under this sub-category. Required. + :vartype enabled: bool + :ivar properties: Additional properties for the taxonomy sub-category. + :vartype properties: dict[str, str] + """ + + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Unique identifier of the taxonomy sub-category. Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the taxonomy sub-category. Required.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Description of the taxonomy sub-category.""" + enabled: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """List of taxonomy items under this sub-category. Required.""" + properties: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Additional properties for the taxonomy sub-category.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + name: str, + enabled: bool, + description: Optional[str] = None, + properties: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TelephonyBinding(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A telephony binding owned by a voice agent. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + TeamsPhoneExtensibilityTelephonyBinding, TwilioTelephonyBinding + + :ivar id: The service-generated binding identifier. Required. + :vartype id: str + :ivar provider: The telephony provider. Required. Known values are: "teams_phone_extensibility" + and "twilio". + :vartype provider: str or ~azure.ai.projects.models.TelephonyProvider + :ivar connection_name: The Foundry connection name for the telephony provider. Required. + :vartype connection_name: str + :ivar label: The optional display label for the binding. + :vartype label: str + :ivar status: The lifecycle status. Required. Known values are: "active" and "suspended". + :vartype status: str or ~azure.ai.projects.models.TelephonyBindingStatus + :ivar incoming_call_url: The service-generated webhook URL to configure with the telephony + provider. Required. + :vartype incoming_call_url: str + """ + + __mapping__: dict[str, _Model] = {} + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The service-generated binding identifier. Required.""" + provider: str = rest_discriminator(name="provider", visibility=["read", "create", "update", "delete", "query"]) + """The telephony provider. Required. Known values are: \"teams_phone_extensibility\" and + \"twilio\".""" + connection_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Foundry connection name for the telephony provider. Required.""" + label: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The optional display label for the binding.""" + status: Union[str, "_models.TelephonyBindingStatus"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The lifecycle status. Required. Known values are: \"active\" and \"suspended\".""" + incoming_call_url: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The service-generated webhook URL to configure with the telephony provider. Required.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + provider: str, + connection_name: str, + status: Union[str, "_models.TelephonyBindingStatus"], + incoming_call_url: str, + label: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TeamsPhoneExtensibilityTelephonyBinding( + TelephonyBinding, discriminator="teams_phone_extensibility" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A Microsoft Teams Phone extensibility binding owned by a voice agent. + + :ivar id: The service-generated binding identifier. Required. + :vartype id: str + :ivar connection_name: The Foundry connection name for the telephony provider. Required. + :vartype connection_name: str + :ivar label: The optional display label for the binding. + :vartype label: str + :ivar status: The lifecycle status. Required. Known values are: "active" and "suspended". + :vartype status: str or ~azure.ai.projects.models.TelephonyBindingStatus + :ivar incoming_call_url: The service-generated webhook URL to configure with the telephony + provider. Required. + :vartype incoming_call_url: str + :ivar provider: The Microsoft Teams Phone extensibility provider. Required. Microsoft Teams + Phone extensibility. + :vartype provider: str or ~azure.ai.projects.models.TEAMS_PHONE_EXTENSIBILITY + :ivar phone_number: The optional display phone number for the Teams resource account. + :vartype phone_number: str + :ivar resource_account_object_id: The Microsoft Teams resource-account object identifier as a + GUID. Required. + :vartype resource_account_object_id: str + """ + + provider: Literal[TelephonyProvider.TEAMS_PHONE_EXTENSIBILITY] = rest_discriminator(name="provider", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The Microsoft Teams Phone extensibility provider. Required. Microsoft Teams Phone + extensibility.""" + phone_number: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The optional display phone number for the Teams resource account.""" + resource_account_object_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Microsoft Teams resource-account object identifier as a GUID. Required.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + connection_name: str, + status: Union[str, "_models.TelephonyBindingStatus"], + incoming_call_url: str, + resource_account_object_id: str, + label: Optional[str] = None, + phone_number: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.provider = TelephonyProvider.TEAMS_PHONE_EXTENSIBILITY # type: ignore + + +class TelephonyBindingListItem(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A telephony binding returned in a list, including its entity tag. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + TeamsPhoneExtensibilityTelephonyBindingListItem, TwilioTelephonyBindingListItem + + :ivar id: The service-generated binding identifier. Required. + :vartype id: str + :ivar provider: The telephony provider. Required. Known values are: "teams_phone_extensibility" + and "twilio". + :vartype provider: str or ~azure.ai.projects.models.TelephonyProvider + :ivar connection_name: The Foundry connection name for the telephony provider. Required. + :vartype connection_name: str + :ivar label: The optional display label for the binding. + :vartype label: str + :ivar status: The lifecycle status. Required. Known values are: "active" and "suspended". + :vartype status: str or ~azure.ai.projects.models.TelephonyBindingStatus + :ivar incoming_call_url: The service-generated webhook URL to configure with the telephony + provider. Required. + :vartype incoming_call_url: str + :ivar etag: The entity tag to send in the ``If-Match`` header when updating or deleting this + binding. Required. + :vartype etag: str + """ + + __mapping__: dict[str, _Model] = {} + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The service-generated binding identifier. Required.""" + provider: str = rest_discriminator(name="provider", visibility=["read", "create", "update", "delete", "query"]) + """The telephony provider. Required. Known values are: \"teams_phone_extensibility\" and + \"twilio\".""" + connection_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Foundry connection name for the telephony provider. Required.""" + label: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The optional display label for the binding.""" + status: Union[str, "_models.TelephonyBindingStatus"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The lifecycle status. Required. Known values are: \"active\" and \"suspended\".""" + incoming_call_url: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The service-generated webhook URL to configure with the telephony provider. Required.""" + etag: str = rest_field(visibility=["read"]) + """The entity tag to send in the ``If-Match`` header when updating or deleting this binding. + Required.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + provider: str, + connection_name: str, + status: Union[str, "_models.TelephonyBindingStatus"], + incoming_call_url: str, + label: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TeamsPhoneExtensibilityTelephonyBindingListItem( + TelephonyBindingListItem, discriminator="teams_phone_extensibility" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """A Microsoft Teams Phone extensibility binding returned in a list, including its entity tag. + + :ivar id: The service-generated binding identifier. Required. + :vartype id: str + :ivar connection_name: The Foundry connection name for the telephony provider. Required. + :vartype connection_name: str + :ivar label: The optional display label for the binding. + :vartype label: str + :ivar status: The lifecycle status. Required. Known values are: "active" and "suspended". + :vartype status: str or ~azure.ai.projects.models.TelephonyBindingStatus + :ivar incoming_call_url: The service-generated webhook URL to configure with the telephony + provider. Required. + :vartype incoming_call_url: str + :ivar etag: The entity tag to send in the ``If-Match`` header when updating or deleting this + binding. Required. + :vartype etag: str + :ivar provider: The Microsoft Teams Phone extensibility provider. Required. Microsoft Teams + Phone extensibility. + :vartype provider: str or ~azure.ai.projects.models.TEAMS_PHONE_EXTENSIBILITY + :ivar phone_number: The optional display phone number for the Teams resource account. + :vartype phone_number: str + :ivar resource_account_object_id: The Microsoft Teams resource-account object identifier as a + GUID. Required. + :vartype resource_account_object_id: str + """ + + provider: Literal[TelephonyProvider.TEAMS_PHONE_EXTENSIBILITY] = rest_discriminator(name="provider", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The Microsoft Teams Phone extensibility provider. Required. Microsoft Teams Phone + extensibility.""" + phone_number: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The optional display phone number for the Teams resource account.""" + resource_account_object_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Microsoft Teams resource-account object identifier as a GUID. Required.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + connection_name: str, + status: Union[str, "_models.TelephonyBindingStatus"], + incoming_call_url: str, + resource_account_object_id: str, + label: Optional[str] = None, + phone_number: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.provider = TelephonyProvider.TEAMS_PHONE_EXTENSIBILITY # type: ignore + + +class TeamsTelephonyTransferDestination( + TelephonyTransferDestination, discriminator="teams" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A Microsoft Teams destination for a telephony transfer target. + + :ivar kind: The Microsoft Teams destination type. Required. A Microsoft Teams user or + resource-account destination. + :vartype kind: str or ~azure.ai.projects.models.TEAMS + :ivar value: The Microsoft Teams user or resource-account identifier. Required. + :vartype value: str + """ + + kind: Literal[TelephonyTransferDestinationKind.TEAMS] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The Microsoft Teams destination type. Required. A Microsoft Teams user or resource-account + destination.""" + value: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Microsoft Teams user or resource-account identifier. Required.""" + + @overload + def __init__( + self, + *, + value: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.kind = TelephonyTransferDestinationKind.TEAMS # type: ignore + + +class TelemetryConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Customer-supplied telemetry configuration for exporting container logs, traces, and metrics. + + :ivar endpoints: Customer-supplied telemetry export endpoint configurations. Required. + :vartype endpoints: list[~azure.ai.projects.models.TelemetryEndpoint] + """ + + endpoints: list["_models.TelemetryEndpoint"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Customer-supplied telemetry export endpoint configurations. Required.""" + + @overload + def __init__( + self, + *, + endpoints: list["_models.TelemetryEndpoint"], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TelephonyCallJob(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A durable direct or campaign-created outbound call intent. + + :ivar destination: The phone destination to call. Required. + :vartype destination: ~azure.ai.projects.models.TelephonyOutboundDestination + :ivar connection_name: The Foundry connection name in the current project used to originate the + call. Its category selects Twilio or Azure Communication Services / Teams Phone extensibility. + No inbound telephony binding is required. Required. + :vartype connection_name: str + :ivar source: The caller identity used to originate the call. For a Twilio connection, provide + an authorized E.164 phone number. For an Azure Communication Services / Teams Phone + extensibility connection, provide the Teams Resource Account object ID. The identity type is + inferred from the connection category; originating does not change inbound routing. Required. + :vartype source: str + :ivar purpose: An optional customer-declared purpose for placing the call. + :vartype purpose: str + :ivar structured_inputs: Structured input values available to the agent and greeting for this + call. Agent-declared inputs are validated against their schemas; omitted optional inputs may + use their Agent-defined default values, while omitted required inputs are rejected. Additional + inputs remain available as dynamic template variables. + :vartype structured_inputs: dict[str, any] + :ivar schedule: The optional execution window. + :vartype schedule: ~azure.ai.projects.models.TelephonyCallJobSchedule + :ivar id: The service-generated call-job identifier. Required. + :vartype id: str + :ivar object: The object type. Always ``telephony.call_job``. Required. Default value is + "telephony.call_job". + :vartype object: str + :ivar agent_name: The name of the voice agent used at execution time. Required. + :vartype agent_name: str + :ivar status: The current call-job lifecycle status. Required. Known values are: "accepted", + "waiting_for_schedule", "queued", "dispatching", "in_progress", "waiting_for_retry", + "cancellation_requested", "completed", "blocked", "expired", "failed", and "cancelled". + :vartype status: str or ~azure.ai.projects.models.TelephonyCallJobStatus + :ivar cancellation: The recorded cancellation request, when cancellation was requested. + :vartype cancellation: ~azure.ai.projects.models.TelephonyCallJobCancellation + :ivar retry_policy: The frozen provider-attempt retry policy. Required. + :vartype retry_policy: ~azure.ai.projects.models.TelephonyOutboundRetryPolicy + :ivar attempt_count: The number of provider attempts created so far. Required. + :vartype attempt_count: int + :ivar next_attempt_at: The Unix timestamp in seconds at which the next retry becomes eligible. + :vartype next_attempt_at: ~datetime.datetime + :ivar terminal_reason: The stable service-generated reason for the overall outbound call job, + which can span multiple provider attempts, when available. Interpret this with ``status``: a + queued job can retain a temporary dispatch-deferral reason. Additional string codes may be + returned. Known values are: "no_answer", "no_answer_timeout", "answer_failed", + "bridge_cancelled", "bridge_failed", "voice_session_configuration_invalid", + "connection_project_mismatch", "outbound_connection_changed", + "outbound_connection_unavailable", "telephony_binding_invalid", "telephony_binding_not_found", + "telephony_binding_inactive", "telephony_binding_changed", "campaign_not_found", + "campaign_cancelled", "campaign_completed", "campaign_failed", + "origination_fence_not_recorded", "origination_reconciliation_timeout", + "cancellation_reconciliation_timeout", and + "provider_callback_timeout_cancellation_reconciliation_timeout". + :vartype terminal_reason: str or ~azure.ai.projects.models.TelephonyCallJobTerminalReason + :ivar revision: The monotonically increasing optimistic-concurrency revision. Required. + :vartype revision: int + :ivar created_at: The Unix timestamp in seconds when the call job was created. Required. + :vartype created_at: ~datetime.datetime + :ivar updated_at: The Unix timestamp in seconds when the call job was last updated. Required. + :vartype updated_at: ~datetime.datetime + """ + + destination: "_models.TelephonyOutboundDestination" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The phone destination to call. Required.""" + connection_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Foundry connection name in the current project used to originate the call. Its category + selects Twilio or Azure Communication Services / Teams Phone extensibility. No inbound + telephony binding is required. Required.""" + source: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The caller identity used to originate the call. For a Twilio connection, provide an authorized + E.164 phone number. For an Azure Communication Services / Teams Phone extensibility connection, + provide the Teams Resource Account object ID. The identity type is inferred from the connection + category; originating does not change inbound routing. Required.""" + purpose: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An optional customer-declared purpose for placing the call.""" + structured_inputs: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Structured input values available to the agent and greeting for this call. Agent-declared + inputs are validated against their schemas; omitted optional inputs may use their Agent-defined + default values, while omitted required inputs are rejected. Additional inputs remain available + as dynamic template variables.""" + schedule: Optional["_models.TelephonyCallJobSchedule"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The optional execution window.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The service-generated call-job identifier. Required.""" + object: Literal["telephony.call_job"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The object type. Always ``telephony.call_job``. Required. Default value is + \"telephony.call_job\".""" + agent_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the voice agent used at execution time. Required.""" + status: Union[str, "_models.TelephonyCallJobStatus"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The current call-job lifecycle status. Required. Known values are: \"accepted\", + \"waiting_for_schedule\", \"queued\", \"dispatching\", \"in_progress\", \"waiting_for_retry\", + \"cancellation_requested\", \"completed\", \"blocked\", \"expired\", \"failed\", and + \"cancelled\".""" + cancellation: Optional["_models.TelephonyCallJobCancellation"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The recorded cancellation request, when cancellation was requested.""" + retry_policy: "_models.TelephonyOutboundRetryPolicy" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The frozen provider-attempt retry policy. Required.""" + attempt_count: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The number of provider attempts created so far. Required.""" + next_attempt_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp in seconds at which the next retry becomes eligible.""" + terminal_reason: Optional[Union[str, "_models.TelephonyCallJobTerminalReason"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The stable service-generated reason for the overall outbound call job, which can span multiple + provider attempts, when available. Interpret this with ``status``: a queued job can retain a + temporary dispatch-deferral reason. Additional string codes may be returned. Known values are: + \"no_answer\", \"no_answer_timeout\", \"answer_failed\", \"bridge_cancelled\", + \"bridge_failed\", \"voice_session_configuration_invalid\", \"connection_project_mismatch\", + \"outbound_connection_changed\", \"outbound_connection_unavailable\", + \"telephony_binding_invalid\", \"telephony_binding_not_found\", \"telephony_binding_inactive\", + \"telephony_binding_changed\", \"campaign_not_found\", \"campaign_cancelled\", + \"campaign_completed\", \"campaign_failed\", \"origination_fence_not_recorded\", + \"origination_reconciliation_timeout\", \"cancellation_reconciliation_timeout\", and + \"provider_callback_timeout_cancellation_reconciliation_timeout\".""" + revision: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The monotonically increasing optimistic-concurrency revision. Required.""" + created_at: datetime.datetime = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp in seconds when the call job was created. Required.""" + updated_at: datetime.datetime = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp in seconds when the call job was last updated. Required.""" + + @overload + def __init__( + self, + *, + destination: "_models.TelephonyOutboundDestination", + connection_name: str, + source: str, + id: str, # pylint: disable=redefined-builtin + agent_name: str, + status: Union[str, "_models.TelephonyCallJobStatus"], + retry_policy: "_models.TelephonyOutboundRetryPolicy", + attempt_count: int, + revision: int, + created_at: datetime.datetime, + updated_at: datetime.datetime, + purpose: Optional[str] = None, + structured_inputs: Optional[dict[str, Any]] = None, + schedule: Optional["_models.TelephonyCallJobSchedule"] = None, + cancellation: Optional["_models.TelephonyCallJobCancellation"] = None, + next_attempt_at: Optional[datetime.datetime] = None, + terminal_reason: Optional[Union[str, "_models.TelephonyCallJobTerminalReason"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.object: Literal["telephony.call_job"] = "telephony.call_job" + + +class TelephonyCallJobCancellation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A cancellation request recorded for an outbound call job. + + :ivar requested_by: The authenticated principal that requested cancellation. Required. + :vartype requested_by: str + :ivar mode: The cancellation mode applied to the call job. Required. + :vartype mode: str + :ivar requested_at: The Unix timestamp in seconds when cancellation was requested. Required. + :vartype requested_at: ~datetime.datetime + :ivar revision: The call-job revision at which cancellation was recorded. Required. + :vartype revision: int + """ + + requested_by: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The authenticated principal that requested cancellation. Required.""" + mode: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The cancellation mode applied to the call job. Required.""" + requested_at: datetime.datetime = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp in seconds when cancellation was requested. Required.""" + revision: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The call-job revision at which cancellation was recorded. Required.""" + + @overload + def __init__( + self, + *, + requested_by: str, + mode: str, + requested_at: datetime.datetime, + revision: int, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TelephonyCallJobSchedule(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The optional execution window for a direct outbound call. + + :ivar not_before: The earliest instant at which dispatch may begin. + :vartype not_before: ~datetime.datetime + :ivar expires_at: The instant after which the call job expires without dispatch. + :vartype expires_at: ~datetime.datetime + """ + + not_before: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The earliest instant at which dispatch may begin.""" + expires_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The instant after which the call job expires without dispatch.""" + + @overload + def __init__( + self, + *, + not_before: Optional[datetime.datetime] = None, + expires_at: Optional[datetime.datetime] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TelephonyCallLifecycleEvent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A bounded durable observation in the lifecycle of one telephony call. + + :ivar sequence: The service-assigned order of the event within the call record. Required. + :vartype sequence: int + :ivar name: The stable provider-neutral event name. Required. Known values are: + "telephony.webhook.received", "telephony.webhook.validation", "telephony.binding.resolve", + "telephony.provider.answer", "telephony.media.connect", "telephony.agent_session.connect", + "telephony.media.first_caller_audio", "telephony.media.first_agent_audio", + "telephony.call.transfer", "telephony.call.hangup", and "telephony.call.disconnect". + :vartype name: str or ~azure.ai.projects.models.TelephonyCallLifecycleEventName + :ivar source: The component that supplied the observation. Required. Known values are: + "gateway", "teams_phone_extensibility", "twilio", and "voice_agent". + :vartype source: str or ~azure.ai.projects.models.TelephonyCallLifecycleEventSource + :ivar outcome: The outcome of the observed lifecycle operation. Required. Known values are: + "observed", "started", "succeeded", "failed", "rejected", and "cancelled". + :vartype outcome: str or ~azure.ai.projects.models.TelephonyCallLifecycleEventOutcome + :ivar observed_at: The Unix timestamp (in seconds) for when the service observed the event. + Required. + :vartype observed_at: ~datetime.datetime + :ivar occurred_at: The Unix timestamp (in seconds) for when the event occurred according to the + provider. + :vartype occurred_at: ~datetime.datetime + :ivar timestamp_source: The source of the event timestamp. Required. Known values are: + "provider", "gateway", and "derived". + :vartype timestamp_source: str or ~azure.ai.projects.models.TelephonyCallTimestampSource + :ivar reason: A stable service-generated reason associated with this lifecycle event, not + necessarily the final outcome of the call. Additional string codes may be returned. Known + values are: "invalid_webhook_payload", "webhook_validation_failed", "binding_not_found", + "binding_suspended", "admission_rejected", "admission_check_failed", "route_agent_mismatch", + "invalid_binding_configuration", "credential_resolution_failed", "provider_resource_mismatch", + "endpoint_resolution_failed", "ingress_setup_failed", "live_call_conflict", + "live_call_persistence_failed", "answer_failed", "provider_disconnected", "provider_busy", + "provider_no_answer", "provider_cancelled", "provider_failed", "provider_stream_error", + "provider_stream_stopped", "agent_session_connect_failed", "media_stream_ended", + "bridge_cancelled", "bridge_failed", "managed_hangup", "managed_transfer", + "manage_hangup_failed", and "manage_transfer_failed". + :vartype reason: str or ~azure.ai.projects.models.TelephonyCallLifecycleEventReason + :ivar provider_event_id: The provider event identifier used for idempotency, when supplied. + :vartype provider_event_id: str + :ivar provider_sequence: The provider event sequence, when supplied. + :vartype provider_sequence: int + :ivar provider_status_code: The provider status code associated with the event. + :vartype provider_status_code: int + :ivar provider_sub_code: The provider subcode associated with the event. + :vartype provider_sub_code: int + """ + + sequence: int = rest_field(visibility=["read"]) + """The service-assigned order of the event within the call record. Required.""" + name: Union[str, "_models.TelephonyCallLifecycleEventName"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The stable provider-neutral event name. Required. Known values are: + \"telephony.webhook.received\", \"telephony.webhook.validation\", + \"telephony.binding.resolve\", \"telephony.provider.answer\", \"telephony.media.connect\", + \"telephony.agent_session.connect\", \"telephony.media.first_caller_audio\", + \"telephony.media.first_agent_audio\", \"telephony.call.transfer\", \"telephony.call.hangup\", + and \"telephony.call.disconnect\".""" + source: Union[str, "_models.TelephonyCallLifecycleEventSource"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The component that supplied the observation. Required. Known values are: \"gateway\", + \"teams_phone_extensibility\", \"twilio\", and \"voice_agent\".""" + outcome: Union[str, "_models.TelephonyCallLifecycleEventOutcome"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The outcome of the observed lifecycle operation. Required. Known values are: \"observed\", + \"started\", \"succeeded\", \"failed\", \"rejected\", and \"cancelled\".""" + observed_at: datetime.datetime = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (in seconds) for when the service observed the event. Required.""" + occurred_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (in seconds) for when the event occurred according to the provider.""" + timestamp_source: Union[str, "_models.TelephonyCallTimestampSource"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The source of the event timestamp. Required. Known values are: \"provider\", \"gateway\", and + \"derived\".""" + reason: Optional[Union[str, "_models.TelephonyCallLifecycleEventReason"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """A stable service-generated reason associated with this lifecycle event, not necessarily the + final outcome of the call. Additional string codes may be returned. Known values are: + \"invalid_webhook_payload\", \"webhook_validation_failed\", \"binding_not_found\", + \"binding_suspended\", \"admission_rejected\", \"admission_check_failed\", + \"route_agent_mismatch\", \"invalid_binding_configuration\", \"credential_resolution_failed\", + \"provider_resource_mismatch\", \"endpoint_resolution_failed\", \"ingress_setup_failed\", + \"live_call_conflict\", \"live_call_persistence_failed\", \"answer_failed\", + \"provider_disconnected\", \"provider_busy\", \"provider_no_answer\", \"provider_cancelled\", + \"provider_failed\", \"provider_stream_error\", \"provider_stream_stopped\", + \"agent_session_connect_failed\", \"media_stream_ended\", \"bridge_cancelled\", + \"bridge_failed\", \"managed_hangup\", \"managed_transfer\", \"manage_hangup_failed\", and + \"manage_transfer_failed\".""" + provider_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The provider event identifier used for idempotency, when supplied.""" + provider_sequence: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The provider event sequence, when supplied.""" + provider_status_code: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The provider status code associated with the event.""" + provider_sub_code: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The provider subcode associated with the event.""" + + @overload + def __init__( + self, + *, + name: Union[str, "_models.TelephonyCallLifecycleEventName"], + source: Union[str, "_models.TelephonyCallLifecycleEventSource"], + outcome: Union[str, "_models.TelephonyCallLifecycleEventOutcome"], + observed_at: datetime.datetime, + timestamp_source: Union[str, "_models.TelephonyCallTimestampSource"], + occurred_at: Optional[datetime.datetime] = None, + reason: Optional[Union[str, "_models.TelephonyCallLifecycleEventReason"]] = None, + provider_event_id: Optional[str] = None, + provider_sequence: Optional[int] = None, + provider_status_code: Optional[int] = None, + provider_sub_code: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TelephonyCallRecord(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Detailed diagnostics for a durable inbound call to a voice agent. + + :ivar id: The service-generated call identifier. Required. + :vartype id: str + :ivar provider: The telephony provider. Required. Known values are: "teams_phone_extensibility" + and "twilio". + :vartype provider: str or ~azure.ai.projects.models.TelephonyProvider + :ivar provider_call_id: The provider-assigned call identifier, when available. + :vartype provider_call_id: str + :ivar caller_number: The caller's phone number, when supplied by the provider. + :vartype caller_number: str + :ivar provider_number: The Teams Phone extensibility or Twilio number that received the call. + :vartype provider_number: str + :ivar status: The lifecycle status of the call. Required. Known values are: "in_progress", + "success", and "failed". + :vartype status: str or ~azure.ai.projects.models.TelephonyCallStatus + :ivar phase: The provider-neutral lifecycle phase reached by the call. Required. Known values + are: "received", "validated", "admitted", "answering", "answered", "media_connected", + "agent_session_ready", "bridging", "managing", "completed", "rejected", and "failed". + :vartype phase: str or ~azure.ai.projects.models.TelephonyCallPhase + :ivar started_at: The Unix timestamp (in seconds) for when the inbound webhook was received. + Required. + :vartype started_at: ~datetime.datetime + :ivar answered_at: The Unix timestamp (in seconds) for when the provider reported the call as + answered. + :vartype answered_at: ~datetime.datetime + :ivar media_connected_at: The Unix timestamp (in seconds) for when the provider media channel + connected. + :vartype media_connected_at: ~datetime.datetime + :ivar agent_session_ready_at: The Unix timestamp (in seconds) for when the voice-agent session + became ready. + :vartype agent_session_ready_at: ~datetime.datetime + :ivar ended_at: The Unix timestamp (in seconds) for when the call ended. + :vartype ended_at: ~datetime.datetime + :ivar duration_ms: The call duration. + :vartype duration_ms: ~datetime.timedelta + :ivar end_reason: The service-generated reason that this single call ended, rather than the + outcome of an overall outbound call job. Additional string codes may be returned. Known values + are: "invalid_webhook_payload", "webhook_validation_failed", "binding_not_found", + "binding_suspended", "admission_rejected", "admission_check_failed", "route_agent_mismatch", + "invalid_binding_configuration", "credential_resolution_failed", "provider_resource_mismatch", + "endpoint_resolution_failed", "ingress_setup_failed", "live_call_conflict", + "live_call_persistence_failed", "answer_failed", "provider_disconnected", "provider_busy", + "provider_no_answer", "provider_cancelled", "provider_failed", "provider_stream_error", + "provider_stream_stopped", "agent_session_connect_failed", "media_stream_ended", + "bridge_cancelled", "bridge_failed", "managed_hangup", "managed_transfer", + "manage_hangup_failed", and "manage_transfer_failed". + :vartype end_reason: str or ~azure.ai.projects.models.TelephonyCallEndReason + :ivar provider_status_code: The provider status code associated with the terminal result. + :vartype provider_status_code: int + :ivar provider_sub_code: The provider subcode associated with the terminal result. + :vartype provider_sub_code: int + :ivar provider_message: The provider message associated with the terminal result. + :vartype provider_message: str + :ivar timing: Detailed provider-neutral call timing. Required. + :vartype timing: ~azure.ai.projects.models.TelephonyCallTiming + :ivar trace: Correlation to the customer-facing Foundry trace. + :vartype trace: ~azure.ai.projects.models.TelephonyCallTrace + :ivar events: The lifecycle timeline. Required. + :vartype events: list[~azure.ai.projects.models.TelephonyCallLifecycleEvent] + :ivar events_truncated: Whether older lifecycle events were omitted from the timeline. + Required. + :vartype events_truncated: bool + """ + + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The service-generated call identifier. Required.""" + provider: Union[str, "_models.TelephonyProvider"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The telephony provider. Required. Known values are: \"teams_phone_extensibility\" and + \"twilio\".""" + provider_call_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The provider-assigned call identifier, when available.""" + caller_number: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The caller's phone number, when supplied by the provider.""" + provider_number: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Teams Phone extensibility or Twilio number that received the call.""" + status: Union[str, "_models.TelephonyCallStatus"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The lifecycle status of the call. Required. Known values are: \"in_progress\", \"success\", and + \"failed\".""" + phase: Union[str, "_models.TelephonyCallPhase"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The provider-neutral lifecycle phase reached by the call. Required. Known values are: + \"received\", \"validated\", \"admitted\", \"answering\", \"answered\", \"media_connected\", + \"agent_session_ready\", \"bridging\", \"managing\", \"completed\", \"rejected\", and + \"failed\".""" + started_at: datetime.datetime = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (in seconds) for when the inbound webhook was received. Required.""" + answered_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (in seconds) for when the provider reported the call as answered.""" + media_connected_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (in seconds) for when the provider media channel connected.""" + agent_session_ready_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (in seconds) for when the voice-agent session became ready.""" + ended_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (in seconds) for when the call ended.""" + duration_ms: Optional[datetime.timedelta] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) + """The call duration.""" + end_reason: Optional[Union[str, "_models.TelephonyCallEndReason"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The service-generated reason that this single call ended, rather than the outcome of an overall + outbound call job. Additional string codes may be returned. Known values are: + \"invalid_webhook_payload\", \"webhook_validation_failed\", \"binding_not_found\", + \"binding_suspended\", \"admission_rejected\", \"admission_check_failed\", + \"route_agent_mismatch\", \"invalid_binding_configuration\", \"credential_resolution_failed\", + \"provider_resource_mismatch\", \"endpoint_resolution_failed\", \"ingress_setup_failed\", + \"live_call_conflict\", \"live_call_persistence_failed\", \"answer_failed\", + \"provider_disconnected\", \"provider_busy\", \"provider_no_answer\", \"provider_cancelled\", + \"provider_failed\", \"provider_stream_error\", \"provider_stream_stopped\", + \"agent_session_connect_failed\", \"media_stream_ended\", \"bridge_cancelled\", + \"bridge_failed\", \"managed_hangup\", \"managed_transfer\", \"manage_hangup_failed\", and + \"manage_transfer_failed\".""" + provider_status_code: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The provider status code associated with the terminal result.""" + provider_sub_code: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The provider subcode associated with the terminal result.""" + provider_message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The provider message associated with the terminal result.""" + timing: "_models.TelephonyCallTiming" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Detailed provider-neutral call timing. Required.""" + trace: Optional["_models.TelephonyCallTrace"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Correlation to the customer-facing Foundry trace.""" + events: list["_models.TelephonyCallLifecycleEvent"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The lifecycle timeline. Required.""" + events_truncated: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether older lifecycle events were omitted from the timeline. Required.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + provider: Union[str, "_models.TelephonyProvider"], + status: Union[str, "_models.TelephonyCallStatus"], + phase: Union[str, "_models.TelephonyCallPhase"], + started_at: datetime.datetime, + timing: "_models.TelephonyCallTiming", + events: list["_models.TelephonyCallLifecycleEvent"], + events_truncated: bool, + provider_call_id: Optional[str] = None, + caller_number: Optional[str] = None, + provider_number: Optional[str] = None, + answered_at: Optional[datetime.datetime] = None, + media_connected_at: Optional[datetime.datetime] = None, + agent_session_ready_at: Optional[datetime.datetime] = None, + ended_at: Optional[datetime.datetime] = None, + duration_ms: Optional[datetime.timedelta] = None, + end_reason: Optional[Union[str, "_models.TelephonyCallEndReason"]] = None, + provider_status_code: Optional[int] = None, + provider_sub_code: Optional[int] = None, + provider_message: Optional[str] = None, + trace: Optional["_models.TelephonyCallTrace"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TelephonyCallSummary(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A summary of a durable inbound call to a voice agent. + + :ivar id: The service-generated call identifier. Required. + :vartype id: str + :ivar provider: The telephony provider. Required. Known values are: "teams_phone_extensibility" + and "twilio". + :vartype provider: str or ~azure.ai.projects.models.TelephonyProvider + :ivar provider_call_id: The provider-assigned call identifier, when available. + :vartype provider_call_id: str + :ivar caller_number: The caller's phone number, when supplied by the provider. + :vartype caller_number: str + :ivar provider_number: The Teams Phone extensibility or Twilio number that received the call. + :vartype provider_number: str + :ivar status: The lifecycle status of the call. Required. Known values are: "in_progress", + "success", and "failed". + :vartype status: str or ~azure.ai.projects.models.TelephonyCallStatus + :ivar phase: The provider-neutral lifecycle phase reached by the call. Required. Known values + are: "received", "validated", "admitted", "answering", "answered", "media_connected", + "agent_session_ready", "bridging", "managing", "completed", "rejected", and "failed". + :vartype phase: str or ~azure.ai.projects.models.TelephonyCallPhase + :ivar started_at: The Unix timestamp (in seconds) for when the inbound webhook was received. + Required. + :vartype started_at: ~datetime.datetime + :ivar answered_at: The Unix timestamp (in seconds) for when the provider reported the call as + answered. + :vartype answered_at: ~datetime.datetime + :ivar media_connected_at: The Unix timestamp (in seconds) for when the provider media channel + connected. + :vartype media_connected_at: ~datetime.datetime + :ivar agent_session_ready_at: The Unix timestamp (in seconds) for when the voice-agent session + became ready. + :vartype agent_session_ready_at: ~datetime.datetime + :ivar ended_at: The Unix timestamp (in seconds) for when the call ended. + :vartype ended_at: ~datetime.datetime + :ivar duration_ms: The call duration. + :vartype duration_ms: ~datetime.timedelta + :ivar end_reason: The service-generated reason that this single call ended, rather than the + outcome of an overall outbound call job. Additional string codes may be returned. Known values + are: "invalid_webhook_payload", "webhook_validation_failed", "binding_not_found", + "binding_suspended", "admission_rejected", "admission_check_failed", "route_agent_mismatch", + "invalid_binding_configuration", "credential_resolution_failed", "provider_resource_mismatch", + "endpoint_resolution_failed", "ingress_setup_failed", "live_call_conflict", + "live_call_persistence_failed", "answer_failed", "provider_disconnected", "provider_busy", + "provider_no_answer", "provider_cancelled", "provider_failed", "provider_stream_error", + "provider_stream_stopped", "agent_session_connect_failed", "media_stream_ended", + "bridge_cancelled", "bridge_failed", "managed_hangup", "managed_transfer", + "manage_hangup_failed", and "manage_transfer_failed". + :vartype end_reason: str or ~azure.ai.projects.models.TelephonyCallEndReason + :ivar provider_status_code: The provider status code associated with the terminal result. + :vartype provider_status_code: int + :ivar provider_sub_code: The provider subcode associated with the terminal result. + :vartype provider_sub_code: int + :ivar provider_message: The provider message associated with the terminal result. + :vartype provider_message: str + """ + + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The service-generated call identifier. Required.""" + provider: Union[str, "_models.TelephonyProvider"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The telephony provider. Required. Known values are: \"teams_phone_extensibility\" and + \"twilio\".""" + provider_call_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The provider-assigned call identifier, when available.""" + caller_number: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The caller's phone number, when supplied by the provider.""" + provider_number: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Teams Phone extensibility or Twilio number that received the call.""" + status: Union[str, "_models.TelephonyCallStatus"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The lifecycle status of the call. Required. Known values are: \"in_progress\", \"success\", and + \"failed\".""" + phase: Union[str, "_models.TelephonyCallPhase"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The provider-neutral lifecycle phase reached by the call. Required. Known values are: + \"received\", \"validated\", \"admitted\", \"answering\", \"answered\", \"media_connected\", + \"agent_session_ready\", \"bridging\", \"managing\", \"completed\", \"rejected\", and + \"failed\".""" + started_at: datetime.datetime = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (in seconds) for when the inbound webhook was received. Required.""" + answered_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (in seconds) for when the provider reported the call as answered.""" + media_connected_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (in seconds) for when the provider media channel connected.""" + agent_session_ready_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (in seconds) for when the voice-agent session became ready.""" + ended_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (in seconds) for when the call ended.""" + duration_ms: Optional[datetime.timedelta] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) + """The call duration.""" + end_reason: Optional[Union[str, "_models.TelephonyCallEndReason"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The service-generated reason that this single call ended, rather than the outcome of an overall + outbound call job. Additional string codes may be returned. Known values are: + \"invalid_webhook_payload\", \"webhook_validation_failed\", \"binding_not_found\", + \"binding_suspended\", \"admission_rejected\", \"admission_check_failed\", + \"route_agent_mismatch\", \"invalid_binding_configuration\", \"credential_resolution_failed\", + \"provider_resource_mismatch\", \"endpoint_resolution_failed\", \"ingress_setup_failed\", + \"live_call_conflict\", \"live_call_persistence_failed\", \"answer_failed\", + \"provider_disconnected\", \"provider_busy\", \"provider_no_answer\", \"provider_cancelled\", + \"provider_failed\", \"provider_stream_error\", \"provider_stream_stopped\", + \"agent_session_connect_failed\", \"media_stream_ended\", \"bridge_cancelled\", + \"bridge_failed\", \"managed_hangup\", \"managed_transfer\", \"manage_hangup_failed\", and + \"manage_transfer_failed\".""" + provider_status_code: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The provider status code associated with the terminal result.""" + provider_sub_code: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The provider subcode associated with the terminal result.""" + provider_message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The provider message associated with the terminal result.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + provider: Union[str, "_models.TelephonyProvider"], + status: Union[str, "_models.TelephonyCallStatus"], + phase: Union[str, "_models.TelephonyCallPhase"], + started_at: datetime.datetime, + provider_call_id: Optional[str] = None, + caller_number: Optional[str] = None, + provider_number: Optional[str] = None, + answered_at: Optional[datetime.datetime] = None, + media_connected_at: Optional[datetime.datetime] = None, + agent_session_ready_at: Optional[datetime.datetime] = None, + ended_at: Optional[datetime.datetime] = None, + duration_ms: Optional[datetime.timedelta] = None, + end_reason: Optional[Union[str, "_models.TelephonyCallEndReason"]] = None, + provider_status_code: Optional[int] = None, + provider_sub_code: Optional[int] = None, + provider_message: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TelephonyCallTiming(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Detailed provider-neutral timing for an inbound telephony call. + + :ivar received_at: The Unix timestamp (in seconds) for when the provider webhook was received. + :vartype received_at: ~datetime.datetime + :ivar validated_at: The Unix timestamp (in seconds) for when webhook validation completed. + :vartype validated_at: ~datetime.datetime + :ivar admitted_at: The Unix timestamp (in seconds) for when the call was admitted to an agent + binding. + :vartype admitted_at: ~datetime.datetime + :ivar answer_requested_at: The Unix timestamp (in seconds) for when the service requested that + the provider answer the call. + :vartype answer_requested_at: ~datetime.datetime + :ivar answered_at: The Unix timestamp (in seconds) for when the provider reported that the call + was answered. + :vartype answered_at: ~datetime.datetime + :ivar media_connected_at: The Unix timestamp (in seconds) for when the provider media channel + connected. + :vartype media_connected_at: ~datetime.datetime + :ivar agent_session_ready_at: The Unix timestamp (in seconds) for when the voice-agent session + became ready. + :vartype agent_session_ready_at: ~datetime.datetime + :ivar first_caller_audio_at: The Unix timestamp (in seconds) for when caller audio was first + observed. + :vartype first_caller_audio_at: ~datetime.datetime + :ivar first_agent_audio_at: The Unix timestamp (in seconds) for when agent audio was first + observed. + :vartype first_agent_audio_at: ~datetime.datetime + :ivar ended_at: The Unix timestamp (in seconds) for when the call reached a terminal state. + :vartype ended_at: ~datetime.datetime + :ivar duration_basis: The timestamp used as the basis for duration. Known values are: + "answered" and "received". + :vartype duration_basis: str or ~azure.ai.projects.models.TelephonyCallDurationBasis + :ivar timestamp_source: The primary source of the timing milestones. Individual lifecycle + events identify their own timestamp source separately. Required. Known values are: "provider", + "gateway", and "derived". + :vartype timestamp_source: str or ~azure.ai.projects.models.TelephonyCallTimestampSource + """ + + received_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (in seconds) for when the provider webhook was received.""" + validated_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (in seconds) for when webhook validation completed.""" + admitted_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (in seconds) for when the call was admitted to an agent binding.""" + answer_requested_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (in seconds) for when the service requested that the provider answer the + call.""" + answered_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (in seconds) for when the provider reported that the call was answered.""" + media_connected_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (in seconds) for when the provider media channel connected.""" + agent_session_ready_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (in seconds) for when the voice-agent session became ready.""" + first_caller_audio_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (in seconds) for when caller audio was first observed.""" + first_agent_audio_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (in seconds) for when agent audio was first observed.""" + ended_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (in seconds) for when the call reached a terminal state.""" + duration_basis: Optional[Union[str, "_models.TelephonyCallDurationBasis"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The timestamp used as the basis for duration. Known values are: \"answered\" and \"received\".""" + timestamp_source: Union[str, "_models.TelephonyCallTimestampSource"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The primary source of the timing milestones. Individual lifecycle events identify their own + timestamp source separately. Required. Known values are: \"provider\", \"gateway\", and + \"derived\".""" + + @overload + def __init__( + self, + *, + timestamp_source: Union[str, "_models.TelephonyCallTimestampSource"], + received_at: Optional[datetime.datetime] = None, + validated_at: Optional[datetime.datetime] = None, + admitted_at: Optional[datetime.datetime] = None, + answer_requested_at: Optional[datetime.datetime] = None, + answered_at: Optional[datetime.datetime] = None, + media_connected_at: Optional[datetime.datetime] = None, + agent_session_ready_at: Optional[datetime.datetime] = None, + first_caller_audio_at: Optional[datetime.datetime] = None, + first_agent_audio_at: Optional[datetime.datetime] = None, + ended_at: Optional[datetime.datetime] = None, + duration_basis: Optional[Union[str, "_models.TelephonyCallDurationBasis"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TelephonyCallTrace(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Correlation from a durable telephony call record to its customer-facing Foundry trace. + + :ivar status: The trace availability status. Required. Known values are: "pending", "emitting", + "available", "not_recorded", "not_applicable", and "failed". + :vartype status: str or ~azure.ai.projects.models.TelephonyCallTraceStatus + :ivar trace_id: The W3C trace identifier, when a trace was recorded. + :vartype trace_id: str + :ivar root_span_id: The root span identifier, when a trace was recorded. + :vartype root_span_id: str + :ivar conversation_id: The voice-agent conversation identifier, when a conversation was + created. + :vartype conversation_id: str + :ivar mode: Whether the trace was emitted live or after the call ended. Known values are: + "live" and "post_call". + :vartype mode: str or ~azure.ai.projects.models.TelephonyCallTraceMode + """ + + status: Union[str, "_models.TelephonyCallTraceStatus"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The trace availability status. Required. Known values are: \"pending\", \"emitting\", + \"available\", \"not_recorded\", \"not_applicable\", and \"failed\".""" + trace_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The W3C trace identifier, when a trace was recorded.""" + root_span_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The root span identifier, when a trace was recorded.""" + conversation_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The voice-agent conversation identifier, when a conversation was created.""" + mode: Optional[Union[str, "_models.TelephonyCallTraceMode"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Whether the trace was emitted live or after the call ended. Known values are: \"live\" and + \"post_call\".""" + + @overload + def __init__( + self, + *, + status: Union[str, "_models.TelephonyCallTraceStatus"], + trace_id: Optional[str] = None, + root_span_id: Optional[str] = None, + conversation_id: Optional[str] = None, + mode: Optional[Union[str, "_models.TelephonyCallTraceMode"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TelephonyOutboundDestination(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The destination of an outbound call. + + :ivar type: The destination type. Only E.164 phone numbers are currently supported. Required. + "phone_number" + :vartype type: str or ~azure.ai.projects.models.TelephonyOutboundDestinationType + :ivar value: The destination E.164 phone number. Required. + :vartype value: str + """ + + type: Union[str, "_models.TelephonyOutboundDestinationType"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The destination type. Only E.164 phone numbers are currently supported. Required. + \"phone_number\"""" + value: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The destination E.164 phone number. Required.""" + + @overload + def __init__( + self, + *, + type: Union[str, "_models.TelephonyOutboundDestinationType"], + value: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TelephonyOutboundRetryPolicy(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The retry policy for one durable outbound call intent. ``max_attempts`` includes the first + attempt. Strategy-specific settings are defined by the derived policy. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + TelephonyOutboundFixedIntervalRetryPolicy + + :ivar type: The retry strategy. Only fixed-interval retries are currently supported. Required. + "fixed_interval" + :vartype type: str or ~azure.ai.projects.models.TelephonyOutboundRetryPolicyType + :ivar max_attempts: The maximum number of provider attempts, including the first attempt. + Defaults to 1. + :vartype max_attempts: int + """ + + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """The retry strategy. Only fixed-interval retries are currently supported. Required. + \"fixed_interval\"""" + max_attempts: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The maximum number of provider attempts, including the first attempt. Defaults to 1.""" + + @overload + def __init__( + self, + *, + type: str, + max_attempts: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TelephonyOutboundFixedIntervalRetryPolicy( + TelephonyOutboundRetryPolicy, discriminator="fixed_interval" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The frozen fixed-interval retry policy returned for an outbound call or campaign. + + :ivar max_attempts: The maximum number of provider attempts, including the first attempt. + Defaults to 1. + :vartype max_attempts: int + :ivar type: The fixed-interval retry strategy. Required. Retry after a fixed interval between + attempts. + :vartype type: str or ~azure.ai.projects.models.FIXED_INTERVAL + :ivar interval: The fixed delay in seconds between attempts. Required. + :vartype interval: ~datetime.timedelta + """ + + type: Literal[TelephonyOutboundRetryPolicyType.FIXED_INTERVAL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The fixed-interval retry strategy. Required. Retry after a fixed interval between attempts.""" + interval: datetime.timedelta = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-seconds-int" + ) + """The fixed delay in seconds between attempts. Required.""" + + @overload + def __init__( + self, + *, + interval: datetime.timedelta, + max_attempts: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = TelephonyOutboundRetryPolicyType.FIXED_INTERVAL # type: ignore + + +class TelephonyTransferTarget(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A named destination to which the voice agent may transfer a call. + + :ivar name: The unique name exposed to the voice agent for this transfer target. Required. + :vartype name: str + :ivar description: A description that helps the voice agent decide when to use this target. + Required. + :vartype description: str + :ivar destination: The provider-specific transfer destination. Required. + :vartype destination: ~azure.ai.projects.models.TelephonyTransferDestination + """ + + name: str = rest_field(visibility=["read", "create"]) + """The unique name exposed to the voice agent for this transfer target. Required.""" + description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A description that helps the voice agent decide when to use this target. Required.""" + destination: "_models.TelephonyTransferDestination" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The provider-specific transfer destination. Required.""" + + @overload + def __init__( + self, + *, + name: str, + description: str, + destination: "_models.TelephonyTransferDestination", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TelephonyTransferTargets(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The telephony transfer targets configured for one voice agent. + + :ivar transfer_targets: The complete set of destinations to which the voice agent may transfer + calls. An empty array clears all targets when replacing the configuration. Required. + :vartype transfer_targets: list[~azure.ai.projects.models.TelephonyTransferTarget] + """ + + transfer_targets: list["_models.TelephonyTransferTarget"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The complete set of destinations to which the voice agent may transfer calls. An empty array + clears all targets when replacing the configuration. Required.""" + + @overload + def __init__( + self, + *, + transfer_targets: list["_models.TelephonyTransferTarget"], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TextResponseFormat(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """An object specifying the format that the model must output. Configuring ``{ "type": + "json_schema" }`` enables Structured Outputs, which ensures the model will match your supplied + JSON schema. Learn more in the `Structured Outputs guide + `_. The default format is ``{ + "type": "text" }`` with no additional options. *Not recommended for gpt-4o and newer models:** + Setting to ``{ "type": "json_object" }`` enables the older JSON mode, which ensures the message + the model generates is valid JSON. Using ``json_schema`` is preferred for models that support + it. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + TextResponseFormatJsonObject, TextResponseFormatJsonSchema, TextResponseFormatText + + :ivar type: Required. Known values are: "text", "json_schema", and "json_object". + :vartype type: str or ~azure.ai.projects.models.TextResponseFormatConfigurationType + """ + + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"text\", \"json_schema\", and \"json_object\".""" + + @overload + def __init__( + self, + *, + type: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TextResponseFormatJsonObject(TextResponseFormat, discriminator="json_object"): + """JSON object. + + :ivar type: The type of response format being defined. Always ``json_object``. Required. + JSON_OBJECT. + :vartype type: str or ~azure.ai.projects.models.JSON_OBJECT + """ + + type: Literal[TextResponseFormatConfigurationType.JSON_OBJECT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of response format being defined. Always ``json_object``. Required. JSON_OBJECT.""" + + @overload + def __init__( + self, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = TextResponseFormatConfigurationType.JSON_OBJECT # type: ignore + + +class TextResponseFormatJsonSchema( + TextResponseFormat, discriminator="json_schema" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """JSON schema. + + :ivar type: The type of response format being defined. Always ``json_schema``. Required. + JSON_SCHEMA. + :vartype type: str or ~azure.ai.projects.models.JSON_SCHEMA + :ivar description: A description of what the response format is for, used by the model to + determine how to respond in the format. + :vartype description: str + :ivar name: The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and + dashes, with a maximum length of 64. Required. + :vartype name: str + :ivar schema: Required. + :vartype schema: dict[str, any] + :ivar strict: + :vartype strict: bool + """ + + type: Literal[TextResponseFormatConfigurationType.JSON_SCHEMA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of response format being defined. Always ``json_schema``. Required. JSON_SCHEMA.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A description of what the response format is for, used by the model to determine how to respond + in the format.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with + a maximum length of 64. Required.""" + schema: dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + strict: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + + @overload + def __init__( + self, + *, + name: str, + schema: dict[str, Any], + description: Optional[str] = None, + strict: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = TextResponseFormatConfigurationType.JSON_SCHEMA # type: ignore + + +class TextResponseFormatText(TextResponseFormat, discriminator="text"): + """Text. + + :ivar type: The type of response format being defined. Always ``text``. Required. TEXT. + :vartype type: str or ~azure.ai.projects.models.TEXT + """ + + type: Literal[TextResponseFormatConfigurationType.TEXT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of response format being defined. Always ``text``. Required. TEXT.""" + + @overload + def __init__( + self, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = TextResponseFormatConfigurationType.TEXT # type: ignore + + +class TimerRoutineTrigger( + RoutineTrigger, discriminator="timer" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A one-shot timer routine trigger. + + :ivar type: The trigger type. Required. A one-shot timer trigger. + :vartype type: str or ~azure.ai.projects.models.TIMER + :ivar at: The UTC date and time at which the timer fires. + :vartype at: ~datetime.datetime + """ + + type: Literal[RoutineTriggerType.TIMER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The trigger type. Required. A one-shot timer trigger.""" + at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The UTC date and time at which the timer fires.""" + + @overload + def __init__( + self, + *, + at: Optional[datetime.datetime] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = RoutineTriggerType.TIMER # type: ignore + + +class ToolApplyPatchToolParam( + Tool, discriminator="apply_patch" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Apply patch tool. + + :ivar type: The type of the tool. Always ``apply_patch``. Required. APPLY_PATCH. + :vartype type: str or ~azure.ai.projects.models.APPLY_PATCH + :ivar allowed_callers: + :vartype allowed_callers: list[str or ~azure.ai.projects.models.CallableToolAllowedCaller] + """ + + type: Literal[ToolType.APPLY_PATCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the tool. Always ``apply_patch``. Required. APPLY_PATCH.""" + allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + + @overload + def __init__( + self, + *, + allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = ToolType.APPLY_PATCH # type: ignore + + +class ToolboxObject(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A toolbox that stores reusable tool definitions for agents. + + :ivar id: The unique identifier of the toolbox. Required. + :vartype id: str + :ivar name: The name of the toolbox. Required. + :vartype name: str + :ivar updated_at: The Unix timestamp (seconds) when the toolbox was last updated. This value + changes when a new toolbox version is created or the toolbox is updated. Required. + :vartype updated_at: ~datetime.datetime + :ivar versions: The versions associated with the toolbox. Required. + :vartype versions: ~azure.ai.projects.models.ToolboxVersions + :ivar default_version: The version identifier that the toolbox currently points to. Defaults to + the latest version. Can be changed via updateToolbox. Required. + :vartype default_version: str + """ + + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique identifier of the toolbox. Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the toolbox. Required.""" + updated_at: datetime.datetime = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (seconds) when the toolbox was last updated. This value changes when a new + toolbox version is created or the toolbox is updated. Required.""" + versions: "_models.ToolboxVersions" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The versions associated with the toolbox. Required.""" + default_version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The version identifier that the toolbox currently points to. Defaults to the latest version. + Can be changed via updateToolbox. Required.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + name: str, + updated_at: datetime.datetime, + versions: "_models.ToolboxVersions", + default_version: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ToolboxPolicies(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Policy configuration for a toolbox, including content safety and other governance settings. + + :ivar rai_config: Responsible AI content filtering configuration. + :vartype rai_config: ~azure.ai.projects.models.RaiConfig + """ + + rai_config: Optional["_models.RaiConfig"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Responsible AI content filtering configuration.""" + + @overload + def __init__( + self, + *, + rai_config: Optional["_models.RaiConfig"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ToolboxSearchPreviewToolboxTool( + ToolboxTool, discriminator="toolbox_search_preview" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A toolbox search tool stored in a toolbox. + + :ivar name: Optional user-defined name for this tool or configuration. + :vartype name: str + :ivar description: Optional user-defined description for this tool or configuration. + :vartype description: str + :ivar tool_configs: Per-tool configuration map. Keys are tool names or ``*`` (catch-all + default). Resolution order: exact tool name match takes priority over ``*``. Unknown tool names + are silently ignored at runtime. + :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] + :ivar type: The type of the tool. Always ``toolbox_search_preview``. Required. + TOOLBOX_SEARCH_PREVIEW. + :vartype type: str or ~azure.ai.projects.models.TOOLBOX_SEARCH_PREVIEW + """ + + type: Literal[ToolboxToolType.TOOLBOX_SEARCH_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the tool. Always ``toolbox_search_preview``. Required. TOOLBOX_SEARCH_PREVIEW.""" + + @overload + def __init__( + self, + *, + name: Optional[str] = None, + description: Optional[str] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = ToolboxToolType.TOOLBOX_SEARCH_PREVIEW # type: ignore + + +class ToolboxShellEnvironment(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """An execution environment for a shell tool stored in a toolbox. This environment model is scoped + to toolbox configuration and does not modify the OpenAI shell environment contract. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + ToolboxShellContainerAutoEnvironment, ToolboxShellContainerReferenceEnvironment + + :ivar type: The type of the shell execution environment. Required. Default value is None. + :vartype type: str + """ + + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """The type of the shell execution environment. Required. Default value is None.""" + + @overload + def __init__( + self, + *, + type: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ToolboxShellContainerAutoEnvironment( + ToolboxShellEnvironment, discriminator="container_auto" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """An automatically provisioned container environment for a shell tool stored in a toolbox. + + :ivar type: The type of the shell execution environment. Always ``container_auto``. Required. + Default value is "container_auto". + :vartype type: str + :ivar file_ids: An optional list of uploaded files to make available to your code. + :vartype file_ids: list[str] + :ivar memory_limit: Known values are: "1g", "4g", "16g", and "64g". + :vartype memory_limit: str or ~azure.ai.projects.models.ContainerMemoryLimit + :ivar skills: An optional list of skills referenced by id or inline data. + :vartype skills: list[~azure.ai.projects.models.ContainerSkill] + :ivar network_policy: The network access policy for the container. When omitted, the service + defaults to disabled outbound network access. + :vartype network_policy: ~azure.ai.projects.models.ToolboxShellNetworkPolicy + """ + + type: Literal["container_auto"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the shell execution environment. Always ``container_auto``. Required. Default value + is \"container_auto\".""" + file_ids: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An optional list of uploaded files to make available to your code.""" + memory_limit: Optional[Union[str, "_models.ContainerMemoryLimit"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Known values are: \"1g\", \"4g\", \"16g\", and \"64g\".""" + skills: Optional[list["_models.ContainerSkill"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """An optional list of skills referenced by id or inline data.""" + network_policy: Optional["_models.ToolboxShellNetworkPolicy"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The network access policy for the container. When omitted, the service defaults to disabled + outbound network access.""" + + @overload + def __init__( + self, + *, + file_ids: Optional[list[str]] = None, + memory_limit: Optional[Union[str, "_models.ContainerMemoryLimit"]] = None, + skills: Optional[list["_models.ContainerSkill"]] = None, + network_policy: Optional["_models.ToolboxShellNetworkPolicy"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = "container_auto" # type: ignore + + +class ToolboxShellContainerReferenceEnvironment( + ToolboxShellEnvironment, discriminator="container_reference" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """An existing container environment for a shell tool stored in a toolbox. + + :ivar type: The type of the shell execution environment. Always ``container_reference``. + Required. Default value is "container_reference". + :vartype type: str + :ivar container_id: The ID of the referenced container. Required. + :vartype container_id: str + """ + + type: Literal["container_reference"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the shell execution environment. Always ``container_reference``. Required. Default + value is \"container_reference\".""" + container_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the referenced container. Required.""" + + @overload + def __init__( + self, + *, + container_id: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = "container_reference" # type: ignore + + +class ToolboxShellNetworkPolicy(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Network access policy for an automatically provisioned toolbox shell container. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + ToolboxShellNetworkPolicyDisabled + + :ivar type: The type of network access policy. Required. Default value is None. + :vartype type: str + """ + + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """The type of network access policy. Required. Default value is None.""" + + @overload + def __init__( + self, + *, + type: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ToolboxShellNetworkPolicyDisabled(ToolboxShellNetworkPolicy, discriminator="disabled"): + """A network policy that disables outbound access from a toolbox shell container. + + :ivar type: The type of network access policy. Always ``disabled``. Required. Default value is + "disabled". + :vartype type: str + """ + + type: Literal["disabled"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of network access policy. Always ``disabled``. Required. Default value is + \"disabled\".""" + + @overload + def __init__( + self, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = "disabled" # type: ignore + + +class ToolboxSkill(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A skill source included in a toolbox. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + ToolboxSkillReference + + :ivar type: The type of skill source. Required. Default value is None. + :vartype type: str + """ + + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """The type of skill source. Required. Default value is None.""" + + @overload + def __init__( + self, + *, + type: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ToolboxSkillReference( + ToolboxSkill, discriminator="skill_reference" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A reference to an existing skill to include in a toolbox. + + :ivar type: The type of skill source. Required. Default value is "skill_reference". + :vartype type: str + :ivar name: The name of the skill. Required. + :vartype name: str + :ivar version: The version of the skill. If not specified, the skill's default version is used. + When a version is specified, the reference is pinned to that immutable version. + :vartype version: str """ - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The service-generated call identifier. Required.""" - provider: Union[str, "_models.TelephonyProvider"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The telephony provider. Required. Known values are: \"teams_phone_extensibility\" and - \"twilio\".""" - provider_call_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The provider-assigned call identifier, when available.""" - caller_number: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The caller's phone number, when supplied by the provider.""" - provider_number: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The Teams Phone extensibility or Twilio number that received the call.""" - status: Union[str, "_models.TelephonyCallStatus"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The lifecycle status of the call. Required. Known values are: \"in_progress\", \"success\", and - \"failed\".""" - phase: Union[str, "_models.TelephonyCallPhase"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The provider-neutral lifecycle phase reached by the call. Required. Known values are: - \"received\", \"validated\", \"admitted\", \"answering\", \"answered\", \"media_connected\", - \"agent_session_ready\", \"bridging\", \"managing\", \"completed\", \"rejected\", and - \"failed\".""" - started_at: datetime.datetime = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp (in seconds) for when the inbound webhook was received. Required.""" - answered_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp (in seconds) for when the provider reported the call as answered.""" - media_connected_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp (in seconds) for when the provider media channel connected.""" - agent_session_ready_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp (in seconds) for when the voice-agent session became ready.""" - ended_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp (in seconds) for when the call ended.""" - duration_ms: Optional[datetime.timedelta] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" - ) - """The call duration.""" - end_reason: Optional[Union[str, "_models.TelephonyCallEndReason"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The service-generated reason that this single call ended, rather than the outcome of an overall - outbound call job. Additional string codes may be returned. Known values are: - \"invalid_webhook_payload\", \"webhook_validation_failed\", \"binding_not_found\", - \"binding_suspended\", \"admission_rejected\", \"admission_check_failed\", - \"route_agent_mismatch\", \"invalid_binding_configuration\", \"credential_resolution_failed\", - \"provider_resource_mismatch\", \"endpoint_resolution_failed\", \"ingress_setup_failed\", - \"live_call_conflict\", \"live_call_persistence_failed\", \"answer_failed\", - \"provider_disconnected\", \"provider_busy\", \"provider_no_answer\", \"provider_cancelled\", - \"provider_failed\", \"provider_stream_error\", \"provider_stream_stopped\", - \"agent_session_connect_failed\", \"media_stream_ended\", \"bridge_cancelled\", - \"bridge_failed\", \"managed_hangup\", \"managed_transfer\", \"manage_hangup_failed\", and - \"manage_transfer_failed\".""" - provider_status_code: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The provider status code associated with the terminal result.""" - provider_sub_code: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The provider subcode associated with the terminal result.""" - provider_message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The provider message associated with the terminal result.""" - timing: "_models.TelephonyCallTiming" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Detailed provider-neutral call timing. Required.""" - trace: Optional["_models.TelephonyCallTrace"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Correlation to the customer-facing Foundry trace.""" - events: list["_models.TelephonyCallLifecycleEvent"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The lifecycle timeline. Required.""" - events_truncated: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether older lifecycle events were omitted from the timeline. Required.""" + type: Literal["skill_reference"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of skill source. Required. Default value is \"skill_reference\".""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the skill. Required.""" + version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The version of the skill. If not specified, the skill's default version is used. When a version + is specified, the reference is pinned to that immutable version.""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - provider: Union[str, "_models.TelephonyProvider"], - status: Union[str, "_models.TelephonyCallStatus"], - phase: Union[str, "_models.TelephonyCallPhase"], - started_at: datetime.datetime, - timing: "_models.TelephonyCallTiming", - events: list["_models.TelephonyCallLifecycleEvent"], - events_truncated: bool, - provider_call_id: Optional[str] = None, - caller_number: Optional[str] = None, - provider_number: Optional[str] = None, - answered_at: Optional[datetime.datetime] = None, - media_connected_at: Optional[datetime.datetime] = None, - agent_session_ready_at: Optional[datetime.datetime] = None, - ended_at: Optional[datetime.datetime] = None, - duration_ms: Optional[datetime.timedelta] = None, - end_reason: Optional[Union[str, "_models.TelephonyCallEndReason"]] = None, - provider_status_code: Optional[int] = None, - provider_sub_code: Optional[int] = None, - provider_message: Optional[str] = None, - trace: Optional["_models.TelephonyCallTrace"] = None, + name: str, + version: Optional[str] = None, ) -> None: ... @overload @@ -24846,157 +31186,285 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = "skill_reference" # type: ignore -class TelephonyCallSummary(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A summary of a durable inbound call to a voice agent. +class ToolboxVersionObject(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A specific version of a toolbox. - :ivar id: The service-generated call identifier. Required. + :ivar metadata: Set of 16 key-value pairs that can be attached to an object. This can be + useful for storing additional information about the object in a structured + format, and querying for objects via API or the dashboard. + + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. Required. + :vartype metadata: dict[str, str] + :ivar id: The unique identifier of the toolbox version. Required. :vartype id: str - :ivar provider: The telephony provider. Required. Known values are: "teams_phone_extensibility" - and "twilio". - :vartype provider: str or ~azure.ai.projects.models.TelephonyProvider - :ivar provider_call_id: The provider-assigned call identifier, when available. - :vartype provider_call_id: str - :ivar caller_number: The caller's phone number, when supplied by the provider. - :vartype caller_number: str - :ivar provider_number: The Teams Phone extensibility or Twilio number that received the call. - :vartype provider_number: str - :ivar status: The lifecycle status of the call. Required. Known values are: "in_progress", - "success", and "failed". - :vartype status: str or ~azure.ai.projects.models.TelephonyCallStatus - :ivar phase: The provider-neutral lifecycle phase reached by the call. Required. Known values - are: "received", "validated", "admitted", "answering", "answered", "media_connected", - "agent_session_ready", "bridging", "managing", "completed", "rejected", and "failed". - :vartype phase: str or ~azure.ai.projects.models.TelephonyCallPhase - :ivar started_at: The Unix timestamp (in seconds) for when the inbound webhook was received. - Required. - :vartype started_at: ~datetime.datetime - :ivar answered_at: The Unix timestamp (in seconds) for when the provider reported the call as - answered. - :vartype answered_at: ~datetime.datetime - :ivar media_connected_at: The Unix timestamp (in seconds) for when the provider media channel - connected. - :vartype media_connected_at: ~datetime.datetime - :ivar agent_session_ready_at: The Unix timestamp (in seconds) for when the voice-agent session - became ready. - :vartype agent_session_ready_at: ~datetime.datetime - :ivar ended_at: The Unix timestamp (in seconds) for when the call ended. - :vartype ended_at: ~datetime.datetime - :ivar duration_ms: The call duration. - :vartype duration_ms: ~datetime.timedelta - :ivar end_reason: The service-generated reason that this single call ended, rather than the - outcome of an overall outbound call job. Additional string codes may be returned. Known values - are: "invalid_webhook_payload", "webhook_validation_failed", "binding_not_found", - "binding_suspended", "admission_rejected", "admission_check_failed", "route_agent_mismatch", - "invalid_binding_configuration", "credential_resolution_failed", "provider_resource_mismatch", - "endpoint_resolution_failed", "ingress_setup_failed", "live_call_conflict", - "live_call_persistence_failed", "answer_failed", "provider_disconnected", "provider_busy", - "provider_no_answer", "provider_cancelled", "provider_failed", "provider_stream_error", - "provider_stream_stopped", "agent_session_connect_failed", "media_stream_ended", - "bridge_cancelled", "bridge_failed", "managed_hangup", "managed_transfer", - "manage_hangup_failed", and "manage_transfer_failed". - :vartype end_reason: str or ~azure.ai.projects.models.TelephonyCallEndReason - :ivar provider_status_code: The provider status code associated with the terminal result. - :vartype provider_status_code: int - :ivar provider_sub_code: The provider subcode associated with the terminal result. - :vartype provider_sub_code: int - :ivar provider_message: The provider message associated with the terminal result. - :vartype provider_message: str + :ivar name: The name of the toolbox. Required. + :vartype name: str + :ivar version: The version identifier of the toolbox. Toolbox versions are immutable and every + update creates a new version. Required. + :vartype version: str + :ivar description: A human-readable description of the toolbox. + :vartype description: str + :ivar created_at: The Unix timestamp (seconds) when the toolbox version was created. Required. + :vartype created_at: ~datetime.datetime + :ivar tools: The list of tools contained in this toolbox version. Required. + :vartype tools: list[~azure.ai.projects.models.ToolboxTool] + :ivar skills: The list of skill sources included in this toolbox version. + :vartype skills: list[~azure.ai.projects.models.ToolboxSkill] + :ivar policies: Policy configuration for the toolbox version. + :vartype policies: ~azure.ai.projects.models.ToolboxPolicies """ + metadata: dict[str, str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Set of 16 key-value pairs that can be attached to an object. This can be + useful for storing additional information about the object in a structured + format, and querying for objects via API or the dashboard. + + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. Required.""" id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The service-generated call identifier. Required.""" - provider: Union[str, "_models.TelephonyProvider"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The telephony provider. Required. Known values are: \"teams_phone_extensibility\" and - \"twilio\".""" - provider_call_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The provider-assigned call identifier, when available.""" - caller_number: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The caller's phone number, when supplied by the provider.""" - provider_number: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The Teams Phone extensibility or Twilio number that received the call.""" - status: Union[str, "_models.TelephonyCallStatus"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The lifecycle status of the call. Required. Known values are: \"in_progress\", \"success\", and - \"failed\".""" - phase: Union[str, "_models.TelephonyCallPhase"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The provider-neutral lifecycle phase reached by the call. Required. Known values are: - \"received\", \"validated\", \"admitted\", \"answering\", \"answered\", \"media_connected\", - \"agent_session_ready\", \"bridging\", \"managing\", \"completed\", \"rejected\", and - \"failed\".""" - started_at: datetime.datetime = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp (in seconds) for when the inbound webhook was received. Required.""" - answered_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp (in seconds) for when the provider reported the call as answered.""" - media_connected_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp (in seconds) for when the provider media channel connected.""" - agent_session_ready_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp (in seconds) for when the voice-agent session became ready.""" - ended_at: Optional[datetime.datetime] = rest_field( + """The unique identifier of the toolbox version. Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the toolbox. Required.""" + version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The version identifier of the toolbox. Toolbox versions are immutable and every update creates + a new version. Required.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A human-readable description of the toolbox.""" + created_at: datetime.datetime = rest_field( visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" ) - """The Unix timestamp (in seconds) for when the call ended.""" - duration_ms: Optional[datetime.timedelta] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + """The Unix timestamp (seconds) when the toolbox version was created. Required.""" + tools: list["_models.ToolboxTool"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The list of tools contained in this toolbox version. Required.""" + skills: Optional[list["_models.ToolboxSkill"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """The call duration.""" - end_reason: Optional[Union[str, "_models.TelephonyCallEndReason"]] = rest_field( + """The list of skill sources included in this toolbox version.""" + policies: Optional["_models.ToolboxPolicies"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The service-generated reason that this single call ended, rather than the outcome of an overall - outbound call job. Additional string codes may be returned. Known values are: - \"invalid_webhook_payload\", \"webhook_validation_failed\", \"binding_not_found\", - \"binding_suspended\", \"admission_rejected\", \"admission_check_failed\", - \"route_agent_mismatch\", \"invalid_binding_configuration\", \"credential_resolution_failed\", - \"provider_resource_mismatch\", \"endpoint_resolution_failed\", \"ingress_setup_failed\", - \"live_call_conflict\", \"live_call_persistence_failed\", \"answer_failed\", - \"provider_disconnected\", \"provider_busy\", \"provider_no_answer\", \"provider_cancelled\", - \"provider_failed\", \"provider_stream_error\", \"provider_stream_stopped\", - \"agent_session_connect_failed\", \"media_stream_ended\", \"bridge_cancelled\", - \"bridge_failed\", \"managed_hangup\", \"managed_transfer\", \"manage_hangup_failed\", and - \"manage_transfer_failed\".""" - provider_status_code: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The provider status code associated with the terminal result.""" - provider_sub_code: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The provider subcode associated with the terminal result.""" - provider_message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The provider message associated with the terminal result.""" + """Policy configuration for the toolbox version.""" @overload def __init__( self, *, + metadata: dict[str, str], id: str, # pylint: disable=redefined-builtin - provider: Union[str, "_models.TelephonyProvider"], - status: Union[str, "_models.TelephonyCallStatus"], - phase: Union[str, "_models.TelephonyCallPhase"], - started_at: datetime.datetime, - provider_call_id: Optional[str] = None, - caller_number: Optional[str] = None, - provider_number: Optional[str] = None, - answered_at: Optional[datetime.datetime] = None, - media_connected_at: Optional[datetime.datetime] = None, - agent_session_ready_at: Optional[datetime.datetime] = None, - ended_at: Optional[datetime.datetime] = None, - duration_ms: Optional[datetime.timedelta] = None, - end_reason: Optional[Union[str, "_models.TelephonyCallEndReason"]] = None, - provider_status_code: Optional[int] = None, - provider_sub_code: Optional[int] = None, - provider_message: Optional[str] = None, + name: str, + version: str, + created_at: datetime.datetime, + tools: list["_models.ToolboxTool"], + description: Optional[str] = None, + skills: Optional[list["_models.ToolboxSkill"]] = None, + policies: Optional["_models.ToolboxPolicies"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ToolboxVersions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The versions associated with a toolbox. + + :ivar latest: The latest version of the toolbox. Required. + :vartype latest: ~azure.ai.projects.models.ToolboxVersionObject + """ + + latest: "_models.ToolboxVersionObject" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The latest version of the toolbox. Required.""" + + @overload + def __init__( + self, + *, + latest: "_models.ToolboxVersionObject", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ToolChoiceAllowed( + ToolChoiceParam, discriminator="allowed_tools" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Allowed tools. + + :ivar type: Allowed tool configuration type. Always ``allowed_tools``. Required. ALLOWED_TOOLS. + :vartype type: str or ~azure.ai.projects.models.ALLOWED_TOOLS + :ivar mode: Constrains the tools available to the model to a pre-defined set. ``auto`` allows + the model to pick from among the allowed tools and generate a message. ``required`` requires + the model to call one or more of the allowed tools. Required. Is either a Literal["auto"] type + or a Literal["required"] type. + :vartype mode: str or str + :ivar tools: Required. A list of tool definitions that the model should be allowed to call. For + the Responses API, the list of tool definitions might look like: + + .. code-block:: json + + [ + { "type": "function", "name": "get_weather" }, + { "type": "mcp", "server_label": "deepwiki" }, + { "type": "image_generation" } + ] + :vartype tools: list[dict[str, any]] + """ + + type: Literal[ToolChoiceParamType.ALLOWED_TOOLS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Allowed tool configuration type. Always ``allowed_tools``. Required. ALLOWED_TOOLS.""" + mode: Literal["auto", "required"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Constrains the tools available to the model to a pre-defined set. ``auto`` allows the model to + pick from among the allowed tools and generate a message. ``required`` requires the model to + call one or more of the allowed tools. Required. Is either a Literal[\"auto\"] type or a + Literal[\"required\"] type.""" + tools: list[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. A list of tool definitions that the model should be allowed to call. For the + Responses API, the list of tool definitions might look like: + + .. code-block:: json + + [ + { \"type\": \"function\", \"name\": \"get_weather\" }, + { \"type\": \"mcp\", \"server_label\": \"deepwiki\" }, + { \"type\": \"image_generation\" } + ]""" + + @overload + def __init__( + self, + *, + mode: Literal["auto", "required"], + tools: list[dict[str, Any]], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = ToolChoiceParamType.ALLOWED_TOOLS # type: ignore + + +class ToolChoiceCodeInterpreter(ToolChoiceParam, discriminator="code_interpreter"): + """Indicates that the model should use a built-in tool to generate a response. `Learn more about + built-in tools `_. + + :ivar type: Required. CODE_INTERPRETER. + :vartype type: str or ~azure.ai.projects.models.CODE_INTERPRETER + """ + + type: Literal[ToolChoiceParamType.CODE_INTERPRETER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. CODE_INTERPRETER.""" + + @overload + def __init__( + self, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = ToolChoiceParamType.CODE_INTERPRETER # type: ignore + + +class ToolChoiceComputer(ToolChoiceParam, discriminator="computer"): + """Indicates that the model should use a built-in tool to generate a response. `Learn more about + built-in tools `_. + + :ivar type: Required. COMPUTER. + :vartype type: str or ~azure.ai.projects.models.COMPUTER + """ + + type: Literal[ToolChoiceParamType.COMPUTER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. COMPUTER.""" + + @overload + def __init__( + self, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = ToolChoiceParamType.COMPUTER # type: ignore + + +class ToolChoiceComputerUse(ToolChoiceParam, discriminator="computer_use"): + """Indicates that the model should use a built-in tool to generate a response. `Learn more about + built-in tools `_. + + :ivar type: Required. COMPUTER_USE. + :vartype type: str or ~azure.ai.projects.models.COMPUTER_USE + """ + + type: Literal[ToolChoiceParamType.COMPUTER_USE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. COMPUTER_USE.""" + + @overload + def __init__( + self, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = ToolChoiceParamType.COMPUTER_USE # type: ignore + + +class ToolChoiceComputerUsePreview(ToolChoiceParam, discriminator="computer_use_preview"): + """Indicates that the model should use a built-in tool to generate a response. `Learn more about + built-in tools `_. + + :ivar type: Required. COMPUTER_USE_PREVIEW. + :vartype type: str or ~azure.ai.projects.models.COMPUTER_USE_PREVIEW + """ + + type: Literal[ToolChoiceParamType.COMPUTER_USE_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. COMPUTER_USE_PREVIEW.""" + + @overload + def __init__( + self, ) -> None: ... @overload @@ -25008,115 +31476,30 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolChoiceParamType.COMPUTER_USE_PREVIEW # type: ignore -class TelephonyCallTiming(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Detailed provider-neutral timing for an inbound telephony call. +class ToolChoiceCustom( + ToolChoiceParam, discriminator="custom" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Custom tool. - :ivar received_at: The Unix timestamp (in seconds) for when the provider webhook was received. - :vartype received_at: ~datetime.datetime - :ivar validated_at: The Unix timestamp (in seconds) for when webhook validation completed. - :vartype validated_at: ~datetime.datetime - :ivar admitted_at: The Unix timestamp (in seconds) for when the call was admitted to an agent - binding. - :vartype admitted_at: ~datetime.datetime - :ivar answer_requested_at: The Unix timestamp (in seconds) for when the service requested that - the provider answer the call. - :vartype answer_requested_at: ~datetime.datetime - :ivar answered_at: The Unix timestamp (in seconds) for when the provider reported that the call - was answered. - :vartype answered_at: ~datetime.datetime - :ivar media_connected_at: The Unix timestamp (in seconds) for when the provider media channel - connected. - :vartype media_connected_at: ~datetime.datetime - :ivar agent_session_ready_at: The Unix timestamp (in seconds) for when the voice-agent session - became ready. - :vartype agent_session_ready_at: ~datetime.datetime - :ivar first_caller_audio_at: The Unix timestamp (in seconds) for when caller audio was first - observed. - :vartype first_caller_audio_at: ~datetime.datetime - :ivar first_agent_audio_at: The Unix timestamp (in seconds) for when agent audio was first - observed. - :vartype first_agent_audio_at: ~datetime.datetime - :ivar ended_at: The Unix timestamp (in seconds) for when the call reached a terminal state. - :vartype ended_at: ~datetime.datetime - :ivar duration_basis: The timestamp used as the basis for duration. Known values are: - "answered" and "received". - :vartype duration_basis: str or ~azure.ai.projects.models.TelephonyCallDurationBasis - :ivar timestamp_source: The primary source of the timing milestones. Individual lifecycle - events identify their own timestamp source separately. Required. Known values are: "provider", - "gateway", and "derived". - :vartype timestamp_source: str or ~azure.ai.projects.models.TelephonyCallTimestampSource + :ivar type: For custom tool calling, the type is always ``custom``. Required. CUSTOM. + :vartype type: str or ~azure.ai.projects.models.CUSTOM + :ivar name: The name of the custom tool to call. Required. + :vartype name: str """ - received_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp (in seconds) for when the provider webhook was received.""" - validated_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp (in seconds) for when webhook validation completed.""" - admitted_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp (in seconds) for when the call was admitted to an agent binding.""" - answer_requested_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp (in seconds) for when the service requested that the provider answer the - call.""" - answered_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp (in seconds) for when the provider reported that the call was answered.""" - media_connected_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp (in seconds) for when the provider media channel connected.""" - agent_session_ready_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp (in seconds) for when the voice-agent session became ready.""" - first_caller_audio_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp (in seconds) for when caller audio was first observed.""" - first_agent_audio_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp (in seconds) for when agent audio was first observed.""" - ended_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp (in seconds) for when the call reached a terminal state.""" - duration_basis: Optional[Union[str, "_models.TelephonyCallDurationBasis"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The timestamp used as the basis for duration. Known values are: \"answered\" and \"received\".""" - timestamp_source: Union[str, "_models.TelephonyCallTimestampSource"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The primary source of the timing milestones. Individual lifecycle events identify their own - timestamp source separately. Required. Known values are: \"provider\", \"gateway\", and - \"derived\".""" + type: Literal[ToolChoiceParamType.CUSTOM] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """For custom tool calling, the type is always ``custom``. Required. CUSTOM.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the custom tool to call. Required.""" @overload def __init__( self, *, - timestamp_source: Union[str, "_models.TelephonyCallTimestampSource"], - received_at: Optional[datetime.datetime] = None, - validated_at: Optional[datetime.datetime] = None, - admitted_at: Optional[datetime.datetime] = None, - answer_requested_at: Optional[datetime.datetime] = None, - answered_at: Optional[datetime.datetime] = None, - media_connected_at: Optional[datetime.datetime] = None, - agent_session_ready_at: Optional[datetime.datetime] = None, - first_caller_audio_at: Optional[datetime.datetime] = None, - first_agent_audio_at: Optional[datetime.datetime] = None, - ended_at: Optional[datetime.datetime] = None, - duration_basis: Optional[Union[str, "_models.TelephonyCallDurationBasis"]] = None, + name: str, ) -> None: ... @overload @@ -25128,52 +31511,23 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolChoiceParamType.CUSTOM # type: ignore -class TelephonyCallTrace(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Correlation from a durable telephony call record to its customer-facing Foundry trace. +class ToolChoiceFileSearch(ToolChoiceParam, discriminator="file_search"): + """Indicates that the model should use a built-in tool to generate a response. `Learn more about + built-in tools `_. - :ivar status: The trace availability status. Required. Known values are: "pending", "emitting", - "available", "not_recorded", "not_applicable", and "failed". - :vartype status: str or ~azure.ai.projects.models.TelephonyCallTraceStatus - :ivar trace_id: The W3C trace identifier, when a trace was recorded. - :vartype trace_id: str - :ivar root_span_id: The root span identifier, when a trace was recorded. - :vartype root_span_id: str - :ivar conversation_id: The voice-agent conversation identifier, when a conversation was - created. - :vartype conversation_id: str - :ivar mode: Whether the trace was emitted live or after the call ended. Known values are: - "live" and "post_call". - :vartype mode: str or ~azure.ai.projects.models.TelephonyCallTraceMode + :ivar type: Required. FILE_SEARCH. + :vartype type: str or ~azure.ai.projects.models.FILE_SEARCH """ - status: Union[str, "_models.TelephonyCallTraceStatus"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The trace availability status. Required. Known values are: \"pending\", \"emitting\", - \"available\", \"not_recorded\", \"not_applicable\", and \"failed\".""" - trace_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The W3C trace identifier, when a trace was recorded.""" - root_span_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The root span identifier, when a trace was recorded.""" - conversation_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The voice-agent conversation identifier, when a conversation was created.""" - mode: Optional[Union[str, "_models.TelephonyCallTraceMode"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Whether the trace was emitted live or after the call ended. Known values are: \"live\" and - \"post_call\".""" + type: Literal[ToolChoiceParamType.FILE_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. FILE_SEARCH.""" @overload def __init__( self, - *, - status: Union[str, "_models.TelephonyCallTraceStatus"], - trace_id: Optional[str] = None, - root_span_id: Optional[str] = None, - conversation_id: Optional[str] = None, - mode: Optional[Union[str, "_models.TelephonyCallTraceMode"]] = None, ) -> None: ... @overload @@ -25185,32 +31539,30 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolChoiceParamType.FILE_SEARCH # type: ignore -class TelephonyOutboundDestination(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The destination of an outbound call. +class ToolChoiceFunction( + ToolChoiceParam, discriminator="function" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Function tool. - :ivar type: The destination type. Only E.164 phone numbers are currently supported. Required. - "phone_number" - :vartype type: str or ~azure.ai.projects.models.TelephonyOutboundDestinationType - :ivar value: The destination E.164 phone number. Required. - :vartype value: str + :ivar type: For function calling, the type is always ``function``. Required. FUNCTION. + :vartype type: str or ~azure.ai.projects.models.FUNCTION + :ivar name: The name of the function to call. Required. + :vartype name: str """ - type: Union[str, "_models.TelephonyOutboundDestinationType"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The destination type. Only E.164 phone numbers are currently supported. Required. - \"phone_number\"""" - value: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The destination E.164 phone number. Required.""" + type: Literal[ToolChoiceParamType.FUNCTION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """For function calling, the type is always ``function``. Required. FUNCTION.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the function to call. Required.""" @overload def __init__( self, *, - type: Union[str, "_models.TelephonyOutboundDestinationType"], - value: str, + name: str, ) -> None: ... @overload @@ -25222,36 +31574,23 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolChoiceParamType.FUNCTION # type: ignore -class TelephonyOutboundRetryPolicy(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The retry policy for one durable outbound call intent. ``max_attempts`` includes the first - attempt. Strategy-specific settings are defined by the derived policy. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - TelephonyOutboundFixedIntervalRetryPolicy +class ToolChoiceImageGeneration(ToolChoiceParam, discriminator="image_generation"): + """Indicates that the model should use a built-in tool to generate a response. `Learn more about + built-in tools `_. - :ivar type: The retry strategy. Only fixed-interval retries are currently supported. Required. - "fixed_interval" - :vartype type: str or ~azure.ai.projects.models.TelephonyOutboundRetryPolicyType - :ivar max_attempts: The maximum number of provider attempts, including the first attempt. - Defaults to 1. - :vartype max_attempts: int + :ivar type: Required. IMAGE_GENERATION. + :vartype type: str or ~azure.ai.projects.models.IMAGE_GENERATION """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The retry strategy. Only fixed-interval retries are currently supported. Required. - \"fixed_interval\"""" - max_attempts: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The maximum number of provider attempts, including the first attempt. Defaults to 1.""" + type: Literal[ToolChoiceParamType.IMAGE_GENERATION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. IMAGE_GENERATION.""" @overload def __init__( self, - *, - type: str, - max_attempts: Optional[int] = None, ) -> None: ... @overload @@ -25263,36 +31602,34 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolChoiceParamType.IMAGE_GENERATION # type: ignore -class TelephonyOutboundFixedIntervalRetryPolicy( - TelephonyOutboundRetryPolicy, discriminator="fixed_interval" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The frozen fixed-interval retry policy returned for an outbound call or campaign. +class ToolChoiceMCP( + ToolChoiceParam, discriminator="mcp" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """MCP tool. - :ivar max_attempts: The maximum number of provider attempts, including the first attempt. - Defaults to 1. - :vartype max_attempts: int - :ivar type: The fixed-interval retry strategy. Required. Retry after a fixed interval between - attempts. - :vartype type: str or ~azure.ai.projects.models.FIXED_INTERVAL - :ivar interval: The fixed delay in seconds between attempts. Required. - :vartype interval: ~datetime.timedelta + :ivar type: For MCP tools, the type is always ``mcp``. Required. MCP. + :vartype type: str or ~azure.ai.projects.models.MCP + :ivar server_label: The label of the MCP server to use. Required. + :vartype server_label: str + :ivar name: + :vartype name: str """ - type: Literal[TelephonyOutboundRetryPolicyType.FIXED_INTERVAL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The fixed-interval retry strategy. Required. Retry after a fixed interval between attempts.""" - interval: datetime.timedelta = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="duration-seconds-int" - ) - """The fixed delay in seconds between attempts. Required.""" + type: Literal[ToolChoiceParamType.MCP] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """For MCP tools, the type is always ``mcp``. Required. MCP.""" + server_label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The label of the MCP server to use. Required.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - interval: datetime.timedelta, - max_attempts: Optional[int] = None, + server_label: str, + name: Optional[str] = None, ) -> None: ... @overload @@ -25304,37 +31641,23 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = TelephonyOutboundRetryPolicyType.FIXED_INTERVAL # type: ignore + self.type = ToolChoiceParamType.MCP # type: ignore -class TelephonyTransferTarget(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A named destination to which the voice agent may transfer a call. +class ToolChoiceWebSearchPreview(ToolChoiceParam, discriminator="web_search_preview"): + """Indicates that the model should use a built-in tool to generate a response. `Learn more about + built-in tools `_. - :ivar name: The unique name exposed to the voice agent for this transfer target. Required. - :vartype name: str - :ivar description: A description that helps the voice agent decide when to use this target. - Required. - :vartype description: str - :ivar destination: The provider-specific transfer destination. Required. - :vartype destination: ~azure.ai.projects.models.TelephonyTransferDestination + :ivar type: Required. WEB_SEARCH_PREVIEW. + :vartype type: str or ~azure.ai.projects.models.WEB_SEARCH_PREVIEW """ - name: str = rest_field(visibility=["read", "create"]) - """The unique name exposed to the voice agent for this transfer target. Required.""" - description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A description that helps the voice agent decide when to use this target. Required.""" - destination: "_models.TelephonyTransferDestination" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The provider-specific transfer destination. Required.""" + type: Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. WEB_SEARCH_PREVIEW.""" @overload def __init__( self, - *, - name: str, - description: str, - destination: "_models.TelephonyTransferDestination", ) -> None: ... @overload @@ -25346,27 +31669,23 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolChoiceParamType.WEB_SEARCH_PREVIEW # type: ignore -class TelephonyTransferTargets(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The telephony transfer targets configured for one voice agent. +class ToolChoiceWebSearchPreview20250311(ToolChoiceParam, discriminator="web_search_preview_2025_03_11"): + """Indicates that the model should use a built-in tool to generate a response. `Learn more about + built-in tools `_. - :ivar transfer_targets: The complete set of destinations to which the voice agent may transfer - calls. An empty array clears all targets when replacing the configuration. Required. - :vartype transfer_targets: list[~azure.ai.projects.models.TelephonyTransferTarget] + :ivar type: Required. WEB_SEARCH_PREVIEW_2025_03_11. + :vartype type: str or ~azure.ai.projects.models.WEB_SEARCH_PREVIEW_2025_03_11 """ - transfer_targets: list["_models.TelephonyTransferTarget"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The complete set of destinations to which the voice agent may transfer calls. An empty array - clears all targets when replacing the configuration. Required.""" + type: Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW_2025_03_11] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. WEB_SEARCH_PREVIEW_2025_03_11.""" @overload def __init__( self, - *, - transfer_targets: list["_models.TelephonyTransferTarget"], ) -> None: ... @overload @@ -25378,33 +31697,64 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolChoiceParamType.WEB_SEARCH_PREVIEW_2025_03_11 # type: ignore -class TextResponseFormat(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """An object specifying the format that the model must output. Configuring ``{ "type": - "json_schema" }`` enables Structured Outputs, which ensures the model will match your supplied - JSON schema. Learn more in the `Structured Outputs guide `_. - The default format is ``{ "type": "text" }`` with no additional options. *Not recommended for - gpt-4o and newer models:** Setting to ``{ "type": "json_object" }`` enables the older JSON - mode, which ensures the message the model generates is valid JSON. Using ``json_schema`` is - preferred for models that support it. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - TextResponseFormatJsonObject, TextResponseFormatJsonSchema, TextResponseFormatText +class ToolCodeInterpreterTool( + Tool, discriminator="code_interpreter" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Code interpreter. - :ivar type: Required. Known values are: "text", "json_schema", and "json_object". - :vartype type: str or ~azure.ai.projects.models.TextResponseFormatConfigurationType + :ivar type: The type of the code interpreter tool. Always ``code_interpreter``. Required. + CODE_INTERPRETER. + :vartype type: str or ~azure.ai.projects.models.CODE_INTERPRETER + :ivar allowed_callers: + :vartype allowed_callers: list[str or ~azure.ai.projects.models.CallableToolAllowedCaller] + :ivar container: The code interpreter container. Can be a container ID or an object that + specifies uploaded file IDs to make available to your code, along with an optional + ``memory_limit`` setting. If not provided, the service assumes auto. Is either a str type or a + AutoCodeInterpreterToolParam type. + :vartype container: str or ~azure.ai.projects.models.AutoCodeInterpreterToolParam + :ivar name: Deprecated. This property is deprecated and will be removed in a future version. + :vartype name: str + :ivar description: Deprecated. This property is deprecated and will be removed in a future + version. + :vartype description: str + :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future + version. + :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"text\", \"json_schema\", and \"json_object\".""" + type: Literal[ToolType.CODE_INTERPRETER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the code interpreter tool. Always ``code_interpreter``. Required. CODE_INTERPRETER.""" + allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + container: Optional[Union[str, "_models.AutoCodeInterpreterToolParam"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The code interpreter container. Can be a container ID or an object that specifies uploaded file + IDs to make available to your code, along with an optional ``memory_limit`` setting. If not + provided, the service assumes auto. Is either a str type or a AutoCodeInterpreterToolParam + type.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Deprecated. This property is deprecated and will be removed in a future version.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Deprecated. This property is deprecated and will be removed in a future version.""" + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Deprecated. This property is deprecated and will be removed in a future version.""" @overload def __init__( self, *, - type: str, + allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = None, + container: Optional[Union[str, "_models.AutoCodeInterpreterToolParam"]] = None, + name: Optional[str] = None, + description: Optional[str] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, ) -> None: ... @overload @@ -25416,18 +31766,18 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolType.CODE_INTERPRETER # type: ignore -class TextResponseFormatJsonObject(TextResponseFormat, discriminator="json_object"): - """JSON object. +class ToolComputerTool(Tool, discriminator="computer"): + """Computer. - :ivar type: The type of response format being defined. Always ``json_object``. Required. - JSON_OBJECT. - :vartype type: str or ~azure.ai.projects.models.JSON_OBJECT + :ivar type: The type of the computer tool. Always ``computer``. Required. COMPUTER. + :vartype type: str or ~azure.ai.projects.models.COMPUTER """ - type: Literal[TextResponseFormatConfigurationType.JSON_OBJECT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of response format being defined. Always ``json_object``. Required. JSON_OBJECT.""" + type: Literal[ToolType.COMPUTER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the computer tool. Always ``computer``. Required. COMPUTER.""" @overload def __init__( @@ -25443,49 +31793,46 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = TextResponseFormatConfigurationType.JSON_OBJECT # type: ignore + self.type = ToolType.COMPUTER # type: ignore -class TextResponseFormatJsonSchema( - TextResponseFormat, discriminator="json_schema" +class ToolComputerUsePreviewTool( + Tool, discriminator="computer_use_preview" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """JSON schema. + """Computer use preview. - :ivar type: The type of response format being defined. Always ``json_schema``. Required. - JSON_SCHEMA. - :vartype type: str or ~azure.ai.projects.models.JSON_SCHEMA - :ivar description: A description of what the response format is for, used by the model to - determine how to respond in the format. - :vartype description: str - :ivar name: The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and - dashes, with a maximum length of 64. Required. - :vartype name: str - :ivar schema: Required. - :vartype schema: dict[str, any] - :ivar strict: - :vartype strict: bool + :ivar type: The type of the computer use tool. Always ``computer_use_preview``. Required. + COMPUTER_USE_PREVIEW. + :vartype type: str or ~azure.ai.projects.models.COMPUTER_USE_PREVIEW + :ivar environment: The type of computer environment to control. Required. Known values are: + "windows", "mac", "linux", "ubuntu", and "browser". + :vartype environment: str or ~azure.ai.projects.models.ComputerEnvironment + :ivar display_width: The width of the computer display. Required. + :vartype display_width: int + :ivar display_height: The height of the computer display. Required. + :vartype display_height: int """ - type: Literal[TextResponseFormatConfigurationType.JSON_SCHEMA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of response format being defined. Always ``json_schema``. Required. JSON_SCHEMA.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A description of what the response format is for, used by the model to determine how to respond - in the format.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with - a maximum length of 64. Required.""" - schema: dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - strict: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[ToolType.COMPUTER_USE_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the computer use tool. Always ``computer_use_preview``. Required. + COMPUTER_USE_PREVIEW.""" + environment: Union[str, "_models.ComputerEnvironment"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The type of computer environment to control. Required. Known values are: \"windows\", \"mac\", + \"linux\", \"ubuntu\", and \"browser\".""" + display_width: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The width of the computer display. Required.""" + display_height: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The height of the computer display. Required.""" @overload def __init__( self, *, - name: str, - schema: dict[str, Any], - description: Optional[str] = None, - strict: Optional[bool] = None, + environment: Union[str, "_models.ComputerEnvironment"], + display_width: int, + display_height: int, ) -> None: ... @overload @@ -25497,22 +31844,35 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = TextResponseFormatConfigurationType.JSON_SCHEMA # type: ignore + self.type = ToolType.COMPUTER_USE_PREVIEW # type: ignore -class TextResponseFormatText(TextResponseFormat, discriminator="text"): - """Text. +class ToolConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Per-tool configuration that controls tool visibility and search behavior. - :ivar type: The type of response format being defined. Always ``text``. Required. TEXT. - :vartype type: str or ~azure.ai.projects.models.TEXT + :ivar pin: When true, the tool is always included in agent context and visible in + ``tools/list``. When false (default), the tool is hidden from ``tools/list`` and only + discoverable via ``tool_search``. + :vartype pin: bool + :ivar additional_search_text: Additional text indexed for tool_search. Supplements the native + tool description to improve discoverability. Does not alter ``tools/list`` output. + :vartype additional_search_text: str """ - type: Literal[TextResponseFormatConfigurationType.TEXT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of response format being defined. Always ``text``. Required. TEXT.""" + pin: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """When true, the tool is always included in agent context and visible in ``tools/list``. When + false (default), the tool is hidden from ``tools/list`` and only discoverable via + ``tool_search``.""" + additional_search_text: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Additional text indexed for tool_search. Supplements the native tool description to improve + discoverability. Does not alter ``tools/list`` output.""" @overload def __init__( self, + *, + pin: Optional[bool] = None, + additional_search_text: Optional[str] = None, ) -> None: ... @overload @@ -25524,32 +31884,59 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = TextResponseFormatConfigurationType.TEXT # type: ignore -class TimerRoutineTrigger( - RoutineTrigger, discriminator="timer" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A one-shot timer routine trigger. +class ToolCustomToolParam(Tool, discriminator="custom"): # pylint: disable=docstring-keyword-should-match-keyword-only + """Custom tool. - :ivar type: The trigger type. Required. A one-shot timer trigger. - :vartype type: str or ~azure.ai.projects.models.TIMER - :ivar at: The UTC date and time at which the timer fires. - :vartype at: ~datetime.datetime + :ivar type: The type of the custom tool. Always ``custom``. Required. CUSTOM. + :vartype type: str or ~azure.ai.projects.models.CUSTOM + :ivar name: The name of the custom tool, used to identify it in tool calls. Required. + :vartype name: str + :ivar async_property: Whether the tool response can be returned asynchronously versus + immediately returned on next response creation. + :vartype async_property: bool + :ivar description: Optional description of the custom tool, used to provide more context. + :vartype description: str + :ivar format: The input format for the custom tool. Default is unconstrained text. + :vartype format: ~azure.ai.projects.models.CustomToolParamFormat + :ivar defer_loading: Whether this tool should be deferred and discovered via tool search. + :vartype defer_loading: bool + :ivar allowed_callers: + :vartype allowed_callers: list[str or ~azure.ai.projects.models.CallableToolAllowedCaller] """ - type: Literal[RoutineTriggerType.TIMER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The trigger type. Required. A one-shot timer trigger.""" - at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + type: Literal[ToolType.CUSTOM] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the custom tool. Always ``custom``. Required. CUSTOM.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the custom tool, used to identify it in tool calls. Required.""" + async_property: Optional[bool] = rest_field( + name="async", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether the tool response can be returned asynchronously versus immediately returned on next + response creation.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional description of the custom tool, used to provide more context.""" + format: Optional["_models.CustomToolParamFormat"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The input format for the custom tool. Default is unconstrained text.""" + defer_loading: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether this tool should be deferred and discovered via tool search.""" + allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """The UTC date and time at which the timer fires.""" @overload def __init__( self, *, - at: Optional[datetime.datetime] = None, + name: str, + async_property: Optional[bool] = None, + description: Optional[str] = None, + format: Optional["_models.CustomToolParamFormat"] = None, + defer_loading: Optional[bool] = None, + allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = None, ) -> None: ... @overload @@ -25561,50 +31948,29 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RoutineTriggerType.TIMER # type: ignore + self.type = ToolType.CUSTOM # type: ignore -class ToolboxObject(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A toolbox that stores reusable tool definitions for agents. +class ToolDescription(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Description of a tool that can be used by an agent. - :ivar id: The unique identifier of the toolbox. Required. - :vartype id: str - :ivar name: The name of the toolbox. Required. + :ivar name: The name of the tool. :vartype name: str - :ivar updated_at: The Unix timestamp (seconds) when the toolbox was last updated. This value - changes when a new toolbox version is created or the toolbox is updated. Required. - :vartype updated_at: ~datetime.datetime - :ivar versions: The versions associated with the toolbox. Required. - :vartype versions: ~azure.ai.projects.models.ToolboxVersions - :ivar default_version: The version identifier that the toolbox currently points to. Defaults to - the latest version. Can be changed via updateToolbox. Required. - :vartype default_version: str + :ivar description: A brief description of the tool's purpose. + :vartype description: str """ - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique identifier of the toolbox. Required.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the toolbox. Required.""" - updated_at: datetime.datetime = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp (seconds) when the toolbox was last updated. This value changes when a new - toolbox version is created or the toolbox is updated. Required.""" - versions: "_models.ToolboxVersions" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The versions associated with the toolbox. Required.""" - default_version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The version identifier that the toolbox currently points to. Defaults to the latest version. - Can be changed via updateToolbox. Required.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the tool.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A brief description of the tool's purpose.""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - name: str, - updated_at: datetime.datetime, - versions: "_models.ToolboxVersions", - default_version: str, + name: Optional[str] = None, + description: Optional[str] = None, ) -> None: ... @overload @@ -25618,21 +31984,65 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ToolboxPolicies(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Policy configuration for a toolbox, including content safety and other governance settings. +class ToolFileSearchTool( + Tool, discriminator="file_search" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """File search. - :ivar rai_config: Responsible AI content filtering configuration. - :vartype rai_config: ~azure.ai.projects.models.RaiConfig + :ivar type: The type of the file search tool. Always ``file_search``. Required. FILE_SEARCH. + :vartype type: str or ~azure.ai.projects.models.FILE_SEARCH + :ivar vector_store_ids: The IDs of the vector stores to search. Required. + :vartype vector_store_ids: list[str] + :ivar max_num_results: The maximum number of results to return. This number should be between 1 + and 50 inclusive. + :vartype max_num_results: int + :ivar ranking_options: Ranking options for search. + :vartype ranking_options: ~azure.ai.projects.models.RankingOptions + :ivar filters: Is either a ComparisonFilter type or a CompoundFilter type. + :vartype filters: ~azure.ai.projects.models.ComparisonFilter or + ~azure.ai.projects.models.CompoundFilter + :ivar name: Deprecated. This property is deprecated and will be removed in a future version. + :vartype name: str + :ivar description: Deprecated. This property is deprecated and will be removed in a future + version. + :vartype description: str + :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future + version. + :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] """ - rai_config: Optional["_models.RaiConfig"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Responsible AI content filtering configuration.""" + type: Literal[ToolType.FILE_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the file search tool. Always ``file_search``. Required. FILE_SEARCH.""" + vector_store_ids: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The IDs of the vector stores to search. Required.""" + max_num_results: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The maximum number of results to return. This number should be between 1 and 50 inclusive.""" + ranking_options: Optional["_models.RankingOptions"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Ranking options for search.""" + filters: Optional["_unions.Filters"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Is either a ComparisonFilter type or a CompoundFilter type.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Deprecated. This property is deprecated and will be removed in a future version.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Deprecated. This property is deprecated and will be removed in a future version.""" + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Deprecated. This property is deprecated and will be removed in a future version.""" @overload def __init__( self, *, - rai_config: Optional["_models.RaiConfig"] = None, + vector_store_ids: list[str], + max_num_results: Optional[int] = None, + ranking_options: Optional["_models.RankingOptions"] = None, + filters: Optional["_unions.Filters"] = None, + name: Optional[str] = None, + description: Optional[str] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, ) -> None: ... @overload @@ -25644,33 +32054,53 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolType.FILE_SEARCH # type: ignore -class ToolboxSearchPreviewToolboxTool( - ToolboxTool, discriminator="toolbox_search_preview" +class ToolFunctionShellToolParam( + Tool, discriminator="shell" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """A toolbox search tool stored in a toolbox. + """Shell tool. - :ivar name: Optional user-defined name for this tool or configuration. + :ivar type: The type of the shell tool. Always ``shell``. Required. SHELL. + :vartype type: str or ~azure.ai.projects.models.SHELL + :ivar environment: + :vartype environment: ~azure.ai.projects.models.FunctionShellToolParamEnvironment + :ivar allowed_callers: + :vartype allowed_callers: list[str or ~azure.ai.projects.models.CallableToolAllowedCaller] + :ivar name: Deprecated. This property is deprecated and will be removed in a future version. :vartype name: str - :ivar description: Optional user-defined description for this tool or configuration. + :ivar description: Deprecated. This property is deprecated and will be removed in a future + version. :vartype description: str - :ivar tool_configs: Per-tool configuration map. Keys are tool names or ``*`` (catch-all - default). Resolution order: exact tool name match takes priority over ``*``. Unknown tool names - are silently ignored at runtime. + :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future + version. :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] - :ivar type: The type of the tool. Always ``toolbox_search_preview``. Required. - TOOLBOX_SEARCH_PREVIEW. - :vartype type: str or ~azure.ai.projects.models.TOOLBOX_SEARCH_PREVIEW """ - type: Literal[ToolboxToolType.TOOLBOX_SEARCH_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the tool. Always ``toolbox_search_preview``. Required. TOOLBOX_SEARCH_PREVIEW.""" + type: Literal[ToolType.SHELL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the shell tool. Always ``shell``. Required. SHELL.""" + environment: Optional["_models.FunctionShellToolParamEnvironment"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Deprecated. This property is deprecated and will be removed in a future version.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Deprecated. This property is deprecated and will be removed in a future version.""" + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Deprecated. This property is deprecated and will be removed in a future version.""" @overload def __init__( self, *, + environment: Optional["_models.FunctionShellToolParamEnvironment"] = None, + allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = None, name: Optional[str] = None, description: Optional[str] = None, tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, @@ -25685,29 +32115,63 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolboxToolType.TOOLBOX_SEARCH_PREVIEW # type: ignore - + self.type = ToolType.SHELL # type: ignore -class ToolboxShellEnvironment(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """An execution environment for a shell tool stored in a toolbox. This environment model is scoped - to toolbox configuration and does not modify the OpenAI shell environment contract. - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ToolboxShellContainerAutoEnvironment, ToolboxShellContainerReferenceEnvironment +class ToolFunctionTool(Tool, discriminator="function"): # pylint: disable=docstring-keyword-should-match-keyword-only + """Function. - :ivar type: The type of the shell execution environment. Required. Default value is None. - :vartype type: str + :ivar type: The type of the function tool. Always ``function``. Required. FUNCTION. + :vartype type: str or ~azure.ai.projects.models.FUNCTION + :ivar name: The name of the function to call. Required. + :vartype name: str + :ivar async_property: + :vartype async_property: bool + :ivar description: + :vartype description: str + :ivar parameters: Required. + :vartype parameters: dict[str, any] + :ivar output_schema: + :vartype output_schema: dict[str, any] + :ivar strict: Required. + :vartype strict: bool + :ivar defer_loading: Whether this function is deferred and loaded via tool search. + :vartype defer_loading: bool + :ivar allowed_callers: + :vartype allowed_callers: list[str or ~azure.ai.projects.models.CallableToolAllowedCaller] """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The type of the shell execution environment. Required. Default value is None.""" + type: Literal[ToolType.FUNCTION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the function tool. Always ``function``. Required. FUNCTION.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the function to call. Required.""" + async_property: Optional[bool] = rest_field( + name="async", visibility=["read", "create", "update", "delete", "query"] + ) + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + parameters: dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + output_schema: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + strict: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + defer_loading: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether this function is deferred and loaded via tool search.""" + allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) @overload def __init__( self, *, - type: str, + name: str, + parameters: dict[str, Any], + strict: bool, + async_property: Optional[bool] = None, + description: Optional[str] = None, + output_schema: Optional[dict[str, Any]] = None, + defer_loading: Optional[bool] = None, + allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = None, ) -> None: ... @overload @@ -25719,54 +32183,199 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolType.FUNCTION # type: ignore -class ToolboxShellContainerAutoEnvironment( - ToolboxShellEnvironment, discriminator="container_auto" +class ToolImageGenTool( + Tool, discriminator="image_generation" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """An automatically provisioned container environment for a shell tool stored in a toolbox. + """Image generation tool. - :ivar type: The type of the shell execution environment. Always ``container_auto``. Required. - Default value is "container_auto". - :vartype type: str - :ivar file_ids: An optional list of uploaded files to make available to your code. - :vartype file_ids: list[str] - :ivar memory_limit: Known values are: "1g", "4g", "16g", and "64g". - :vartype memory_limit: str or ~azure.ai.projects.models.ContainerMemoryLimit - :ivar skills: An optional list of skills referenced by id or inline data. - :vartype skills: list[~azure.ai.projects.models.ContainerSkill] - :ivar network_policy: The network access policy for the container. When omitted, the service - defaults to disabled outbound network access. - :vartype network_policy: ~azure.ai.projects.models.ToolboxShellNetworkPolicy + :ivar type: The type of the image generation tool. Always ``image_generation``. Required. + IMAGE_GENERATION. + :vartype type: str or ~azure.ai.projects.models.IMAGE_GENERATION + :ivar model: Is one of the following types: Literal["gpt-image-1"], + Literal["gpt-image-1-mini"], Literal["gpt-image-1.5"], Literal["gpt-image-2"], + Literal["gpt-image-2-2026-04-21"], Literal["gpt-image-2.5-sunburst"], + Literal["gpt-image-2.5-sunburst-2026-09-08"], Literal["gpt-image-2.5-flare"], + Literal["gpt-image-2.5-flare-2026-09-08"], str + :vartype model: str or str or str or str or str or str or str or str or str or str + :ivar quality: The quality of the generated image. The GPT image models support ``low``, + ``medium``, and ``high``. ``gpt-image-2.5-sunburst`` and ``gpt-image-2.5-flare``, including + their ``2026-09-08`` snapshots, also support ``xhigh`` and ``max``. Default: ``auto``. Is one + of the following types: Literal["low"], Literal["medium"], Literal["high"], Literal["xhigh"], + Literal["max"], Literal["auto"] + :vartype quality: str or str or str or str or str or str + :ivar size: The size of the generated images. For ``gpt-image-2``, ``gpt-image-2-2026-04-21``, + ``gpt-image-2.5-sunburst``, ``gpt-image-2.5-sunburst-2026-09-08``, ``gpt-image-2.5-flare``, and + ``gpt-image-2.5-flare-2026-09-08``, arbitrary resolutions are supported as ``WIDTHxHEIGHT`` + strings, for example ``1536x864``. Width and height must both be divisible by 16 and the + requested aspect ratio must be between 1:3 and 3:1. Resolutions above ``2560x1440`` are + experimental, and the maximum supported resolution is ``3840x2160``. The requested size must + also satisfy the model's current pixel and edge limits. The standard sizes ``1024x1024``, + ``1536x1024``, and ``1024x1536`` are supported by the GPT image models; ``auto`` is supported + for models that allow automatic sizing. Is one of the following types: Literal["1024x1024"], + Literal["1024x1536"], Literal["1536x1024"], Literal["auto"], str + :vartype size: str or str or str or str or str + :ivar output_format: The output format of the generated image. One of ``png``, ``webp``, or + ``jpeg``. Default: ``png``. Is one of the following types: Literal["png"], Literal["webp"], + Literal["jpeg"] + :vartype output_format: str or str or str + :ivar output_compression: Compression level for the output image. Default: 100. + :vartype output_compression: int + :ivar moderation: Moderation level for the generated image. Default: ``auto``. Is either a + Literal["auto"] type or a Literal["low"] type. + :vartype moderation: str or str + :ivar background: Set the background of the generated image. One of ``transparent``, + ``opaque``, or ``auto``. ``gpt-image-2.5-sunburst`` and ``gpt-image-2.5-flare``, including + their ``2026-09-08`` snapshots, support ``opaque`` and ``transparent`` backgrounds. Transparent + backgrounds are available for supported GPT Image models. For ``gpt-image-2`` and + ``gpt-image-2-2026-04-21``, this support is in preview. When using ``transparent``, set the + output format to ``png`` or ``webp``. Default: ``auto``. Is one of the following types: + Literal["transparent"], Literal["opaque"], Literal["auto"] + :vartype background: str or str or str + :ivar input_fidelity: Known values are: "high" and "low". + :vartype input_fidelity: str or ~azure.ai.projects.models.InputFidelity + :ivar input_image_mask: Optional mask for inpainting. Contains ``image_url`` (string, optional) + and ``file_id`` (string, optional). + :vartype input_image_mask: ~azure.ai.projects.models.ImageGenToolInputImageMask + :ivar partial_images: Number of partial images to generate in streaming mode, from 0 (default + value) to 3. + :vartype partial_images: int + :ivar action: Whether to generate a new image or edit an existing image. Default: ``auto``. + Known values are: "generate", "edit", and "auto". + :vartype action: str or ~azure.ai.projects.models.ImageGenAction + :ivar name: Deprecated. This property is deprecated and will be removed in a future version. + :vartype name: str + :ivar description: Deprecated. This property is deprecated and will be removed in a future + version. + :vartype description: str + :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future + version. + :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] """ - type: Literal["container_auto"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the shell execution environment. Always ``container_auto``. Required. Default value - is \"container_auto\".""" - file_ids: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """An optional list of uploaded files to make available to your code.""" - memory_limit: Optional[Union[str, "_models.ContainerMemoryLimit"]] = rest_field( + type: Literal[ToolType.IMAGE_GENERATION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the image generation tool. Always ``image_generation``. Required. IMAGE_GENERATION.""" + model: Optional[ + Union[ + Literal["gpt-image-1"], + Literal["gpt-image-1-mini"], + Literal["gpt-image-1.5"], + Literal["gpt-image-2"], + Literal["gpt-image-2-2026-04-21"], + Literal["gpt-image-2.5-sunburst"], + Literal["gpt-image-2.5-sunburst-2026-09-08"], + Literal["gpt-image-2.5-flare"], + Literal["gpt-image-2.5-flare-2026-09-08"], + str, + ] + ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Is one of the following types: Literal[\"gpt-image-1\"], Literal[\"gpt-image-1-mini\"], + Literal[\"gpt-image-1.5\"], Literal[\"gpt-image-2\"], Literal[\"gpt-image-2-2026-04-21\"], + Literal[\"gpt-image-2.5-sunburst\"], Literal[\"gpt-image-2.5-sunburst-2026-09-08\"], + Literal[\"gpt-image-2.5-flare\"], Literal[\"gpt-image-2.5-flare-2026-09-08\"], str""" + quality: Optional[Literal["low", "medium", "high", "xhigh", "max", "auto"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Known values are: \"1g\", \"4g\", \"16g\", and \"64g\".""" - skills: Optional[list["_models.ContainerSkill"]] = rest_field( + """The quality of the generated image. The GPT image models support ``low``, ``medium``, and + ``high``. ``gpt-image-2.5-sunburst`` and ``gpt-image-2.5-flare``, including their + ``2026-09-08`` snapshots, also support ``xhigh`` and ``max``. Default: ``auto``. Is one of the + following types: Literal[\"low\"], Literal[\"medium\"], Literal[\"high\"], Literal[\"xhigh\"], + Literal[\"max\"], Literal[\"auto\"]""" + size: Optional[Union[Literal["1024x1024"], Literal["1024x1536"], Literal["1536x1024"], Literal["auto"], str]] = ( + rest_field(visibility=["read", "create", "update", "delete", "query"]) + ) + """The size of the generated images. For ``gpt-image-2``, ``gpt-image-2-2026-04-21``, + ``gpt-image-2.5-sunburst``, ``gpt-image-2.5-sunburst-2026-09-08``, ``gpt-image-2.5-flare``, and + ``gpt-image-2.5-flare-2026-09-08``, arbitrary resolutions are supported as ``WIDTHxHEIGHT`` + strings, for example ``1536x864``. Width and height must both be divisible by 16 and the + requested aspect ratio must be between 1:3 and 3:1. Resolutions above ``2560x1440`` are + experimental, and the maximum supported resolution is ``3840x2160``. The requested size must + also satisfy the model's current pixel and edge limits. The standard sizes ``1024x1024``, + ``1536x1024``, and ``1024x1536`` are supported by the GPT image models; ``auto`` is supported + for models that allow automatic sizing. Is one of the following types: Literal[\"1024x1024\"], + Literal[\"1024x1536\"], Literal[\"1536x1024\"], Literal[\"auto\"], str""" + output_format: Optional[Literal["png", "webp", "jpeg"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """An optional list of skills referenced by id or inline data.""" - network_policy: Optional["_models.ToolboxShellNetworkPolicy"] = rest_field( + """The output format of the generated image. One of ``png``, ``webp``, or ``jpeg``. Default: + ``png``. Is one of the following types: Literal[\"png\"], Literal[\"webp\"], Literal[\"jpeg\"]""" + output_compression: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Compression level for the output image. Default: 100.""" + moderation: Optional[Literal["auto", "low"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The network access policy for the container. When omitted, the service defaults to disabled - outbound network access.""" + """Moderation level for the generated image. Default: ``auto``. Is either a Literal[\"auto\"] type + or a Literal[\"low\"] type.""" + background: Optional[Literal["transparent", "opaque", "auto"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Set the background of the generated image. One of ``transparent``, ``opaque``, or ``auto``. + ``gpt-image-2.5-sunburst`` and ``gpt-image-2.5-flare``, including their ``2026-09-08`` + snapshots, support ``opaque`` and ``transparent`` backgrounds. Transparent backgrounds are + available for supported GPT Image models. For ``gpt-image-2`` and ``gpt-image-2-2026-04-21``, + this support is in preview. When using ``transparent``, set the output format to ``png`` or + ``webp``. Default: ``auto``. Is one of the following types: Literal[\"transparent\"], + Literal[\"opaque\"], Literal[\"auto\"]""" + input_fidelity: Optional[Union[str, "_models.InputFidelity"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Known values are: \"high\" and \"low\".""" + input_image_mask: Optional["_models.ImageGenToolInputImageMask"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Optional mask for inpainting. Contains ``image_url`` (string, optional) and ``file_id`` + (string, optional).""" + partial_images: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Number of partial images to generate in streaming mode, from 0 (default value) to 3.""" + action: Optional[Union[str, "_models.ImageGenAction"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Whether to generate a new image or edit an existing image. Default: ``auto``. Known values are: + \"generate\", \"edit\", and \"auto\".""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Deprecated. This property is deprecated and will be removed in a future version.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Deprecated. This property is deprecated and will be removed in a future version.""" + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Deprecated. This property is deprecated and will be removed in a future version.""" @overload def __init__( self, *, - file_ids: Optional[list[str]] = None, - memory_limit: Optional[Union[str, "_models.ContainerMemoryLimit"]] = None, - skills: Optional[list["_models.ContainerSkill"]] = None, - network_policy: Optional["_models.ToolboxShellNetworkPolicy"] = None, + model: Optional[ + Union[ + Literal["gpt-image-1"], + Literal["gpt-image-1-mini"], + Literal["gpt-image-1.5"], + Literal["gpt-image-2"], + Literal["gpt-image-2-2026-04-21"], + Literal["gpt-image-2.5-sunburst"], + Literal["gpt-image-2.5-sunburst-2026-09-08"], + Literal["gpt-image-2.5-flare"], + Literal["gpt-image-2.5-flare-2026-09-08"], + str, + ] + ] = None, + quality: Optional[Literal["low", "medium", "high", "xhigh", "max", "auto"]] = None, + size: Optional[ + Union[Literal["1024x1024"], Literal["1024x1536"], Literal["1536x1024"], Literal["auto"], str] + ] = None, + output_format: Optional[Literal["png", "webp", "jpeg"]] = None, + output_compression: Optional[int] = None, + moderation: Optional[Literal["auto", "low"]] = None, + background: Optional[Literal["transparent", "opaque", "auto"]] = None, + input_fidelity: Optional[Union[str, "_models.InputFidelity"]] = None, + input_image_mask: Optional["_models.ImageGenToolInputImageMask"] = None, + partial_images: Optional[int] = None, + action: Optional[Union[str, "_models.ImageGenAction"]] = None, + name: Optional[str] = None, + description: Optional[str] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, ) -> None: ... @overload @@ -25778,32 +32387,44 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = "container_auto" # type: ignore + self.type = ToolType.IMAGE_GENERATION # type: ignore -class ToolboxShellContainerReferenceEnvironment( - ToolboxShellEnvironment, discriminator="container_reference" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """An existing container environment for a shell tool stored in a toolbox. +class ToolLocalShellToolParam( + Tool, discriminator="local_shell" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Local shell tool. - :ivar type: The type of the shell execution environment. Always ``container_reference``. - Required. Default value is "container_reference". - :vartype type: str - :ivar container_id: The ID of the referenced container. Required. - :vartype container_id: str + :ivar type: The type of the local shell tool. Always ``local_shell``. Required. LOCAL_SHELL. + :vartype type: str or ~azure.ai.projects.models.LOCAL_SHELL + :ivar name: Deprecated. This property is deprecated and will be removed in a future version. + :vartype name: str + :ivar description: Deprecated. This property is deprecated and will be removed in a future + version. + :vartype description: str + :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future + version. + :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] """ - type: Literal["container_reference"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the shell execution environment. Always ``container_reference``. Required. Default - value is \"container_reference\".""" - container_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the referenced container. Required.""" + type: Literal[ToolType.LOCAL_SHELL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the local shell tool. Always ``local_shell``. Required. LOCAL_SHELL.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Deprecated. This property is deprecated and will be removed in a future version.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Deprecated. This property is deprecated and will be removed in a future version.""" + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Deprecated. This property is deprecated and will be removed in a future version.""" @overload def __init__( self, *, - container_id: str, + name: Optional[str] = None, + description: Optional[str] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, ) -> None: ... @overload @@ -25815,28 +32436,167 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = "container_reference" # type: ignore + self.type = ToolType.LOCAL_SHELL # type: ignore -class ToolboxShellNetworkPolicy(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Network access policy for an automatically provisioned toolbox shell container. +class ToolMcpTool(Tool, discriminator="mcp"): # pylint: disable=docstring-keyword-should-match-keyword-only + """MCP tool. - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ToolboxShellNetworkPolicyDisabled + :ivar type: The type of the MCP tool. Always ``mcp``. Required. MCP. + :vartype type: str or ~azure.ai.projects.models.MCP + :ivar server_label: A label for this MCP server, used to identify it in tool calls. Required. + :vartype server_label: str + :ivar server_url: The URL for the MCP server. One of ``server_url``, ``connector_id``, or + ``tunnel_id`` must be provided. + :vartype server_url: str + :ivar connector_id: Identifier for service connectors, like those available in ChatGPT. One of + ``server_url``, ``connector_id``, or ``tunnel_id`` must be provided. Learn more about service + connectors `here + `_. This field + is deprecated for models released after September 1, 2026. Use ``server_url`` to connect to a + remote MCP server, or ``tunnel_id`` to connect through a Secure MCP Tunnel. Currently supported + ``connector_id`` values are: - :ivar type: The type of network access policy. Required. Default value is None. - :vartype type: str + * Dropbox: `connector_dropbox` + * Gmail: `connector_gmail` + * Google Calendar: `connector_googlecalendar` + * Google Drive: `connector_googledrive` + * Microsoft Teams: `connector_microsoftteams` + * Outlook Calendar: `connector_outlookcalendar` + * Outlook Email: `connector_outlookemail` + * SharePoint: `connector_sharepoint`. Is one of the following types: + Literal["connector_dropbox"], Literal["connector_gmail"], Literal["connector_googlecalendar"], + Literal["connector_googledrive"], Literal["connector_microsoftteams"], + Literal["connector_outlookcalendar"], Literal["connector_outlookemail"], + Literal["connector_sharepoint"] + + :vartype connector_id: str or str or str or str or str or str or str or str + :ivar tunnel_id: The Secure MCP Tunnel ID to use instead of a direct server URL. One of + ``server_url``, ``connector_id``, or ``tunnel_id`` must be provided. + :vartype tunnel_id: str + :ivar authorization: An OAuth access token that can be used with a remote MCP server, either + with a custom MCP server URL or a service connector. Your application must handle the OAuth + authorization flow and provide the token here. + :vartype authorization: str + :ivar server_description: Optional description of the MCP server, used to provide more context. + :vartype server_description: str + :ivar headers: + :vartype headers: dict[str, str] + :ivar allowed_tools: Is either a [str] type or a MCPToolFilter type. + :vartype allowed_tools: list[str] or ~azure.ai.projects.models.MCPToolFilter + :ivar allowed_callers: + :vartype allowed_callers: list[str or ~azure.ai.projects.models.CallableToolAllowedCaller] + :ivar require_approval: Is one of the following types: MCPToolRequireApproval, + Literal["always"], Literal["never"] + :vartype require_approval: ~azure.ai.projects.models.MCPToolRequireApproval or str or str + :ivar defer_loading: Whether this MCP tool is deferred and discovered via tool search. + :vartype defer_loading: bool + :ivar project_connection_id: The connection ID in the project for the MCP server. The + connection stores authentication and other connection details needed to connect to the MCP + server. + :vartype project_connection_id: str + :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future + version. + :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The type of network access policy. Required. Default value is None.""" + type: Literal[ToolType.MCP] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the MCP tool. Always ``mcp``. Required. MCP.""" + server_label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A label for this MCP server, used to identify it in tool calls. Required.""" + server_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The URL for the MCP server. One of ``server_url``, ``connector_id``, or ``tunnel_id`` must be + provided.""" + connector_id: Optional[ + Literal[ + "connector_dropbox", + "connector_gmail", + "connector_googlecalendar", + "connector_googledrive", + "connector_microsoftteams", + "connector_outlookcalendar", + "connector_outlookemail", + "connector_sharepoint", + ] + ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Identifier for service connectors, like those available in ChatGPT. One of ``server_url``, + ``connector_id``, or ``tunnel_id`` must be provided. Learn more about service connectors `here + `_. This field + is deprecated for models released after September 1, 2026. Use ``server_url`` to connect to a + remote MCP server, or ``tunnel_id`` to connect through a Secure MCP Tunnel. Currently supported + ``connector_id`` values are: + + * Dropbox: `connector_dropbox` + * Gmail: `connector_gmail` + * Google Calendar: `connector_googlecalendar` + * Google Drive: `connector_googledrive` + * Microsoft Teams: `connector_microsoftteams` + * Outlook Calendar: `connector_outlookcalendar` + * Outlook Email: `connector_outlookemail` + * SharePoint: `connector_sharepoint`. Is one of the following types: + Literal[\"connector_dropbox\"], Literal[\"connector_gmail\"], + Literal[\"connector_googlecalendar\"], Literal[\"connector_googledrive\"], + Literal[\"connector_microsoftteams\"], Literal[\"connector_outlookcalendar\"], + Literal[\"connector_outlookemail\"], Literal[\"connector_sharepoint\"]""" + tunnel_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Secure MCP Tunnel ID to use instead of a direct server URL. One of ``server_url``, + ``connector_id``, or ``tunnel_id`` must be provided.""" + authorization: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An OAuth access token that can be used with a remote MCP server, either with a custom MCP + server URL or a service connector. Your application must handle the OAuth authorization flow + and provide the token here.""" + server_description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional description of the MCP server, used to provide more context.""" + headers: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + allowed_tools: Optional[Union[list[str], "_models.MCPToolFilter"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Is either a [str] type or a MCPToolFilter type.""" + allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + require_approval: Optional[Union["_models.MCPToolRequireApproval", Literal["always"], Literal["never"]]] = ( + rest_field(visibility=["read", "create", "update", "delete", "query"]) + ) + """Is one of the following types: MCPToolRequireApproval, Literal[\"always\"], Literal[\"never\"]""" + defer_loading: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether this MCP tool is deferred and discovered via tool search.""" + project_connection_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The connection ID in the project for the MCP server. The connection stores authentication and + other connection details needed to connect to the MCP server.""" + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Deprecated. This property is deprecated and will be removed in a future version.""" @overload def __init__( self, *, - type: str, + server_label: str, + server_url: Optional[str] = None, + connector_id: Optional[ + Literal[ + "connector_dropbox", + "connector_gmail", + "connector_googlecalendar", + "connector_googledrive", + "connector_microsoftteams", + "connector_outlookcalendar", + "connector_outlookemail", + "connector_sharepoint", + ] + ] = None, + tunnel_id: Optional[str] = None, + authorization: Optional[str] = None, + server_description: Optional[str] = None, + headers: Optional[dict[str, str]] = None, + allowed_tools: Optional[Union[list[str], "_models.MCPToolFilter"]] = None, + allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = None, + require_approval: Optional[Union["_models.MCPToolRequireApproval", Literal["always"], Literal["never"]]] = None, + defer_loading: Optional[bool] = None, + project_connection_id: Optional[str] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, ) -> None: ... @overload @@ -25848,19 +32608,20 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolType.MCP # type: ignore -class ToolboxShellNetworkPolicyDisabled(ToolboxShellNetworkPolicy, discriminator="disabled"): - """A network policy that disables outbound access from a toolbox shell container. +class ToolProgrammaticToolCallingParam(Tool, discriminator="programmatic_tool_calling"): + """ToolProgrammaticToolCallingParam. - :ivar type: The type of network access policy. Always ``disabled``. Required. Default value is - "disabled". - :vartype type: str + :ivar type: The type of the tool. Always ``programmatic_tool_calling``. Required. + PROGRAMMATIC_TOOL_CALLING. + :vartype type: str or ~azure.ai.projects.models.PROGRAMMATIC_TOOL_CALLING """ - type: Literal["disabled"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of network access policy. Always ``disabled``. Required. Default value is - \"disabled\".""" + type: Literal[ToolType.PROGRAMMATIC_TOOL_CALLING] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the tool. Always ``programmatic_tool_calling``. Required. + PROGRAMMATIC_TOOL_CALLING.""" @overload def __init__( @@ -25876,28 +32637,25 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = "disabled" # type: ignore - + self.type = ToolType.PROGRAMMATIC_TOOL_CALLING # type: ignore -class ToolboxSkill(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A skill source included in a toolbox. - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ToolboxSkillReference +class ToolProjectConnection(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A project connection resource. - :ivar type: The type of skill source. Required. Default value is None. - :vartype type: str + :ivar project_connection_id: A project connection in a ToolProjectConnectionList attached to + this tool. Required. + :vartype project_connection_id: str """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The type of skill source. Required. Default value is None.""" + project_connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A project connection in a ToolProjectConnectionList attached to this tool. Required.""" @overload def __init__( self, *, - type: str, + project_connection_id: str, ) -> None: ... @overload @@ -25911,34 +32669,33 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ToolboxSkillReference( - ToolboxSkill, discriminator="skill_reference" +class ToolSearchToolboxTool( + ToolboxTool, discriminator="toolbox_search" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """A reference to an existing skill to include in a toolbox. + """A toolbox search tool stored in a toolbox. - :ivar type: The type of skill source. Required. Default value is "skill_reference". - :vartype type: str - :ivar name: The name of the skill. Required. + :ivar name: Optional user-defined name for this tool or configuration. :vartype name: str - :ivar version: The version of the skill. If not specified, the skill's default version is used. - When a version is specified, the reference is pinned to that immutable version. - :vartype version: str + :ivar description: Optional user-defined description for this tool or configuration. + :vartype description: str + :ivar tool_configs: Per-tool configuration map. Keys are tool names or ``*`` (catch-all + default). Resolution order: exact tool name match takes priority over ``*``. Unknown tool names + are silently ignored at runtime. + :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] + :ivar type: The type of the tool. Always ``toolbox_search``. Required. TOOLBOX_SEARCH. + :vartype type: str or ~azure.ai.projects.models.TOOLBOX_SEARCH """ - type: Literal["skill_reference"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of skill source. Required. Default value is \"skill_reference\".""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the skill. Required.""" - version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The version of the skill. If not specified, the skill's default version is used. When a version - is specified, the reference is pinned to that immutable version.""" + type: Literal[ToolboxToolType.TOOLBOX_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the tool. Always ``toolbox_search``. Required. TOOLBOX_SEARCH.""" @overload def __init__( self, *, - name: str, - version: Optional[str] = None, + name: Optional[str] = None, + description: Optional[str] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, ) -> None: ... @overload @@ -25950,82 +32707,44 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = "skill_reference" # type: ignore - + self.type = ToolboxToolType.TOOLBOX_SEARCH # type: ignore -class ToolboxVersionObject(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A specific version of a toolbox. - :ivar metadata: Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. +class ToolToolSearchToolParam( + Tool, discriminator="tool_search" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Tool search tool. - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. Required. - :vartype metadata: dict[str, str] - :ivar id: The unique identifier of the toolbox version. Required. - :vartype id: str - :ivar name: The name of the toolbox. Required. - :vartype name: str - :ivar version: The version identifier of the toolbox. Toolbox versions are immutable and every - update creates a new version. Required. - :vartype version: str - :ivar description: A human-readable description of the toolbox. + :ivar type: The type of the tool. Always ``tool_search``. Required. TOOL_SEARCH. + :vartype type: str or ~azure.ai.projects.models.TOOL_SEARCH + :ivar execution: Whether tool search is executed by the server or by the client. Known values + are: "server" and "client". + :vartype execution: str or ~azure.ai.projects.models.ToolSearchExecutionType + :ivar description: :vartype description: str - :ivar created_at: The Unix timestamp (seconds) when the toolbox version was created. Required. - :vartype created_at: ~datetime.datetime - :ivar tools: The list of tools contained in this toolbox version. Required. - :vartype tools: list[~azure.ai.projects.models.ToolboxTool] - :ivar skills: The list of skill sources included in this toolbox version. - :vartype skills: list[~azure.ai.projects.models.ToolboxSkill] - :ivar policies: Policy configuration for the toolbox version. - :vartype policies: ~azure.ai.projects.models.ToolboxPolicies + :ivar parameters: + :vartype parameters: ~azure.ai.projects.models.EmptyModelParam """ - metadata: dict[str, str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. Required.""" - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique identifier of the toolbox version. Required.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the toolbox. Required.""" - version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The version identifier of the toolbox. Toolbox versions are immutable and every update creates - a new version. Required.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A human-readable description of the toolbox.""" - created_at: datetime.datetime = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp (seconds) when the toolbox version was created. Required.""" - tools: list["_models.ToolboxTool"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The list of tools contained in this toolbox version. Required.""" - skills: Optional[list["_models.ToolboxSkill"]] = rest_field( + type: Literal[ToolType.TOOL_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the tool. Always ``tool_search``. Required. TOOL_SEARCH.""" + execution: Optional[Union[str, "_models.ToolSearchExecutionType"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The list of skill sources included in this toolbox version.""" - policies: Optional["_models.ToolboxPolicies"] = rest_field( + """Whether tool search is executed by the server or by the client. Known values are: \"server\" + and \"client\".""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + parameters: Optional["_models.EmptyModelParam"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Policy configuration for the toolbox version.""" @overload def __init__( self, *, - metadata: dict[str, str], - id: str, # pylint: disable=redefined-builtin - name: str, - version: str, - created_at: datetime.datetime, - tools: list["_models.ToolboxTool"], + execution: Optional[Union[str, "_models.ToolSearchExecutionType"]] = None, description: Optional[str] = None, - skills: Optional[list["_models.ToolboxSkill"]] = None, - policies: Optional["_models.ToolboxPolicies"] = None, + parameters: Optional["_models.EmptyModelParam"] = None, ) -> None: ... @overload @@ -26037,23 +32756,41 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolType.TOOL_SEARCH # type: ignore -class ToolboxVersions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The versions associated with a toolbox. +class ToolUseFineTuningDataGenerationJobConfiguration( + DataGenerationJobConfiguration, discriminator="tool_use" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The configuration for a data generation job with ToolUse type. This is a preview feature used + only for fine-tuning scenarios. - :ivar latest: The latest version of the toolbox. Required. - :vartype latest: ~azure.ai.projects.models.ToolboxVersionObject + :ivar train_split: The proportion of the generated data to be used for training when the data + is used for fine-tuning. The rest will be used for validation. Value should be between 0 and 1. + :vartype train_split: float + :ivar model_options: The LLM model options. + :vartype model_options: ~azure.ai.projects.models.DataGenerationModelOptions + :ivar type: The data generation job type, which is ToolUse for this model. Required. Tool + calling conversation between user and agent. + :vartype type: str or ~azure.ai.projects.models.TOOL_USE + :ivar max_samples: Maximum number of samples to generate, up to service-defined limits. + Required. + :vartype max_samples: int """ - latest: "_models.ToolboxVersionObject" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The latest version of the toolbox. Required.""" + type: Literal[DataGenerationJobType.TOOL_USE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The data generation job type, which is ToolUse for this model. Required. Tool calling + conversation between user and agent.""" + max_samples: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Maximum number of samples to generate, up to service-defined limits. Required.""" @overload def __init__( self, *, - latest: "_models.ToolboxVersionObject", + max_samples: int, + train_split: Optional[float] = None, + model_options: Optional["_models.DataGenerationModelOptions"] = None, ) -> None: ... @overload @@ -26065,114 +32802,50 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = DataGenerationJobType.TOOL_USE # type: ignore -class ToolChoiceAllowed( - ToolChoiceParam, discriminator="allowed_tools" +class ToolWebSearchPreviewTool( + Tool, discriminator="web_search_preview" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Allowed tools. - - :ivar type: Allowed tool configuration type. Always ``allowed_tools``. Required. ALLOWED_TOOLS. - :vartype type: str or ~azure.ai.projects.models.ALLOWED_TOOLS - :ivar mode: Constrains the tools available to the model to a pre-defined set. ``auto`` allows - the model to pick from among the allowed tools and generate a message. ``required`` requires - the model to call one or more of the allowed tools. Required. Is either a Literal["auto"] type - or a Literal["required"] type. - :vartype mode: str or str - :ivar tools: Required. A list of tool definitions that the model should be allowed to call. For - the Responses API, the list of tool definitions might look like: - - .. code-block:: json + """Web search preview. - [ - { "type": "function", "name": "get_weather" }, - { "type": "mcp", "server_label": "deepwiki" }, - { "type": "image_generation" } - ] - :vartype tools: list[dict[str, any]] + :ivar type: The type of the web search tool. One of ``web_search_preview`` or + ``web_search_preview_2025_03_11``. Required. WEB_SEARCH_PREVIEW. + :vartype type: str or ~azure.ai.projects.models.WEB_SEARCH_PREVIEW + :ivar user_location: + :vartype user_location: ~azure.ai.projects.models.ApproximateLocation + :ivar search_context_size: High level guidance for the amount of context window space to use + for the search. One of ``low``, ``medium``, or ``high``. ``medium`` is the default. Known + values are: "low", "medium", and "high". + :vartype search_context_size: str or ~azure.ai.projects.models.SearchContextSize + :ivar search_content_types: + :vartype search_content_types: list[str or ~azure.ai.projects.models.SearchContentType] """ - type: Literal[ToolChoiceParamType.ALLOWED_TOOLS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Allowed tool configuration type. Always ``allowed_tools``. Required. ALLOWED_TOOLS.""" - mode: Literal["auto", "required"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Constrains the tools available to the model to a pre-defined set. ``auto`` allows the model to - pick from among the allowed tools and generate a message. ``required`` requires the model to - call one or more of the allowed tools. Required. Is either a Literal[\"auto\"] type or a - Literal[\"required\"] type.""" - tools: list[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. A list of tool definitions that the model should be allowed to call. For the - Responses API, the list of tool definitions might look like: - - .. code-block:: json - - [ - { \"type\": \"function\", \"name\": \"get_weather\" }, - { \"type\": \"mcp\", \"server_label\": \"deepwiki\" }, - { \"type\": \"image_generation\" } - ]""" + type: Literal[ToolType.WEB_SEARCH_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the web search tool. One of ``web_search_preview`` or + ``web_search_preview_2025_03_11``. Required. WEB_SEARCH_PREVIEW.""" + user_location: Optional["_models.ApproximateLocation"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + search_context_size: Optional[Union[str, "_models.SearchContextSize"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """High level guidance for the amount of context window space to use for the search. One of + ``low``, ``medium``, or ``high``. ``medium`` is the default. Known values are: \"low\", + \"medium\", and \"high\".""" + search_content_types: Optional[list[Union[str, "_models.SearchContentType"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) @overload def __init__( self, *, - mode: Literal["auto", "required"], - tools: list[dict[str, Any]], - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type = ToolChoiceParamType.ALLOWED_TOOLS # type: ignore - - -class ToolChoiceCodeInterpreter(ToolChoiceParam, discriminator="code_interpreter"): - """Indicates that the model should use a built-in tool to generate a response. `Learn more about - built-in tools `_. - - :ivar type: Required. CODE_INTERPRETER. - :vartype type: str or ~azure.ai.projects.models.CODE_INTERPRETER - """ - - type: Literal[ToolChoiceParamType.CODE_INTERPRETER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. CODE_INTERPRETER.""" - - @overload - def __init__( - self, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type = ToolChoiceParamType.CODE_INTERPRETER # type: ignore - - -class ToolChoiceComputer(ToolChoiceParam, discriminator="computer"): - """Indicates that the model should use a built-in tool to generate a response. `Learn more about - built-in tools `_. - - :ivar type: Required. COMPUTER. - :vartype type: str or ~azure.ai.projects.models.COMPUTER - """ - - type: Literal[ToolChoiceParamType.COMPUTER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. COMPUTER.""" - - @overload - def __init__( - self, + user_location: Optional["_models.ApproximateLocation"] = None, + search_context_size: Optional[Union[str, "_models.SearchContextSize"]] = None, + search_content_types: Optional[list[Union[str, "_models.SearchContentType"]]] = None, ) -> None: ... @overload @@ -26184,23 +32857,91 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolChoiceParamType.COMPUTER # type: ignore + self.type = ToolType.WEB_SEARCH_PREVIEW # type: ignore -class ToolChoiceComputerUse(ToolChoiceParam, discriminator="computer_use"): - """Indicates that the model should use a built-in tool to generate a response. `Learn more about - built-in tools `_. +class ToolWebSearchTool( + Tool, discriminator="web_search" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Web search. - :ivar type: Required. COMPUTER_USE. - :vartype type: str or ~azure.ai.projects.models.COMPUTER_USE + :ivar type: The type of the web search tool. One of ``web_search`` or + ``web_search_2025_08_26``. Required. WEB_SEARCH. + :vartype type: str or ~azure.ai.projects.models.WEB_SEARCH + :ivar external_web_access: Allow live internet access for web search. Defaults to true when + omitted. When false, the web search tool runs in offline/cache-only mode and will not fetch new + external content. + :vartype external_web_access: bool + :ivar filters: + :vartype filters: ~azure.ai.projects.models.WebSearchToolFilters + :ivar user_location: The approximate location of the user. If omitted or null, defaults to the + United States. To avoid this fallback, pass ``{"type": "approximate"}`` without location + fields. To localize results, provide the relevant location fields. + :vartype user_location: ~azure.ai.projects.models.WebSearchApproximateLocation + :ivar search_context_size: High level guidance for the amount of context window space to use + for the search. One of ``low``, ``medium``, or ``high``. ``medium`` is the default. Is one of + the following types: Literal["low"], Literal["medium"], Literal["high"] + :vartype search_context_size: str or str or str + :ivar name: Deprecated. This property is deprecated and will be removed in a future version. + :vartype name: str + :ivar description: Deprecated. This property is deprecated and will be removed in a future + version. + :vartype description: str + :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future + version. + :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] + :ivar custom_search_configuration: The project connections attached to this tool. There can be + a maximum of 1 connection resource attached to the tool. + :vartype custom_search_configuration: ~azure.ai.projects.models.WebSearchConfiguration """ - type: Literal[ToolChoiceParamType.COMPUTER_USE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. COMPUTER_USE.""" + type: Literal[ToolType.WEB_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the web search tool. One of ``web_search`` or ``web_search_2025_08_26``. Required. + WEB_SEARCH.""" + external_web_access: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Allow live internet access for web search. Defaults to true when omitted. When false, the web + search tool runs in offline/cache-only mode and will not fetch new external content.""" + filters: Optional["_models.WebSearchToolFilters"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + user_location: Optional["_models.WebSearchApproximateLocation"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The approximate location of the user. If omitted or null, defaults to the United States. To + avoid this fallback, pass ``{\"type\": \"approximate\"}`` without location fields. To localize + results, provide the relevant location fields.""" + search_context_size: Optional[Literal["low", "medium", "high"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """High level guidance for the amount of context window space to use for the search. One of + ``low``, ``medium``, or ``high``. ``medium`` is the default. Is one of the following types: + Literal[\"low\"], Literal[\"medium\"], Literal[\"high\"]""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Deprecated. This property is deprecated and will be removed in a future version.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Deprecated. This property is deprecated and will be removed in a future version.""" + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Deprecated. This property is deprecated and will be removed in a future version.""" + custom_search_configuration: Optional["_models.WebSearchConfiguration"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The project connections attached to this tool. There can be a maximum of 1 connection resource + attached to the tool.""" @overload def __init__( self, + *, + external_web_access: Optional[bool] = None, + filters: Optional["_models.WebSearchToolFilters"] = None, + user_location: Optional["_models.WebSearchApproximateLocation"] = None, + search_context_size: Optional[Literal["low", "medium", "high"]] = None, + name: Optional[str] = None, + description: Optional[str] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + custom_search_configuration: Optional["_models.WebSearchConfiguration"] = None, ) -> None: ... @overload @@ -26212,23 +32953,48 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolChoiceParamType.COMPUTER_USE # type: ignore + self.type = ToolType.WEB_SEARCH # type: ignore -class ToolChoiceComputerUsePreview(ToolChoiceParam, discriminator="computer_use_preview"): - """Indicates that the model should use a built-in tool to generate a response. `Learn more about - built-in tools `_. +class TracesDataGenerationJobConfiguration( + DataGenerationJobConfiguration, discriminator="traces" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """The configuration for a data generation job with Traces type. - :ivar type: Required. COMPUTER_USE_PREVIEW. - :vartype type: str or ~azure.ai.projects.models.COMPUTER_USE_PREVIEW + :ivar train_split: The proportion of the generated data to be used for training when the data + is used for fine-tuning. The rest will be used for validation. Value should be between 0 and 1. + :vartype train_split: float + :ivar model_options: The LLM model options. + :vartype model_options: ~azure.ai.projects.models.DataGenerationModelOptions + :ivar type: The data generation job type, which is Traces for this model. Required. Single turn + query and response from agent traces. + :vartype type: str or ~azure.ai.projects.models.TRACES + :ivar max_samples: Maximum number of samples to generate, up to service-defined limits. If + omitted, sampling is turned off. + :vartype max_samples: int + :ivar redact_private_content: Whether to redact private content from traces. When omitted or + set to true, private content is redacted. Set to false to opt out of redaction. + :vartype redact_private_content: bool """ - type: Literal[ToolChoiceParamType.COMPUTER_USE_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. COMPUTER_USE_PREVIEW.""" + type: Literal[DataGenerationJobType.TRACES] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The data generation job type, which is Traces for this model. Required. Single turn query and + response from agent traces.""" + max_samples: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Maximum number of samples to generate, up to service-defined limits. If omitted, sampling is + turned off.""" + redact_private_content: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether to redact private content from traces. When omitted or set to true, private content is + redacted. Set to false to opt out of redaction.""" @overload def __init__( self, + *, + train_split: Optional[float] = None, + model_options: Optional["_models.DataGenerationModelOptions"] = None, + max_samples: Optional[int] = None, + redact_private_content: Optional[bool] = None, ) -> None: ... @overload @@ -26240,30 +33006,73 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolChoiceParamType.COMPUTER_USE_PREVIEW # type: ignore + self.type = DataGenerationJobType.TRACES # type: ignore -class ToolChoiceCustom( - ToolChoiceParam, discriminator="custom" +class TracesDataGenerationJobSource( + DataGenerationJobSource, discriminator="traces" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Custom tool. + """Traces source for data generation jobs — conversation traces from Application Insights. - :ivar type: For custom tool calling, the type is always ``custom``. Required. CUSTOM. - :vartype type: str or ~azure.ai.projects.models.CUSTOM - :ivar name: The name of the custom tool to call. Required. - :vartype name: str + :ivar description: Optional description of what this source represents — helps the pipeline + interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core + capabilities'). + :vartype description: str + :ivar type: The source type for this source, which is Traces. Required. Traces source — + conversation traces from Application Insights. + :vartype type: str or ~azure.ai.projects.models.TRACES + :ivar agent_id: The unique agent ID used to filter traces. Provide either ``agent_id`` or + ``agent_name`` — at least one is required. + :vartype agent_id: str + :ivar agent_name: The agent name to fetch traces for. Provide either ``agent_id`` or + ``agent_name`` — at least one is required. + :vartype agent_name: str + :ivar agent_version: The agent version. If not specified, traces for ALL versions of the agent + are included within the time window. + :vartype agent_version: str + :ivar start_time: Start of the time window (Unix timestamp in seconds) for fetching traces. + Required. + :vartype start_time: ~datetime.datetime + :ivar end_time: End of the time window (Unix timestamp in seconds). Defaults to current time. + :vartype end_time: ~datetime.datetime + :ivar trace_ids: Optional explicit list of trace IDs to include. + :vartype trace_ids: list[str] """ - type: Literal[ToolChoiceParamType.CUSTOM] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """For custom tool calling, the type is always ``custom``. Required. CUSTOM.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the custom tool to call. Required.""" + type: Literal[DataGenerationJobSourceType.TRACES] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The source type for this source, which is Traces. Required. Traces source — conversation traces + from Application Insights.""" + agent_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique agent ID used to filter traces. Provide either ``agent_id`` or ``agent_name`` — at + least one is required.""" + agent_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The agent name to fetch traces for. Provide either ``agent_id`` or ``agent_name`` — at least + one is required.""" + agent_version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The agent version. If not specified, traces for ALL versions of the agent are included within + the time window.""" + start_time: datetime.datetime = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """Start of the time window (Unix timestamp in seconds) for fetching traces. Required.""" + end_time: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """End of the time window (Unix timestamp in seconds). Defaults to current time.""" + trace_ids: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional explicit list of trace IDs to include.""" @overload def __init__( self, *, - name: str, + start_time: datetime.datetime, + description: Optional[str] = None, + agent_id: Optional[str] = None, + agent_name: Optional[str] = None, + agent_version: Optional[str] = None, + end_time: Optional[datetime.datetime] = None, + trace_ids: Optional[list[str]] = None, ) -> None: ... @overload @@ -26275,23 +33084,71 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolChoiceParamType.CUSTOM # type: ignore + self.type = DataGenerationJobSourceType.TRACES # type: ignore -class ToolChoiceFileSearch(ToolChoiceParam, discriminator="file_search"): - """Indicates that the model should use a built-in tool to generate a response. `Learn more about - built-in tools `_. +class TracesEvaluatorGenerationJobSource( + EvaluatorGenerationJobSource, discriminator="traces" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Traces source for evaluator generation jobs — conversation traces from Application Insights. - :ivar type: Required. FILE_SEARCH. - :vartype type: str or ~azure.ai.projects.models.FILE_SEARCH + :ivar description: Optional description of what this source represents — helps the pipeline + interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core + capabilities'). + :vartype description: str + :ivar type: The source type for this source, which is Traces. Required. Traces source — + conversation traces from Application Insights. + :vartype type: str or ~azure.ai.projects.models.TRACES + :ivar agent_id: The unique agent ID used to filter traces. Provide either ``agent_id`` or + ``agent_name`` — at least one is required. + :vartype agent_id: str + :ivar agent_name: The agent name to fetch traces for. Provide either ``agent_id`` or + ``agent_name`` — at least one is required. + :vartype agent_name: str + :ivar agent_version: The agent version. If not specified, traces for ALL versions of the agent + are included within the time window. + :vartype agent_version: str + :ivar start_time: Start of the time window (Unix timestamp in seconds) for fetching traces. + Required. + :vartype start_time: ~datetime.datetime + :ivar end_time: End of the time window (Unix timestamp in seconds). Defaults to current time. + :vartype end_time: ~datetime.datetime """ - type: Literal[ToolChoiceParamType.FILE_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. FILE_SEARCH.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional description of what this source represents — helps the pipeline interpret its content + (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities').""" + type: Literal[EvaluatorGenerationJobSourceType.TRACES] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The source type for this source, which is Traces. Required. Traces source — conversation traces + from Application Insights.""" + agent_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique agent ID used to filter traces. Provide either ``agent_id`` or ``agent_name`` — at + least one is required.""" + agent_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The agent name to fetch traces for. Provide either ``agent_id`` or ``agent_name`` — at least + one is required.""" + agent_version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The agent version. If not specified, traces for ALL versions of the agent are included within + the time window.""" + start_time: datetime.datetime = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """Start of the time window (Unix timestamp in seconds) for fetching traces. Required.""" + end_time: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """End of the time window (Unix timestamp in seconds). Defaults to current time.""" @overload def __init__( self, + *, + start_time: datetime.datetime, + description: Optional[str] = None, + agent_id: Optional[str] = None, + agent_name: Optional[str] = None, + agent_version: Optional[str] = None, + end_time: Optional[datetime.datetime] = None, ) -> None: ... @overload @@ -26303,30 +33160,24 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolChoiceParamType.FILE_SEARCH # type: ignore + self.type = EvaluatorGenerationJobSourceType.TRACES # type: ignore -class ToolChoiceFunction( - ToolChoiceParam, discriminator="function" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Function tool. +class TranscriptionLanguage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A language detected in transcribed audio. - :ivar type: For function calling, the type is always ``function``. Required. FUNCTION. - :vartype type: str or ~azure.ai.projects.models.FUNCTION - :ivar name: The name of the function to call. Required. - :vartype name: str + :ivar code: The code of a language detected in the audio. Required. + :vartype code: str """ - type: Literal[ToolChoiceParamType.FUNCTION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """For function calling, the type is always ``function``. Required. FUNCTION.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the function to call. Required.""" + code: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The code of a language detected in the audio. Required.""" @overload def __init__( self, *, - name: str, + code: str, ) -> None: ... @overload @@ -26338,23 +33189,32 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolChoiceParamType.FUNCTION # type: ignore -class ToolChoiceImageGeneration(ToolChoiceParam, discriminator="image_generation"): - """Indicates that the model should use a built-in tool to generate a response. `Learn more about - built-in tools `_. +class TranscriptTextUsageDuration( + CreateTranscriptionResponseJsonUsage, discriminator="duration" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Duration Usage. - :ivar type: Required. IMAGE_GENERATION. - :vartype type: str or ~azure.ai.projects.models.IMAGE_GENERATION + :ivar type: The type of the usage object. Always ``duration`` for this variant. Required. + DURATION. + :vartype type: str or ~azure.ai.projects.models.DURATION + :ivar seconds: Duration of the input audio in seconds. Required. + :vartype seconds: ~datetime.timedelta """ - type: Literal[ToolChoiceParamType.IMAGE_GENERATION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. IMAGE_GENERATION.""" + type: Literal[CreateTranscriptionResponseJsonUsageType.DURATION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the usage object. Always ``duration`` for this variant. Required. DURATION.""" + seconds: datetime.timedelta = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-seconds-int" + ) + """Duration of the input audio in seconds. Required.""" @overload def __init__( self, + *, + seconds: datetime.timedelta, ) -> None: ... @overload @@ -26366,34 +33226,48 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolChoiceParamType.IMAGE_GENERATION # type: ignore + self.type = CreateTranscriptionResponseJsonUsageType.DURATION # type: ignore -class ToolChoiceMCP( - ToolChoiceParam, discriminator="mcp" +class TranscriptTextUsageTokens( + CreateTranscriptionResponseJsonUsage, discriminator="tokens" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """MCP tool. + """Token Usage. - :ivar type: For MCP tools, the type is always ``mcp``. Required. MCP. - :vartype type: str or ~azure.ai.projects.models.MCP - :ivar server_label: The label of the MCP server to use. Required. - :vartype server_label: str - :ivar name: - :vartype name: str + :ivar type: The type of the usage object. Always ``tokens`` for this variant. Required. TOKENS. + :vartype type: str or ~azure.ai.projects.models.TOKENS + :ivar input_tokens: Number of input tokens billed for this request. Required. + :vartype input_tokens: int + :ivar input_token_details: Details about the input tokens billed for this request. + :vartype input_token_details: + ~azure.ai.projects.models.TranscriptTextUsageTokensInputTokenDetails + :ivar output_tokens: Number of output tokens generated. Required. + :vartype output_tokens: int + :ivar total_tokens: Total number of tokens used (input + output). Required. + :vartype total_tokens: int """ - type: Literal[ToolChoiceParamType.MCP] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """For MCP tools, the type is always ``mcp``. Required. MCP.""" - server_label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The label of the MCP server to use. Required.""" - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[CreateTranscriptionResponseJsonUsageType.TOKENS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the usage object. Always ``tokens`` for this variant. Required. TOKENS.""" + input_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Number of input tokens billed for this request. Required.""" + input_token_details: Optional["_models.TranscriptTextUsageTokensInputTokenDetails"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Details about the input tokens billed for this request.""" + output_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Number of output tokens generated. Required.""" + total_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Total number of tokens used (input + output). Required.""" @overload def __init__( self, *, - server_label: str, - name: Optional[str] = None, + input_tokens: int, + output_tokens: int, + total_tokens: int, + input_token_details: Optional["_models.TranscriptTextUsageTokensInputTokenDetails"] = None, ) -> None: ... @overload @@ -26405,23 +33279,29 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolChoiceParamType.MCP # type: ignore + self.type = CreateTranscriptionResponseJsonUsageType.TOKENS # type: ignore -class ToolChoiceWebSearchPreview(ToolChoiceParam, discriminator="web_search_preview"): - """Indicates that the model should use a built-in tool to generate a response. `Learn more about - built-in tools `_. +class TranscriptTextUsageTokensInputTokenDetails( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """TranscriptTextUsageTokensInputTokenDetails. - :ivar type: Required. WEB_SEARCH_PREVIEW. - :vartype type: str or ~azure.ai.projects.models.WEB_SEARCH_PREVIEW + :ivar text_tokens: + :vartype text_tokens: int + :ivar audio_tokens: + :vartype audio_tokens: int """ - type: Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. WEB_SEARCH_PREVIEW.""" + text_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + audio_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, + *, + text_tokens: Optional[int] = None, + audio_tokens: Optional[int] = None, ) -> None: ... @overload @@ -26433,23 +33313,45 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolChoiceParamType.WEB_SEARCH_PREVIEW # type: ignore -class ToolChoiceWebSearchPreview20250311(ToolChoiceParam, discriminator="web_search_preview_2025_03_11"): - """Indicates that the model should use a built-in tool to generate a response. `Learn more about - built-in tools `_. +class TwilioTelephonyBinding( + TelephonyBinding, discriminator="twilio" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A Twilio binding owned by a voice agent. - :ivar type: Required. WEB_SEARCH_PREVIEW_2025_03_11. - :vartype type: str or ~azure.ai.projects.models.WEB_SEARCH_PREVIEW_2025_03_11 + :ivar id: The service-generated binding identifier. Required. + :vartype id: str + :ivar connection_name: The Foundry connection name for the telephony provider. Required. + :vartype connection_name: str + :ivar label: The optional display label for the binding. + :vartype label: str + :ivar status: The lifecycle status. Required. Known values are: "active" and "suspended". + :vartype status: str or ~azure.ai.projects.models.TelephonyBindingStatus + :ivar incoming_call_url: The service-generated webhook URL to configure with the telephony + provider. Required. + :vartype incoming_call_url: str + :ivar provider: The Twilio provider. Required. Twilio Programmable Voice. + :vartype provider: str or ~azure.ai.projects.models.TWILIO + :ivar phone_number: The Twilio E.164 phone number. Required. + :vartype phone_number: str """ - type: Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW_2025_03_11] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. WEB_SEARCH_PREVIEW_2025_03_11.""" + provider: Literal[TelephonyProvider.TWILIO] = rest_discriminator(name="provider", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The Twilio provider. Required. Twilio Programmable Voice.""" + phone_number: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Twilio E.164 phone number. Required.""" @overload def __init__( self, + *, + id: str, # pylint: disable=redefined-builtin + connection_name: str, + status: Union[str, "_models.TelephonyBindingStatus"], + incoming_call_url: str, + phone_number: str, + label: Optional[str] = None, ) -> None: ... @overload @@ -26461,35 +33363,49 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolChoiceParamType.WEB_SEARCH_PREVIEW_2025_03_11 # type: ignore + self.provider = TelephonyProvider.TWILIO # type: ignore -class ToolConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Per-tool configuration that controls tool visibility and search behavior. +class TwilioTelephonyBindingListItem( + TelephonyBindingListItem, discriminator="twilio" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A Twilio binding returned in a list, including its entity tag. - :ivar pin: When true, the tool is always included in agent context and visible in - ``tools/list``. When false (default), the tool is hidden from ``tools/list`` and only - discoverable via ``tool_search``. - :vartype pin: bool - :ivar additional_search_text: Additional text indexed for tool_search. Supplements the native - tool description to improve discoverability. Does not alter ``tools/list`` output. - :vartype additional_search_text: str + :ivar id: The service-generated binding identifier. Required. + :vartype id: str + :ivar connection_name: The Foundry connection name for the telephony provider. Required. + :vartype connection_name: str + :ivar label: The optional display label for the binding. + :vartype label: str + :ivar status: The lifecycle status. Required. Known values are: "active" and "suspended". + :vartype status: str or ~azure.ai.projects.models.TelephonyBindingStatus + :ivar incoming_call_url: The service-generated webhook URL to configure with the telephony + provider. Required. + :vartype incoming_call_url: str + :ivar etag: The entity tag to send in the ``If-Match`` header when updating or deleting this + binding. Required. + :vartype etag: str + :ivar provider: The Twilio provider. Required. Twilio Programmable Voice. + :vartype provider: str or ~azure.ai.projects.models.TWILIO + :ivar phone_number: The Twilio E.164 phone number. Required. + :vartype phone_number: str """ - pin: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """When true, the tool is always included in agent context and visible in ``tools/list``. When - false (default), the tool is hidden from ``tools/list`` and only discoverable via - ``tool_search``.""" - additional_search_text: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Additional text indexed for tool_search. Supplements the native tool description to improve - discoverability. Does not alter ``tools/list`` output.""" + provider: Literal[TelephonyProvider.TWILIO] = rest_discriminator(name="provider", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The Twilio provider. Required. Twilio Programmable Voice.""" + phone_number: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Twilio E.164 phone number. Required.""" @overload def __init__( self, *, - pin: Optional[bool] = None, - additional_search_text: Optional[str] = None, + id: str, # pylint: disable=redefined-builtin + connection_name: str, + status: Union[str, "_models.TelephonyBindingStatus"], + incoming_call_url: str, + phone_number: str, + label: Optional[str] = None, ) -> None: ... @overload @@ -26501,28 +33417,29 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.provider = TelephonyProvider.TWILIO # type: ignore -class ToolDescription(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Description of a tool that can be used by an agent. +class UpdateModelVersionRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Request body for updating a model version. Only description and tags can be modified. - :ivar name: The name of the tool. - :vartype name: str - :ivar description: A brief description of the tool's purpose. + :ivar description: The asset description text. :vartype description: str + :ivar tags: Tag dictionary. Tags can be added, removed, and updated. + :vartype tags: dict[str, str] """ - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the tool.""" description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A brief description of the tool's purpose.""" + """The asset description text.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Tag dictionary. Tags can be added, removed, and updated.""" @overload def __init__( self, *, - name: Optional[str] = None, description: Optional[str] = None, + tags: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -26536,22 +33453,46 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ToolProjectConnection(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A project connection resource. +class UpdateTelephonyBindingRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The request to update an existing telephony binding. Every property is optional and the + binding's provider is immutable. - :ivar project_connection_id: A project connection in a ToolProjectConnectionList attached to - this tool. Required. - :vartype project_connection_id: str + :ivar status: The new lifecycle status. Known values are: "active" and "suspended". + :vartype status: str or ~azure.ai.projects.models.TelephonyBindingStatus + :ivar label: The replacement display label. Omit it to preserve the current value; use null to + clear it. + :vartype label: str + :ivar connection_name: The replacement Foundry connection name. This property is valid only for + a Teams Phone extensibility binding; a Twilio binding's connection is immutable. + :vartype connection_name: str + :ivar phone_number: The replacement Teams Phone extensibility display phone number. Omit it to + preserve the current value; use null to clear it. This property is valid only for a Teams Phone + extensibility binding. + :vartype phone_number: str """ - project_connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A project connection in a ToolProjectConnectionList attached to this tool. Required.""" + status: Optional[Union[str, "_models.TelephonyBindingStatus"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The new lifecycle status. Known values are: \"active\" and \"suspended\".""" + label: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The replacement display label. Omit it to preserve the current value; use null to clear it.""" + connection_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The replacement Foundry connection name. This property is valid only for a Teams Phone + extensibility binding; a Twilio binding's connection is immutable.""" + phone_number: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The replacement Teams Phone extensibility display phone number. Omit it to preserve the current + value; use null to clear it. This property is valid only for a Teams Phone extensibility + binding.""" @overload def __init__( self, *, - project_connection_id: str, + status: Optional[Union[str, "_models.TelephonyBindingStatus"]] = None, + label: Optional[str] = None, + connection_name: Optional[str] = None, + phone_number: Optional[str] = None, ) -> None: ... @overload @@ -26565,33 +33506,23 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ToolSearchToolboxTool( - ToolboxTool, discriminator="toolbox_search" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A toolbox search tool stored in a toolbox. +class UpdateToolboxRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """UpdateToolboxRequest. - :ivar name: Optional user-defined name for this tool or configuration. - :vartype name: str - :ivar description: Optional user-defined description for this tool or configuration. - :vartype description: str - :ivar tool_configs: Per-tool configuration map. Keys are tool names or ``*`` (catch-all - default). Resolution order: exact tool name match takes priority over ``*``. Unknown tool names - are silently ignored at runtime. - :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] - :ivar type: The type of the tool. Always ``toolbox_search``. Required. TOOLBOX_SEARCH. - :vartype type: str or ~azure.ai.projects.models.TOOLBOX_SEARCH + :ivar default_version: The version identifier that the toolbox should point to. When set, the + toolbox's default version will resolve to this version instead of the latest. Required. + :vartype default_version: str """ - type: Literal[ToolboxToolType.TOOLBOX_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the tool. Always ``toolbox_search``. Required. TOOLBOX_SEARCH.""" + default_version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The version identifier that the toolbox should point to. When set, the toolbox's default + version will resolve to this version instead of the latest. Required.""" @overload def __init__( self, *, - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + default_version: str, ) -> None: ... @overload @@ -26603,44 +33534,34 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolboxToolType.TOOLBOX_SEARCH # type: ignore -class ToolSearchToolParam( - Tool, discriminator="tool_search" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Tool search tool. +class UserConversationSimulationAudioEffectsConfiguration( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Configures effects applied to simulated conversation audio. - :ivar type: The type of the tool. Always ``tool_search``. Required. TOOL_SEARCH. - :vartype type: str or ~azure.ai.projects.models.TOOL_SEARCH - :ivar execution: Whether tool search is executed by the server or by the client. Known values - are: "server" and "client". - :vartype execution: str or ~azure.ai.projects.models.ToolSearchExecutionType - :ivar description: - :vartype description: str - :ivar parameters: - :vartype parameters: ~azure.ai.projects.models.EmptyModelParam + :ivar effects: Effects to apply to simulated audio. + :vartype effects: list[str or ~azure.ai.projects.models.UserConversationSimulationAudioEffect] + :ivar volume_percentage: Volume of the configured audio effects, as a percentage from 1 through + 100. When omitted, the service defaults to 15. + :vartype volume_percentage: int """ - type: Literal[ToolType.TOOL_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the tool. Always ``tool_search``. Required. TOOL_SEARCH.""" - execution: Optional[Union[str, "_models.ToolSearchExecutionType"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Whether tool search is executed by the server or by the client. Known values are: \"server\" - and \"client\".""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - parameters: Optional["_models.EmptyModelParam"] = rest_field( + effects: Optional[list[Union[str, "_models.UserConversationSimulationAudioEffect"]]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) + """Effects to apply to simulated audio.""" + volume_percentage: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Volume of the configured audio effects, as a percentage from 1 through 100. When omitted, the + service defaults to 15.""" @overload def __init__( self, *, - execution: Optional[Union[str, "_models.ToolSearchExecutionType"]] = None, - description: Optional[str] = None, - parameters: Optional["_models.EmptyModelParam"] = None, + effects: Optional[list[Union[str, "_models.UserConversationSimulationAudioEffect"]]] = None, + volume_percentage: Optional[int] = None, ) -> None: ... @overload @@ -26652,41 +33573,58 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.TOOL_SEARCH # type: ignore -class ToolUseFineTuningDataGenerationJobConfiguration( - DataGenerationJobConfiguration, discriminator="tool_use" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The configuration for a data generation job with ToolUse type. This is a preview feature used - only for fine-tuning scenarios. +class UserConversationSimulationConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Configures the number, length, audio effects, and simulated user behavior of conversations. - :ivar train_split: The proportion of the generated data to be used for training when the data - is used for fine-tuning. The rest will be used for validation. Value should be between 0 and 1. - :vartype train_split: float - :ivar model_options: The LLM model options. - :vartype model_options: ~azure.ai.projects.models.DataGenerationModelOptions - :ivar type: The data generation job type, which is ToolUse for this model. Required. Tool - calling conversation between user and agent. - :vartype type: str or ~azure.ai.projects.models.TOOL_USE - :ivar max_samples: Maximum number of samples to generate, up to service-defined limits. - Required. - :vartype max_samples: int + :ivar max_num_turns: Hard limit on turns in each conversation. When omitted, the service + defaults to 20. + :vartype max_num_turns: int + :ivar conversation_repetitions: Number of independent conversation repetitions for each test + case. Defaults to 1 when not specified at either the data-source or test-case level. + :vartype conversation_repetitions: int + :ivar desired_num_turns: Target number of turns in each conversation. The effective value + cannot exceed the effective ``max_num_turns``. When omitted, no target is set and the + simulation model determines the conversation length dynamically from the scenario. + :vartype desired_num_turns: int + :ivar audio_effects: Audio effects applied to voice conversation simulations. This property is + ignored for text-only simulations. + :vartype audio_effects: + ~azure.ai.projects.models.UserConversationSimulationAudioEffectsConfiguration + :ivar user_behavior: Conversation behavior of the simulated user. + :vartype user_behavior: + ~azure.ai.projects.models.UserConversationSimulationUserBehaviorConfiguration """ - type: Literal[DataGenerationJobType.TOOL_USE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The data generation job type, which is ToolUse for this model. Required. Tool calling - conversation between user and agent.""" - max_samples: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Maximum number of samples to generate, up to service-defined limits. Required.""" + max_num_turns: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Hard limit on turns in each conversation. When omitted, the service defaults to 20.""" + conversation_repetitions: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Number of independent conversation repetitions for each test case. Defaults to 1 when not + specified at either the data-source or test-case level.""" + desired_num_turns: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Target number of turns in each conversation. The effective value cannot exceed the effective + ``max_num_turns``. When omitted, no target is set and the simulation model determines the + conversation length dynamically from the scenario.""" + audio_effects: Optional["_models.UserConversationSimulationAudioEffectsConfiguration"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Audio effects applied to voice conversation simulations. This property is ignored for text-only + simulations.""" + user_behavior: Optional["_models.UserConversationSimulationUserBehaviorConfiguration"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Conversation behavior of the simulated user.""" @overload def __init__( self, *, - max_samples: int, - train_split: Optional[float] = None, - model_options: Optional["_models.DataGenerationModelOptions"] = None, + max_num_turns: Optional[int] = None, + conversation_repetitions: Optional[int] = None, + desired_num_turns: Optional[int] = None, + audio_effects: Optional["_models.UserConversationSimulationAudioEffectsConfiguration"] = None, + user_behavior: Optional["_models.UserConversationSimulationUserBehaviorConfiguration"] = None, ) -> None: ... @overload @@ -26698,48 +33636,29 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = DataGenerationJobType.TOOL_USE # type: ignore -class TracesDataGenerationJobConfiguration( - DataGenerationJobConfiguration, discriminator="traces" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """The configuration for a data generation job with Traces type. +class UserConversationSimulationInterruptionConfiguration( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Configuration for simulated user interruption behavior. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + UserConversationSimulationDefaultInterruptionConfiguration - :ivar train_split: The proportion of the generated data to be used for training when the data - is used for fine-tuning. The rest will be used for validation. Value should be between 0 and 1. - :vartype train_split: float - :ivar model_options: The LLM model options. - :vartype model_options: ~azure.ai.projects.models.DataGenerationModelOptions - :ivar type: The data generation job type, which is Traces for this model. Required. Single turn - query and response from agent traces. - :vartype type: str or ~azure.ai.projects.models.TRACES - :ivar max_samples: Maximum number of samples to generate, up to service-defined limits. If - omitted, sampling is turned off. - :vartype max_samples: int - :ivar redact_private_content: Whether to redact private content from traces. When omitted or - set to true, private content is redacted. Set to false to opt out of redaction. - :vartype redact_private_content: bool + :ivar type: The interruption type. Required. Default value is None. + :vartype type: str """ - type: Literal[DataGenerationJobType.TRACES] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The data generation job type, which is Traces for this model. Required. Single turn query and - response from agent traces.""" - max_samples: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Maximum number of samples to generate, up to service-defined limits. If omitted, sampling is - turned off.""" - redact_private_content: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether to redact private content from traces. When omitted or set to true, private content is - redacted. Set to false to opt out of redaction.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """The interruption type. Required. Default value is None.""" @overload def __init__( self, *, - train_split: Optional[float] = None, - model_options: Optional["_models.DataGenerationModelOptions"] = None, - max_samples: Optional[int] = None, - redact_private_content: Optional[bool] = None, + type: str, ) -> None: ... @overload @@ -26751,73 +33670,23 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = DataGenerationJobType.TRACES # type: ignore -class TracesDataGenerationJobSource( - DataGenerationJobSource, discriminator="traces" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Traces source for data generation jobs — conversation traces from Application Insights. +class UserConversationSimulationDefaultInterruptionConfiguration( + UserConversationSimulationInterruptionConfiguration, discriminator="default" +): # pylint: disable=name-too-long + """Configures the default interruption behavior for the simulated user. - :ivar description: Optional description of what this source represents — helps the pipeline - interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core - capabilities'). - :vartype description: str - :ivar type: The source type for this source, which is Traces. Required. Traces source — - conversation traces from Application Insights. - :vartype type: str or ~azure.ai.projects.models.TRACES - :ivar agent_id: The unique agent ID used to filter traces. Provide either ``agent_id`` or - ``agent_name`` — at least one is required. - :vartype agent_id: str - :ivar agent_name: The agent name to fetch traces for. Provide either ``agent_id`` or - ``agent_name`` — at least one is required. - :vartype agent_name: str - :ivar agent_version: The agent version. If not specified, traces for ALL versions of the agent - are included within the time window. - :vartype agent_version: str - :ivar start_time: Start of the time window (Unix timestamp in seconds) for fetching traces. - Required. - :vartype start_time: ~datetime.datetime - :ivar end_time: End of the time window (Unix timestamp in seconds). Defaults to current time. - :vartype end_time: ~datetime.datetime - :ivar trace_ids: Optional explicit list of trace IDs to include. - :vartype trace_ids: list[str] + :ivar type: The interruption type, always ``default``. Required. Default value is "default". + :vartype type: str """ - type: Literal[DataGenerationJobSourceType.TRACES] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The source type for this source, which is Traces. Required. Traces source — conversation traces - from Application Insights.""" - agent_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique agent ID used to filter traces. Provide either ``agent_id`` or ``agent_name`` — at - least one is required.""" - agent_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The agent name to fetch traces for. Provide either ``agent_id`` or ``agent_name`` — at least - one is required.""" - agent_version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The agent version. If not specified, traces for ALL versions of the agent are included within - the time window.""" - start_time: datetime.datetime = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """Start of the time window (Unix timestamp in seconds) for fetching traces. Required.""" - end_time: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """End of the time window (Unix timestamp in seconds). Defaults to current time.""" - trace_ids: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional explicit list of trace IDs to include.""" + type: Literal["default"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The interruption type, always ``default``. Required. Default value is \"default\".""" @overload def __init__( self, - *, - start_time: datetime.datetime, - description: Optional[str] = None, - agent_id: Optional[str] = None, - agent_name: Optional[str] = None, - agent_version: Optional[str] = None, - end_time: Optional[datetime.datetime] = None, - trace_ids: Optional[list[str]] = None, ) -> None: ... @overload @@ -26829,71 +33698,50 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = DataGenerationJobSourceType.TRACES # type: ignore + self.type = "default" # type: ignore -class TracesEvaluatorGenerationJobSource( - EvaluatorGenerationJobSource, discriminator="traces" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Traces source for evaluator generation jobs — conversation traces from Application Insights. +class UserConversationSimulationTestCase(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Defines one test scenario. Simulation configuration properties specified here override the + corresponding data-source defaults. - :ivar description: Optional description of what this source represents — helps the pipeline - interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core - capabilities'). - :vartype description: str - :ivar type: The source type for this source, which is Traces. Required. Traces source — - conversation traces from Application Insights. - :vartype type: str or ~azure.ai.projects.models.TRACES - :ivar agent_id: The unique agent ID used to filter traces. Provide either ``agent_id`` or - ``agent_name`` — at least one is required. - :vartype agent_id: str - :ivar agent_name: The agent name to fetch traces for. Provide either ``agent_id`` or - ``agent_name`` — at least one is required. - :vartype agent_name: str - :ivar agent_version: The agent version. If not specified, traces for ALL versions of the agent - are included within the time window. - :vartype agent_version: str - :ivar start_time: Start of the time window (Unix timestamp in seconds) for fetching traces. - Required. - :vartype start_time: ~datetime.datetime - :ivar end_time: End of the time window (Unix timestamp in seconds). Defaults to current time. - :vartype end_time: ~datetime.datetime + :ivar test_case_id: Identifier for the test case. When omitted, the service generates a random + identifier. + :vartype test_case_id: str + :ivar test_case_category: Category used to group related test cases. When omitted, the service + leaves the category null. + :vartype test_case_category: str + :ivar test_case_description: Scenario, simulated user goal, and behavioral constraints that + guide the conversation. The length must be from 1 through 2,500 characters. + :vartype test_case_description: str + :ivar simulation_configuration: Configuration for conversations generated from this test case. + Each specified property overrides the corresponding property in + ``default_simulation_configuration``. + :vartype simulation_configuration: + ~azure.ai.projects.models.UserConversationSimulationConfiguration """ - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional description of what this source represents — helps the pipeline interpret its content - (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities').""" - type: Literal[EvaluatorGenerationJobSourceType.TRACES] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The source type for this source, which is Traces. Required. Traces source — conversation traces - from Application Insights.""" - agent_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique agent ID used to filter traces. Provide either ``agent_id`` or ``agent_name`` — at - least one is required.""" - agent_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The agent name to fetch traces for. Provide either ``agent_id`` or ``agent_name`` — at least - one is required.""" - agent_version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The agent version. If not specified, traces for ALL versions of the agent are included within - the time window.""" - start_time: datetime.datetime = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """Start of the time window (Unix timestamp in seconds) for fetching traces. Required.""" - end_time: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + test_case_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Identifier for the test case. When omitted, the service generates a random identifier.""" + test_case_category: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Category used to group related test cases. When omitted, the service leaves the category null.""" + test_case_description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Scenario, simulated user goal, and behavioral constraints that guide the conversation. The + length must be from 1 through 2,500 characters.""" + simulation_configuration: Optional["_models.UserConversationSimulationConfiguration"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """End of the time window (Unix timestamp in seconds). Defaults to current time.""" + """Configuration for conversations generated from this test case. Each specified property + overrides the corresponding property in ``default_simulation_configuration``.""" @overload def __init__( self, *, - start_time: datetime.datetime, - description: Optional[str] = None, - agent_id: Optional[str] = None, - agent_name: Optional[str] = None, - agent_version: Optional[str] = None, - end_time: Optional[datetime.datetime] = None, + test_case_id: Optional[str] = None, + test_case_category: Optional[str] = None, + test_case_description: Optional[str] = None, + simulation_configuration: Optional["_models.UserConversationSimulationConfiguration"] = None, ) -> None: ... @overload @@ -26905,24 +33753,30 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = EvaluatorGenerationJobSourceType.TRACES # type: ignore -class TranscriptionLanguage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A language detected in transcribed audio. +class UserConversationSimulationUserBehaviorConfiguration( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Configures conversation behavior for the simulated user. - :ivar code: The code of a language detected in the audio. Required. - :vartype code: str + :ivar interruption: Configures how the simulated user interrupts the target while it is + speaking. Omit to disable interruption. + :vartype interruption: + ~azure.ai.projects.models.UserConversationSimulationInterruptionConfiguration """ - code: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The code of a language detected in the audio. Required.""" + interruption: Optional["_models.UserConversationSimulationInterruptionConfiguration"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Configures how the simulated user interrupts the target while it is speaking. Omit to disable + interruption.""" @overload def __init__( self, *, - code: str, + interruption: Optional["_models.UserConversationSimulationInterruptionConfiguration"] = None, ) -> None: ... @overload @@ -26936,30 +33790,37 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class TranscriptTextUsageDuration( - CreateTranscriptionResponseJsonUsage, discriminator="duration" +class UserProfileMemoryItem( + MemoryItem, discriminator="user_profile" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Duration Usage. + """A memory item specifically containing user profile information extracted from conversations, + such as preferences, interests, and personal details. - :ivar type: The type of the usage object. Always ``duration`` for this variant. Required. - DURATION. - :vartype type: str or ~azure.ai.projects.models.DURATION - :ivar seconds: Duration of the input audio in seconds. Required. - :vartype seconds: ~datetime.timedelta + :ivar memory_id: The unique ID of the memory item. Required. + :vartype memory_id: str + :ivar updated_at: The last update time of the memory item. Required. + :vartype updated_at: ~datetime.datetime + :ivar scope: The namespace that logically groups and isolates memories, such as a user ID. + Required. + :vartype scope: str + :ivar content: The content of the memory. Required. + :vartype content: str + :ivar kind: The kind of the memory item. Required. User profile information extracted from + conversations. + :vartype kind: str or ~azure.ai.projects.models.USER_PROFILE """ - type: Literal[CreateTranscriptionResponseJsonUsageType.DURATION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the usage object. Always ``duration`` for this variant. Required. DURATION.""" - seconds: datetime.timedelta = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="duration-seconds-int" - ) - """Duration of the input audio in seconds. Required.""" + kind: Literal[MemoryItemKind.USER_PROFILE] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The kind of the memory item. Required. User profile information extracted from conversations.""" @overload def __init__( self, *, - seconds: datetime.timedelta, + memory_id: str, + updated_at: datetime.datetime, + scope: str, + content: str, ) -> None: ... @overload @@ -26971,48 +33832,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = CreateTranscriptionResponseJsonUsageType.DURATION # type: ignore + self.kind = MemoryItemKind.USER_PROFILE # type: ignore -class TranscriptTextUsageTokens( - CreateTranscriptionResponseJsonUsage, discriminator="tokens" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Token Usage. +class VersionIndicator(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Version indicator determining which agent version backs the session. - :ivar type: The type of the usage object. Always ``tokens`` for this variant. Required. TOKENS. - :vartype type: str or ~azure.ai.projects.models.TOKENS - :ivar input_tokens: Number of input tokens billed for this request. Required. - :vartype input_tokens: int - :ivar input_token_details: Details about the input tokens billed for this request. - :vartype input_token_details: - ~azure.ai.projects.models.TranscriptTextUsageTokensInputTokenDetails - :ivar output_tokens: Number of output tokens generated. Required. - :vartype output_tokens: int - :ivar total_tokens: Total number of tokens used (input + output). Required. - :vartype total_tokens: int + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + VersionRefIndicator + + :ivar type: The type of version indicator. Required. "version_ref" + :vartype type: str or ~azure.ai.projects.models.VersionIndicatorType """ - type: Literal[CreateTranscriptionResponseJsonUsageType.TOKENS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the usage object. Always ``tokens`` for this variant. Required. TOKENS.""" - input_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Number of input tokens billed for this request. Required.""" - input_token_details: Optional["_models.TranscriptTextUsageTokensInputTokenDetails"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Details about the input tokens billed for this request.""" - output_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Number of output tokens generated. Required.""" - total_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Total number of tokens used (input + output). Required.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """The type of version indicator. Required. \"version_ref\"""" @overload def __init__( self, *, - input_tokens: int, - output_tokens: int, - total_tokens: int, - input_token_details: Optional["_models.TranscriptTextUsageTokensInputTokenDetails"] = None, + type: str, ) -> None: ... @overload @@ -27024,29 +33865,30 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = CreateTranscriptionResponseJsonUsageType.TOKENS # type: ignore -class TranscriptTextUsageTokensInputTokenDetails( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """TranscriptTextUsageTokensInputTokenDetails. +class VersionRefIndicator( + VersionIndicator, discriminator="version_ref" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Version indicator that references a specific agent version by name. - :ivar text_tokens: - :vartype text_tokens: int - :ivar audio_tokens: - :vartype audio_tokens: int + :ivar type: Discriminator value for version_ref. Required. Direct reference to a specific agent + version. + :vartype type: str or ~azure.ai.projects.models.VERSION_REF + :ivar agent_version: The agent version identifier returned by the agent version APIs. Required. + :vartype agent_version: str """ - text_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - audio_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[VersionIndicatorType.VERSION_REF] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Discriminator value for version_ref. Required. Direct reference to a specific agent version.""" + agent_version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The agent version identifier returned by the agent version APIs. Required.""" @overload def __init__( self, *, - text_tokens: Optional[int] = None, - audio_tokens: Optional[int] = None, + agent_version: str, ) -> None: ... @overload @@ -27058,45 +33900,26 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = VersionIndicatorType.VERSION_REF # type: ignore -class TwilioTelephonyBinding( - TelephonyBinding, discriminator="twilio" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A Twilio binding owned by a voice agent. +class VersionSelector(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """VersionSelector. - :ivar id: The service-generated binding identifier. Required. - :vartype id: str - :ivar connection_name: The Foundry connection name for the telephony provider. Required. - :vartype connection_name: str - :ivar label: The optional display label for the binding. - :vartype label: str - :ivar status: The lifecycle status. Required. Known values are: "active" and "suspended". - :vartype status: str or ~azure.ai.projects.models.TelephonyBindingStatus - :ivar incoming_call_url: The service-generated webhook URL to configure with the telephony - provider. Required. - :vartype incoming_call_url: str - :ivar provider: The Twilio provider. Required. Twilio Programmable Voice. - :vartype provider: str or ~azure.ai.projects.models.TWILIO - :ivar phone_number: The Twilio E.164 phone number. Required. - :vartype phone_number: str + :ivar version_selection_rules: Required. + :vartype version_selection_rules: list[~azure.ai.projects.models.VersionSelectionRule] """ - provider: Literal[TelephonyProvider.TWILIO] = rest_discriminator(name="provider", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The Twilio provider. Required. Twilio Programmable Voice.""" - phone_number: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The Twilio E.164 phone number. Required.""" + version_selection_rules: list["_models.VersionSelectionRule"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required.""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - connection_name: str, - status: Union[str, "_models.TelephonyBindingStatus"], - incoming_call_url: str, - phone_number: str, - label: Optional[str] = None, + version_selection_rules: list["_models.VersionSelectionRule"], ) -> None: ... @overload @@ -27108,49 +33931,30 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.provider = TelephonyProvider.TWILIO # type: ignore -class TwilioTelephonyBindingListItem( - TelephonyBindingListItem, discriminator="twilio" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A Twilio binding returned in a list, including its entity tag. +class VoiceAgentAnimationConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Animation settings for a voice-agent session. - :ivar id: The service-generated binding identifier. Required. - :vartype id: str - :ivar connection_name: The Foundry connection name for the telephony provider. Required. - :vartype connection_name: str - :ivar label: The optional display label for the binding. - :vartype label: str - :ivar status: The lifecycle status. Required. Known values are: "active" and "suspended". - :vartype status: str or ~azure.ai.projects.models.TelephonyBindingStatus - :ivar incoming_call_url: The service-generated webhook URL to configure with the telephony - provider. Required. - :vartype incoming_call_url: str - :ivar etag: The entity tag to send in the ``If-Match`` header when updating or deleting this - binding. Required. - :vartype etag: str - :ivar provider: The Twilio provider. Required. Twilio Programmable Voice. - :vartype provider: str or ~azure.ai.projects.models.TWILIO - :ivar phone_number: The Twilio E.164 phone number. Required. - :vartype phone_number: str + :ivar model_name: The animation model name. + :vartype model_name: str + :ivar outputs: The requested animation output kinds. + :vartype outputs: list[str or ~azure.ai.projects.models.VoiceAgentAnimationOutputType] """ - provider: Literal[TelephonyProvider.TWILIO] = rest_discriminator(name="provider", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The Twilio provider. Required. Twilio Programmable Voice.""" - phone_number: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The Twilio E.164 phone number. Required.""" + model_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The animation model name.""" + outputs: Optional[list[Union[str, "_models.VoiceAgentAnimationOutputType"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The requested animation output kinds.""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - connection_name: str, - status: Union[str, "_models.TelephonyBindingStatus"], - incoming_call_url: str, - phone_number: str, - label: Optional[str] = None, + model_name: Optional[str] = None, + outputs: Optional[list[Union[str, "_models.VoiceAgentAnimationOutputType"]]] = None, ) -> None: ... @overload @@ -27162,29 +33966,33 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.provider = TelephonyProvider.TWILIO # type: ignore -class UpdateModelVersionRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Request body for updating a model version. Only description and tags can be modified. +class VoiceAgentAudioConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The audio configuration for a voice agent. These values are session defaults and may be + overridden when connecting. - :ivar description: The asset description text. - :vartype description: str - :ivar tags: Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] + :ivar input: Input (microphone) audio configuration. + :vartype input: ~azure.ai.projects.models.VoiceAgentAudioInputConfig + :ivar output: Output (agent speech) audio configuration. + :vartype output: ~azure.ai.projects.models.VoiceAgentAudioOutputConfig """ - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The asset description text.""" - tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Tag dictionary. Tags can be added, removed, and updated.""" + input: Optional["_models.VoiceAgentAudioInputConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Input (microphone) audio configuration.""" + output: Optional["_models.VoiceAgentAudioOutputConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Output (agent speech) audio configuration.""" @overload def __init__( self, *, - description: Optional[str] = None, - tags: Optional[dict[str, str]] = None, + input: Optional["_models.VoiceAgentAudioInputConfig"] = None, + output: Optional["_models.VoiceAgentAudioOutputConfig"] = None, ) -> None: ... @overload @@ -27198,46 +34006,54 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class UpdateTelephonyBindingRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The request to update an existing telephony binding. Every property is optional and the - binding's provider is immutable. +class VoiceAgentAudioInputConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Input audio configuration for a voice agent. - :ivar status: The new lifecycle status. Known values are: "active" and "suspended". - :vartype status: str or ~azure.ai.projects.models.TelephonyBindingStatus - :ivar label: The replacement display label. Omit it to preserve the current value; use null to - clear it. - :vartype label: str - :ivar connection_name: The replacement Foundry connection name. This property is valid only for - a Teams Phone extensibility binding; a Twilio binding's connection is immutable. - :vartype connection_name: str - :ivar phone_number: The replacement Teams Phone extensibility display phone number. Omit it to - preserve the current value; use null to clear it. This property is valid only for a Teams Phone - extensibility binding. - :vartype phone_number: str + :ivar format: The input audio format. + :vartype format: ~azure.ai.projects.models.RealtimeAudioFormats + :ivar noise_reduction: Input noise reduction. Set to null to disable. + :vartype noise_reduction: ~azure.ai.projects.models.VoiceAgentNoiseReduction + :ivar turn_detection: Turn (end-of-speech) detection. Server-side turn detection is enabled by + default; set to null to disable it, in which case the client must trigger responses manually. + :vartype turn_detection: ~azure.ai.projects.models.VoiceAgentTurnDetectionConfig + :ivar echo_cancellation: Optional server-side echo cancellation settings. + :vartype echo_cancellation: ~azure.ai.projects.models.VoiceAgentEchoCancellation + :ivar transcription: Asynchronous input-audio transcription. Set to null to disable + transcription. + :vartype transcription: ~azure.ai.projects.models.VoiceAgentInputTranscription """ - status: Optional[Union[str, "_models.TelephonyBindingStatus"]] = rest_field( + format: Optional["_models.RealtimeAudioFormats"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The new lifecycle status. Known values are: \"active\" and \"suspended\".""" - label: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The replacement display label. Omit it to preserve the current value; use null to clear it.""" - connection_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The replacement Foundry connection name. This property is valid only for a Teams Phone - extensibility binding; a Twilio binding's connection is immutable.""" - phone_number: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The replacement Teams Phone extensibility display phone number. Omit it to preserve the current - value; use null to clear it. This property is valid only for a Teams Phone extensibility - binding.""" + """The input audio format.""" + noise_reduction: Optional["_models.VoiceAgentNoiseReduction"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Input noise reduction. Set to null to disable.""" + turn_detection: Optional["_models.VoiceAgentTurnDetectionConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Turn (end-of-speech) detection. Server-side turn detection is enabled by default; set to null + to disable it, in which case the client must trigger responses manually.""" + echo_cancellation: Optional["_models.VoiceAgentEchoCancellation"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Optional server-side echo cancellation settings.""" + transcription: Optional["_models.VoiceAgentInputTranscription"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Asynchronous input-audio transcription. Set to null to disable transcription.""" @overload def __init__( self, *, - status: Optional[Union[str, "_models.TelephonyBindingStatus"]] = None, - label: Optional[str] = None, - connection_name: Optional[str] = None, - phone_number: Optional[str] = None, + format: Optional["_models.RealtimeAudioFormats"] = None, + noise_reduction: Optional["_models.VoiceAgentNoiseReduction"] = None, + turn_detection: Optional["_models.VoiceAgentTurnDetectionConfig"] = None, + echo_cancellation: Optional["_models.VoiceAgentEchoCancellation"] = None, + transcription: Optional["_models.VoiceAgentInputTranscription"] = None, ) -> None: ... @overload @@ -27251,23 +34067,139 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class UpdateToolboxRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """UpdateToolboxRequest. +class VoiceAgentAudioOutputConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Output audio configuration for a voice agent. + Provider-specific fields are selected by ``voice_type``: + + * `openai`: `voice` and `speed`. + * `azure-standard`: `voice`, `voice_locale`, `speed`, `voice_temperature`, `custom_lexicon_url`, + `custom_text_normalization_url`, `prefer_locales`, `style`, `pitch`, and `volume`. + * `azure-custom`: all `azure-standard` fields except `style`, plus `custom_voice_endpoint_id`. + * `azure-personal`: all `azure-standard` fields except `style`, plus `personal_voice_model`. + * `avatar-voice-sync`: all `azure-standard` fields except `voice` and `style`, plus `personal_voice_model`; the + voice name is derived from the avatar. + * `azure-realtime-native`: `voice` and `speed`. `format` and `output_audio_timestamp_types` apply to every voice + type. - :ivar default_version: The version identifier that the toolbox should point to. When set, the - toolbox's default version will resolve to this version instead of the latest. Required. - :vartype default_version: str + :ivar format: The output audio format. Applies to every ``voice_type`` and defaults to 24 kHz + PCM. + :vartype format: ~azure.ai.projects.models.RealtimeAudioFormats + :ivar voice: The voice name or identifier. Applies to ``openai``, ``azure-standard``, + ``azure-custom``, ``azure-personal``, and ``azure-realtime-native``. It does not apply to + ``avatar-voice-sync``, which derives the voice name from the avatar. + :vartype voice: str + :ivar voice_type: The voice implementation. Known values are: "openai", "azure-standard", + "azure-custom", "azure-personal", "avatar-voice-sync", and "azure-realtime-native". + :vartype voice_type: str or ~azure.ai.projects.models.VoiceType + :ivar voice_locale: The enforced BCP-47 output locale. Applies to ``azure-standard``, + ``azure-custom``, ``azure-personal``, and ``avatar-voice-sync``. + :vartype voice_locale: str + :ivar speed: The numeric output speed multiplier. Applies to all known ``voice_type`` values + and defaults to 1. + :vartype speed: float + :ivar voice_temperature: The voice variation temperature. Applies to ``azure-standard``, + ``azure-custom``, ``azure-personal``, and ``avatar-voice-sync``. + :vartype voice_temperature: float + :ivar custom_lexicon_url: The URL of a custom pronunciation lexicon. Applies to + ``azure-standard``, ``azure-custom``, ``azure-personal``, and ``avatar-voice-sync``. + :vartype custom_lexicon_url: str + :ivar custom_text_normalization_url: The URL of a custom text-normalization configuration. + Applies to ``azure-standard``, ``azure-custom``, ``azure-personal``, and ``avatar-voice-sync``. + :vartype custom_text_normalization_url: str + :ivar prefer_locales: Preferred BCP-47 locales for multilingual synthesis. Applies to + ``azure-standard``, ``azure-custom``, ``azure-personal``, and ``avatar-voice-sync``. + :vartype prefer_locales: list[str] + :ivar style: The voice speaking style. Applies only when ``voice_type`` is ``azure-standard``. + :vartype style: str + :ivar pitch: The voice pitch adjustment. Applies to ``azure-standard``, ``azure-custom``, + ``azure-personal``, and ``avatar-voice-sync``. + :vartype pitch: str + :ivar volume: The voice volume adjustment. Applies to ``azure-standard``, ``azure-custom``, + ``azure-personal``, and ``avatar-voice-sync``. + :vartype volume: str + :ivar custom_voice_endpoint_id: The Azure custom-voice deployment endpoint identifier. Applies + only when ``voice_type`` is ``azure-custom``. + :vartype custom_voice_endpoint_id: str + :ivar personal_voice_model: The Azure personal or avatar voice model. Applies only when + ``voice_type`` is ``azure-personal`` or ``avatar-voice-sync``. + :vartype personal_voice_model: str + :ivar output_audio_timestamp_types: Timestamp kinds to include with output audio. Applies to + every ``voice_type``. + :vartype output_audio_timestamp_types: list[str or + ~azure.ai.projects.models.VoiceAgentAudioTimestampType] """ - default_version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The version identifier that the toolbox should point to. When set, the toolbox's default - version will resolve to this version instead of the latest. Required.""" + format: Optional["_models.RealtimeAudioFormats"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The output audio format. Applies to every ``voice_type`` and defaults to 24 kHz PCM.""" + voice: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The voice name or identifier. Applies to ``openai``, ``azure-standard``, ``azure-custom``, + ``azure-personal``, and ``azure-realtime-native``. It does not apply to ``avatar-voice-sync``, + which derives the voice name from the avatar.""" + voice_type: Optional[Union[str, "_models.VoiceType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The voice implementation. Known values are: \"openai\", \"azure-standard\", \"azure-custom\", + \"azure-personal\", \"avatar-voice-sync\", and \"azure-realtime-native\".""" + voice_locale: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The enforced BCP-47 output locale. Applies to ``azure-standard``, ``azure-custom``, + ``azure-personal``, and ``avatar-voice-sync``.""" + speed: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The numeric output speed multiplier. Applies to all known ``voice_type`` values and defaults to + 1.""" + voice_temperature: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The voice variation temperature. Applies to ``azure-standard``, ``azure-custom``, + ``azure-personal``, and ``avatar-voice-sync``.""" + custom_lexicon_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The URL of a custom pronunciation lexicon. Applies to ``azure-standard``, ``azure-custom``, + ``azure-personal``, and ``avatar-voice-sync``.""" + custom_text_normalization_url: Optional[str] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The URL of a custom text-normalization configuration. Applies to ``azure-standard``, + ``azure-custom``, ``azure-personal``, and ``avatar-voice-sync``.""" + prefer_locales: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Preferred BCP-47 locales for multilingual synthesis. Applies to ``azure-standard``, + ``azure-custom``, ``azure-personal``, and ``avatar-voice-sync``.""" + style: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The voice speaking style. Applies only when ``voice_type`` is ``azure-standard``.""" + pitch: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The voice pitch adjustment. Applies to ``azure-standard``, ``azure-custom``, + ``azure-personal``, and ``avatar-voice-sync``.""" + volume: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The voice volume adjustment. Applies to ``azure-standard``, ``azure-custom``, + ``azure-personal``, and ``avatar-voice-sync``.""" + custom_voice_endpoint_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Azure custom-voice deployment endpoint identifier. Applies only when ``voice_type`` is + ``azure-custom``.""" + personal_voice_model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Azure personal or avatar voice model. Applies only when ``voice_type`` is + ``azure-personal`` or ``avatar-voice-sync``.""" + output_audio_timestamp_types: Optional[list[Union[str, "_models.VoiceAgentAudioTimestampType"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Timestamp kinds to include with output audio. Applies to every ``voice_type``.""" @overload def __init__( self, *, - default_version: str, + format: Optional["_models.RealtimeAudioFormats"] = None, + voice: Optional[str] = None, + voice_type: Optional[Union[str, "_models.VoiceType"]] = None, + voice_locale: Optional[str] = None, + speed: Optional[float] = None, + voice_temperature: Optional[float] = None, + custom_lexicon_url: Optional[str] = None, + custom_text_normalization_url: Optional[str] = None, + prefer_locales: Optional[list[str]] = None, + style: Optional[str] = None, + pitch: Optional[str] = None, + volume: Optional[str] = None, + custom_voice_endpoint_id: Optional[str] = None, + personal_voice_model: Optional[str] = None, + output_audio_timestamp_types: Optional[list[Union[str, "_models.VoiceAgentAudioTimestampType"]]] = None, ) -> None: ... @overload @@ -27281,32 +34213,72 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class UserConversationSimulationAudioEffectsConfiguration( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Configures effects applied to simulated conversation audio. +class VoiceAgentAvatarConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Avatar configuration for a voice agent. These values are session defaults and may be overridden + when connecting. - :ivar effects: Effects to apply to simulated audio. - :vartype effects: list[str or ~azure.ai.projects.models.UserConversationSimulationAudioEffect] - :ivar volume_percentage: Volume of the configured audio effects, as a percentage from 1 through - 100. When omitted, the service defaults to 15. - :vartype volume_percentage: int + :ivar type: The avatar type. Required. Known values are: "video_avatar" and "photo_avatar". + :vartype type: str or ~azure.ai.projects.models.VoiceAgentAvatarType + :ivar character: The avatar character identifier, e.g. 'lisa'. Required. + :vartype character: str + :ivar style: The avatar style, e.g. 'casual-sitting'. + :vartype style: str + :ivar customized: Whether the avatar is a customer-customized avatar. Defaults to false. + :vartype customized: bool + :ivar output_protocol: The transport used to deliver the avatar video stream. Known values are: + "webrtc" and "websocket". + :vartype output_protocol: str or ~azure.ai.projects.models.VoiceAgentAvatarOutputProtocol + :ivar model: The avatar model identifier. + :vartype model: str + :ivar video: Avatar video encoder and presentation settings. + :vartype video: ~azure.ai.projects.models.VoiceAgentAvatarVideoParams + :ivar scene: Avatar placement and motion settings. + :vartype scene: ~azure.ai.projects.models.VoiceAgentAvatarScene + :ivar output_audit_audio: Whether audit audio is emitted with avatar output. Defaults to false. + :vartype output_audit_audio: bool """ - effects: Optional[list[Union[str, "_models.UserConversationSimulationAudioEffect"]]] = rest_field( + type: Union[str, "_models.VoiceAgentAvatarType"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Effects to apply to simulated audio.""" - volume_percentage: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Volume of the configured audio effects, as a percentage from 1 through 100. When omitted, the - service defaults to 15.""" + """The avatar type. Required. Known values are: \"video_avatar\" and \"photo_avatar\".""" + character: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The avatar character identifier, e.g. 'lisa'. Required.""" + style: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The avatar style, e.g. 'casual-sitting'.""" + customized: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether the avatar is a customer-customized avatar. Defaults to false.""" + output_protocol: Optional[Union[str, "_models.VoiceAgentAvatarOutputProtocol"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The transport used to deliver the avatar video stream. Known values are: \"webrtc\" and + \"websocket\".""" + model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The avatar model identifier.""" + video: Optional["_models.VoiceAgentAvatarVideoParams"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Avatar video encoder and presentation settings.""" + scene: Optional["_models.VoiceAgentAvatarScene"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Avatar placement and motion settings.""" + output_audit_audio: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether audit audio is emitted with avatar output. Defaults to false.""" @overload def __init__( self, *, - effects: Optional[list[Union[str, "_models.UserConversationSimulationAudioEffect"]]] = None, - volume_percentage: Optional[int] = None, + type: Union[str, "_models.VoiceAgentAvatarType"], + character: str, + style: Optional[str] = None, + customized: Optional[bool] = None, + output_protocol: Optional[Union[str, "_models.VoiceAgentAvatarOutputProtocol"]] = None, + model: Optional[str] = None, + video: Optional["_models.VoiceAgentAvatarVideoParams"] = None, + scene: Optional["_models.VoiceAgentAvatarScene"] = None, + output_audit_audio: Optional[bool] = None, ) -> None: ... @overload @@ -27320,56 +34292,29 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class UserConversationSimulationConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Configures the number, length, audio effects, and simulated user behavior of conversations. +class VoiceAgentAvatarIceServer(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """An ICE server used for avatar WebRTC negotiation. - :ivar max_num_turns: Hard limit on turns in each conversation. When omitted, the service - defaults to 20. - :vartype max_num_turns: int - :ivar conversation_repetitions: Number of independent conversation repetitions for each test - case. Defaults to 1 when not specified at either the data-source or test-case level. - :vartype conversation_repetitions: int - :ivar desired_num_turns: Target number of turns in each conversation. The effective value - cannot exceed the effective ``max_num_turns``. When omitted, no target is set and the - simulation model determines the conversation length dynamically from the scenario. - :vartype desired_num_turns: int - :ivar audio_effects: Audio effects applied to voice conversation simulations. This property is - ignored for text-only simulations. - :vartype audio_effects: - ~azure.ai.projects.models.UserConversationSimulationAudioEffectsConfiguration - :ivar user_behavior: Conversation behavior of the simulated user. - :vartype user_behavior: - ~azure.ai.projects.models.UserConversationSimulationUserBehaviorConfiguration + :ivar urls: Required. + :vartype urls: list[str] + :ivar username: + :vartype username: str + :ivar credential: + :vartype credential: str """ - max_num_turns: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Hard limit on turns in each conversation. When omitted, the service defaults to 20.""" - conversation_repetitions: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Number of independent conversation repetitions for each test case. Defaults to 1 when not - specified at either the data-source or test-case level.""" - desired_num_turns: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Target number of turns in each conversation. The effective value cannot exceed the effective - ``max_num_turns``. When omitted, no target is set and the simulation model determines the - conversation length dynamically from the scenario.""" - audio_effects: Optional["_models.UserConversationSimulationAudioEffectsConfiguration"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Audio effects applied to voice conversation simulations. This property is ignored for text-only - simulations.""" - user_behavior: Optional["_models.UserConversationSimulationUserBehaviorConfiguration"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Conversation behavior of the simulated user.""" + urls: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + username: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + credential: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - max_num_turns: Optional[int] = None, - conversation_repetitions: Optional[int] = None, - desired_num_turns: Optional[int] = None, - audio_effects: Optional["_models.UserConversationSimulationAudioEffectsConfiguration"] = None, - user_behavior: Optional["_models.UserConversationSimulationUserBehaviorConfiguration"] = None, + urls: list[str], + username: Optional[str] = None, + credential: Optional[str] = None, ) -> None: ... @overload @@ -27383,27 +34328,44 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class UserConversationSimulationInterruptionConfiguration( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Configuration for simulated user interruption behavior. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - UserConversationSimulationDefaultInterruptionConfiguration +class VoiceAgentAvatarScene(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Avatar placement and motion settings. - :ivar type: The interruption type. Required. Default value is None. - :vartype type: str + :ivar zoom: + :vartype zoom: float + :ivar position_x: + :vartype position_x: float + :ivar position_y: + :vartype position_y: float + :ivar rotation_x: + :vartype rotation_x: float + :ivar rotation_y: + :vartype rotation_y: float + :ivar rotation_z: + :vartype rotation_z: float + :ivar amplitude: + :vartype amplitude: float """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The interruption type. Required. Default value is None.""" + zoom: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + position_x: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + position_y: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + rotation_x: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + rotation_y: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + rotation_z: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + amplitude: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - type: str, + zoom: Optional[float] = None, + position_x: Optional[float] = None, + position_y: Optional[float] = None, + rotation_x: Optional[float] = None, + rotation_y: Optional[float] = None, + rotation_z: Optional[float] = None, + amplitude: Optional[float] = None, ) -> None: ... @overload @@ -27417,21 +34379,24 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class UserConversationSimulationDefaultInterruptionConfiguration( - UserConversationSimulationInterruptionConfiguration, discriminator="default" -): # pylint: disable=name-too-long - """Configures the default interruption behavior for the simulated user. +class VoiceAgentAvatarVideoBackground(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The avatar video background. - :ivar type: The interruption type, always ``default``. Required. Default value is "default". - :vartype type: str + :ivar image_url: + :vartype image_url: str + :ivar color: + :vartype color: str """ - type: Literal["default"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The interruption type, always ``default``. Required. Default value is \"default\".""" + image_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + color: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, + *, + image_url: Optional[str] = None, + color: Optional[str] = None, ) -> None: ... @overload @@ -27443,50 +34408,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = "default" # type: ignore -class UserConversationSimulationTestCase(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Defines one test scenario. Simulation configuration properties specified here override the - corresponding data-source defaults. +class VoiceAgentAvatarVideoCrop(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The rectangular crop applied to avatar video. - :ivar test_case_id: Identifier for the test case. When omitted, the service generates a random - identifier. - :vartype test_case_id: str - :ivar test_case_category: Category used to group related test cases. When omitted, the service - leaves the category null. - :vartype test_case_category: str - :ivar test_case_description: Scenario, simulated user goal, and behavioral constraints that - guide the conversation. The length must be from 1 through 2,500 characters. - :vartype test_case_description: str - :ivar simulation_configuration: Configuration for conversations generated from this test case. - Each specified property overrides the corresponding property in - ``default_simulation_configuration``. - :vartype simulation_configuration: - ~azure.ai.projects.models.UserConversationSimulationConfiguration + :ivar bottom_right: Required. + :vartype bottom_right: list[int] + :ivar top_left: Required. + :vartype top_left: list[int] """ - test_case_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Identifier for the test case. When omitted, the service generates a random identifier.""" - test_case_category: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Category used to group related test cases. When omitted, the service leaves the category null.""" - test_case_description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Scenario, simulated user goal, and behavioral constraints that guide the conversation. The - length must be from 1 through 2,500 characters.""" - simulation_configuration: Optional["_models.UserConversationSimulationConfiguration"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Configuration for conversations generated from this test case. Each specified property - overrides the corresponding property in ``default_simulation_configuration``.""" + bottom_right: list[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + top_left: list[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - test_case_id: Optional[str] = None, - test_case_category: Optional[str] = None, - test_case_description: Optional[str] = None, - simulation_configuration: Optional["_models.UserConversationSimulationConfiguration"] = None, + bottom_right: list[int], + top_left: list[int], ) -> None: ... @overload @@ -27500,28 +34443,43 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class UserConversationSimulationUserBehaviorConfiguration( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Configures conversation behavior for the simulated user. +class VoiceAgentAvatarVideoParams(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Avatar video encoder and presentation settings. - :ivar interruption: Configures how the simulated user interrupts the target while it is - speaking. Omit to disable interruption. - :vartype interruption: - ~azure.ai.projects.models.UserConversationSimulationInterruptionConfiguration + :ivar bitrate: The target video bitrate in bits per second. + :vartype bitrate: int + :ivar crop: + :vartype crop: ~azure.ai.projects.models.VoiceAgentAvatarVideoCrop + :ivar resolution: + :vartype resolution: ~azure.ai.projects.models.VoiceAgentAvatarVideoResolution + :ivar background: + :vartype background: ~azure.ai.projects.models.VoiceAgentAvatarVideoBackground + :ivar gop_size: + :vartype gop_size: int """ - interruption: Optional["_models.UserConversationSimulationInterruptionConfiguration"] = rest_field( + bitrate: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The target video bitrate in bits per second.""" + crop: Optional["_models.VoiceAgentAvatarVideoCrop"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Configures how the simulated user interrupts the target while it is speaking. Omit to disable - interruption.""" + resolution: Optional["_models.VoiceAgentAvatarVideoResolution"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + background: Optional["_models.VoiceAgentAvatarVideoBackground"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + gop_size: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - interruption: Optional["_models.UserConversationSimulationInterruptionConfiguration"] = None, + bitrate: Optional[int] = None, + crop: Optional["_models.VoiceAgentAvatarVideoCrop"] = None, + resolution: Optional["_models.VoiceAgentAvatarVideoResolution"] = None, + background: Optional["_models.VoiceAgentAvatarVideoBackground"] = None, + gop_size: Optional[int] = None, ) -> None: ... @overload @@ -27535,37 +34493,26 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class UserProfileMemoryItem( - MemoryItem, discriminator="user_profile" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A memory item specifically containing user profile information extracted from conversations, - such as preferences, interests, and personal details. +class VoiceAgentAvatarVideoResolution(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The avatar video resolution. - :ivar memory_id: The unique ID of the memory item. Required. - :vartype memory_id: str - :ivar updated_at: The last update time of the memory item. Required. - :vartype updated_at: ~datetime.datetime - :ivar scope: The namespace that logically groups and isolates memories, such as a user ID. - Required. - :vartype scope: str - :ivar content: The content of the memory. Required. - :vartype content: str - :ivar kind: The kind of the memory item. Required. User profile information extracted from - conversations. - :vartype kind: str or ~azure.ai.projects.models.USER_PROFILE + :ivar width: Required. + :vartype width: int + :ivar height: Required. + :vartype height: int """ - kind: Literal[MemoryItemKind.USER_PROFILE] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The kind of the memory item. Required. User profile information extracted from conversations.""" + width: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + height: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - memory_id: str, - updated_at: datetime.datetime, - scope: str, - content: str, + width: int, + height: int, ) -> None: ... @overload @@ -27577,28 +34524,38 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.kind = MemoryItemKind.USER_PROFILE # type: ignore -class VersionIndicator(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Version indicator determining which agent version backs the session. +class VoiceAgentTurnDetectionConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Turn-detection configuration for a voice agent. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - VersionRefIndicator + VoiceAgentAzureSemanticVadTurnDetection, VoiceAgentAzureSemanticVadEnTurnDetection, + VoiceAgentAzureSemanticVadMultilingualTurnDetection, VoiceAgentSemanticVadTurnDetection, + VoiceAgentServerVadTurnDetection - :ivar type: The type of version indicator. Required. "version_ref" - :vartype type: str or ~azure.ai.projects.models.VersionIndicatorType + :ivar type: The turn-detection strategy. Required. Known values are: "server_vad", + "semantic_vad", "azure_semantic_vad", "azure_semantic_vad_en", and + "azure_semantic_vad_multilingual". + :vartype type: str or ~azure.ai.projects.models.VoiceAgentTurnDetectionType + :ivar auto_truncate: Whether the input audio buffer is truncated automatically when speech + stops. + :vartype auto_truncate: bool """ __mapping__: dict[str, _Model] = {} type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The type of version indicator. Required. \"version_ref\"""" + """The turn-detection strategy. Required. Known values are: \"server_vad\", \"semantic_vad\", + \"azure_semantic_vad\", \"azure_semantic_vad_en\", and \"azure_semantic_vad_multilingual\".""" + auto_truncate: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether the input audio buffer is truncated automatically when speech stops.""" @overload def __init__( self, *, type: str, + auto_truncate: Optional[bool] = None, ) -> None: ... @overload @@ -27612,28 +34569,84 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VersionRefIndicator( - VersionIndicator, discriminator="version_ref" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Version indicator that references a specific agent version by name. +class VoiceAgentAzureSemanticVadEnTurnDetection( + VoiceAgentTurnDetectionConfig, discriminator="azure_semantic_vad_en" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """English-optimized Azure semantic voice activity detection. - :ivar type: Discriminator value for version_ref. Required. Direct reference to a specific agent - version. - :vartype type: str or ~azure.ai.projects.models.VERSION_REF - :ivar agent_version: The agent version identifier returned by the agent version APIs. Required. - :vartype agent_version: str + :ivar auto_truncate: Whether the input audio buffer is truncated automatically when speech + stops. + :vartype auto_truncate: bool + :ivar type: Required. English-optimized Azure semantic voice activity detection. + :vartype type: str or ~azure.ai.projects.models.AZURE_SEMANTIC_VAD_EN + :ivar threshold: Activation threshold for voice activity detection, from 0 to 1. + :vartype threshold: float + :ivar prefix_padding_ms: Audio to include before detected speech, in milliseconds. + :vartype prefix_padding_ms: ~datetime.timedelta + :ivar silence_duration_ms: Silence required to end speech detection, in milliseconds. + :vartype silence_duration_ms: ~datetime.timedelta + :ivar idle_timeout_ms: Maximum idle time before the detector ends the turn, in milliseconds. + :vartype idle_timeout_ms: ~datetime.timedelta + :ivar end_of_utterance_detection: Semantic end-of-utterance detection configuration. Set to + null to disable it. + :vartype end_of_utterance_detection: + ~azure.ai.projects.models.VoiceAgentEndOfUtteranceDetection + :ivar speech_duration_ms: Minimum speech duration required to trigger detection, in + milliseconds. + :vartype speech_duration_ms: ~datetime.timedelta + :ivar remove_filler_words: Whether filler words are removed from transcription. + :vartype remove_filler_words: bool + :ivar create_response: Whether a response is created automatically when speech stops. + :vartype create_response: bool + :ivar interrupt_response: Whether user speech may interrupt the agent's response. + :vartype interrupt_response: bool """ - type: Literal[VersionIndicatorType.VERSION_REF] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Discriminator value for version_ref. Required. Direct reference to a specific agent version.""" - agent_version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The agent version identifier returned by the agent version APIs. Required.""" + type: Literal[VoiceAgentTurnDetectionType.AZURE_SEMANTIC_VAD_EN] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. English-optimized Azure semantic voice activity detection.""" + threshold: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Activation threshold for voice activity detection, from 0 to 1.""" + prefix_padding_ms: Optional[datetime.timedelta] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) + """Audio to include before detected speech, in milliseconds.""" + silence_duration_ms: Optional[datetime.timedelta] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) + """Silence required to end speech detection, in milliseconds.""" + idle_timeout_ms: Optional[datetime.timedelta] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) + """Maximum idle time before the detector ends the turn, in milliseconds.""" + end_of_utterance_detection: Optional["_models.VoiceAgentEndOfUtteranceDetection"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Semantic end-of-utterance detection configuration. Set to null to disable it.""" + speech_duration_ms: Optional[datetime.timedelta] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) + """Minimum speech duration required to trigger detection, in milliseconds.""" + remove_filler_words: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether filler words are removed from transcription.""" + create_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether a response is created automatically when speech stops.""" + interrupt_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether user speech may interrupt the agent's response.""" @overload def __init__( self, *, - agent_version: str, + auto_truncate: Optional[bool] = None, + threshold: Optional[float] = None, + prefix_padding_ms: Optional[datetime.timedelta] = None, + silence_duration_ms: Optional[datetime.timedelta] = None, + idle_timeout_ms: Optional[datetime.timedelta] = None, + end_of_utterance_detection: Optional["_models.VoiceAgentEndOfUtteranceDetection"] = None, + speech_duration_ms: Optional[datetime.timedelta] = None, + remove_filler_words: Optional[bool] = None, + create_response: Optional[bool] = None, + interrupt_response: Optional[bool] = None, ) -> None: ... @overload @@ -27645,26 +34658,92 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = VersionIndicatorType.VERSION_REF # type: ignore + self.type = VoiceAgentTurnDetectionType.AZURE_SEMANTIC_VAD_EN # type: ignore -class VersionSelector(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """VersionSelector. +class VoiceAgentAzureSemanticVadMultilingualTurnDetection( + VoiceAgentTurnDetectionConfig, discriminator="azure_semantic_vad_multilingual" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Multilingual Azure semantic voice activity detection. - :ivar version_selection_rules: Required. - :vartype version_selection_rules: list[~azure.ai.projects.models.VersionSelectionRule] + :ivar auto_truncate: Whether the input audio buffer is truncated automatically when speech + stops. + :vartype auto_truncate: bool + :ivar type: Required. Multilingual Azure semantic voice activity detection. + :vartype type: str or ~azure.ai.projects.models.AZURE_SEMANTIC_VAD_MULTILINGUAL + :ivar threshold: Activation threshold for voice activity detection, from 0 to 1. + :vartype threshold: float + :ivar prefix_padding_ms: Audio to include before detected speech, in milliseconds. + :vartype prefix_padding_ms: ~datetime.timedelta + :ivar silence_duration_ms: Silence required to end speech detection, in milliseconds. + :vartype silence_duration_ms: ~datetime.timedelta + :ivar idle_timeout_ms: Maximum idle time before the detector ends the turn, in milliseconds. + :vartype idle_timeout_ms: ~datetime.timedelta + :ivar end_of_utterance_detection: Semantic end-of-utterance detection configuration. Set to + null to disable it. + :vartype end_of_utterance_detection: + ~azure.ai.projects.models.VoiceAgentEndOfUtteranceDetection + :ivar speech_duration_ms: Minimum speech duration required to trigger detection, in + milliseconds. + :vartype speech_duration_ms: ~datetime.timedelta + :ivar remove_filler_words: Whether filler words are removed from transcription. + :vartype remove_filler_words: bool + :ivar create_response: Whether a response is created automatically when speech stops. + :vartype create_response: bool + :ivar interrupt_response: Whether user speech may interrupt the agent's response. + :vartype interrupt_response: bool + :ivar languages: BCP-47 language codes used for speech detection. + :vartype languages: list[str] """ - version_selection_rules: list["_models.VersionSelectionRule"] = rest_field( + type: Literal[VoiceAgentTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Multilingual Azure semantic voice activity detection.""" + threshold: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Activation threshold for voice activity detection, from 0 to 1.""" + prefix_padding_ms: Optional[datetime.timedelta] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) + """Audio to include before detected speech, in milliseconds.""" + silence_duration_ms: Optional[datetime.timedelta] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) + """Silence required to end speech detection, in milliseconds.""" + idle_timeout_ms: Optional[datetime.timedelta] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) + """Maximum idle time before the detector ends the turn, in milliseconds.""" + end_of_utterance_detection: Optional["_models.VoiceAgentEndOfUtteranceDetection"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Required.""" + """Semantic end-of-utterance detection configuration. Set to null to disable it.""" + speech_duration_ms: Optional[datetime.timedelta] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) + """Minimum speech duration required to trigger detection, in milliseconds.""" + remove_filler_words: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether filler words are removed from transcription.""" + create_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether a response is created automatically when speech stops.""" + interrupt_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether user speech may interrupt the agent's response.""" + languages: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """BCP-47 language codes used for speech detection.""" @overload def __init__( self, *, - version_selection_rules: list["_models.VersionSelectionRule"], + auto_truncate: Optional[bool] = None, + threshold: Optional[float] = None, + prefix_padding_ms: Optional[datetime.timedelta] = None, + silence_duration_ms: Optional[datetime.timedelta] = None, + idle_timeout_ms: Optional[datetime.timedelta] = None, + end_of_utterance_detection: Optional["_models.VoiceAgentEndOfUtteranceDetection"] = None, + speech_duration_ms: Optional[datetime.timedelta] = None, + remove_filler_words: Optional[bool] = None, + create_response: Optional[bool] = None, + interrupt_response: Optional[bool] = None, + languages: Optional[list[str]] = None, ) -> None: ... @overload @@ -27676,30 +34755,92 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = VoiceAgentTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL # type: ignore -class VoiceAgentAnimationConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Animation settings for a voice-agent session. +class VoiceAgentAzureSemanticVadTurnDetection( + VoiceAgentTurnDetectionConfig, discriminator="azure_semantic_vad" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Azure semantic voice activity detection. - :ivar model_name: The animation model name. - :vartype model_name: str - :ivar outputs: The requested animation output kinds. - :vartype outputs: list[str or ~azure.ai.projects.models.VoiceAgentAnimationOutputType] + :ivar auto_truncate: Whether the input audio buffer is truncated automatically when speech + stops. + :vartype auto_truncate: bool + :ivar type: Required. Azure semantic voice activity detection. + :vartype type: str or ~azure.ai.projects.models.AZURE_SEMANTIC_VAD + :ivar threshold: Activation threshold for voice activity detection, from 0 to 1. + :vartype threshold: float + :ivar prefix_padding_ms: Audio to include before detected speech, in milliseconds. + :vartype prefix_padding_ms: ~datetime.timedelta + :ivar silence_duration_ms: Silence required to end speech detection, in milliseconds. + :vartype silence_duration_ms: ~datetime.timedelta + :ivar idle_timeout_ms: Maximum idle time before the detector ends the turn, in milliseconds. + :vartype idle_timeout_ms: ~datetime.timedelta + :ivar end_of_utterance_detection: Semantic end-of-utterance detection configuration. Set to + null to disable it. + :vartype end_of_utterance_detection: + ~azure.ai.projects.models.VoiceAgentEndOfUtteranceDetection + :ivar speech_duration_ms: Minimum speech duration required to trigger detection, in + milliseconds. + :vartype speech_duration_ms: ~datetime.timedelta + :ivar remove_filler_words: Whether filler words are removed from transcription. + :vartype remove_filler_words: bool + :ivar create_response: Whether a response is created automatically when speech stops. + :vartype create_response: bool + :ivar interrupt_response: Whether user speech may interrupt the agent's response. + :vartype interrupt_response: bool + :ivar languages: BCP-47 language codes used for speech detection. + :vartype languages: list[str] """ - model_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The animation model name.""" - outputs: Optional[list[Union[str, "_models.VoiceAgentAnimationOutputType"]]] = rest_field( + type: Literal[VoiceAgentTurnDetectionType.AZURE_SEMANTIC_VAD] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Azure semantic voice activity detection.""" + threshold: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Activation threshold for voice activity detection, from 0 to 1.""" + prefix_padding_ms: Optional[datetime.timedelta] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) + """Audio to include before detected speech, in milliseconds.""" + silence_duration_ms: Optional[datetime.timedelta] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) + """Silence required to end speech detection, in milliseconds.""" + idle_timeout_ms: Optional[datetime.timedelta] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) + """Maximum idle time before the detector ends the turn, in milliseconds.""" + end_of_utterance_detection: Optional["_models.VoiceAgentEndOfUtteranceDetection"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The requested animation output kinds.""" + """Semantic end-of-utterance detection configuration. Set to null to disable it.""" + speech_duration_ms: Optional[datetime.timedelta] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) + """Minimum speech duration required to trigger detection, in milliseconds.""" + remove_filler_words: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether filler words are removed from transcription.""" + create_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether a response is created automatically when speech stops.""" + interrupt_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether user speech may interrupt the agent's response.""" + languages: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """BCP-47 language codes used for speech detection.""" @overload def __init__( self, *, - model_name: Optional[str] = None, - outputs: Optional[list[Union[str, "_models.VoiceAgentAnimationOutputType"]]] = None, + auto_truncate: Optional[bool] = None, + threshold: Optional[float] = None, + prefix_padding_ms: Optional[datetime.timedelta] = None, + silence_duration_ms: Optional[datetime.timedelta] = None, + idle_timeout_ms: Optional[datetime.timedelta] = None, + end_of_utterance_detection: Optional["_models.VoiceAgentEndOfUtteranceDetection"] = None, + speech_duration_ms: Optional[datetime.timedelta] = None, + remove_filler_words: Optional[bool] = None, + create_response: Optional[bool] = None, + interrupt_response: Optional[bool] = None, + languages: Optional[list[str]] = None, ) -> None: ... @overload @@ -27711,33 +34852,59 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = VoiceAgentTurnDetectionType.AZURE_SEMANTIC_VAD # type: ignore -class VoiceAgentAudioConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The audio configuration for a voice agent. These values are session defaults and may be - overridden when connecting. +class VoiceAgentBaseDefinition( + AgentDefinition, discriminator="voice" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Shared voice-agent settings; protocol-specific fields remain flat on each subtype. Creates and + updates produce immutable versions. An agent's protocol cannot change across versions. - :ivar input: Input (microphone) audio configuration. - :vartype input: ~azure.ai.projects.models.VoiceAgentAudioInputConfig - :ivar output: Output (agent speech) audio configuration. - :vartype output: ~azure.ai.projects.models.VoiceAgentAudioOutputConfig + :ivar rai_config: Configuration for Responsible AI (RAI) content filtering and safety features. + :vartype rai_config: ~azure.ai.projects.models.RaiConfig + :ivar kind: Always voice. Required. VOICE. + :vartype kind: str or ~azure.ai.projects.models.VOICE + :ivar sub_protocol: Omission selects Realtime. Null and unknown values are invalid. Reads + preserve omission. Known values are: "realtime" and "live". + :vartype sub_protocol: str or ~azure.ai.projects.models.VoiceAgentSubProtocol + :ivar instructions: Frontend instructions, templated with structured_inputs. Backend + instructions belong in delegation.responses. + :vartype instructions: str + :ivar structured_inputs: Template inputs for session instructions and supported greetings. + :vartype structured_inputs: dict[str, ~azure.ai.projects.models.StructuredInputDefinition] + :ivar store: Persists conversation content and audio in Foundry, not native Live recordings. + Defaults to false. + :vartype store: bool """ - input: Optional["_models.VoiceAgentAudioInputConfig"] = rest_field( + kind: Literal[AgentKind.VOICE] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Always voice. Required. VOICE.""" + sub_protocol: Optional[Union[str, "_models.VoiceAgentSubProtocol"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Input (microphone) audio configuration.""" - output: Optional["_models.VoiceAgentAudioOutputConfig"] = rest_field( + """Omission selects Realtime. Null and unknown values are invalid. Reads preserve omission. Known + values are: \"realtime\" and \"live\".""" + instructions: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Frontend instructions, templated with structured_inputs. Backend instructions belong in + delegation.responses.""" + structured_inputs: Optional[dict[str, "_models.StructuredInputDefinition"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Output (agent speech) audio configuration.""" + """Template inputs for session instructions and supported greetings.""" + store: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Persists conversation content and audio in Foundry, not native Live recordings. Defaults to + false.""" @overload def __init__( self, *, - input: Optional["_models.VoiceAgentAudioInputConfig"] = None, - output: Optional["_models.VoiceAgentAudioOutputConfig"] = None, + rai_config: Optional["_models.RaiConfig"] = None, + sub_protocol: Optional[Union[str, "_models.VoiceAgentSubProtocol"]] = None, + instructions: Optional[str] = None, + structured_inputs: Optional[dict[str, "_models.StructuredInputDefinition"]] = None, + store: Optional[bool] = None, ) -> None: ... @overload @@ -27749,56 +34916,44 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.kind = AgentKind.VOICE # type: ignore -class VoiceAgentAudioInputConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Input audio configuration for a voice agent. +class VoiceAgentClientEventRtcCallSdpCreate( + RealtimeClientEvent, discriminator="rtc.call.sdp.create" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """The ``rtc.call.sdp.create`` client event: begins WebRTC signaling with an SDP offer. - :ivar format: The input audio format. - :vartype format: ~azure.ai.projects.models.RealtimeAudioFormats - :ivar noise_reduction: Input noise reduction. Set to null to disable. - :vartype noise_reduction: ~azure.ai.projects.models.VoiceAgentNoiseReduction - :ivar turn_detection: Turn (end-of-speech) detection. Server-side turn detection is enabled by - default; set to null to disable it, in which case the client must trigger responses manually. - :vartype turn_detection: ~azure.ai.projects.models.VoiceAgentTurnDetectionConfig - :ivar echo_cancellation: Optional server-side echo cancellation settings. - :vartype echo_cancellation: ~azure.ai.projects.models.VoiceAgentEchoCancellation - :ivar transcription: Asynchronous input-audio transcription. Set to null to disable - transcription. - :vartype transcription: ~azure.ai.projects.models.VoiceAgentInputTranscription + :ivar type: The event type. Always ``rtc.call.sdp.create``. Required. RTC_CALL_SDP_CREATE. + :vartype type: str or ~azure.ai.projects.models.RTC_CALL_SDP_CREATE + :ivar event_id: An optional client-generated event identifier. + :vartype event_id: str + :ivar sdp_offer: The client's SDP offer for the WebRTC connection. Required. + :vartype sdp_offer: str + :ivar session: Optional session configuration. For an ``/agents`` endpoint the service rebuilds + it authoritatively from the persisted agent definition. + :vartype session: ~azure.ai.projects.models.VoiceAgentSessionUpdateConfig """ - format: Optional["_models.RealtimeAudioFormats"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The input audio format.""" - noise_reduction: Optional["_models.VoiceAgentNoiseReduction"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Input noise reduction. Set to null to disable.""" - turn_detection: Optional["_models.VoiceAgentTurnDetectionConfig"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Turn (end-of-speech) detection. Server-side turn detection is enabled by default; set to null - to disable it, in which case the client must trigger responses manually.""" - echo_cancellation: Optional["_models.VoiceAgentEchoCancellation"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Optional server-side echo cancellation settings.""" - transcription: Optional["_models.VoiceAgentInputTranscription"] = rest_field( + type: Literal[RealtimeClientEventType.RTC_CALL_SDP_CREATE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type. Always ``rtc.call.sdp.create``. Required. RTC_CALL_SDP_CREATE.""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An optional client-generated event identifier.""" + sdp_offer: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The client's SDP offer for the WebRTC connection. Required.""" + session: Optional["_models.VoiceAgentSessionUpdateConfig"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Asynchronous input-audio transcription. Set to null to disable transcription.""" + """Optional session configuration. For an ``/agents`` endpoint the service rebuilds it + authoritatively from the persisted agent definition.""" @overload def __init__( self, *, - format: Optional["_models.RealtimeAudioFormats"] = None, - noise_reduction: Optional["_models.VoiceAgentNoiseReduction"] = None, - turn_detection: Optional["_models.VoiceAgentTurnDetectionConfig"] = None, - echo_cancellation: Optional["_models.VoiceAgentEchoCancellation"] = None, - transcription: Optional["_models.VoiceAgentInputTranscription"] = None, + sdp_offer: str, + event_id: Optional[str] = None, + session: Optional["_models.VoiceAgentSessionUpdateConfig"] = None, ) -> None: ... @overload @@ -27810,141 +34965,36 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RealtimeClientEventType.RTC_CALL_SDP_CREATE # type: ignore -class VoiceAgentAudioOutputConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Output audio configuration for a voice agent. - Provider-specific fields are selected by ``voice_type``: - - * `openai`: `voice` and `speed`. - * `azure-standard`: `voice`, `voice_locale`, `speed`, `voice_temperature`, `custom_lexicon_url`, - `custom_text_normalization_url`, `prefer_locales`, `style`, `pitch`, and `volume`. - * `azure-custom`: all `azure-standard` fields except `style`, plus `custom_voice_endpoint_id`. - * `azure-personal`: all `azure-standard` fields except `style`, plus `personal_voice_model`. - * `avatar-voice-sync`: all `azure-standard` fields except `voice` and `style`, plus `personal_voice_model`; the - voice name is derived from the avatar. - * `azure-realtime-native`: `voice` and `speed`. `format` and `output_audio_timestamp_types` apply to every voice - type. +class VoiceAgentClientEventSessionAvatarConnect( + RealtimeClientEvent, discriminator="session.avatar.connect" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``session.avatar.connect`` client event. - :ivar format: The output audio format. Applies to every ``voice_type`` and defaults to 24 kHz - PCM. - :vartype format: ~azure.ai.projects.models.RealtimeAudioFormats - :ivar voice: The voice name or identifier. Applies to ``openai``, ``azure-standard``, - ``azure-custom``, ``azure-personal``, and ``azure-realtime-native``. It does not apply to - ``avatar-voice-sync``, which derives the voice name from the avatar. - :vartype voice: str - :ivar voice_type: The voice implementation. Known values are: "openai", "azure-standard", - "azure-custom", "azure-personal", "avatar-voice-sync", and "azure-realtime-native". - :vartype voice_type: str or ~azure.ai.projects.models.VoiceType - :ivar voice_locale: The enforced BCP-47 output locale. Applies to ``azure-standard``, - ``azure-custom``, ``azure-personal``, and ``avatar-voice-sync``. - :vartype voice_locale: str - :ivar speed: The numeric output speed multiplier. Applies to all known ``voice_type`` values - and defaults to 1. - :vartype speed: float - :ivar voice_temperature: The voice variation temperature. Applies to ``azure-standard``, - ``azure-custom``, ``azure-personal``, and ``avatar-voice-sync``. - :vartype voice_temperature: float - :ivar custom_lexicon_url: The URL of a custom pronunciation lexicon. Applies to - ``azure-standard``, ``azure-custom``, ``azure-personal``, and ``avatar-voice-sync``. - :vartype custom_lexicon_url: str - :ivar custom_text_normalization_url: The URL of a custom text-normalization configuration. - Applies to ``azure-standard``, ``azure-custom``, ``azure-personal``, and ``avatar-voice-sync``. - :vartype custom_text_normalization_url: str - :ivar prefer_locales: Preferred BCP-47 locales for multilingual synthesis. Applies to - ``azure-standard``, ``azure-custom``, ``azure-personal``, and ``avatar-voice-sync``. - :vartype prefer_locales: list[str] - :ivar style: The voice speaking style. Applies only when ``voice_type`` is ``azure-standard``. - :vartype style: str - :ivar pitch: The voice pitch adjustment. Applies to ``azure-standard``, ``azure-custom``, - ``azure-personal``, and ``avatar-voice-sync``. - :vartype pitch: str - :ivar volume: The voice volume adjustment. Applies to ``azure-standard``, ``azure-custom``, - ``azure-personal``, and ``avatar-voice-sync``. - :vartype volume: str - :ivar custom_voice_endpoint_id: The Azure custom-voice deployment endpoint identifier. Applies - only when ``voice_type`` is ``azure-custom``. - :vartype custom_voice_endpoint_id: str - :ivar personal_voice_model: The Azure personal or avatar voice model. Applies only when - ``voice_type`` is ``azure-personal`` or ``avatar-voice-sync``. - :vartype personal_voice_model: str - :ivar output_audio_timestamp_types: Timestamp kinds to include with output audio. Applies to - every ``voice_type``. - :vartype output_audio_timestamp_types: list[str or - ~azure.ai.projects.models.VoiceAgentAudioTimestampType] + :ivar type: The event type. Always ``session.avatar.connect``. Required. + SESSION_AVATAR_CONNECT. + :vartype type: str or ~azure.ai.projects.models.SESSION_AVATAR_CONNECT + :ivar event_id: An optional client-generated event identifier. + :vartype event_id: str + :ivar client_sdp: The client's SDP offer for avatar media negotiation. Required. + :vartype client_sdp: str """ - format: Optional["_models.RealtimeAudioFormats"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The output audio format. Applies to every ``voice_type`` and defaults to 24 kHz PCM.""" - voice: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The voice name or identifier. Applies to ``openai``, ``azure-standard``, ``azure-custom``, - ``azure-personal``, and ``azure-realtime-native``. It does not apply to ``avatar-voice-sync``, - which derives the voice name from the avatar.""" - voice_type: Optional[Union[str, "_models.VoiceType"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The voice implementation. Known values are: \"openai\", \"azure-standard\", \"azure-custom\", - \"azure-personal\", \"avatar-voice-sync\", and \"azure-realtime-native\".""" - voice_locale: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The enforced BCP-47 output locale. Applies to ``azure-standard``, ``azure-custom``, - ``azure-personal``, and ``avatar-voice-sync``.""" - speed: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The numeric output speed multiplier. Applies to all known ``voice_type`` values and defaults to - 1.""" - voice_temperature: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The voice variation temperature. Applies to ``azure-standard``, ``azure-custom``, - ``azure-personal``, and ``avatar-voice-sync``.""" - custom_lexicon_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The URL of a custom pronunciation lexicon. Applies to ``azure-standard``, ``azure-custom``, - ``azure-personal``, and ``avatar-voice-sync``.""" - custom_text_normalization_url: Optional[str] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The URL of a custom text-normalization configuration. Applies to ``azure-standard``, - ``azure-custom``, ``azure-personal``, and ``avatar-voice-sync``.""" - prefer_locales: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Preferred BCP-47 locales for multilingual synthesis. Applies to ``azure-standard``, - ``azure-custom``, ``azure-personal``, and ``avatar-voice-sync``.""" - style: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The voice speaking style. Applies only when ``voice_type`` is ``azure-standard``.""" - pitch: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The voice pitch adjustment. Applies to ``azure-standard``, ``azure-custom``, - ``azure-personal``, and ``avatar-voice-sync``.""" - volume: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The voice volume adjustment. Applies to ``azure-standard``, ``azure-custom``, - ``azure-personal``, and ``avatar-voice-sync``.""" - custom_voice_endpoint_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The Azure custom-voice deployment endpoint identifier. Applies only when ``voice_type`` is - ``azure-custom``.""" - personal_voice_model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The Azure personal or avatar voice model. Applies only when ``voice_type`` is - ``azure-personal`` or ``avatar-voice-sync``.""" - output_audio_timestamp_types: Optional[list[Union[str, "_models.VoiceAgentAudioTimestampType"]]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Timestamp kinds to include with output audio. Applies to every ``voice_type``.""" + type: Literal[RealtimeClientEventType.SESSION_AVATAR_CONNECT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type. Always ``session.avatar.connect``. Required. SESSION_AVATAR_CONNECT.""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An optional client-generated event identifier.""" + client_sdp: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The client's SDP offer for avatar media negotiation. Required.""" @overload def __init__( self, *, - format: Optional["_models.RealtimeAudioFormats"] = None, - voice: Optional[str] = None, - voice_type: Optional[Union[str, "_models.VoiceType"]] = None, - voice_locale: Optional[str] = None, - speed: Optional[float] = None, - voice_temperature: Optional[float] = None, - custom_lexicon_url: Optional[str] = None, - custom_text_normalization_url: Optional[str] = None, - prefer_locales: Optional[list[str]] = None, - style: Optional[str] = None, - pitch: Optional[str] = None, - volume: Optional[str] = None, - custom_voice_endpoint_id: Optional[str] = None, - personal_voice_model: Optional[str] = None, - output_audio_timestamp_types: Optional[list[Union[str, "_models.VoiceAgentAudioTimestampType"]]] = None, + client_sdp: str, + event_id: Optional[str] = None, ) -> None: ... @overload @@ -27956,74 +35006,42 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RealtimeClientEventType.SESSION_AVATAR_CONNECT # type: ignore -class VoiceAgentAvatarConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Avatar configuration for a voice agent. These values are session defaults and may be overridden - when connecting. +class VoiceAgentClientEventSessionUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The ``session.update`` client event. - :ivar type: The avatar type. Required. Known values are: "video_avatar" and "photo_avatar". - :vartype type: str or ~azure.ai.projects.models.VoiceAgentAvatarType - :ivar character: The avatar character identifier, e.g. 'lisa'. Required. - :vartype character: str - :ivar style: The avatar style, e.g. 'casual-sitting'. - :vartype style: str - :ivar customized: Whether the avatar is a customer-customized avatar. Defaults to false. - :vartype customized: bool - :ivar output_protocol: The transport used to deliver the avatar video stream. Known values are: - "webrtc" and "websocket". - :vartype output_protocol: str or ~azure.ai.projects.models.VoiceAgentAvatarOutputProtocol - :ivar model: The avatar model identifier. - :vartype model: str - :ivar video: Avatar video encoder and presentation settings. - :vartype video: ~azure.ai.projects.models.VoiceAgentAvatarVideoParams - :ivar scene: Avatar placement and motion settings. - :vartype scene: ~azure.ai.projects.models.VoiceAgentAvatarScene - :ivar output_audit_audio: Whether audit audio is emitted with avatar output. Defaults to false. - :vartype output_audit_audio: bool + :ivar event_id: Optional client-generated ID used to identify this event. This is an arbitrary + string that a client may assign. It will be passed back if there is an error with the event, + but the corresponding ``session.updated`` event will not include it. + :vartype event_id: str + :ivar type: The event type, must be ``session.update``. Required. SESSION_UPDATE. + :vartype type: str or ~azure.ai.projects.models.SESSION_UPDATE + :ivar session: The voice-agent session settings to update. Required. Is one of the following + types: VoiceAgentSessionUpdateConfig + :vartype session: ~azure.ai.projects.models.VoiceAgentSessionUpdateConfig """ - type: Union[str, "_models.VoiceAgentAvatarType"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The avatar type. Required. Known values are: \"video_avatar\" and \"photo_avatar\".""" - character: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The avatar character identifier, e.g. 'lisa'. Required.""" - style: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The avatar style, e.g. 'casual-sitting'.""" - customized: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether the avatar is a customer-customized avatar. Defaults to false.""" - output_protocol: Optional[Union[str, "_models.VoiceAgentAvatarOutputProtocol"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The transport used to deliver the avatar video stream. Known values are: \"webrtc\" and - \"websocket\".""" - model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The avatar model identifier.""" - video: Optional["_models.VoiceAgentAvatarVideoParams"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Avatar video encoder and presentation settings.""" - scene: Optional["_models.VoiceAgentAvatarScene"] = rest_field( + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional client-generated ID used to identify this event. This is an arbitrary string that a + client may assign. It will be passed back if there is an error with the event, but the + corresponding ``session.updated`` event will not include it.""" + type: Literal[RealtimeClientEventType.SESSION_UPDATE] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Avatar placement and motion settings.""" - output_audit_audio: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether audit audio is emitted with avatar output. Defaults to false.""" + """The event type, must be ``session.update``. Required. SESSION_UPDATE.""" + session: "_unions.VoiceAgentSessionUpdate" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The voice-agent session settings to update. Required. Is one of the following types: + VoiceAgentSessionUpdateConfig""" @overload def __init__( self, *, - type: Union[str, "_models.VoiceAgentAvatarType"], - character: str, - style: Optional[str] = None, - customized: Optional[bool] = None, - output_protocol: Optional[Union[str, "_models.VoiceAgentAvatarOutputProtocol"]] = None, - model: Optional[str] = None, - video: Optional["_models.VoiceAgentAvatarVideoParams"] = None, - scene: Optional["_models.VoiceAgentAvatarScene"] = None, - output_audit_audio: Optional[bool] = None, + type: Literal[RealtimeClientEventType.SESSION_UPDATE], + session: "_unions.VoiceAgentSessionUpdate", + event_id: Optional[str] = None, ) -> None: ... @overload @@ -28037,29 +35055,199 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentAvatarIceServer(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """An ICE server used for avatar WebRTC negotiation. +class VoiceAgentDefinition(VoiceAgentBaseDefinition): # pylint: disable=docstring-keyword-should-match-keyword-only + """The voice agent definition. Its configuration (model, instructions, audio, tools, and optional + avatar) drives a managed speech-to-speech experience. Establish realtime voice sessions through + ``GET /agents/{agent_name}/endpoint/protocols/voice``. Every create or update produces a new + immutable version. - :ivar urls: Required. - :vartype urls: list[str] - :ivar username: - :vartype username: str - :ivar credential: - :vartype credential: str + :ivar rai_config: Configuration for Responsible AI (RAI) content filtering and safety features. + :vartype rai_config: ~azure.ai.projects.models.RaiConfig + :ivar kind: Always voice. Required. VOICE. + :vartype kind: str or ~azure.ai.projects.models.VOICE + :ivar instructions: Frontend instructions, templated with structured_inputs. Backend + instructions belong in delegation.responses. + :vartype instructions: str + :ivar structured_inputs: Template inputs for session instructions and supported greetings. + :vartype structured_inputs: dict[str, ~azure.ai.projects.models.StructuredInputDefinition] + :ivar store: Persists conversation content and audio in Foundry, not native Live recordings. + Defaults to false. + :vartype store: bool + :ivar sub_protocol: Selects Realtime. May be omitted for legacy agents. Default value is + "realtime". + :vartype sub_protocol: str + :ivar model_type: How the model backing this voice agent is served. Required with ``model`` for + a model-backed voice agent and omitted when ``conversation_engine`` is provided. This is + independent of the architecture (realtime or cascaded), which the service derives from the + selected model. Known values are: "managed" and "self_deployed". + :vartype model_type: str or ~azure.ai.projects.models.VoiceModelType + :ivar model: The model to use for this agent. Required with ``model_type`` for a model-backed + voice agent and omitted when ``conversation_engine`` is provided. The model must support + realtime or cascaded voice. + :vartype model: str + :ivar conversation_engine: The engine that owns conversation handling for this voice agent. + Exactly one of this property and the model-backed configuration (``model_type`` with ``model``) + must be provided. When this property is provided, ``model_type``, ``model``, ``instructions``, + ``tools``, and ``tool_choice`` must be omitted, and ``greeting.tool_choice`` cannot be + ``required``, because the engine owns the conversation logic. The initial implementation + supports a hosted-agent engine. + :vartype conversation_engine: ~azure.ai.projects.models.VoiceConversationEngine + :ivar greeting: Optional session-start greeting. Template mode speaks exact rendered text; + LLM-generated mode asks the session model to author the opening response and may use configured + tools. + :vartype greeting: ~azure.ai.projects.models.VoiceAgentGreetingConfig + :ivar audio: The audio configuration, including input and output formats, voice, turn + detection, noise reduction, and transcription. These values are session defaults; a client may + override supported fields when connecting. + :vartype audio: ~azure.ai.projects.models.VoiceAgentAudioConfig + :ivar soundscape: Optional background ambience and event cues, stored with the agent version + and separate from the audio configuration. Currently rendered only for telephony calls, not + browser WebRTC or direct voice WebSocket sessions. Omit this property to disable all auxiliary + audio. Persisted conversation recordings do not include the soundscape mix. + :vartype soundscape: ~azure.ai.projects.models.VoiceAgentSoundscapeConfig + :ivar output_modalities: The output modalities the agent produces. Defaults to ``["audio"]``. + ``animation`` and ``avatar`` are available when an avatar is configured. + :vartype output_modalities: list[str or ~azure.ai.projects.models.VoiceOutputModality] + :ivar max_output_tokens: The maximum output-token count for one response. Is either a int type + or a Literal["inf"] type. + :vartype max_output_tokens: int or str + :ivar include: Additional fields to include in service outputs. + :vartype include: list[str or ~azure.ai.projects.models.VoiceAgentSessionIncludeOption] + :ivar interim_response: Interim-response settings for latency and tool execution. + :vartype interim_response: ~azure.ai.projects.models.VoiceAgentInterimResponseConfig + :ivar avatar: Optional avatar configuration. These values are session defaults and may be + overridden when connecting. + :vartype avatar: ~azure.ai.projects.models.VoiceAgentAvatarConfig + :ivar tools: The tools the voice agent may use. Supported tool kinds are ``function`` (executed + by the client), ``mcp``, ``system`` (service-managed session controls), and ``toolbox``. + Server-side tools such as ``web_search``, ``azure_ai_search``, and ``openapi`` are provided + through a toolbox rather than declared directly. + :vartype tools: list[~azure.ai.projects.models.VoiceAgentTool] + :ivar tool_choice: How the model chooses tools for generated responses. ``none`` prevents tool + calls, ``auto`` lets the model decide, ``required`` requires at least one tool call, and a + specific function or MCP tool can be selected with an object. Defaults to ``auto``. Is one of + the following types: Literal["none"], Literal["auto"], Literal["required"], ToolChoiceFunction, + ToolChoiceMCP + :vartype tool_choice: str or str or str or ~azure.ai.projects.models.ToolChoiceFunction or + ~azure.ai.projects.models.ToolChoiceMCP + :ivar parallel_tool_calls: Whether the model may call multiple tools in parallel. + :vartype parallel_tool_calls: bool + :ivar subagent_config: Optional configuration for sibling Foundry text agents that this voice + agent may consult as background specialists. + :vartype subagent_config: ~azure.ai.projects.models.VoiceAgentSubagentConfig """ - urls: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - username: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - credential: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + sub_protocol: Optional[Literal["realtime"]] = rest_field( # pyright: ignore[reportIncompatibleVariableOverride] + visibility=["read", "create", "update", "delete", "query"] + ) + """Selects Realtime. May be omitted for legacy agents. Default value is \"realtime\".""" + model_type: Optional[Union[str, "_models.VoiceModelType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """How the model backing this voice agent is served. Required with ``model`` for a model-backed + voice agent and omitted when ``conversation_engine`` is provided. This is independent of the + architecture (realtime or cascaded), which the service derives from the selected model. Known + values are: \"managed\" and \"self_deployed\".""" + model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The model to use for this agent. Required with ``model_type`` for a model-backed voice agent + and omitted when ``conversation_engine`` is provided. The model must support realtime or + cascaded voice.""" + conversation_engine: Optional["_models.VoiceConversationEngine"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The engine that owns conversation handling for this voice agent. Exactly one of this property + and the model-backed configuration (``model_type`` with ``model``) must be provided. When this + property is provided, ``model_type``, ``model``, ``instructions``, ``tools``, and + ``tool_choice`` must be omitted, and ``greeting.tool_choice`` cannot be ``required``, because + the engine owns the conversation logic. The initial implementation supports a hosted-agent + engine.""" + greeting: Optional["_models.VoiceAgentGreetingConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Optional session-start greeting. Template mode speaks exact rendered text; LLM-generated mode + asks the session model to author the opening response and may use configured tools.""" + audio: Optional["_models.VoiceAgentAudioConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The audio configuration, including input and output formats, voice, turn detection, noise + reduction, and transcription. These values are session defaults; a client may override + supported fields when connecting.""" + soundscape: Optional["_models.VoiceAgentSoundscapeConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Optional background ambience and event cues, stored with the agent version and separate from + the audio configuration. Currently rendered only for telephony calls, not browser WebRTC or + direct voice WebSocket sessions. Omit this property to disable all auxiliary audio. Persisted + conversation recordings do not include the soundscape mix.""" + output_modalities: Optional[list[Union[str, "_models.VoiceOutputModality"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The output modalities the agent produces. Defaults to ``[\"audio\"]``. ``animation`` and + ``avatar`` are available when an avatar is configured.""" + max_output_tokens: Optional["_unions.VoiceAgentMaxOutputTokens"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The maximum output-token count for one response. Is either a int type or a Literal[\"inf\"] + type.""" + include: Optional[list[Union[str, "_models.VoiceAgentSessionIncludeOption"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Additional fields to include in service outputs.""" + interim_response: Optional["_models.VoiceAgentInterimResponseConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Interim-response settings for latency and tool execution.""" + avatar: Optional["_models.VoiceAgentAvatarConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Optional avatar configuration. These values are session defaults and may be overridden when + connecting.""" + tools: Optional[list["_models.VoiceAgentTool"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The tools the voice agent may use. Supported tool kinds are ``function`` (executed by the + client), ``mcp``, ``system`` (service-managed session controls), and ``toolbox``. Server-side + tools such as ``web_search``, ``azure_ai_search``, and ``openapi`` are provided through a + toolbox rather than declared directly.""" + tool_choice: Optional["_unions.VoiceAgentToolChoice"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """How the model chooses tools for generated responses. ``none`` prevents tool calls, ``auto`` + lets the model decide, ``required`` requires at least one tool call, and a specific function or + MCP tool can be selected with an object. Defaults to ``auto``. Is one of the following types: + Literal[\"none\"], Literal[\"auto\"], Literal[\"required\"], ToolChoiceFunction, ToolChoiceMCP""" + parallel_tool_calls: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether the model may call multiple tools in parallel.""" + subagent_config: Optional["_models.VoiceAgentSubagentConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Optional configuration for sibling Foundry text agents that this voice agent may consult as + background specialists.""" @overload def __init__( self, *, - urls: list[str], - username: Optional[str] = None, - credential: Optional[str] = None, + rai_config: Optional["_models.RaiConfig"] = None, + instructions: Optional[str] = None, + structured_inputs: Optional[dict[str, "_models.StructuredInputDefinition"]] = None, + store: Optional[bool] = None, + sub_protocol: Optional[Literal["realtime"]] = None, + model_type: Optional[Union[str, "_models.VoiceModelType"]] = None, + model: Optional[str] = None, + conversation_engine: Optional["_models.VoiceConversationEngine"] = None, + greeting: Optional["_models.VoiceAgentGreetingConfig"] = None, + audio: Optional["_models.VoiceAgentAudioConfig"] = None, + soundscape: Optional["_models.VoiceAgentSoundscapeConfig"] = None, + output_modalities: Optional[list[Union[str, "_models.VoiceOutputModality"]]] = None, + max_output_tokens: Optional["_unions.VoiceAgentMaxOutputTokens"] = None, + include: Optional[list[Union[str, "_models.VoiceAgentSessionIncludeOption"]]] = None, + interim_response: Optional["_models.VoiceAgentInterimResponseConfig"] = None, + avatar: Optional["_models.VoiceAgentAvatarConfig"] = None, + tools: Optional[list["_models.VoiceAgentTool"]] = None, + tool_choice: Optional["_unions.VoiceAgentToolChoice"] = None, + parallel_tool_calls: Optional[bool] = None, + subagent_config: Optional["_models.VoiceAgentSubagentConfig"] = None, ) -> None: ... @overload @@ -28073,44 +35261,39 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentAvatarScene(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Avatar placement and motion settings. +class VoiceAgentEchoCancellation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Server-side echo cancellation settings for input audio. - :ivar zoom: - :vartype zoom: float - :ivar position_x: - :vartype position_x: float - :ivar position_y: - :vartype position_y: float - :ivar rotation_x: - :vartype rotation_x: float - :ivar rotation_y: - :vartype rotation_y: float - :ivar rotation_z: - :vartype rotation_z: float - :ivar amplitude: - :vartype amplitude: float + :ivar type: The echo cancellation implementation. Always ``server_echo_cancellation``. + Required. Default value is "server_echo_cancellation". + :vartype type: str + :ivar reference_source: Whether reference audio comes from server playback or a client-provided + channel. Known values are: "server" and "client". + :vartype reference_source: str or + ~azure.ai.projects.models.VoiceAgentEchoCancellationReferenceSource + :ivar channels: The number of input channels. Use two interleaved channels when + ``reference_source`` is ``client``. + :vartype channels: int """ - zoom: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - position_x: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - position_y: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - rotation_x: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - rotation_y: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - rotation_z: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - amplitude: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal["server_echo_cancellation"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The echo cancellation implementation. Always ``server_echo_cancellation``. Required. Default + value is \"server_echo_cancellation\".""" + reference_source: Optional[Union[str, "_models.VoiceAgentEchoCancellationReferenceSource"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Whether reference audio comes from server playback or a client-provided channel. Known values + are: \"server\" and \"client\".""" + channels: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The number of input channels. Use two interleaved channels when ``reference_source`` is + ``client``.""" @overload def __init__( self, *, - zoom: Optional[float] = None, - position_x: Optional[float] = None, - position_y: Optional[float] = None, - rotation_x: Optional[float] = None, - rotation_y: Optional[float] = None, - rotation_z: Optional[float] = None, - amplitude: Optional[float] = None, + reference_source: Optional[Union[str, "_models.VoiceAgentEchoCancellationReferenceSource"]] = None, + channels: Optional[int] = None, ) -> None: ... @overload @@ -28122,26 +35305,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["server_echo_cancellation"] = "server_echo_cancellation" -class VoiceAgentAvatarVideoBackground(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The avatar video background. +class VoiceAgentTool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A tool usable by a voice agent. - :ivar image_url: - :vartype image_url: str - :ivar color: - :vartype color: str + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + VoiceAgentFunctionTool, VoiceAgentMcpTool, VoiceAgentSystemTool, VoiceAgentToolboxTool + + :ivar type: The tool kind. Required. Default value is None. + :vartype type: str """ - image_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - color: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """The tool kind. Required. Default value is None.""" @overload def __init__( self, *, - image_url: Optional[str] = None, - color: Optional[str] = None, + type: str, ) -> None: ... @overload @@ -28155,26 +35340,39 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentAvatarVideoCrop(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The rectangular crop applied to avatar video. +class VoiceAgentSystemTool( + VoiceAgentTool, discriminator="system" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A service-managed control that acts on the active voice session without customer code or + external authentication. - :ivar bottom_right: Required. - :vartype bottom_right: list[int] - :ivar top_left: Required. - :vartype top_left: list[int] + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + VoiceAgentEndConversationSystemTool + + :ivar type: The type of the tool. Always ``system``. Required. Default value is "system". + :vartype type: str + :ivar name: The service-managed control action. Known values are stable; additional values may + be added over time. Required. "end_conversation" + :vartype name: str or ~azure.ai.projects.models.VoiceAgentSystemToolName + :ivar description: An optional description of the system tool. + :vartype description: str """ - bottom_right: list[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - top_left: list[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + __mapping__: dict[str, _Model] = {} + type: Literal["system"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the tool. Always ``system``. Required. Default value is \"system\".""" + name: str = rest_discriminator(name="name", visibility=["read", "create", "update", "delete", "query"]) + """The service-managed control action. Known values are stable; additional values may be added + over time. Required. \"end_conversation\"""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An optional description of the system tool.""" @overload def __init__( self, *, - bottom_right: list[int], - top_left: list[int], + name: str, + description: Optional[str] = None, ) -> None: ... @overload @@ -28186,45 +35384,33 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = "system" # type: ignore -class VoiceAgentAvatarVideoParams(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Avatar video encoder and presentation settings. +class VoiceAgentEndConversationSystemTool( + VoiceAgentSystemTool, discriminator="end_conversation" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A service-managed control that ends the active conversation. - :ivar bitrate: The target video bitrate in bits per second. - :vartype bitrate: int - :ivar crop: - :vartype crop: ~azure.ai.projects.models.VoiceAgentAvatarVideoCrop - :ivar resolution: - :vartype resolution: ~azure.ai.projects.models.VoiceAgentAvatarVideoResolution - :ivar background: - :vartype background: ~azure.ai.projects.models.VoiceAgentAvatarVideoBackground - :ivar gop_size: - :vartype gop_size: int + :ivar type: The type of the tool. Always ``system``. Required. Default value is "system". + :vartype type: str + :ivar description: An optional description of the system tool. + :vartype description: str + :ivar name: The service-managed control action. Always ``end_conversation``. Required. Ends the + active conversation. + :vartype name: str or ~azure.ai.projects.models.END_CONVERSATION """ - bitrate: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The target video bitrate in bits per second.""" - crop: Optional["_models.VoiceAgentAvatarVideoCrop"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - resolution: Optional["_models.VoiceAgentAvatarVideoResolution"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - background: Optional["_models.VoiceAgentAvatarVideoBackground"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - gop_size: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + __mapping__: dict[str, _Model] = {} + name: Literal[VoiceAgentSystemToolName.END_CONVERSATION] = rest_discriminator(name="name", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The service-managed control action. Always ``end_conversation``. Required. Ends the active + conversation.""" @overload def __init__( self, *, - bitrate: Optional[int] = None, - crop: Optional["_models.VoiceAgentAvatarVideoCrop"] = None, - resolution: Optional["_models.VoiceAgentAvatarVideoResolution"] = None, - background: Optional["_models.VoiceAgentAvatarVideoBackground"] = None, - gop_size: Optional[int] = None, + description: Optional[str] = None, ) -> None: ... @overload @@ -28236,28 +35422,46 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.name = VoiceAgentSystemToolName.END_CONVERSATION # type: ignore -class VoiceAgentAvatarVideoResolution(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The avatar video resolution. +class VoiceAgentEndOfUtteranceDetection(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Semantic end-of-utterance detection configuration. - :ivar width: Required. - :vartype width: int - :ivar height: Required. - :vartype height: int + :ivar model: The semantic detection model. Required. Known values are: "semantic_detection_v1", + "semantic_detection_v1_en", "semantic_detection_v1_multilingual", and + "smart_end_of_turn_detection". + :vartype model: str or ~azure.ai.projects.models.VoiceAgentEndOfUtteranceDetectionModel + :ivar threshold_level: The sensitivity threshold. Known values are: "low", "medium", "high", + and "default". + :vartype threshold_level: str or + ~azure.ai.projects.models.VoiceAgentEndOfUtteranceThresholdLevel + :ivar timeout_ms: The detection timeout in milliseconds. + :vartype timeout_ms: ~datetime.timedelta """ - width: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - height: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + model: Union[str, "_models.VoiceAgentEndOfUtteranceDetectionModel"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The semantic detection model. Required. Known values are: \"semantic_detection_v1\", + \"semantic_detection_v1_en\", \"semantic_detection_v1_multilingual\", and + \"smart_end_of_turn_detection\".""" + threshold_level: Optional[Union[str, "_models.VoiceAgentEndOfUtteranceThresholdLevel"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The sensitivity threshold. Known values are: \"low\", \"medium\", \"high\", and \"default\".""" + timeout_ms: Optional[datetime.timedelta] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) + """The detection timeout in milliseconds.""" @overload def __init__( self, *, - width: int, - height: int, + model: Union[str, "_models.VoiceAgentEndOfUtteranceDetectionModel"], + threshold_level: Optional[Union[str, "_models.VoiceAgentEndOfUtteranceThresholdLevel"]] = None, + timeout_ms: Optional[datetime.timedelta] = None, ) -> None: ... @overload @@ -28271,127 +35475,74 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentTurnDetectionConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Turn-detection configuration for a voice agent. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - VoiceAgentAzureSemanticVadTurnDetection, VoiceAgentAzureSemanticVadEnTurnDetection, - VoiceAgentAzureSemanticVadMultilingualTurnDetection, VoiceAgentSemanticVadTurnDetection, - VoiceAgentServerVadTurnDetection +class VoiceAgentFunctionTool( + VoiceAgentTool, discriminator="function" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A native function tool executed by the client. - :ivar type: The turn-detection strategy. Required. Known values are: "server_vad", - "semantic_vad", "azure_semantic_vad", "azure_semantic_vad_en", and - "azure_semantic_vad_multilingual". - :vartype type: str or ~azure.ai.projects.models.VoiceAgentTurnDetectionType - :ivar auto_truncate: Whether the input audio buffer is truncated automatically when speech - stops. - :vartype auto_truncate: bool + :ivar description: The description of the function, including guidance on when and how to call + it, and guidance about what to tell the user when calling (if anything). + :vartype description: str + :ivar parameters: Parameters of the function in JSON Schema. + :vartype parameters: ~azure.ai.projects.models.RealtimeFunctionToolParameters + :ivar type: Required. Default value is "function". + :vartype type: str + :ivar name: The function name. Required. + :vartype name: str """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The turn-detection strategy. Required. Known values are: \"server_vad\", \"semantic_vad\", - \"azure_semantic_vad\", \"azure_semantic_vad_en\", and \"azure_semantic_vad_multilingual\".""" - auto_truncate: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether the input audio buffer is truncated automatically when speech stops.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The description of the function, including guidance on when and how to call it, and guidance + about what to tell the user when calling (if anything).""" + parameters: Optional["_models.RealtimeFunctionToolParameters"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Parameters of the function in JSON Schema.""" + type: Literal["function"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Default value is \"function\".""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The function name. Required.""" @overload def __init__( self, *, - type: str, - auto_truncate: Optional[bool] = None, + name: str, + description: Optional[str] = None, + parameters: Optional["_models.RealtimeFunctionToolParameters"] = None, ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class VoiceAgentAzureSemanticVadEnTurnDetection( - VoiceAgentTurnDetectionConfig, discriminator="azure_semantic_vad_en" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """English-optimized Azure semantic voice activity detection. - - :ivar auto_truncate: Whether the input audio buffer is truncated automatically when speech - stops. - :vartype auto_truncate: bool - :ivar type: Required. English-optimized Azure semantic voice activity detection. - :vartype type: str or ~azure.ai.projects.models.AZURE_SEMANTIC_VAD_EN - :ivar threshold: Activation threshold for voice activity detection, from 0 to 1. - :vartype threshold: float - :ivar prefix_padding_ms: Audio to include before detected speech, in milliseconds. - :vartype prefix_padding_ms: ~datetime.timedelta - :ivar silence_duration_ms: Silence required to end speech detection, in milliseconds. - :vartype silence_duration_ms: ~datetime.timedelta - :ivar idle_timeout_ms: Maximum idle time before the detector ends the turn, in milliseconds. - :vartype idle_timeout_ms: ~datetime.timedelta - :ivar end_of_utterance_detection: Semantic end-of-utterance detection configuration. Set to - null to disable it. - :vartype end_of_utterance_detection: - ~azure.ai.projects.models.VoiceAgentEndOfUtteranceDetection - :ivar speech_duration_ms: Minimum speech duration required to trigger detection, in - milliseconds. - :vartype speech_duration_ms: ~datetime.timedelta - :ivar remove_filler_words: Whether filler words are removed from transcription. - :vartype remove_filler_words: bool - :ivar create_response: Whether a response is created automatically when speech stops. - :vartype create_response: bool - :ivar interrupt_response: Whether user speech may interrupt the agent's response. - :vartype interrupt_response: bool - """ - - type: Literal[VoiceAgentTurnDetectionType.AZURE_SEMANTIC_VAD_EN] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. English-optimized Azure semantic voice activity detection.""" - threshold: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Activation threshold for voice activity detection, from 0 to 1.""" - prefix_padding_ms: Optional[datetime.timedelta] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" - ) - """Audio to include before detected speech, in milliseconds.""" - silence_duration_ms: Optional[datetime.timedelta] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" - ) - """Silence required to end speech detection, in milliseconds.""" - idle_timeout_ms: Optional[datetime.timedelta] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" - ) - """Maximum idle time before the detector ends the turn, in milliseconds.""" - end_of_utterance_detection: Optional["_models.VoiceAgentEndOfUtteranceDetection"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Semantic end-of-utterance detection configuration. Set to null to disable it.""" - speech_duration_ms: Optional[datetime.timedelta] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" - ) - """Minimum speech duration required to trigger detection, in milliseconds.""" - remove_filler_words: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether filler words are removed from transcription.""" - create_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether a response is created automatically when speech stops.""" - interrupt_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether user speech may interrupt the agent's response.""" + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = "function" # type: ignore + + +class VoiceAgentGreetingConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Session-start greeting configuration for a voice agent. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + VoiceAgentLlmGeneratedGreetingConfig, VoiceAgentTemplateGreetingConfig + + :ivar type: The greeting mode. Required. Default value is None. + :vartype type: str + """ + + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """The greeting mode. Required. Default value is None.""" @overload def __init__( self, *, - auto_truncate: Optional[bool] = None, - threshold: Optional[float] = None, - prefix_padding_ms: Optional[datetime.timedelta] = None, - silence_duration_ms: Optional[datetime.timedelta] = None, - idle_timeout_ms: Optional[datetime.timedelta] = None, - end_of_utterance_detection: Optional["_models.VoiceAgentEndOfUtteranceDetection"] = None, - speech_duration_ms: Optional[datetime.timedelta] = None, - remove_filler_words: Optional[bool] = None, - create_response: Optional[bool] = None, - interrupt_response: Optional[bool] = None, + type: str, ) -> None: ... @overload @@ -28403,92 +35554,130 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = VoiceAgentTurnDetectionType.AZURE_SEMANTIC_VAD_EN # type: ignore -class VoiceAgentAzureSemanticVadMultilingualTurnDetection( - VoiceAgentTurnDetectionConfig, discriminator="azure_semantic_vad_multilingual" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Multilingual Azure semantic voice activity detection. +class VoiceAgentInputTranscription(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Settings for transcribing input audio, including the transcription model, Custom Speech + deployments, and phrase hints. When ``model`` is ``azure-speech-streaming``, transcription is + supported for cascaded text-model conversations only (not realtime speech-to-speech models), + requires a nonempty ``language`` such as ``en-US`` (comma-separated locales are supported), and + supports ``custom_speech``, ``phrase_list``, and ``profanity_filter``. - :ivar auto_truncate: Whether the input audio buffer is truncated automatically when speech - stops. - :vartype auto_truncate: bool - :ivar type: Required. Multilingual Azure semantic voice activity detection. - :vartype type: str or ~azure.ai.projects.models.AZURE_SEMANTIC_VAD_MULTILINGUAL - :ivar threshold: Activation threshold for voice activity detection, from 0 to 1. - :vartype threshold: float - :ivar prefix_padding_ms: Audio to include before detected speech, in milliseconds. - :vartype prefix_padding_ms: ~datetime.timedelta - :ivar silence_duration_ms: Silence required to end speech detection, in milliseconds. - :vartype silence_duration_ms: ~datetime.timedelta - :ivar idle_timeout_ms: Maximum idle time before the detector ends the turn, in milliseconds. - :vartype idle_timeout_ms: ~datetime.timedelta - :ivar end_of_utterance_detection: Semantic end-of-utterance detection configuration. Set to - null to disable it. - :vartype end_of_utterance_detection: - ~azure.ai.projects.models.VoiceAgentEndOfUtteranceDetection - :ivar speech_duration_ms: Minimum speech duration required to trigger detection, in - milliseconds. - :vartype speech_duration_ms: ~datetime.timedelta - :ivar remove_filler_words: Whether filler words are removed from transcription. - :vartype remove_filler_words: bool - :ivar create_response: Whether a response is created automatically when speech stops. - :vartype create_response: bool - :ivar interrupt_response: Whether user speech may interrupt the agent's response. - :vartype interrupt_response: bool - :ivar languages: BCP-47 language codes used for speech detection. + :ivar language: The language of the input audio. Supplying the input language in `ISO-639-1 + `_ (e.g. ``en``) format will improve + accuracy and latency. Optional for other transcription models; required and must be nonempty + when ``model`` is ``azure-speech-streaming`` (such as ``en-US``; comma-separated locales are + supported). + :vartype language: str + :ivar languages: Possible languages of the input audio, in `ISO-639-1 + `_ format. Supported by + ``gpt-transcribe`` and ``gpt-live-transcribe``. :vartype languages: list[str] + :ivar keywords: Words or phrases to guide transcription of the input audio. Supported by + ``gpt-transcribe`` and ``gpt-live-transcribe``. + :vartype keywords: list[str] + :ivar prompt: An optional text to guide the model's style or continue a previous audio segment. + For ``whisper-1``, the `prompt is a list of keywords + `_. For + ``gpt-4o-transcribe`` models (excluding ``gpt-4o-transcribe-diarize``), the prompt is a free + text string, for example "expect words related to technology". Prompt is not supported with + ``gpt-realtime-whisper`` in GA Realtime sessions. + :vartype prompt: str + :ivar delay: Controls how long the model waits before emitting transcription text. Higher + values can improve transcription accuracy at the cost of latency. Only supported with + ``gpt-realtime-whisper`` in GA Realtime sessions. Is one of the following types: + Literal["minimal"], Literal["low"], Literal["medium"], Literal["high"], Literal["xhigh"] + :vartype delay: str or str or str or str or str + :ivar model: The transcription model identifier. Configure customer custom speech deployments + in ``custom_speech``. ``azure-speech-streaming`` is for cascaded text-model conversations only + (not realtime speech-to-speech models), requires a nonempty ``language`` such as ``en-US`` + (comma-separated locales are supported), and supports ``custom_speech``, ``phrase_list``, and + ``profanity_filter``. Required. Known values are: "whisper-1", "gpt-realtime-whisper", + "gpt-4o-transcribe", "gpt-4o-mini-transcribe", "gpt-4o-transcribe-diarize", "gpt-transcribe", + "gpt-live-transcribe", "mai-transcribe", "azure-speech", and "azure-speech-streaming". + :vartype model: str or ~azure.ai.projects.models.VoiceAgentInputTranscriptionModel + :ivar custom_speech: Optional customer custom speech deployment configuration, keyed by locale. + :vartype custom_speech: dict[str, str] + :ivar phrase_list: Optional phrase hints that bias recognition toward domain terms. + :vartype phrase_list: list[str] + :ivar profanity_filter: Controls how profanity is handled in input transcripts. Supported only + with managed Azure Speech (``azure-speech`` and ``azure-speech-streaming``), including Custom + Speech. Set this property before the session starts. If omitted, the transcription provider's + default applies. You cannot change the mode during a session. Filtering affects transcript + events and the text sent to cascaded models. It does not change input audio, voice activity + detection, or assistant speech; audio-native models still receive the original audio. Mandatory + service masking policies apply even when you select ``unfiltered``. Known values are: "masked", + "unfiltered", and "removed". + :vartype profanity_filter: str or ~azure.ai.projects.models.VoiceAgentProfanityFilterMode """ - type: Literal[VoiceAgentTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Multilingual Azure semantic voice activity detection.""" - threshold: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Activation threshold for voice activity detection, from 0 to 1.""" - prefix_padding_ms: Optional[datetime.timedelta] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" - ) - """Audio to include before detected speech, in milliseconds.""" - silence_duration_ms: Optional[datetime.timedelta] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" - ) - """Silence required to end speech detection, in milliseconds.""" - idle_timeout_ms: Optional[datetime.timedelta] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + language: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The language of the input audio. Supplying the input language in `ISO-639-1 + `_ (e.g. ``en``) format will improve + accuracy and latency. Optional for other transcription models; required and must be nonempty + when ``model`` is ``azure-speech-streaming`` (such as ``en-US``; comma-separated locales are + supported).""" + languages: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Possible languages of the input audio, in `ISO-639-1 + `_ format. Supported by + ``gpt-transcribe`` and ``gpt-live-transcribe``.""" + keywords: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Words or phrases to guide transcription of the input audio. Supported by ``gpt-transcribe`` and + ``gpt-live-transcribe``.""" + prompt: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An optional text to guide the model's style or continue a previous audio segment. For + ``whisper-1``, the `prompt is a list of keywords + `_. For + ``gpt-4o-transcribe`` models (excluding ``gpt-4o-transcribe-diarize``), the prompt is a free + text string, for example \"expect words related to technology\". Prompt is not supported with + ``gpt-realtime-whisper`` in GA Realtime sessions.""" + delay: Optional[Literal["minimal", "low", "medium", "high", "xhigh"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """Maximum idle time before the detector ends the turn, in milliseconds.""" - end_of_utterance_detection: Optional["_models.VoiceAgentEndOfUtteranceDetection"] = rest_field( + """Controls how long the model waits before emitting transcription text. Higher values can improve + transcription accuracy at the cost of latency. Only supported with ``gpt-realtime-whisper`` in + GA Realtime sessions. Is one of the following types: Literal[\"minimal\"], Literal[\"low\"], + Literal[\"medium\"], Literal[\"high\"], Literal[\"xhigh\"]""" + model: Union[str, "_models.VoiceAgentInputTranscriptionModel"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Semantic end-of-utterance detection configuration. Set to null to disable it.""" - speech_duration_ms: Optional[datetime.timedelta] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + """The transcription model identifier. Configure customer custom speech deployments in + ``custom_speech``. ``azure-speech-streaming`` is for cascaded text-model conversations only + (not realtime speech-to-speech models), requires a nonempty ``language`` such as ``en-US`` + (comma-separated locales are supported), and supports ``custom_speech``, ``phrase_list``, and + ``profanity_filter``. Required. Known values are: \"whisper-1\", \"gpt-realtime-whisper\", + \"gpt-4o-transcribe\", \"gpt-4o-mini-transcribe\", \"gpt-4o-transcribe-diarize\", + \"gpt-transcribe\", \"gpt-live-transcribe\", \"mai-transcribe\", \"azure-speech\", and + \"azure-speech-streaming\".""" + custom_speech: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional customer custom speech deployment configuration, keyed by locale.""" + phrase_list: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional phrase hints that bias recognition toward domain terms.""" + profanity_filter: Optional[Union[str, "_models.VoiceAgentProfanityFilterMode"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """Minimum speech duration required to trigger detection, in milliseconds.""" - remove_filler_words: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether filler words are removed from transcription.""" - create_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether a response is created automatically when speech stops.""" - interrupt_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether user speech may interrupt the agent's response.""" - languages: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """BCP-47 language codes used for speech detection.""" + """Controls how profanity is handled in input transcripts. Supported only with managed Azure + Speech (``azure-speech`` and ``azure-speech-streaming``), including Custom Speech. Set this + property before the session starts. If omitted, the transcription provider's default applies. + You cannot change the mode during a session. Filtering affects transcript events and the text + sent to cascaded models. It does not change input audio, voice activity detection, or assistant + speech; audio-native models still receive the original audio. Mandatory service masking + policies apply even when you select ``unfiltered``. Known values are: \"masked\", + \"unfiltered\", and \"removed\".""" @overload def __init__( self, *, - auto_truncate: Optional[bool] = None, - threshold: Optional[float] = None, - prefix_padding_ms: Optional[datetime.timedelta] = None, - silence_duration_ms: Optional[datetime.timedelta] = None, - idle_timeout_ms: Optional[datetime.timedelta] = None, - end_of_utterance_detection: Optional["_models.VoiceAgentEndOfUtteranceDetection"] = None, - speech_duration_ms: Optional[datetime.timedelta] = None, - remove_filler_words: Optional[bool] = None, - create_response: Optional[bool] = None, - interrupt_response: Optional[bool] = None, + model: Union[str, "_models.VoiceAgentInputTranscriptionModel"], + language: Optional[str] = None, languages: Optional[list[str]] = None, + keywords: Optional[list[str]] = None, + prompt: Optional[str] = None, + delay: Optional[Literal["minimal", "low", "medium", "high", "xhigh"]] = None, + custom_speech: Optional[dict[str, str]] = None, + phrase_list: Optional[list[str]] = None, + profanity_filter: Optional[Union[str, "_models.VoiceAgentProfanityFilterMode"]] = None, ) -> None: ... @overload @@ -28500,92 +35689,41 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = VoiceAgentTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL # type: ignore -class VoiceAgentAzureSemanticVadTurnDetection( - VoiceAgentTurnDetectionConfig, discriminator="azure_semantic_vad" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Azure semantic voice activity detection. +class VoiceAgentInterimResponseConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Fields shared by interim-response configurations. - :ivar auto_truncate: Whether the input audio buffer is truncated automatically when speech - stops. - :vartype auto_truncate: bool - :ivar type: Required. Azure semantic voice activity detection. - :vartype type: str or ~azure.ai.projects.models.AZURE_SEMANTIC_VAD - :ivar threshold: Activation threshold for voice activity detection, from 0 to 1. - :vartype threshold: float - :ivar prefix_padding_ms: Audio to include before detected speech, in milliseconds. - :vartype prefix_padding_ms: ~datetime.timedelta - :ivar silence_duration_ms: Silence required to end speech detection, in milliseconds. - :vartype silence_duration_ms: ~datetime.timedelta - :ivar idle_timeout_ms: Maximum idle time before the detector ends the turn, in milliseconds. - :vartype idle_timeout_ms: ~datetime.timedelta - :ivar end_of_utterance_detection: Semantic end-of-utterance detection configuration. Set to - null to disable it. - :vartype end_of_utterance_detection: - ~azure.ai.projects.models.VoiceAgentEndOfUtteranceDetection - :ivar speech_duration_ms: Minimum speech duration required to trigger detection, in - milliseconds. - :vartype speech_duration_ms: ~datetime.timedelta - :ivar remove_filler_words: Whether filler words are removed from transcription. - :vartype remove_filler_words: bool - :ivar create_response: Whether a response is created automatically when speech stops. - :vartype create_response: bool - :ivar interrupt_response: Whether user speech may interrupt the agent's response. - :vartype interrupt_response: bool - :ivar languages: BCP-47 language codes used for speech detection. - :vartype languages: list[str] + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + VoiceAgentLlmInterimResponseConfig, VoiceAgentStaticInterimResponseConfig + + :ivar type: The interim-response implementation. Required. Default value is None. + :vartype type: str + :ivar triggers: Conditions that may trigger one interim response. + :vartype triggers: list[str or ~azure.ai.projects.models.VoiceAgentInterimResponseTrigger] + :ivar latency_threshold_ms: The latency threshold in milliseconds. + :vartype latency_threshold_ms: ~datetime.timedelta """ - type: Literal[VoiceAgentTurnDetectionType.AZURE_SEMANTIC_VAD] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Azure semantic voice activity detection.""" - threshold: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Activation threshold for voice activity detection, from 0 to 1.""" - prefix_padding_ms: Optional[datetime.timedelta] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" - ) - """Audio to include before detected speech, in milliseconds.""" - silence_duration_ms: Optional[datetime.timedelta] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" - ) - """Silence required to end speech detection, in milliseconds.""" - idle_timeout_ms: Optional[datetime.timedelta] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" - ) - """Maximum idle time before the detector ends the turn, in milliseconds.""" - end_of_utterance_detection: Optional["_models.VoiceAgentEndOfUtteranceDetection"] = rest_field( + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """The interim-response implementation. Required. Default value is None.""" + triggers: Optional[list[Union[str, "_models.VoiceAgentInterimResponseTrigger"]]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Semantic end-of-utterance detection configuration. Set to null to disable it.""" - speech_duration_ms: Optional[datetime.timedelta] = rest_field( + """Conditions that may trigger one interim response.""" + latency_threshold_ms: Optional[datetime.timedelta] = rest_field( visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" ) - """Minimum speech duration required to trigger detection, in milliseconds.""" - remove_filler_words: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether filler words are removed from transcription.""" - create_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether a response is created automatically when speech stops.""" - interrupt_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether user speech may interrupt the agent's response.""" - languages: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """BCP-47 language codes used for speech detection.""" + """The latency threshold in milliseconds.""" @overload def __init__( self, *, - auto_truncate: Optional[bool] = None, - threshold: Optional[float] = None, - prefix_padding_ms: Optional[datetime.timedelta] = None, - silence_duration_ms: Optional[datetime.timedelta] = None, - idle_timeout_ms: Optional[datetime.timedelta] = None, - end_of_utterance_detection: Optional["_models.VoiceAgentEndOfUtteranceDetection"] = None, - speech_duration_ms: Optional[datetime.timedelta] = None, - remove_filler_words: Optional[bool] = None, - create_response: Optional[bool] = None, - interrupt_response: Optional[bool] = None, - languages: Optional[list[str]] = None, + type: str, + triggers: Optional[list[Union[str, "_models.VoiceAgentInterimResponseTrigger"]]] = None, + latency_threshold_ms: Optional[datetime.timedelta] = None, ) -> None: ... @overload @@ -28597,44 +35735,37 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = VoiceAgentTurnDetectionType.AZURE_SEMANTIC_VAD # type: ignore -class VoiceAgentClientEventRtcCallSdpCreate( - RealtimeClientEvent, discriminator="rtc.call.sdp.create" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """The ``rtc.call.sdp.create`` client event: begins WebRTC signaling with an SDP offer. +class VoiceAgentLiveConversationItem(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A stored speech segment or delegation. Speech segments are not native turns or proof of + playback; delegation results are separate from spoken transcripts. - :ivar type: The event type. Always ``rtc.call.sdp.create``. Required. RTC_CALL_SDP_CREATE. - :vartype type: str or ~azure.ai.projects.models.RTC_CALL_SDP_CREATE - :ivar event_id: An optional client-generated event identifier. - :vartype event_id: str - :ivar sdp_offer: The client's SDP offer for the WebRTC connection. Required. - :vartype sdp_offer: str - :ivar session: Optional session configuration. For an ``/agents`` endpoint the service rebuilds - it authoritatively from the persisted agent definition. - :vartype session: ~azure.ai.projects.models.VoiceAgentSessionUpdateConfig + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + VoiceAgentLiveDelegationConversationItem, VoiceAgentLiveInputConversationItem, + VoiceAgentLiveOutputConversationItem + + :ivar type: The persisted item kind. Required. Known values are: "input", "output", and + "delegation". + :vartype type: str or ~azure.ai.projects.models.VoiceAgentLiveConversationItemType + :ivar id: Item ID used for retrieval. Foundry assigns speech IDs; delegation IDs retain their + native value. Required. + :vartype id: str """ - type: Literal[RealtimeClientEventType.RTC_CALL_SDP_CREATE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type. Always ``rtc.call.sdp.create``. Required. RTC_CALL_SDP_CREATE.""" - event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """An optional client-generated event identifier.""" - sdp_offer: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The client's SDP offer for the WebRTC connection. Required.""" - session: Optional["_models.VoiceAgentSessionUpdateConfig"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Optional session configuration. For an ``/agents`` endpoint the service rebuilds it - authoritatively from the persisted agent definition.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """The persisted item kind. Required. Known values are: \"input\", \"output\", and \"delegation\".""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Item ID used for retrieval. Foundry assigns speech IDs; delegation IDs retain their native + value. Required.""" @overload def __init__( self, *, - sdp_offer: str, - event_id: Optional[str] = None, - session: Optional["_models.VoiceAgentSessionUpdateConfig"] = None, + type: str, + id: str, # pylint: disable=redefined-builtin ) -> None: ... @overload @@ -28646,36 +35777,56 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeClientEventType.RTC_CALL_SDP_CREATE # type: ignore -class VoiceAgentClientEventSessionAvatarConnect( - RealtimeClientEvent, discriminator="session.avatar.connect" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``session.avatar.connect`` client event. +class VoiceAgentLiveDelegationConversationItem( + VoiceAgentLiveConversationItem, discriminator="delegation" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A stored delegation using native fields with Foundry-specific targets. Its id is the native + delegation ID. - :ivar type: The event type. Always ``session.avatar.connect``. Required. - SESSION_AVATAR_CONNECT. - :vartype type: str or ~azure.ai.projects.models.SESSION_AVATAR_CONNECT - :ivar event_id: An optional client-generated event identifier. - :vartype event_id: str - :ivar client_sdp: The client's SDP offer for avatar media negotiation. Required. - :vartype client_sdp: str + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + VoiceAgentLiveClientDelegationConversationItem, + VoiceAgentLiveFoundryManagedAgentDelegationItem, + VoiceAgentLiveResponsesDelegationConversationItem + + :ivar id: Item ID used for retrieval. Foundry assigns speech IDs; delegation IDs retain their + native value. Required. + :vartype id: str + :ivar type: The object type, always ``delegation``. Required. DELEGATION. + :vartype type: str or ~azure.ai.projects.models.DELEGATION + :ivar response_id: The ID of the Responses API response associated with a Responses delegation. + Omitted for client delegations. + :vartype response_id: str + :ivar target: The configured delegation owner. Required. Known values are: "responses", + "client", and "foundry_managed_agent". + :vartype target: str or ~azure.ai.projects.models.VoiceAgentLiveDelegationTarget + :ivar created_at: Observed delegation creation time, in Unix seconds. Required. + :vartype created_at: ~datetime.datetime """ - type: Literal[RealtimeClientEventType.SESSION_AVATAR_CONNECT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type. Always ``session.avatar.connect``. Required. SESSION_AVATAR_CONNECT.""" - event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """An optional client-generated event identifier.""" - client_sdp: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The client's SDP offer for avatar media negotiation. Required.""" + __mapping__: dict[str, _Model] = {} + type: Literal[VoiceAgentLiveConversationItemType.DELEGATION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The object type, always ``delegation``. Required. DELEGATION.""" + response_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the Responses API response associated with a Responses delegation. Omitted for client + delegations.""" + target: str = rest_discriminator(name="target", visibility=["read", "create", "update", "delete", "query"]) + """The configured delegation owner. Required. Known values are: \"responses\", \"client\", and + \"foundry_managed_agent\".""" + created_at: datetime.datetime = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """Observed delegation creation time, in Unix seconds. Required.""" @overload def __init__( self, *, - client_sdp: str, - event_id: Optional[str] = None, + id: str, # pylint: disable=redefined-builtin + target: str, + created_at: datetime.datetime, + response_id: Optional[str] = None, ) -> None: ... @overload @@ -28687,42 +35838,49 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeClientEventType.SESSION_AVATAR_CONNECT # type: ignore + self.type = VoiceAgentLiveConversationItemType.DELEGATION # type: ignore -class VoiceAgentClientEventSessionUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The ``session.update`` client event. +class VoiceAgentLiveClientDelegationConversationItem( + VoiceAgentLiveDelegationConversationItem, discriminator="client" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Results supplied by the application for client delegation. - :ivar event_id: Optional client-generated ID used to identify this event. This is an arbitrary - string that a client may assign. It will be passed back if there is an error with the event, - but the corresponding ``session.updated`` event will not include it. - :vartype event_id: str - :ivar type: The event type, must be ``session.update``. Required. SESSION_UPDATE. - :vartype type: str or ~azure.ai.projects.models.SESSION_UPDATE - :ivar session: The voice-agent session settings to update. Required. Is one of the following - types: VoiceAgentSessionUpdateConfig - :vartype session: ~azure.ai.projects.models.VoiceAgentSessionUpdateConfig + :ivar id: Item ID used for retrieval. Foundry assigns speech IDs; delegation IDs retain their + native value. Required. + :vartype id: str + :ivar type: The object type, always ``delegation``. Required. DELEGATION. + :vartype type: str or ~azure.ai.projects.models.DELEGATION + :ivar response_id: The ID of the Responses API response associated with a Responses delegation. + Omitted for client delegations. + :vartype response_id: str + :ivar created_at: Observed delegation creation time, in Unix seconds. Required. + :vartype created_at: ~datetime.datetime + :ivar target: Required. CLIENT. + :vartype target: str or ~azure.ai.projects.models.CLIENT + :ivar commentary: Guidance for Live to communicate to the user, when accepted. + :vartype commentary: str + :ivar thinking: Accepted background context, not private reasoning or a request to speak. + :vartype thinking: str """ - event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional client-generated ID used to identify this event. This is an arbitrary string that a - client may assign. It will be passed back if there is an error with the event, but the - corresponding ``session.updated`` event will not include it.""" - type: Literal[RealtimeClientEventType.SESSION_UPDATE] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The event type, must be ``session.update``. Required. SESSION_UPDATE.""" - session: "_unions.VoiceAgentSessionUpdate" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The voice-agent session settings to update. Required. Is one of the following types: - VoiceAgentSessionUpdateConfig""" + __mapping__: dict[str, _Model] = {} + target: Literal[VoiceAgentLiveDelegationTarget.CLIENT] = rest_discriminator(name="target", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. CLIENT.""" + commentary: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Guidance for Live to communicate to the user, when accepted.""" + thinking: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Accepted background context, not private reasoning or a request to speak.""" @overload def __init__( self, *, - type: Literal[RealtimeClientEventType.SESSION_UPDATE], - session: "_unions.VoiceAgentSessionUpdate", - event_id: Optional[str] = None, + id: str, # pylint: disable=redefined-builtin + created_at: datetime.datetime, + response_id: Optional[str] = None, + commentary: Optional[str] = None, + thinking: Optional[str] = None, ) -> None: ... @overload @@ -28734,208 +35892,163 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.target = VoiceAgentLiveDelegationTarget.CLIENT # type: ignore -class VoiceAgentDefinition( - AgentDefinition, discriminator="voice" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """The voice agent definition. Its configuration (model, instructions, audio, tools, and optional - avatar) drives a managed speech-to-speech experience. Establish realtime voice sessions through - ``GET /agents/{agent_name}/endpoint/protocols/voice``. Every create or update produces a new - immutable version. +class VoiceAgentLiveConversation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A Live session persisted when effective store is true. Uses voice-conversation lifecycle and + retention; items are retrieved separately. - :ivar rai_config: Configuration for Responsible AI (RAI) content filtering and safety features. - :vartype rai_config: ~azure.ai.projects.models.RaiConfig - :ivar kind: The kind discriminator for a voice agent definition. Always ``voice``. Required. - VOICE. - :vartype kind: str or ~azure.ai.projects.models.VOICE - :ivar model_type: How the model backing this voice agent is served. Required with ``model`` for - a model-backed voice agent and omitted when ``conversation_engine`` is provided. This is - independent of the architecture (realtime or cascaded), which the service derives from the - selected model. Known values are: "managed" and "self_deployed". - :vartype model_type: str or ~azure.ai.projects.models.VoiceModelType - :ivar model: The model to use for this agent. Required with ``model_type`` for a model-backed - voice agent and omitted when ``conversation_engine`` is provided. The model must support - realtime or cascaded voice. - :vartype model: str - :ivar conversation_engine: The engine that owns conversation handling for this voice agent. - Exactly one of this property and the model-backed configuration (``model_type`` with ``model``) - must be provided. When this property is provided, ``model_type``, ``model``, ``instructions``, - ``tools``, and ``tool_choice`` must be omitted, and ``greeting.tool_choice`` cannot be - ``required``, because the engine owns the conversation logic. The initial implementation - supports a hosted-agent engine. - :vartype conversation_engine: ~azure.ai.projects.models.VoiceConversationEngine - :ivar instructions: A system (or developer) message inserted into the model's context. Supports - template substitution via ``structured_inputs``, rendered per session before the live session - starts. - :vartype instructions: str - :ivar greeting: Optional session-start greeting. Template mode speaks exact rendered text; - LLM-generated mode asks the session model to author the opening response and may use configured - tools. - :vartype greeting: ~azure.ai.projects.models.VoiceAgentGreetingConfig - :ivar audio: The audio configuration, including input and output formats, voice, turn - detection, noise reduction, and transcription. These values are session defaults; a client may - override supported fields when connecting. - :vartype audio: ~azure.ai.projects.models.VoiceAgentAudioConfig - :ivar output_modalities: The output modalities the agent produces. Defaults to ``["audio"]``. - ``animation`` and ``avatar`` are available when an avatar is configured. - :vartype output_modalities: list[str or ~azure.ai.projects.models.VoiceOutputModality] - :ivar max_output_tokens: The maximum output-token count for one response. Is either a int type - or a Literal["inf"] type. - :vartype max_output_tokens: int or str - :ivar include: Additional fields to include in service outputs. - :vartype include: list[str or ~azure.ai.projects.models.VoiceAgentSessionIncludeOption] - :ivar interim_response: Interim-response settings for latency and tool execution. - :vartype interim_response: ~azure.ai.projects.models.VoiceAgentInterimResponseConfig - :ivar avatar: Optional avatar configuration. These values are session defaults and may be - overridden when connecting. - :vartype avatar: ~azure.ai.projects.models.VoiceAgentAvatarConfig - :ivar tools: The tools the voice agent may use. Supported tool kinds are ``function`` (executed - by the client), ``mcp``, ``system`` (service-managed session controls), and ``toolbox``. - Server-side tools such as ``web_search``, ``azure_ai_search``, and ``openapi`` are provided - through a toolbox rather than declared directly. - :vartype tools: list[~azure.ai.projects.models.VoiceAgentTool] - :ivar tool_choice: How the model chooses tools for generated responses. ``none`` prevents tool - calls, ``auto`` lets the model decide, ``required`` requires at least one tool call, and a - specific function or MCP tool can be selected with an object. Defaults to ``auto``. Is one of - the following types: Literal["none"], Literal["auto"], Literal["required"], ToolChoiceFunction, - ToolChoiceMCP - :vartype tool_choice: str or str or str or ~azure.ai.projects.models.ToolChoiceFunction or - ~azure.ai.projects.models.ToolChoiceMCP - :ivar parallel_tool_calls: Whether the model may call multiple tools in parallel. - :vartype parallel_tool_calls: bool - :ivar structured_inputs: Set of structured inputs that participate in prompt template - substitution, rendered per session before the live session starts. - :vartype structured_inputs: dict[str, ~azure.ai.projects.models.StructuredInputDefinition] - :ivar subagent_config: Optional configuration for sibling Foundry text agents that this voice - agent may consult as background specialists. - :vartype subagent_config: ~azure.ai.projects.models.VoiceAgentSubagentConfig - :ivar store: Whether conversations with this agent are persisted. A single, all-or-nothing - persistence switch that defaults to ``false`` (privacy-safe: off by default). When ``true``, - Foundry persists the full conversation — the transcript/event timeline and raw audio. When - ``false``, nothing is persisted and no conversation is surfaced. There is no separate - audio-logging control; audio is persisted only as part of this switch. Latency/performance - telemetry (e.g. time-to-first-audio, inter-token latency, interruption) is observability-only - (customer trace / App Insights) and is not part of the persisted conversation content. - :vartype store: bool + :ivar id: The unique id of the conversation. Required. + :vartype id: str + :ivar object: The object type. Always ``voice.conversation``. Required. Default value is + "voice.conversation". + :vartype object: str + :ivar status: The lifecycle status of the conversation. Required. Known values are: + "in_progress", "completed", and "failed". + :vartype status: str or ~azure.ai.projects.models.VoiceConversationStatus + :ivar created_at: The Unix timestamp (in seconds) for when the conversation was created. + Required. + :vartype created_at: ~datetime.datetime + :ivar completed_at: The Unix timestamp (in seconds) for when session and persistence + finalization reached the terminal ``completed`` or ``failed`` status. Absent while ``status`` + is ``in_progress``. + :vartype completed_at: ~datetime.datetime + :ivar metadata: A set of key-value pairs attached to the conversation. + :vartype metadata: dict[str, str] + :ivar last_error: The terminal error that prevented persistence finalization. Present only when + ``status`` is ``failed``. + :vartype last_error: ~azure.ai.projects.models.ApiError + :ivar usage: Cumulative Live audio usage, excluding delegated-model tokens. May be absent after + abnormal close. + :vartype usage: ~azure.ai.projects.models.LiveSessionUsage """ - kind: Literal[AgentKind.VOICE] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The kind discriminator for a voice agent definition. Always ``voice``. Required. VOICE.""" - model_type: Optional[Union[str, "_models.VoiceModelType"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """How the model backing this voice agent is served. Required with ``model`` for a model-backed - voice agent and omitted when ``conversation_engine`` is provided. This is independent of the - architecture (realtime or cascaded), which the service derives from the selected model. Known - values are: \"managed\" and \"self_deployed\".""" - model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The model to use for this agent. Required with ``model_type`` for a model-backed voice agent - and omitted when ``conversation_engine`` is provided. The model must support realtime or - cascaded voice.""" - conversation_engine: Optional["_models.VoiceConversationEngine"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The engine that owns conversation handling for this voice agent. Exactly one of this property - and the model-backed configuration (``model_type`` with ``model``) must be provided. When this - property is provided, ``model_type``, ``model``, ``instructions``, ``tools``, and - ``tool_choice`` must be omitted, and ``greeting.tool_choice`` cannot be ``required``, because - the engine owns the conversation logic. The initial implementation supports a hosted-agent - engine.""" - instructions: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A system (or developer) message inserted into the model's context. Supports template - substitution via ``structured_inputs``, rendered per session before the live session starts.""" - greeting: Optional["_models.VoiceAgentGreetingConfig"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Optional session-start greeting. Template mode speaks exact rendered text; LLM-generated mode - asks the session model to author the opening response and may use configured tools.""" - audio: Optional["_models.VoiceAgentAudioConfig"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The audio configuration, including input and output formats, voice, turn detection, noise - reduction, and transcription. These values are session defaults; a client may override - supported fields when connecting.""" - output_modalities: Optional[list[Union[str, "_models.VoiceOutputModality"]]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The output modalities the agent produces. Defaults to ``[\"audio\"]``. ``animation`` and - ``avatar`` are available when an avatar is configured.""" - max_output_tokens: Optional["_unions.VoiceAgentMaxOutputTokens"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The maximum output-token count for one response. Is either a int type or a Literal[\"inf\"] - type.""" - include: Optional[list[Union[str, "_models.VoiceAgentSessionIncludeOption"]]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Additional fields to include in service outputs.""" - interim_response: Optional["_models.VoiceAgentInterimResponseConfig"] = rest_field( + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique id of the conversation. Required.""" + object: Literal["voice.conversation"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The object type. Always ``voice.conversation``. Required. Default value is + \"voice.conversation\".""" + status: Union[str, "_models.VoiceConversationStatus"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Interim-response settings for latency and tool execution.""" - avatar: Optional["_models.VoiceAgentAvatarConfig"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + """The lifecycle status of the conversation. Required. Known values are: \"in_progress\", + \"completed\", and \"failed\".""" + created_at: datetime.datetime = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" ) - """Optional avatar configuration. These values are session defaults and may be overridden when - connecting.""" - tools: Optional[list["_models.VoiceAgentTool"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + """The Unix timestamp (in seconds) for when the conversation was created. Required.""" + completed_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" ) - """The tools the voice agent may use. Supported tool kinds are ``function`` (executed by the - client), ``mcp``, ``system`` (service-managed session controls), and ``toolbox``. Server-side - tools such as ``web_search``, ``azure_ai_search``, and ``openapi`` are provided through a - toolbox rather than declared directly.""" - tool_choice: Optional["_unions.VoiceAgentToolChoice"] = rest_field( + """The Unix timestamp (in seconds) for when session and persistence finalization reached the + terminal ``completed`` or ``failed`` status. Absent while ``status`` is ``in_progress``.""" + metadata: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A set of key-value pairs attached to the conversation.""" + last_error: Optional["_models.ApiError"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The terminal error that prevented persistence finalization. Present only when ``status`` is + ``failed``.""" + usage: Optional["_models.LiveSessionUsage"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Cumulative Live audio usage, excluding delegated-model tokens. May be absent after abnormal + close.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + status: Union[str, "_models.VoiceConversationStatus"], + created_at: datetime.datetime, + completed_at: Optional[datetime.datetime] = None, + metadata: Optional[dict[str, str]] = None, + last_error: Optional["_models.ApiError"] = None, + usage: Optional["_models.LiveSessionUsage"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.object: Literal["voice.conversation"] = "voice.conversation" + + +class VoiceAgentLiveDefinition(VoiceAgentBaseDefinition): # pylint: disable=docstring-keyword-should-match-keyword-only + """The Live voice agent definition. Its configuration (model, instructions, audio, and delegation) + drives a managed speech-to-speech experience using a Foundry GPT Live deployment. Establish + Live voice sessions through ``GET + /agents/{agent_name}/endpoint/protocols/voice/live/sessions``. Every create or update produces + a new immutable version. + + :ivar rai_config: Configuration for Responsible AI (RAI) content filtering and safety features. + :vartype rai_config: ~azure.ai.projects.models.RaiConfig + :ivar kind: Always voice. Required. VOICE. + :vartype kind: str or ~azure.ai.projects.models.VOICE + :ivar instructions: Frontend instructions, templated with structured_inputs. Backend + instructions belong in delegation.responses. + :vartype instructions: str + :ivar structured_inputs: Template inputs for session instructions and supported greetings. + :vartype structured_inputs: dict[str, ~azure.ai.projects.models.StructuredInputDefinition] + :ivar store: Persists conversation content and audio in Foundry, not native Live recordings. + Defaults to false. + :vartype store: bool + :ivar sub_protocol: Selects the Live protocol. Required. Default value is "live". + :vartype sub_protocol: str + :ivar model_type: Uses a Foundry model deployment. Required. Default value is "self_deployed". + :vartype model_type: str + :ivar model: The GPT Live deployment name. Required. + :vartype model: str + :ivar greeting: Template-only startup greeting, rendered with session structured inputs. + Foundry-only; not sent in native Live settings. + :vartype greeting: ~azure.ai.projects.models.VoiceAgentTemplateGreetingConfig + :ivar audio: Startup audio formats and output voice. + :vartype audio: ~azure.ai.projects.models.LiveInitialSessionAudioParam + :ivar delegation: Delegation settings. Omit for client mode. responses.model is a backend + deployment name in the Live resource, not a model catalog ID. Is one of the following types: + LiveClientDelegationParam, LiveResponsesDelegationParam, VoiceAgentLiveManagedAgentDelegation + :vartype delegation: ~azure.ai.projects.models.LiveClientDelegationParam or + ~azure.ai.projects.models.LiveResponsesDelegationParam or + ~azure.ai.projects.models.VoiceAgentLiveManagedAgentDelegation + """ + + sub_protocol: Literal["live"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Selects the Live protocol. Required. Default value is \"live\".""" + model_type: Literal["self_deployed"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Uses a Foundry model deployment. Required. Default value is \"self_deployed\".""" + model: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The GPT Live deployment name. Required.""" + greeting: Optional["_models.VoiceAgentTemplateGreetingConfig"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """How the model chooses tools for generated responses. ``none`` prevents tool calls, ``auto`` - lets the model decide, ``required`` requires at least one tool call, and a specific function or - MCP tool can be selected with an object. Defaults to ``auto``. Is one of the following types: - Literal[\"none\"], Literal[\"auto\"], Literal[\"required\"], ToolChoiceFunction, ToolChoiceMCP""" - parallel_tool_calls: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether the model may call multiple tools in parallel.""" - structured_inputs: Optional[dict[str, "_models.StructuredInputDefinition"]] = rest_field( + """Template-only startup greeting, rendered with session structured inputs. Foundry-only; not sent + in native Live settings.""" + audio: Optional["_models.LiveInitialSessionAudioParam"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Set of structured inputs that participate in prompt template substitution, rendered per session - before the live session starts.""" - subagent_config: Optional["_models.VoiceAgentSubagentConfig"] = rest_field( + """Startup audio formats and output voice.""" + delegation: Optional["_unions.VoiceAgentLiveDelegation"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Optional configuration for sibling Foundry text agents that this voice agent may consult as - background specialists.""" - store: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether conversations with this agent are persisted. A single, all-or-nothing persistence - switch that defaults to ``false`` (privacy-safe: off by default). When ``true``, Foundry - persists the full conversation — the transcript/event timeline and raw audio. When ``false``, - nothing is persisted and no conversation is surfaced. There is no separate audio-logging - control; audio is persisted only as part of this switch. Latency/performance telemetry (e.g. - time-to-first-audio, inter-token latency, interruption) is observability-only (customer trace / - App Insights) and is not part of the persisted conversation content.""" + """Delegation settings. Omit for client mode. responses.model is a backend deployment name in the + Live resource, not a model catalog ID. Is one of the following types: + LiveClientDelegationParam, LiveResponsesDelegationParam, VoiceAgentLiveManagedAgentDelegation""" @overload def __init__( self, *, + model: str, rai_config: Optional["_models.RaiConfig"] = None, - model_type: Optional[Union[str, "_models.VoiceModelType"]] = None, - model: Optional[str] = None, - conversation_engine: Optional["_models.VoiceConversationEngine"] = None, instructions: Optional[str] = None, - greeting: Optional["_models.VoiceAgentGreetingConfig"] = None, - audio: Optional["_models.VoiceAgentAudioConfig"] = None, - output_modalities: Optional[list[Union[str, "_models.VoiceOutputModality"]]] = None, - max_output_tokens: Optional["_unions.VoiceAgentMaxOutputTokens"] = None, - include: Optional[list[Union[str, "_models.VoiceAgentSessionIncludeOption"]]] = None, - interim_response: Optional["_models.VoiceAgentInterimResponseConfig"] = None, - avatar: Optional["_models.VoiceAgentAvatarConfig"] = None, - tools: Optional[list["_models.VoiceAgentTool"]] = None, - tool_choice: Optional["_unions.VoiceAgentToolChoice"] = None, - parallel_tool_calls: Optional[bool] = None, structured_inputs: Optional[dict[str, "_models.StructuredInputDefinition"]] = None, - subagent_config: Optional["_models.VoiceAgentSubagentConfig"] = None, store: Optional[bool] = None, + greeting: Optional["_models.VoiceAgentTemplateGreetingConfig"] = None, + audio: Optional["_models.LiveInitialSessionAudioParam"] = None, + delegation: Optional["_unions.VoiceAgentLiveDelegation"] = None, ) -> None: ... @overload @@ -28947,42 +36060,50 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.kind = AgentKind.VOICE # type: ignore + self.sub_protocol: Literal["live"] = "live" # pyright: ignore[reportIncompatibleVariableOverride] + self.model_type: Literal["self_deployed"] = "self_deployed" -class VoiceAgentEchoCancellation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Server-side echo cancellation settings for input audio. +class VoiceAgentLiveDelegationItem(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Live delegation trigger metadata reported to Foundry clients. This object contains metadata, + not the task text. - :ivar type: The echo cancellation implementation. Always ``server_echo_cancellation``. - Required. Default value is "server_echo_cancellation". + :ivar id: The unique ID of the delegation. Use this as delegation_id when replying to + client-owned work or correlating backend events. Required. + :vartype id: str + :ivar type: The object type, always ``delegation``. Required. Default value is "delegation". :vartype type: str - :ivar reference_source: Whether reference audio comes from server playback or a client-provided - channel. Known values are: "server" and "client". - :vartype reference_source: str or - ~azure.ai.projects.models.VoiceAgentEchoCancellationReferenceSource - :ivar channels: The number of input channels. Use two interleaved channels when - ``reference_source`` is ``client``. - :vartype channels: int + :ivar response_id: The ID of the Responses API response associated with a Responses delegation. + Omitted for client delegations. + :vartype response_id: str + :ivar target: Where the work is handled. foundry_managed_agent sessions report + foundry_managed_agent; GPT Live itself uses client. Required. Known values are: "responses", + "client", and "foundry_managed_agent". + :vartype target: str or ~azure.ai.projects.models.VoiceAgentLiveDelegationTarget """ - type: Literal["server_echo_cancellation"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The echo cancellation implementation. Always ``server_echo_cancellation``. Required. Default - value is \"server_echo_cancellation\".""" - reference_source: Optional[Union[str, "_models.VoiceAgentEchoCancellationReferenceSource"]] = rest_field( + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the delegation. Use this as delegation_id when replying to client-owned work + or correlating backend events. Required.""" + type: Literal["delegation"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The object type, always ``delegation``. Required. Default value is \"delegation\".""" + response_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the Responses API response associated with a Responses delegation. Omitted for client + delegations.""" + target: Union[str, "_models.VoiceAgentLiveDelegationTarget"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Whether reference audio comes from server playback or a client-provided channel. Known values - are: \"server\" and \"client\".""" - channels: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The number of input channels. Use two interleaved channels when ``reference_source`` is - ``client``.""" + """Where the work is handled. foundry_managed_agent sessions report foundry_managed_agent; GPT + Live itself uses client. Required. Known values are: \"responses\", \"client\", and + \"foundry_managed_agent\".""" @overload def __init__( self, *, - reference_source: Optional[Union[str, "_models.VoiceAgentEchoCancellationReferenceSource"]] = None, - channels: Optional[int] = None, + id: str, # pylint: disable=redefined-builtin + target: Union[str, "_models.VoiceAgentLiveDelegationTarget"], + response_id: Optional[str] = None, ) -> None: ... @overload @@ -28994,28 +36115,29 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type: Literal["server_echo_cancellation"] = "server_echo_cancellation" + self.type: Literal["delegation"] = "delegation" -class VoiceAgentTool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A tool usable by a voice agent. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - VoiceAgentFunctionTool, VoiceAgentMcpTool, VoiceAgentSystemTool, VoiceAgentToolboxTool +class VoiceAgentLiveDelegationResultItem1(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """VoiceAgentLiveDelegationResultItem1. - :ivar type: The tool kind. Required. Default value is None. - :vartype type: str + :ivar commentary: Guidance for Live to communicate to the user. + :vartype commentary: str + :ivar thinking: Background context, not private reasoning or a request to speak. Required. + :vartype thinking: str """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The tool kind. Required. Default value is None.""" + commentary: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Guidance for Live to communicate to the user.""" + thinking: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Background context, not private reasoning or a request to speak. Required.""" @overload def __init__( self, *, - type: str, + thinking: str, + commentary: Optional[str] = None, ) -> None: ... @overload @@ -29029,39 +36151,26 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentSystemTool( - VoiceAgentTool, discriminator="system" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A service-managed control that acts on the active voice session without customer code or - external authentication. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - VoiceAgentEndConversationSystemTool +class VoiceAgentLiveDelegationResultItem2(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """VoiceAgentLiveDelegationResultItem2. - :ivar type: The type of the tool. Always ``system``. Required. Default value is "system". - :vartype type: str - :ivar name: The service-managed control action. Known values are stable; additional values may - be added over time. Required. "end_conversation" - :vartype name: str or ~azure.ai.projects.models.VoiceAgentSystemToolName - :ivar description: An optional description of the system tool. - :vartype description: str + :ivar commentary: Guidance for Live to communicate to the user. Required. + :vartype commentary: str + :ivar thinking: Background context, not private reasoning or a request to speak. + :vartype thinking: str """ - __mapping__: dict[str, _Model] = {} - type: Literal["system"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the tool. Always ``system``. Required. Default value is \"system\".""" - name: str = rest_discriminator(name="name", visibility=["read", "create", "update", "delete", "query"]) - """The service-managed control action. Known values are stable; additional values may be added - over time. Required. \"end_conversation\"""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """An optional description of the system tool.""" + commentary: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Guidance for Live to communicate to the user. Required.""" + thinking: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Background context, not private reasoning or a request to speak.""" @overload def __init__( self, *, - name: str, - description: Optional[str] = None, + commentary: str, + thinking: Optional[str] = None, ) -> None: ... @overload @@ -29073,33 +36182,85 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = "system" # type: ignore -class VoiceAgentEndConversationSystemTool( - VoiceAgentSystemTool, discriminator="end_conversation" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A service-managed control that ends the active conversation. +class VoiceAgentLiveFoundryManagedAgentDelegationItem( + VoiceAgentLiveDelegationConversationItem, discriminator="foundry_managed_agent" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Stored prompt-agent delegation state and accepted results. - :ivar type: The type of the tool. Always ``system``. Required. Default value is "system". - :vartype type: str - :ivar description: An optional description of the system tool. - :vartype description: str - :ivar name: The service-managed control action. Always ``end_conversation``. Required. Ends the - active conversation. - :vartype name: str or ~azure.ai.projects.models.END_CONVERSATION + :ivar id: Item ID used for retrieval. Foundry assigns speech IDs; delegation IDs retain their + native value. Required. + :vartype id: str + :ivar type: The object type, always ``delegation``. Required. DELEGATION. + :vartype type: str or ~azure.ai.projects.models.DELEGATION + :ivar response_id: The ID of the Responses API response associated with a Responses delegation. + Omitted for client delegations. + :vartype response_id: str + :ivar created_at: Observed delegation creation time, in Unix seconds. Required. + :vartype created_at: ~datetime.datetime + :ivar target: Required. FOUNDRY_MANAGED_AGENT. + :vartype target: str or ~azure.ai.projects.models.FOUNDRY_MANAGED_AGENT + :ivar agent_name: Target agent name in the same project. Required. + :vartype agent_name: str + :ivar agent_version: Target version pinned at connection start. Required. + :vartype agent_version: str + :ivar offset_ms: Native delegation offset from session start, in milliseconds. Required. + :vartype offset_ms: int + :ivar backend_conversation_id: Backend conversation ID, distinct from the voice conversation + and Live session IDs. + :vartype backend_conversation_id: str + :ivar output: Accepted guidance in order; empty until a result is accepted. Entries have no + individual IDs, are noncumulative, and are independent of backend output_index. Partial results + survive failure or cancellation. Required. + :vartype output: list[~azure.ai.projects.models.VoiceAgentLiveDelegationResultItem2 or + ~azure.ai.projects.models.VoiceAgentLiveDelegationResultItem1] + :ivar delegation_context: Task context sent to the target agent, not the full request body. + :vartype delegation_context: str + :ivar status: The persisted delegation outcome. Required. Known values are: "in_progress", + "completed", "failed", "incomplete", and "cancelled". + :vartype status: str or ~azure.ai.projects.models.VoiceAgentLiveDelegationStatus """ __mapping__: dict[str, _Model] = {} - name: Literal[VoiceAgentSystemToolName.END_CONVERSATION] = rest_discriminator(name="name", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The service-managed control action. Always ``end_conversation``. Required. Ends the active - conversation.""" + target: Literal[VoiceAgentLiveDelegationTarget.FOUNDRY_MANAGED_AGENT] = rest_discriminator(name="target", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. FOUNDRY_MANAGED_AGENT.""" + agent_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Target agent name in the same project. Required.""" + agent_version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Target version pinned at connection start. Required.""" + offset_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Native delegation offset from session start, in milliseconds. Required.""" + backend_conversation_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Backend conversation ID, distinct from the voice conversation and Live session IDs.""" + output: list["_unions.VoiceAgentLiveDelegationResultItem"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Accepted guidance in order; empty until a result is accepted. Entries have no individual IDs, + are noncumulative, and are independent of backend output_index. Partial results survive failure + or cancellation. Required.""" + delegation_context: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Task context sent to the target agent, not the full request body.""" + status: Union[str, "_models.VoiceAgentLiveDelegationStatus"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The persisted delegation outcome. Required. Known values are: \"in_progress\", \"completed\", + \"failed\", \"incomplete\", and \"cancelled\".""" @overload def __init__( self, *, - description: Optional[str] = None, + id: str, # pylint: disable=redefined-builtin + created_at: datetime.datetime, + agent_name: str, + agent_version: str, + offset_ms: int, + output: list["_unions.VoiceAgentLiveDelegationResultItem"], + status: Union[str, "_models.VoiceAgentLiveDelegationStatus"], + response_id: Optional[str] = None, + backend_conversation_id: Optional[str] = None, + delegation_context: Optional[str] = None, ) -> None: ... @overload @@ -29111,46 +36272,39 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.name = VoiceAgentSystemToolName.END_CONVERSATION # type: ignore + self.target = VoiceAgentLiveDelegationTarget.FOUNDRY_MANAGED_AGENT # type: ignore -class VoiceAgentEndOfUtteranceDetection(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Semantic end-of-utterance detection configuration. +class VoiceAgentLiveInputConversationItem( + VoiceAgentLiveConversationItem, discriminator="input" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A stored user speech segment. - :ivar model: The semantic detection model. Required. Known values are: "semantic_detection_v1", - "semantic_detection_v1_en", "semantic_detection_v1_multilingual", and - "smart_end_of_turn_detection". - :vartype model: str or ~azure.ai.projects.models.VoiceAgentEndOfUtteranceDetectionModel - :ivar threshold_level: The sensitivity threshold. Known values are: "low", "medium", "high", - and "default". - :vartype threshold_level: str or - ~azure.ai.projects.models.VoiceAgentEndOfUtteranceThresholdLevel - :ivar timeout_ms: The detection timeout in milliseconds. - :vartype timeout_ms: ~datetime.timedelta + :ivar id: Item ID used for retrieval. Foundry assigns speech IDs; delegation IDs retain their + native value. Required. + :vartype id: str + :ivar type: Required. INPUT. + :vartype type: str or ~azure.ai.projects.models.INPUT + :ivar transcription: Captured user transcription, when available. + :vartype transcription: str + :ivar audio: Captured audio metadata; audio.item_id matches this item's id. + :vartype audio: ~azure.ai.projects.models.VoiceAudioItem """ - model: Union[str, "_models.VoiceAgentEndOfUtteranceDetectionModel"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The semantic detection model. Required. Known values are: \"semantic_detection_v1\", - \"semantic_detection_v1_en\", \"semantic_detection_v1_multilingual\", and - \"smart_end_of_turn_detection\".""" - threshold_level: Optional[Union[str, "_models.VoiceAgentEndOfUtteranceThresholdLevel"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The sensitivity threshold. Known values are: \"low\", \"medium\", \"high\", and \"default\".""" - timeout_ms: Optional[datetime.timedelta] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" - ) - """The detection timeout in milliseconds.""" + type: Literal[VoiceAgentLiveConversationItemType.INPUT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. INPUT.""" + transcription: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Captured user transcription, when available.""" + audio: Optional["_models.VoiceAudioItem"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Captured audio metadata; audio.item_id matches this item's id.""" @overload def __init__( self, *, - model: Union[str, "_models.VoiceAgentEndOfUtteranceDetectionModel"], - threshold_level: Optional[Union[str, "_models.VoiceAgentEndOfUtteranceThresholdLevel"]] = None, - timeout_ms: Optional[datetime.timedelta] = None, + id: str, # pylint: disable=redefined-builtin + transcription: Optional[str] = None, + audio: Optional["_models.VoiceAudioItem"] = None, ) -> None: ... @overload @@ -29162,43 +36316,36 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = VoiceAgentLiveConversationItemType.INPUT # type: ignore -class VoiceAgentFunctionTool( - VoiceAgentTool, discriminator="function" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A native function tool executed by the client. +class VoiceAgentLiveManagedAgentDelegation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Delegates to a same-project prompt agent using native client delegation. Requires [thinking] + and/or [commentary] output sections. - :ivar description: The description of the function, including guidance on when and how to call - it, and guidance about what to tell the user when calling (if anything). - :vartype description: str - :ivar parameters: Parameters of the function in JSON Schema. - :vartype parameters: ~azure.ai.projects.models.RealtimeFunctionToolParameters - :ivar type: Required. Default value is "function". + :ivar type: Canonical delegation type; legacy managed_prompt_agent values are returned as + foundry_managed_agent. Required. Default value is "foundry_managed_agent". :vartype type: str - :ivar name: The function name. Required. - :vartype name: str + :ivar agent_name: Name of a prompt agent in the same project. Required. + :vartype agent_name: str + :ivar agent_version: Agent version, pinned per connection. Omit to select the active version. + :vartype agent_version: str """ - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The description of the function, including guidance on when and how to call it, and guidance - about what to tell the user when calling (if anything).""" - parameters: Optional["_models.RealtimeFunctionToolParameters"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Parameters of the function in JSON Schema.""" - type: Literal["function"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Default value is \"function\".""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The function name. Required.""" + type: Literal["foundry_managed_agent"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Canonical delegation type; legacy managed_prompt_agent values are returned as + foundry_managed_agent. Required. Default value is \"foundry_managed_agent\".""" + agent_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of a prompt agent in the same project. Required.""" + agent_version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Agent version, pinned per connection. Omit to select the active version.""" @overload def __init__( self, *, - name: str, - description: Optional[str] = None, - parameters: Optional["_models.RealtimeFunctionToolParameters"] = None, + agent_name: str, + agent_version: Optional[str] = None, ) -> None: ... @overload @@ -29210,28 +36357,40 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = "function" # type: ignore - + self.type: Literal["foundry_managed_agent"] = "foundry_managed_agent" -class VoiceAgentGreetingConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Session-start greeting configuration for a voice agent. - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - VoiceAgentLlmGeneratedGreetingConfig, VoiceAgentTemplateGreetingConfig +class VoiceAgentLiveOutputConversationItem( + VoiceAgentLiveConversationItem, discriminator="output" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A stored assistant speech segment. - :ivar type: The greeting mode. Required. Default value is None. - :vartype type: str + :ivar id: Item ID used for retrieval. Foundry assigns speech IDs; delegation IDs retain their + native value. Required. + :vartype id: str + :ivar type: Required. OUTPUT. + :vartype type: str or ~azure.ai.projects.models.OUTPUT + :ivar transcription: Captured assistant transcription, not backend output or commentary + guidance. + :vartype transcription: str + :ivar audio: Captured audio metadata; audio.item_id matches this item's id. + :vartype audio: ~azure.ai.projects.models.VoiceAudioItem """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The greeting mode. Required. Default value is None.""" + type: Literal[VoiceAgentLiveConversationItemType.OUTPUT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. OUTPUT.""" + transcription: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Captured assistant transcription, not backend output or commentary guidance.""" + audio: Optional["_models.VoiceAudioItem"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Captured audio metadata; audio.item_id matches this item's id.""" @overload def __init__( self, *, - type: str, + id: str, # pylint: disable=redefined-builtin + transcription: Optional[str] = None, + audio: Optional["_models.VoiceAudioItem"] = None, ) -> None: ... @overload @@ -29243,93 +36402,44 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = VoiceAgentLiveConversationItemType.OUTPUT # type: ignore -class VoiceAgentInputTranscription(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Asynchronous input-audio transcription configuration. Extends the OpenAI Realtime transcription - options with the Azure and MAI transcription models, custom speech models, and phrase hints. +class VoiceAgentLiveResponsesDelegationConversationItem( + VoiceAgentLiveDelegationConversationItem, discriminator="responses" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Stored Responses delegation output, separate from Live speech. - :ivar language: The language of the input audio. Supplying the input language in `ISO-639-1 - `_ (e.g. ``en``) format will improve - accuracy and latency. - :vartype language: str - :ivar languages: Possible languages of the input audio, in `ISO-639-1 - `_ format. Supported by - ``gpt-transcribe`` and ``gpt-live-transcribe``. - :vartype languages: list[str] - :ivar keywords: Words or phrases to guide transcription of the input audio. Supported by - ``gpt-transcribe`` and ``gpt-live-transcribe``. - :vartype keywords: list[str] - :ivar prompt: An optional text to guide the model's style or continue a previous audio segment. - For ``whisper-1``, the `prompt is a list of keywords `_. - For ``gpt-4o-transcribe`` models (excluding ``gpt-4o-transcribe-diarize``), the prompt is a - free text string, for example "expect words related to technology". Prompt is not supported - with ``gpt-realtime-whisper`` in GA Realtime sessions. - :vartype prompt: str - :ivar delay: Controls how long the model waits before emitting transcription text. Higher - values can improve transcription accuracy at the cost of latency. Only supported with - ``gpt-realtime-whisper`` in GA Realtime sessions. Is one of the following types: - Literal["minimal"], Literal["low"], Literal["medium"], Literal["high"], Literal["xhigh"] - :vartype delay: str or str or str or str or str - :ivar model: The transcription model identifier. Configure customer custom speech deployments - in ``custom_speech``. Required. Known values are: "whisper-1", "gpt-realtime-whisper", - "gpt-4o-transcribe", "gpt-4o-mini-transcribe", "gpt-4o-transcribe-diarize", "gpt-transcribe", - "gpt-live-transcribe", "mai-transcribe", and "azure-speech". - :vartype model: str or ~azure.ai.projects.models.VoiceAgentInputTranscriptionModel - :ivar custom_speech: Optional customer custom speech deployment configuration, keyed by locale. - :vartype custom_speech: dict[str, str] - :ivar phrase_list: Optional phrase hints that bias recognition toward domain terms. - :vartype phrase_list: list[str] + :ivar id: Item ID used for retrieval. Foundry assigns speech IDs; delegation IDs retain their + native value. Required. + :vartype id: str + :ivar type: The object type, always ``delegation``. Required. DELEGATION. + :vartype type: str or ~azure.ai.projects.models.DELEGATION + :ivar response_id: The ID of the Responses API response associated with a Responses delegation. + Omitted for client delegations. + :vartype response_id: str + :ivar created_at: Observed delegation creation time, in Unix seconds. Required. + :vartype created_at: ~datetime.datetime + :ivar target: Required. RESPONSES. + :vartype target: str or ~azure.ai.projects.models.RESPONSES + :ivar output: Final backend text, omitted when unavailable; excludes raw tool output. + :vartype output: str """ - language: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The language of the input audio. Supplying the input language in `ISO-639-1 - `_ (e.g. ``en``) format will improve - accuracy and latency.""" - languages: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Possible languages of the input audio, in `ISO-639-1 - `_ format. Supported by - ``gpt-transcribe`` and ``gpt-live-transcribe``.""" - keywords: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Words or phrases to guide transcription of the input audio. Supported by ``gpt-transcribe`` and - ``gpt-live-transcribe``.""" - prompt: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """An optional text to guide the model's style or continue a previous audio segment. For - ``whisper-1``, the `prompt is a list of keywords `_. For - ``gpt-4o-transcribe`` models (excluding ``gpt-4o-transcribe-diarize``), the prompt is a free - text string, for example \"expect words related to technology\". Prompt is not supported with - ``gpt-realtime-whisper`` in GA Realtime sessions.""" - delay: Optional[Literal["minimal", "low", "medium", "high", "xhigh"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Controls how long the model waits before emitting transcription text. Higher values can improve - transcription accuracy at the cost of latency. Only supported with ``gpt-realtime-whisper`` in - GA Realtime sessions. Is one of the following types: Literal[\"minimal\"], Literal[\"low\"], - Literal[\"medium\"], Literal[\"high\"], Literal[\"xhigh\"]""" - model: Union[str, "_models.VoiceAgentInputTranscriptionModel"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The transcription model identifier. Configure customer custom speech deployments in - ``custom_speech``. Required. Known values are: \"whisper-1\", \"gpt-realtime-whisper\", - \"gpt-4o-transcribe\", \"gpt-4o-mini-transcribe\", \"gpt-4o-transcribe-diarize\", - \"gpt-transcribe\", \"gpt-live-transcribe\", \"mai-transcribe\", and \"azure-speech\".""" - custom_speech: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional customer custom speech deployment configuration, keyed by locale.""" - phrase_list: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional phrase hints that bias recognition toward domain terms.""" + __mapping__: dict[str, _Model] = {} + target: Literal[VoiceAgentLiveDelegationTarget.RESPONSES] = rest_discriminator(name="target", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. RESPONSES.""" + output: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Final backend text, omitted when unavailable; excludes raw tool output.""" @overload def __init__( self, *, - model: Union[str, "_models.VoiceAgentInputTranscriptionModel"], - language: Optional[str] = None, - languages: Optional[list[str]] = None, - keywords: Optional[list[str]] = None, - prompt: Optional[str] = None, - delay: Optional[Literal["minimal", "low", "medium", "high", "xhigh"]] = None, - custom_speech: Optional[dict[str, str]] = None, - phrase_list: Optional[list[str]] = None, + id: str, # pylint: disable=redefined-builtin + created_at: datetime.datetime, + response_id: Optional[str] = None, + output: Optional[str] = None, ) -> None: ... @overload @@ -29341,41 +36451,109 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.target = VoiceAgentLiveDelegationTarget.RESPONSES # type: ignore -class VoiceAgentInterimResponseConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Fields shared by interim-response configurations. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - VoiceAgentLlmInterimResponseConfig, VoiceAgentStaticInterimResponseConfig +class VoiceAgentLiveSessionResource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Live session resource reported to Foundry clients. GPT Live runs native client delegation for + foundry_managed_agent sessions; Foundry reports the effective owner. - :ivar type: The interim-response implementation. Required. Default value is None. - :vartype type: str - :ivar triggers: Conditions that may trigger one interim response. - :vartype triggers: list[str or ~azure.ai.projects.models.VoiceAgentInterimResponseTrigger] - :ivar latency_threshold_ms: The latency threshold in milliseconds. - :vartype latency_threshold_ms: ~datetime.timedelta + :ivar model: Required. "gpt-live-1" + :vartype model: str or ~azure.ai.projects.models.ModelIdsLive + :ivar instructions: + :vartype instructions: str + :ivar input: Ordered text-only history supplied before startup. Supports developer, user, and + assistant messages with one text part each; at most 128 messages and a configured + rendered-token limit (8,192 by default). + :vartype input: list[~azure.ai.projects.models.LiveInitialItem] + :ivar audio: Startup audio configuration. Only primary WebSockets accept audio.format; WebRTC + and SIP negotiate their media format. Voice and format are immutable after startup. + :vartype audio: ~azure.ai.projects.models.LiveInitialSessionAudioParam + :ivar triggers: At most one Decisions trigger per transcript event type. Triggers run + independently of delegation. On update, omit triggers to keep the current configuration, send a + list to replace it, or send an empty list to disable triggers. + :vartype triggers: list[~azure.ai.projects.models.LiveDecisionTriggerInputParam_2] + :ivar store: Whether to store the session for later forking and recording download. Defaults to + false for new sessions. + :vartype store: bool + :ivar client: Startup-only capabilities for an untrusted frontend attached to a unified WebRTC + session. Trusted sideband connections are unaffected. + :vartype client: ~azure.ai.projects.models.LiveClientConfigParam + :ivar id: The unique ID of the Live session. Use this ID for sideband connections, forking, and + recording download. Required. + :vartype id: str + :ivar expires_at: The Unix timestamp, in seconds, at which the Live session expires. Required. + :vartype expires_at: int + :ivar status: The status of the session snapshot. Always ``active``, including the final + snapshot in session.closed; use the event type to determine that the session has closed. + Required. Default value is "active". + :vartype status: str + :ivar delegation: Delegation owner. foundry_managed_agent sessions report the pinned target, + including the resolved agent_version. Is one of the following types: LiveClientDelegationParam, + LiveResponsesDelegationParam, VoiceAgentLiveManagedAgentDelegation + :vartype delegation: ~azure.ai.projects.models.LiveClientDelegationParam or + ~azure.ai.projects.models.LiveResponsesDelegationParam or + ~azure.ai.projects.models.VoiceAgentLiveManagedAgentDelegation """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The interim-response implementation. Required. Default value is None.""" - triggers: Optional[list[Union[str, "_models.VoiceAgentInterimResponseTrigger"]]] = rest_field( + model: Union[str, "_models.ModelIdsLive"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. \"gpt-live-1\"""" + instructions: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + input: Optional[list["_models.LiveInitialItem"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Conditions that may trigger one interim response.""" - latency_threshold_ms: Optional[datetime.timedelta] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + """Ordered text-only history supplied before startup. Supports developer, user, and assistant + messages with one text part each; at most 128 messages and a configured rendered-token limit + (8,192 by default).""" + audio: Optional["_models.LiveInitialSessionAudioParam"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """The latency threshold in milliseconds.""" + """Startup audio configuration. Only primary WebSockets accept audio.format; WebRTC and SIP + negotiate their media format. Voice and format are immutable after startup.""" + triggers: Optional[list["_models.LiveDecisionTriggerInputParam_2"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """At most one Decisions trigger per transcript event type. Triggers run independently of + delegation. On update, omit triggers to keep the current configuration, send a list to replace + it, or send an empty list to disable triggers.""" + store: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether to store the session for later forking and recording download. Defaults to false for + new sessions.""" + client: Optional["_models.LiveClientConfigParam"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Startup-only capabilities for an untrusted frontend attached to a unified WebRTC session. + Trusted sideband connections are unaffected.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the Live session. Use this ID for sideband connections, forking, and recording + download. Required.""" + expires_at: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Unix timestamp, in seconds, at which the Live session expires. Required.""" + status: Literal["active"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The status of the session snapshot. Always ``active``, including the final snapshot in + session.closed; use the event type to determine that the session has closed. Required. Default + value is \"active\".""" + delegation: Optional["_unions.VoiceAgentLiveDelegation"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Delegation owner. foundry_managed_agent sessions report the pinned target, including the + resolved agent_version. Is one of the following types: LiveClientDelegationParam, + LiveResponsesDelegationParam, VoiceAgentLiveManagedAgentDelegation""" @overload def __init__( self, *, - type: str, - triggers: Optional[list[Union[str, "_models.VoiceAgentInterimResponseTrigger"]]] = None, - latency_threshold_ms: Optional[datetime.timedelta] = None, + model: Union[str, "_models.ModelIdsLive"], + id: str, # pylint: disable=redefined-builtin + expires_at: int, + instructions: Optional[str] = None, + input: Optional[list["_models.LiveInitialItem"]] = None, + audio: Optional["_models.LiveInitialSessionAudioParam"] = None, + triggers: Optional[list["_models.LiveDecisionTriggerInputParam_2"]] = None, + store: Optional[bool] = None, + client: Optional["_models.LiveClientConfigParam"] = None, + delegation: Optional["_unions.VoiceAgentLiveDelegation"] = None, ) -> None: ... @overload @@ -29387,6 +36565,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.status: Literal["active"] = "active" class VoiceAgentLlmGeneratedGreetingConfig( @@ -29600,18 +36779,34 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class VoiceAgentNoiseReduction(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Input audio noise reduction configuration. - - :ivar type: The noise reduction mode. Required. Known values are: "near_field", "far_field", - and "azure_deep_noise_suppression". + """Input audio noise reduction configuration. ``azure_deep_noise_suppression_headset`` and + ``azure_personal_noise_suppression`` are modes for local voice activity detection that enhance + detection audio without changing the audio used for recognition. + + :ivar type: The noise reduction mode. ``azure_deep_noise_suppression_headset`` provides + headset-optimized noise suppression for local voice activity detection, optimized for + low-sample-rate audio including 8 kHz telephony audio without changing recognition audio (not + restricted to headset devices). ``azure_personal_noise_suppression`` starts with headset + suppression for local voice activity detection and personalizes detection after automatic + speaker enrollment while keeping recognition audio unchanged and keeping headset suppression + active when personalization is unavailable. Required. Known values are: "near_field", + "far_field", "azure_deep_noise_suppression", "azure_deep_noise_suppression_headset", and + "azure_personal_noise_suppression". :vartype type: str or ~azure.ai.projects.models.VoiceAgentNoiseReductionType """ type: Union[str, "_models.VoiceAgentNoiseReductionType"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The noise reduction mode. Required. Known values are: \"near_field\", \"far_field\", and - \"azure_deep_noise_suppression\".""" + """The noise reduction mode. ``azure_deep_noise_suppression_headset`` provides headset-optimized + noise suppression for local voice activity detection, optimized for low-sample-rate audio + including 8 kHz telephony audio without changing recognition audio (not restricted to headset + devices). ``azure_personal_noise_suppression`` starts with headset suppression for local voice + activity detection and personalizes detection after automatic speaker enrollment while keeping + recognition audio unchanged and keeping headset suppression active when personalization is + unavailable. Required. Known values are: \"near_field\", \"far_field\", + \"azure_deep_noise_suppression\", \"azure_deep_noise_suppression_headset\", and + \"azure_personal_noise_suppression\".""" @overload def __init__( @@ -31113,23 +38308,155 @@ class VoiceAgentSessionResponseConfig(_Model): # pylint: disable=docstring-keyw visibility=["read", "create", "update", "delete", "query"] ) """A proactive assistant greeting started after session configuration.""" - object: Literal["realtime.session"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The object type. Always ``realtime.session``. Required. Default value is \"realtime.session\".""" - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The session identifier. Required.""" - model: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The selected model. Required.""" - expires_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The session expiration time as a Unix timestamp in seconds.""" + object: Literal["realtime.session"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The object type. Always ``realtime.session``. Required. Default value is \"realtime.session\".""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The session identifier. Required.""" + model: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The selected model. Required.""" + expires_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The session expiration time as a Unix timestamp in seconds.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + model: str, + instructions: Optional[str] = None, + temperature: Optional[float] = None, + max_output_tokens: Optional["_unions.VoiceAgentMaxOutputTokens"] = None, + output_modalities: Optional[list[Union[str, "_models.VoiceOutputModality"]]] = None, + audio: Optional["_models.VoiceAgentAudioConfig"] = None, + avatar: Optional["_models.VoiceAgentSessionAvatarConfig"] = None, + animation: Optional["_models.VoiceAgentAnimationConfig"] = None, + tools: Optional[list["_models.VoiceAgentTool"]] = None, + tool_choice: Optional["_unions.VoiceAgentToolChoice"] = None, + reasoning: Optional["_models.RealtimeReasoning"] = None, + parallel_tool_calls: Optional[bool] = None, + include: Optional[list[Union[str, "_models.VoiceAgentSessionIncludeOption"]]] = None, + metadata: Optional[dict[str, str]] = None, + interim_response: Optional["_models.VoiceAgentInterimResponseConfig"] = None, + greeting: Optional["_models.VoiceAgentGreetingConfig"] = None, + expires_at: Optional[datetime.datetime] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type: Literal["realtime"] = "realtime" + self.object: Literal["realtime.session"] = "realtime.session" + + +class VoiceAgentSessionUpdateConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The stable realtime session settings accepted in a ``session.update`` client event. + + :ivar type: The session type. Always ``realtime``. Required. Default value is "realtime". + :vartype type: str + :ivar instructions: Instructions applied throughout the session. + :vartype instructions: str + :ivar temperature: The sampling temperature for compatible cascaded pipelines. + :vartype temperature: float + :ivar max_output_tokens: The maximum output-token count for one response. Is either a int type + or a Literal["inf"] type. + :vartype max_output_tokens: int or str + :ivar output_modalities: The output modalities enabled for the session. + :vartype output_modalities: list[str or ~azure.ai.projects.models.VoiceOutputModality] + :ivar audio: The input- and output-audio settings for the session. + :vartype audio: ~azure.ai.projects.models.VoiceAgentAudioConfig + :ivar avatar: The avatar settings for the session. + :vartype avatar: ~azure.ai.projects.models.VoiceAgentSessionAvatarConfig + :ivar animation: Animation settings for the session. + :vartype animation: ~azure.ai.projects.models.VoiceAgentAnimationConfig + :ivar tools: Tools available to the session. + :vartype tools: list[~azure.ai.projects.models.VoiceAgentTool] + :ivar tool_choice: Tool-selection behavior for the session. Is one of the following types: + Literal["none"], Literal["auto"], Literal["required"], ToolChoiceFunction, ToolChoiceMCP + :vartype tool_choice: str or str or str or ~azure.ai.projects.models.ToolChoiceFunction or + ~azure.ai.projects.models.ToolChoiceMCP + :ivar reasoning: Reasoning settings for compatible realtime models. + :vartype reasoning: ~azure.ai.projects.models.RealtimeReasoning + :ivar parallel_tool_calls: Whether the model may call multiple tools in parallel. + :vartype parallel_tool_calls: bool + :ivar include: Additional fields to include in service outputs. + :vartype include: list[str or ~azure.ai.projects.models.VoiceAgentSessionIncludeOption] + :ivar metadata: Up to 16 string key-value pairs attached to the session. + :vartype metadata: dict[str, str] + :ivar interim_response: Interim-response settings for latency and tool execution. + :vartype interim_response: ~azure.ai.projects.models.VoiceAgentInterimResponseConfig + :ivar greeting: A proactive assistant greeting started after session configuration. + :vartype greeting: ~azure.ai.projects.models.VoiceAgentGreetingConfig + """ + + type: Literal["realtime"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The session type. Always ``realtime``. Required. Default value is \"realtime\".""" + instructions: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Instructions applied throughout the session.""" + temperature: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sampling temperature for compatible cascaded pipelines.""" + max_output_tokens: Optional["_unions.VoiceAgentMaxOutputTokens"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The maximum output-token count for one response. Is either a int type or a Literal[\"inf\"] + type.""" + output_modalities: Optional[list[Union[str, "_models.VoiceOutputModality"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The output modalities enabled for the session.""" + audio: Optional["_models.VoiceAgentAudioConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The input- and output-audio settings for the session.""" + avatar: Optional["_models.VoiceAgentSessionAvatarConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The avatar settings for the session.""" + animation: Optional["_models.VoiceAgentAnimationConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Animation settings for the session.""" + tools: Optional[list["_models.VoiceAgentTool"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Tools available to the session.""" + tool_choice: Optional["_unions.VoiceAgentToolChoice"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Tool-selection behavior for the session. Is one of the following types: Literal[\"none\"], + Literal[\"auto\"], Literal[\"required\"], ToolChoiceFunction, ToolChoiceMCP""" + reasoning: Optional["_models.RealtimeReasoning"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Reasoning settings for compatible realtime models.""" + parallel_tool_calls: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether the model may call multiple tools in parallel.""" + include: Optional[list[Union[str, "_models.VoiceAgentSessionIncludeOption"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Additional fields to include in service outputs.""" + metadata: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Up to 16 string key-value pairs attached to the session.""" + interim_response: Optional["_models.VoiceAgentInterimResponseConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Interim-response settings for latency and tool execution.""" + greeting: Optional["_models.VoiceAgentGreetingConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """A proactive assistant greeting started after session configuration.""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - model: str, instructions: Optional[str] = None, temperature: Optional[float] = None, max_output_tokens: Optional["_unions.VoiceAgentMaxOutputTokens"] = None, @@ -31145,7 +38472,6 @@ def __init__( metadata: Optional[dict[str, str]] = None, interim_response: Optional["_models.VoiceAgentInterimResponseConfig"] = None, greeting: Optional["_models.VoiceAgentGreetingConfig"] = None, - expires_at: Optional[datetime.datetime] = None, ) -> None: ... @overload @@ -31158,125 +38484,183 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) self.type: Literal["realtime"] = "realtime" - self.object: Literal["realtime.session"] = "realtime.session" -class VoiceAgentSessionUpdateConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The stable realtime session settings accepted in a ``session.update`` client event. +class VoiceAgentSoundscapeConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Agent-owned background ambience and event cues. Each omitted track is disabled. The service + rejects unknown fields; custom uploads, URLs, and inline audio are not supported. - :ivar type: The session type. Always ``realtime``. Required. Default value is "realtime". - :vartype type: str - :ivar instructions: Instructions applied throughout the session. - :vartype instructions: str - :ivar temperature: The sampling temperature for compatible cascaded pipelines. - :vartype temperature: float - :ivar max_output_tokens: The maximum output-token count for one response. Is either a int type - or a Literal["inf"] type. - :vartype max_output_tokens: int or str - :ivar output_modalities: The output modalities enabled for the session. - :vartype output_modalities: list[str or ~azure.ai.projects.models.VoiceOutputModality] - :ivar audio: The input- and output-audio settings for the session. - :vartype audio: ~azure.ai.projects.models.VoiceAgentAudioConfig - :ivar avatar: The avatar settings for the session. - :vartype avatar: ~azure.ai.projects.models.VoiceAgentSessionAvatarConfig - :ivar animation: Animation settings for the session. - :vartype animation: ~azure.ai.projects.models.VoiceAgentAnimationConfig - :ivar tools: Tools available to the session. - :vartype tools: list[~azure.ai.projects.models.VoiceAgentTool] - :ivar tool_choice: Tool-selection behavior for the session. Is one of the following types: - Literal["none"], Literal["auto"], Literal["required"], ToolChoiceFunction, ToolChoiceMCP - :vartype tool_choice: str or str or str or ~azure.ai.projects.models.ToolChoiceFunction or - ~azure.ai.projects.models.ToolChoiceMCP - :ivar reasoning: Reasoning settings for compatible realtime models. - :vartype reasoning: ~azure.ai.projects.models.RealtimeReasoning - :ivar parallel_tool_calls: Whether the model may call multiple tools in parallel. - :vartype parallel_tool_calls: bool - :ivar include: Additional fields to include in service outputs. - :vartype include: list[str or ~azure.ai.projects.models.VoiceAgentSessionIncludeOption] - :ivar metadata: Up to 16 string key-value pairs attached to the session. - :vartype metadata: dict[str, str] - :ivar interim_response: Interim-response settings for latency and tool execution. - :vartype interim_response: ~azure.ai.projects.models.VoiceAgentInterimResponseConfig - :ivar greeting: A proactive assistant greeting started after session configuration. - :vartype greeting: ~azure.ai.projects.models.VoiceAgentGreetingConfig + :ivar background: Continuous background ambience that continues during caller and agent speech. + :vartype background: ~azure.ai.projects.models.VoiceAgentSoundscapeTrackConfig + :ivar working: A loop played while a non-call-control tool is pending and the agent is silent, + after the configured delay. + :vartype working: ~azure.ai.projects.models.VoiceAgentSoundscapeWorkingTrackConfig + :ivar opening: An interruptible cue played before the first agent speech. + :vartype opening: ~azure.ai.projects.models.VoiceAgentSoundscapeTrackConfig + :ivar transfer: A one-shot cue played after queued agent speech drains and before a committed + call transfer. + :vartype transfer: ~azure.ai.projects.models.VoiceAgentSoundscapeTrackConfig + :ivar closing: A one-shot cue played after queued agent speech drains and before a committed + session end. + :vartype closing: ~azure.ai.projects.models.VoiceAgentSoundscapeTrackConfig """ - type: Literal["realtime"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The session type. Always ``realtime``. Required. Default value is \"realtime\".""" - instructions: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Instructions applied throughout the session.""" - temperature: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The sampling temperature for compatible cascaded pipelines.""" - max_output_tokens: Optional["_unions.VoiceAgentMaxOutputTokens"] = rest_field( + background: Optional["_models.VoiceAgentSoundscapeTrackConfig"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The maximum output-token count for one response. Is either a int type or a Literal[\"inf\"] - type.""" - output_modalities: Optional[list[Union[str, "_models.VoiceOutputModality"]]] = rest_field( + """Continuous background ambience that continues during caller and agent speech.""" + working: Optional["_models.VoiceAgentSoundscapeWorkingTrackConfig"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The output modalities enabled for the session.""" - audio: Optional["_models.VoiceAgentAudioConfig"] = rest_field( + """A loop played while a non-call-control tool is pending and the agent is silent, after the + configured delay.""" + opening: Optional["_models.VoiceAgentSoundscapeTrackConfig"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The input- and output-audio settings for the session.""" - avatar: Optional["_models.VoiceAgentSessionAvatarConfig"] = rest_field( + """An interruptible cue played before the first agent speech.""" + transfer: Optional["_models.VoiceAgentSoundscapeTrackConfig"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The avatar settings for the session.""" - animation: Optional["_models.VoiceAgentAnimationConfig"] = rest_field( + """A one-shot cue played after queued agent speech drains and before a committed call transfer.""" + closing: Optional["_models.VoiceAgentSoundscapeTrackConfig"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Animation settings for the session.""" - tools: Optional[list["_models.VoiceAgentTool"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Tools available to the session.""" - tool_choice: Optional["_unions.VoiceAgentToolChoice"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Tool-selection behavior for the session. Is one of the following types: Literal[\"none\"], - Literal[\"auto\"], Literal[\"required\"], ToolChoiceFunction, ToolChoiceMCP""" - reasoning: Optional["_models.RealtimeReasoning"] = rest_field( + """A one-shot cue played after queued agent speech drains and before a committed session end.""" + + @overload + def __init__( + self, + *, + background: Optional["_models.VoiceAgentSoundscapeTrackConfig"] = None, + working: Optional["_models.VoiceAgentSoundscapeWorkingTrackConfig"] = None, + opening: Optional["_models.VoiceAgentSoundscapeTrackConfig"] = None, + transfer: Optional["_models.VoiceAgentSoundscapeTrackConfig"] = None, + closing: Optional["_models.VoiceAgentSoundscapeTrackConfig"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class VoiceAgentSoundscapeSourceConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A packaged sound selected from the service-managed catalogue. The service rejects unknown + source fields and discriminator values. + + :ivar type: The audio source type. Always ``built_in``. Required. Default value is "built_in". + :vartype type: str + :ivar name: The name of the packaged sound. Only the listed built-in sounds are accepted. + Required. Known values are: "office", "call_center", "busy_street", "people_talking", + "street_and_metro_station", "ding1", and "ding2". + :vartype name: str or ~azure.ai.projects.models.VoiceAgentSoundscapeSound + """ + + type: Literal["built_in"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The audio source type. Always ``built_in``. Required. Default value is \"built_in\".""" + name: Union[str, "_models.VoiceAgentSoundscapeSound"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Reasoning settings for compatible realtime models.""" - parallel_tool_calls: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether the model may call multiple tools in parallel.""" - include: Optional[list[Union[str, "_models.VoiceAgentSessionIncludeOption"]]] = rest_field( + """The name of the packaged sound. Only the listed built-in sounds are accepted. Required. Known + values are: \"office\", \"call_center\", \"busy_street\", \"people_talking\", + \"street_and_metro_station\", \"ding1\", and \"ding2\".""" + + @overload + def __init__( + self, + *, + name: Union[str, "_models.VoiceAgentSoundscapeSound"], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type: Literal["built_in"] = "built_in" + + +class VoiceAgentSoundscapeTrackConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A soundscape track with its own audio source and playback volume. + + :ivar source: The required audio source for this track. Required. + :vartype source: ~azure.ai.projects.models.VoiceAgentSoundscapeSourceConfig + :ivar gain: Linear playback gain from 0 to 1, independent of agent speech volume. If omitted, + the service defaults to 1. A value of 0 mutes this track. + :vartype gain: float + """ + + source: "_models.VoiceAgentSoundscapeSourceConfig" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Additional fields to include in service outputs.""" - metadata: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Up to 16 string key-value pairs attached to the session.""" - interim_response: Optional["_models.VoiceAgentInterimResponseConfig"] = rest_field( + """The required audio source for this track. Required.""" + gain: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Linear playback gain from 0 to 1, independent of agent speech volume. If omitted, the service + defaults to 1. A value of 0 mutes this track.""" + + @overload + def __init__( + self, + *, + source: "_models.VoiceAgentSoundscapeSourceConfig", + gain: Optional[float] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class VoiceAgentSoundscapeWorkingTrackConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A working-loop track with a delay measured from the first pending non-call-control tool. + + :ivar source: The required audio source for this track. Required. + :vartype source: ~azure.ai.projects.models.VoiceAgentSoundscapeSourceConfig + :ivar gain: Linear playback gain from 0 to 1, independent of agent speech volume. If omitted, + the service defaults to 1. A value of 0 mutes this track. + :vartype gain: float + :ivar delay_ms: The delay in milliseconds before working audio starts, from 0 to 10000. If + omitted, the service defaults to 1000 milliseconds. This delays only working audio, not tool + execution, and is valid only on the working track. + :vartype delay_ms: ~datetime.timedelta + """ + + source: "_models.VoiceAgentSoundscapeSourceConfig" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Interim-response settings for latency and tool execution.""" - greeting: Optional["_models.VoiceAgentGreetingConfig"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + """The required audio source for this track. Required.""" + gain: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Linear playback gain from 0 to 1, independent of agent speech volume. If omitted, the service + defaults to 1. A value of 0 mutes this track.""" + delay_ms: Optional[datetime.timedelta] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" ) - """A proactive assistant greeting started after session configuration.""" + """The delay in milliseconds before working audio starts, from 0 to 10000. If omitted, the service + defaults to 1000 milliseconds. This delays only working audio, not tool execution, and is valid + only on the working track.""" @overload def __init__( self, *, - instructions: Optional[str] = None, - temperature: Optional[float] = None, - max_output_tokens: Optional["_unions.VoiceAgentMaxOutputTokens"] = None, - output_modalities: Optional[list[Union[str, "_models.VoiceOutputModality"]]] = None, - audio: Optional["_models.VoiceAgentAudioConfig"] = None, - avatar: Optional["_models.VoiceAgentSessionAvatarConfig"] = None, - animation: Optional["_models.VoiceAgentAnimationConfig"] = None, - tools: Optional[list["_models.VoiceAgentTool"]] = None, - tool_choice: Optional["_unions.VoiceAgentToolChoice"] = None, - reasoning: Optional["_models.RealtimeReasoning"] = None, - parallel_tool_calls: Optional[bool] = None, - include: Optional[list[Union[str, "_models.VoiceAgentSessionIncludeOption"]]] = None, - metadata: Optional[dict[str, str]] = None, - interim_response: Optional["_models.VoiceAgentInterimResponseConfig"] = None, - greeting: Optional["_models.VoiceAgentGreetingConfig"] = None, + source: "_models.VoiceAgentSoundscapeSourceConfig", + gain: Optional[float] = None, + delay_ms: Optional[datetime.timedelta] = None, ) -> None: ... @overload @@ -31288,7 +38672,6 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type: Literal["realtime"] = "realtime" class VoiceAgentStaticInterimResponseConfig( @@ -31992,8 +39375,12 @@ class VoiceHostedAgentConversationEngine( VoiceConversationEngine, discriminator="hosted_agent" ): # pylint: disable=docstring-keyword-should-match-keyword-only """A closed reference to the hosted text agent that owns conversation handling for a voice agent. - The hosted agent is resolved within the same project and must support the ``invocations_ws`` - protocol, Voice Live compatibility, and Bridge Protocol 1.0. + The hosted agent is resolved within the same project and must declare + ``voice_conversation_engine`` version ``1.0.0``. Voice Live connects through the dedicated + voice-conversation-engine endpoint using the existing Bridge Protocol 1.0 wire semantics; the + Bridge message version is independent of the container protocol version and the Hosted Agents + API version ``v1``. Declaring ``invocations_ws`` is optional and does not substitute for + ``voice_conversation_engine``. :ivar type: Selects a hosted Foundry agent as the conversation engine. Required. Default value is "hosted_agent". @@ -32557,150 +39944,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class WebSearchPreviewTool( - Tool, discriminator="web_search_preview" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Web search preview. - - :ivar type: The type of the web search tool. One of ``web_search_preview`` or - ``web_search_preview_2025_03_11``. Required. WEB_SEARCH_PREVIEW. - :vartype type: str or ~azure.ai.projects.models.WEB_SEARCH_PREVIEW - :ivar user_location: - :vartype user_location: ~azure.ai.projects.models.ApproximateLocation - :ivar search_context_size: High level guidance for the amount of context window space to use - for the search. One of ``low``, ``medium``, or ``high``. ``medium`` is the default. Known - values are: "low", "medium", and "high". - :vartype search_context_size: str or ~azure.ai.projects.models.SearchContextSize - :ivar search_content_types: - :vartype search_content_types: list[str or ~azure.ai.projects.models.SearchContentType] - """ - - type: Literal[ToolType.WEB_SEARCH_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the web search tool. One of ``web_search_preview`` or - ``web_search_preview_2025_03_11``. Required. WEB_SEARCH_PREVIEW.""" - user_location: Optional["_models.ApproximateLocation"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - search_context_size: Optional[Union[str, "_models.SearchContextSize"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """High level guidance for the amount of context window space to use for the search. One of - ``low``, ``medium``, or ``high``. ``medium`` is the default. Known values are: \"low\", - \"medium\", and \"high\".""" - search_content_types: Optional[list[Union[str, "_models.SearchContentType"]]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - - @overload - def __init__( - self, - *, - user_location: Optional["_models.ApproximateLocation"] = None, - search_context_size: Optional[Union[str, "_models.SearchContextSize"]] = None, - search_content_types: Optional[list[Union[str, "_models.SearchContentType"]]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type = ToolType.WEB_SEARCH_PREVIEW # type: ignore - - -class WebSearchTool(Tool, discriminator="web_search"): # pylint: disable=docstring-keyword-should-match-keyword-only - """Web search. - - :ivar type: The type of the web search tool. One of ``web_search`` or - ``web_search_2025_08_26``. Required. WEB_SEARCH. - :vartype type: str or ~azure.ai.projects.models.WEB_SEARCH - :ivar external_web_access: Allow live internet access for web search. Defaults to true when - omitted. When false, the web search tool runs in offline/cache-only mode and will not fetch new - external content. - :vartype external_web_access: bool - :ivar filters: - :vartype filters: ~azure.ai.projects.models.WebSearchToolFilters - :ivar user_location: - :vartype user_location: ~azure.ai.projects.models.WebSearchApproximateLocation - :ivar search_context_size: High level guidance for the amount of context window space to use - for the search. One of ``low``, ``medium``, or ``high``. ``medium`` is the default. Is one of - the following types: Literal["low"], Literal["medium"], Literal["high"] - :vartype search_context_size: str or str or str - :ivar name: Deprecated. This property is deprecated and will be removed in a future version. - :vartype name: str - :ivar description: Deprecated. This property is deprecated and will be removed in a future - version. - :vartype description: str - :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future - version. - :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] - :ivar custom_search_configuration: The project connections attached to this tool. There can be - a maximum of 1 connection resource attached to the tool. - :vartype custom_search_configuration: ~azure.ai.projects.models.WebSearchConfiguration - """ - - type: Literal[ToolType.WEB_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the web search tool. One of ``web_search`` or ``web_search_2025_08_26``. Required. - WEB_SEARCH.""" - external_web_access: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Allow live internet access for web search. Defaults to true when omitted. When false, the web - search tool runs in offline/cache-only mode and will not fetch new external content.""" - filters: Optional["_models.WebSearchToolFilters"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - user_location: Optional["_models.WebSearchApproximateLocation"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - search_context_size: Optional[Literal["low", "medium", "high"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """High level guidance for the amount of context window space to use for the search. One of - ``low``, ``medium``, or ``high``. ``medium`` is the default. Is one of the following types: - Literal[\"low\"], Literal[\"medium\"], Literal[\"high\"]""" - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Deprecated. This property is deprecated and will be removed in a future version.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Deprecated. This property is deprecated and will be removed in a future version.""" - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Deprecated. This property is deprecated and will be removed in a future version.""" - custom_search_configuration: Optional["_models.WebSearchConfiguration"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The project connections attached to this tool. There can be a maximum of 1 connection resource - attached to the tool.""" - - @overload - def __init__( - self, - *, - external_web_access: Optional[bool] = None, - filters: Optional["_models.WebSearchToolFilters"] = None, - user_location: Optional["_models.WebSearchApproximateLocation"] = None, - search_context_size: Optional[Literal["low", "medium", "high"]] = None, - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, - custom_search_configuration: Optional["_models.WebSearchConfiguration"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type = ToolType.WEB_SEARCH # type: ignore - - class WebSearchToolboxTool( ToolboxTool, discriminator="web_search" ): # pylint: disable=docstring-keyword-should-match-keyword-only @@ -32722,7 +39965,9 @@ class WebSearchToolboxTool( :vartype external_web_access: bool :ivar filters: :vartype filters: ~azure.ai.projects.models.WebSearchToolFilters - :ivar user_location: + :ivar user_location: The approximate location of the user. If omitted or null, defaults to the + United States. To avoid this fallback, pass ``{"type": "approximate"}`` without location + fields. To localize results, provide the relevant location fields. :vartype user_location: ~azure.ai.projects.models.WebSearchApproximateLocation :ivar search_context_size: High level guidance for the amount of context window space to use for the search. One of ``low``, ``medium``, or ``high``. ``medium`` is the default. Is one of @@ -32744,6 +39989,9 @@ class WebSearchToolboxTool( user_location: Optional["_models.WebSearchApproximateLocation"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) + """The approximate location of the user. If omitted or null, defaults to the United States. To + avoid this fallback, pass ``{\"type\": \"approximate\"}`` without location fields. To localize + results, provide the relevant location fields.""" search_context_size: Optional[Literal["low", "medium", "high"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_operations.py b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_operations.py index 31880837c921..d5a334362a82 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_operations.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_operations.py @@ -4685,6 +4685,274 @@ def build_beta_voice_agents_conversations_download_audio_request( # pylint: dis return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) +def build_beta_voice_agents_live_conversations_list_request( # pylint: disable=name-too-long + agent_name: str, + *, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + after: Optional[str] = None, + before: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/agents/{agent_name}/endpoint/protocols/voice/live/conversations" + path_format_arguments = { + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if limit is not None: + _params["limit"] = _SERIALIZER.query("limit", limit, "int") + if order is not None: + _params["order"] = _SERIALIZER.query("order", order, "str") + if after is not None: + _params["after"] = _SERIALIZER.query("after", after, "str") + if before is not None: + _params["before"] = _SERIALIZER.query("before", before, "str") + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_beta_voice_agents_live_conversations_get_request( # pylint: disable=name-too-long + agent_name: str, conversation_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/agents/{agent_name}/endpoint/protocols/voice/live/conversations/{conversation_id}" + path_format_arguments = { + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), + "conversation_id": _SERIALIZER.url("conversation_id", conversation_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_beta_voice_agents_live_conversations_delete_request( # pylint: disable=name-too-long + agent_name: str, conversation_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) + # Construct URL + _url = "/agents/{agent_name}/endpoint/protocols/voice/live/conversations/{conversation_id}" + path_format_arguments = { + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), + "conversation_id": _SERIALIZER.url("conversation_id", conversation_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_beta_voice_agents_live_conversations_list_items_request( # pylint: disable=name-too-long + agent_name: str, + conversation_id: str, + *, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + after: Optional[str] = None, + before: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/agents/{agent_name}/endpoint/protocols/voice/live/conversations/{conversation_id}/items" + path_format_arguments = { + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), + "conversation_id": _SERIALIZER.url("conversation_id", conversation_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if limit is not None: + _params["limit"] = _SERIALIZER.query("limit", limit, "int") + if order is not None: + _params["order"] = _SERIALIZER.query("order", order, "str") + if after is not None: + _params["after"] = _SERIALIZER.query("after", after, "str") + if before is not None: + _params["before"] = _SERIALIZER.query("before", before, "str") + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_beta_voice_agents_live_conversations_get_item_request( # pylint: disable=name-too-long + agent_name: str, conversation_id: str, item_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/agents/{agent_name}/endpoint/protocols/voice/live/conversations/{conversation_id}/items/{item_id}" + path_format_arguments = { + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), + "conversation_id": _SERIALIZER.url("conversation_id", conversation_id, "str"), + "item_id": _SERIALIZER.url("item_id", item_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_beta_voice_agents_live_conversations_get_audio_item_request( # pylint: disable=name-too-long + agent_name: str, conversation_id: str, item_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/agents/{agent_name}/endpoint/protocols/voice/live/conversations/{conversation_id}/items/{item_id}/audio" + path_format_arguments = { + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), + "conversation_id": _SERIALIZER.url("conversation_id", conversation_id, "str"), + "item_id": _SERIALIZER.url("item_id", item_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_beta_voice_agents_live_conversations_download_audio_item_request( # pylint: disable=name-too-long + agent_name: str, conversation_id: str, item_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) + accept = _headers.pop("Accept", "audio/wav") + + # Construct URL + _url = "/agents/{agent_name}/endpoint/protocols/voice/live/conversations/{conversation_id}/items/{item_id}/audio/content" + path_format_arguments = { + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), + "conversation_id": _SERIALIZER.url("conversation_id", conversation_id, "str"), + "item_id": _SERIALIZER.url("item_id", item_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_beta_voice_agents_live_conversations_get_audio_request( # pylint: disable=name-too-long + agent_name: str, conversation_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/agents/{agent_name}/endpoint/protocols/voice/live/conversations/{conversation_id}/audio" + path_format_arguments = { + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), + "conversation_id": _SERIALIZER.url("conversation_id", conversation_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_beta_voice_agents_live_conversations_download_audio_request( # pylint: disable=name-too-long + agent_name: str, conversation_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) + accept = _headers.pop("Accept", "audio/wav") + + # Construct URL + _url = "/agents/{agent_name}/endpoint/protocols/voice/live/conversations/{conversation_id}/audio/content" + path_format_arguments = { + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), + "conversation_id": _SERIALIZER.url("conversation_id", conversation_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + def build_beta_voice_agents_telephony_create_binding_request( # pylint: disable=name-too-long agent_name: str, **kwargs: Any ) -> HttpRequest: @@ -13895,6 +14163,9 @@ def __init__(self, *args, **kwargs) -> None: self.conversations = BetaVoiceAgentsConversationsOperations( self._client, self._config, self._serialize, self._deserialize ) + self.live_conversations = BetaVoiceAgentsLiveConversationsOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.telephony = BetaVoiceAgentsTelephonyOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -23324,6 +23595,730 @@ def download_audio(self, agent_name: str, conversation_id: str, **kwargs: Any) - return deserialized # type: ignore +class BetaVoiceAgentsLiveConversationsOperations: # pylint: disable=docstring-missing-param,name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.ai.projects.AIProjectClient`'s + :attr:`live_conversations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AIProjectClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list( + self, + agent_name: str, + *, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + before: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.VoiceAgentLiveConversation"]: + """List Live voice agent conversations. + + Lists stored Live conversations for this agent, including sessions stored via an override. + + :param agent_name: The name of the Live voice agent. Required. + :type agent_name: str + :keyword limit: A limit on the number of objects to be returned. Limit can range between 1 and + 100, and the + default is 20. Default value is None. + :paramtype limit: int + :keyword order: Sort order by the ``created_at`` timestamp of the objects. ``asc`` for + ascending order and``desc`` + for descending order. Known values are: "asc" and "desc". Default value is None. + :paramtype order: str or ~azure.ai.projects.models.PageOrder + :keyword before: A cursor for use in pagination. ``before`` is an object ID that defines your + place in the list. + For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + subsequent call can include before=obj_foo in order to fetch the previous page of the list. + Default value is None. + :paramtype before: str + :return: An iterator like instance of VoiceAgentLiveConversation + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.VoiceAgentLiveConversation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.VoiceAgentLiveConversation]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(_continuation_token=None): + + _request = build_beta_voice_agents_live_conversations_list_request( + agent_name=agent_name, + limit=limit, + order=order, + after=_continuation_token, + before=before, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.VoiceAgentLiveConversation], + deserialized.get("data", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("last_id") or None, iter(list_of_elem) + + def get_next(_continuation_token=None): + _request = prepare_request(_continuation_token) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get(self, agent_name: str, conversation_id: str, **kwargs: Any) -> _models.VoiceAgentLiveConversation: + """Get a Live voice agent conversation. + + Gets a stored Live conversation; fetch items separately. Returns 404 if absent or not stored. + + :param agent_name: The name of the Live voice agent. Required. + :type agent_name: str + :param conversation_id: The Foundry conversation ID returned in + session.started.conversation_id. Required. + :type conversation_id: str + :return: VoiceAgentLiveConversation. The VoiceAgentLiveConversation is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.VoiceAgentLiveConversation + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.VoiceAgentLiveConversation] = kwargs.pop("cls", None) + + _request = build_beta_voice_agents_live_conversations_get_request( + agent_name=agent_name, + conversation_id=conversation_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.VoiceAgentLiveConversation, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete( # pylint: disable=inconsistent-return-statements + self, agent_name: str, conversation_id: str, **kwargs: Any + ) -> None: + """Delete a Live voice agent conversation. + + Deletes the stored conversation and its items/audio, without closing the Live session. + + :param agent_name: The name of the Live voice agent. Required. + :type agent_name: str + :param conversation_id: The Foundry conversation ID returned in + session.started.conversation_id. Required. + :type conversation_id: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_beta_voice_agents_live_conversations_delete_request( + agent_name=agent_name, + conversation_id=conversation_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_items( + self, + agent_name: str, + conversation_id: str, + *, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + before: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.VoiceAgentLiveConversationItem"]: + """List items in a Live voice agent conversation. + + Lists stored speech and delegation items in order; cursors use item IDs. Returns 404 if the + conversation is absent or unstored. + + :param agent_name: The name of the Live voice agent. Required. + :type agent_name: str + :param conversation_id: The Foundry conversation ID returned in + session.started.conversation_id. Required. + :type conversation_id: str + :keyword limit: A limit on the number of objects to be returned. Limit can range between 1 and + 100, and the + default is 20. Default value is None. + :paramtype limit: int + :keyword order: Sort order by the ``created_at`` timestamp of the objects. ``asc`` for + ascending order and``desc`` + for descending order. Known values are: "asc" and "desc". Default value is None. + :paramtype order: str or ~azure.ai.projects.models.PageOrder + :keyword before: A cursor for use in pagination. ``before`` is an object ID that defines your + place in the list. + For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + subsequent call can include before=obj_foo in order to fetch the previous page of the list. + Default value is None. + :paramtype before: str + :return: An iterator like instance of VoiceAgentLiveConversationItem + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.VoiceAgentLiveConversationItem] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.VoiceAgentLiveConversationItem]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(_continuation_token=None): + + _request = build_beta_voice_agents_live_conversations_list_items_request( + agent_name=agent_name, + conversation_id=conversation_id, + limit=limit, + order=order, + after=_continuation_token, + before=before, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.VoiceAgentLiveConversationItem], + deserialized.get("data", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("last_id") or None, iter(list_of_elem) + + def get_next(_continuation_token=None): + _request = prepare_request(_continuation_token) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get_item( + self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any + ) -> _models.VoiceAgentLiveConversationItem: + """Get a Live voice agent conversation item. + + Gets a stored item by ID. Returns 404 if the item or conversation is absent. + + :param agent_name: The name of the Live voice agent. Required. + :type agent_name: str + :param conversation_id: The Foundry conversation ID returned in + session.started.conversation_id. Required. + :type conversation_id: str + :param item_id: The id returned on the persisted item. Required. + :type item_id: str + :return: VoiceAgentLiveConversationItem. The VoiceAgentLiveConversationItem is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.VoiceAgentLiveConversationItem + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.VoiceAgentLiveConversationItem] = kwargs.pop("cls", None) + + _request = build_beta_voice_agents_live_conversations_get_item_request( + agent_name=agent_name, + conversation_id=conversation_id, + item_id=item_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.VoiceAgentLiveConversationItem, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_audio_item( + self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any + ) -> _models.VoiceAudioItem: + """Get a Live conversation item's audio metadata. + + Gets captured speech-audio metadata. BYOS uses unsigned blob_uri. Returns 404 for missing + audio, unstored conversations, or delegation items. + + :param agent_name: The name of the Live voice agent. Required. + :type agent_name: str + :param conversation_id: The Foundry conversation ID returned in + session.started.conversation_id. Required. + :type conversation_id: str + :param item_id: The id returned on the persisted item. Required. + :type item_id: str + :return: VoiceAudioItem. The VoiceAudioItem is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.VoiceAudioItem + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.VoiceAudioItem] = kwargs.pop("cls", None) + + _request = build_beta_voice_agents_live_conversations_get_audio_item_request( + agent_name=agent_name, + conversation_id=conversation_id, + item_id=item_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.VoiceAudioItem, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def download_audio_item( + self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any + ) -> Iterator[bytes]: + """Stream a Live conversation item's audio. + + Streams captured speech as WAV. BYOS returns 409; use blob_uri. Returns 404 for missing audio, + unstored conversations, or delegation items. + + :param agent_name: The name of the Live voice agent. Required. + :type agent_name: str + :param conversation_id: The Foundry conversation ID returned in + session.started.conversation_id. Required. + :type conversation_id: str + :param item_id: The id returned on the persisted item. Required. + :type item_id: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_beta_voice_agents_live_conversations_download_audio_item_request( + agent_name=agent_name, + conversation_id=conversation_id, + item_id=item_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) + + response_headers = {} + response_headers["Content-Type"] = self._deserialize("str", response.headers.get("Content-Type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_audio(self, agent_name: str, conversation_id: str, **kwargs: Any) -> _models.VoiceRecording: + """Get a Live conversation's merged recording metadata. + + Gets merged stereo recording metadata (user left, assistant right). BYOS uses unsigned + blob_uri. Returns 404 for no audio, or 409 recording_not_ready/recording_unavailable for + pending/failed finalization; pending responses may include Retry-After. + + :param agent_name: The name of the Live voice agent. Required. + :type agent_name: str + :param conversation_id: The Foundry conversation ID returned in + session.started.conversation_id. Required. + :type conversation_id: str + :return: VoiceRecording. The VoiceRecording is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.VoiceRecording + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.VoiceRecording] = kwargs.pop("cls", None) + + _request = build_beta_voice_agents_live_conversations_get_audio_request( + agent_name=agent_name, + conversation_id=conversation_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.VoiceRecording, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def download_audio(self, agent_name: str, conversation_id: str, **kwargs: Any) -> Iterator[bytes]: + """Stream a Live conversation's merged recording. + + Streams the merged stereo WAV. BYOS returns 409; use blob_uri. Returns 404 for no audio, or 409 + recording_not_ready/recording_unavailable for pending/failed finalization. + + :param agent_name: The name of the Live voice agent. Required. + :type agent_name: str + :param conversation_id: The Foundry conversation ID returned in + session.started.conversation_id. Required. + :type conversation_id: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_beta_voice_agents_live_conversations_download_audio_request( + agent_name=agent_name, + conversation_id=conversation_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) + + response_headers = {} + response_headers["Content-Type"] = self._deserialize("str", response.headers.get("Content-Type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + class BetaVoiceAgentsTelephonyOperations: # pylint: disable=docstring-missing-param """ .. warning:: diff --git a/sdk/ai/azure-ai-projects/docs/public-methods.md b/sdk/ai/azure-ai-projects/docs/public-methods.md index 1af36d277b6f..3e60266b2083 100644 --- a/sdk/ai/azure-ai-projects/docs/public-methods.md +++ b/sdk/ai/azure-ai-projects/docs/public-methods.md @@ -6,11 +6,11 @@ This document lists all public methods available on `AIProjectClient` and its su ## Summary -There are a total of 192 unique public methods: +There are a total of 201 unique public methods: - 5 stable methods on the client - 84 stable methods on top-level sub-clients -- 103 beta methods on nested beta sub-clients +- 112 beta methods on nested beta sub-clients ### Top-level sub-clients (stable operations) @@ -42,6 +42,7 @@ There are a total of 192 unique public methods: | `beta.schedules` | BetaSchedulesOperations | 6 | | `beta.skills` | BetaSkillsOperations | 11 | | `beta.voice_agents.conversations` | BetaVoiceAgentsConversationsOperations | 14 | +| `beta.voice_agents.live_conversations` | BetaVoiceAgentsLiveConversationsOperations | 9 | | `beta.voice_agents.realtime` | BetaRealtime | 1 | | `beta.voice_agents.telephony` | BetaVoiceAgentsTelephonyOperations | 14 | @@ -261,6 +262,16 @@ Alphabetically sorted. An asterisk at the end of the method name means it is a h .beta.voice_agents.conversations.list_response_items .beta.voice_agents.conversations.list_responses +.beta.voice_agents.live_conversations.delete +.beta.voice_agents.live_conversations.download_audio +.beta.voice_agents.live_conversations.download_audio_item +.beta.voice_agents.live_conversations.get +.beta.voice_agents.live_conversations.get_audio +.beta.voice_agents.live_conversations.get_audio_item +.beta.voice_agents.live_conversations.get_item +.beta.voice_agents.live_conversations.list +.beta.voice_agents.live_conversations.list_items + .beta.voice_agents.realtime.connect* .beta.voice_agents.telephony.cancel_call_job diff --git a/sdk/ai/azure-ai-projects/samples/agents/sample_workflow_multi_agent_with_mcp_approval.py b/sdk/ai/azure-ai-projects/samples/agents/sample_workflow_multi_agent_with_mcp_approval.py index 2ef0109250c5..028246d33be3 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/sample_workflow_multi_agent_with_mcp_approval.py +++ b/sdk/ai/azure-ai-projects/samples/agents/sample_workflow_multi_agent_with_mcp_approval.py @@ -36,7 +36,7 @@ from azure.ai.projects.models import ( PromptAgentDefinition, WorkflowAgentDefinition, - MCPTool, + ToolMcpTool, ) load_dotenv() @@ -50,7 +50,7 @@ ): # Define MCP tool for accessing external resources (optional - can be removed for simpler demo) # Note: MCP tools in workflows may require special handling depending on the use case - mcp_tool = MCPTool( + mcp_tool = ToolMcpTool( server_label="api-specs", server_url="https://gitmcp.io/Azure/azure-rest-api-specs", require_approval="always", diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_code_interpreter.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_code_interpreter.py index 3703d2a8a8e7..12d26efa780c 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_code_interpreter.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_code_interpreter.py @@ -29,7 +29,7 @@ from util import create_version_with_endpoint from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient -from azure.ai.projects.models import PromptAgentDefinition, CodeInterpreterTool +from azure.ai.projects.models import PromptAgentDefinition, ToolCodeInterpreterTool load_dotenv() @@ -45,7 +45,7 @@ definition=PromptAgentDefinition( model=os.environ["FOUNDRY_MODEL_NAME"], instructions="You are a helpful assistant.", - tools=[CodeInterpreterTool()], + tools=[ToolCodeInterpreterTool()], ), description="Code interpreter agent for data analysis and visualization.", ), diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_code_interpreter_async.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_code_interpreter_async.py index 7b002282df3b..3841be54e052 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_code_interpreter_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_code_interpreter_async.py @@ -30,7 +30,7 @@ from util import create_version_with_endpoint_async from azure.identity.aio import DefaultAzureCredential from azure.ai.projects.aio import AIProjectClient -from azure.ai.projects.models import PromptAgentDefinition, CodeInterpreterTool +from azure.ai.projects.models import PromptAgentDefinition, ToolCodeInterpreterTool load_dotenv() @@ -48,7 +48,7 @@ async def main() -> None: definition=PromptAgentDefinition( model=os.environ["FOUNDRY_MODEL_NAME"], instructions="You are a helpful assistant.", - tools=[CodeInterpreterTool()], + tools=[ToolCodeInterpreterTool()], ), description="Code interpreter agent for data analysis and visualization.", ), diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_code_interpreter_structured_inputs.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_code_interpreter_structured_inputs.py index f631ca4ed14b..38222f0aea75 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_code_interpreter_structured_inputs.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_code_interpreter_structured_inputs.py @@ -39,7 +39,7 @@ from azure.ai.projects.models._models import AutoCodeInterpreterToolParam from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient -from azure.ai.projects.models import PromptAgentDefinition, CodeInterpreterTool, StructuredInputDefinition +from azure.ai.projects.models import PromptAgentDefinition, ToolCodeInterpreterTool, StructuredInputDefinition load_dotenv() @@ -58,7 +58,7 @@ uploaded = openai_client.files.create(purpose="assistants", file=csv_file) print(f"File uploaded (id: {uploaded.id})") - tool = CodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=["{{analysis_file_id}}"])) + tool = ToolCodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=["{{analysis_file_id}}"])) agent_definition = PromptAgentDefinition( model=os.environ["FOUNDRY_MODEL_NAME"], diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_code_interpreter_with_files.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_code_interpreter_with_files.py index c4891fc02731..5c555f08fc6b 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_code_interpreter_with_files.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_code_interpreter_with_files.py @@ -29,7 +29,7 @@ from dotenv import load_dotenv from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient -from azure.ai.projects.models import PromptAgentDefinition, CodeInterpreterTool, AutoCodeInterpreterToolParam +from azure.ai.projects.models import PromptAgentDefinition, ToolCodeInterpreterTool, AutoCodeInterpreterToolParam load_dotenv() @@ -50,7 +50,7 @@ with open(asset_file_path, "rb") as f: file = openai_client.files.create(purpose="assistants", file=f) - tool = CodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[file.id])) + tool = ToolCodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[file.id])) print(f"File uploaded (id: {file.id})") diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_code_interpreter_with_files_async.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_code_interpreter_with_files_async.py index 25d6173c5595..65130a0b0e87 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_code_interpreter_with_files_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_code_interpreter_with_files_async.py @@ -30,7 +30,7 @@ from dotenv import load_dotenv from azure.identity.aio import DefaultAzureCredential from azure.ai.projects.aio import AIProjectClient -from azure.ai.projects.models import PromptAgentDefinition, CodeInterpreterTool, AutoCodeInterpreterToolParam +from azure.ai.projects.models import PromptAgentDefinition, ToolCodeInterpreterTool, AutoCodeInterpreterToolParam load_dotenv() @@ -62,7 +62,7 @@ async def main() -> None: definition=PromptAgentDefinition( model=os.environ["FOUNDRY_MODEL_NAME"], instructions="You are a helpful assistant.", - tools=[CodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[file.id]))], + tools=[ToolCodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[file.id]))], ), description="Code interpreter agent for data analysis and visualization.", ) diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_computer_use.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_computer_use.py index 0f2a733df0dc..ead44b1bc5cc 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_computer_use.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_computer_use.py @@ -43,7 +43,7 @@ ) from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient -from azure.ai.projects.models import PromptAgentDefinition, ComputerUsePreviewTool +from azure.ai.projects.models import PromptAgentDefinition, ToolComputerUsePreviewTool load_dotenv() @@ -61,7 +61,7 @@ print("Failed to load required screenshot assets. Please ensure the asset files exist in ../assets/") exit(1) # pylint: disable=consider-using-sys-exit -tool = ComputerUsePreviewTool(display_width=1026, display_height=769, environment="windows") +tool = ToolComputerUsePreviewTool(display_width=1026, display_height=769, environment="windows") with ( DefaultAzureCredential() as credential, diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_computer_use_async.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_computer_use_async.py index 79960c8162c2..5aa52e1430ef 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_computer_use_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_computer_use_async.py @@ -43,7 +43,7 @@ ) from azure.identity.aio import DefaultAzureCredential from azure.ai.projects.aio import AIProjectClient -from azure.ai.projects.models import PromptAgentDefinition, ComputerUsePreviewTool +from azure.ai.projects.models import PromptAgentDefinition, ToolComputerUsePreviewTool load_dotenv() @@ -64,7 +64,7 @@ async def main(): print("Failed to load required screenshot assets. Please ensure the asset files exist in ../assets/") return - computer_use_tool = ComputerUsePreviewTool(display_width=1026, display_height=769, environment="windows") + computer_use_tool = ToolComputerUsePreviewTool(display_width=1026, display_height=769, environment="windows") async with ( DefaultAzureCredential() as credential, diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_file_search.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_file_search.py index fc6e7da22dd8..6b1a29b5cc99 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_file_search.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_file_search.py @@ -29,7 +29,7 @@ # Azure AI imports from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient -from azure.ai.projects.models import PromptAgentDefinition, FileSearchTool +from azure.ai.projects.models import PromptAgentDefinition, ToolFileSearchTool load_dotenv() @@ -52,7 +52,7 @@ file = openai_client.vector_stores.files.upload_and_poll(vector_store_id=vector_store.id, file=f) print(f"File uploaded to vector store (id: {file.id})") - tool = FileSearchTool(vector_store_ids=[vector_store.id]) + tool = ToolFileSearchTool(vector_store_ids=[vector_store.id]) # Create agent with file search tool agent = project_client.agents.create_version( diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_file_search_in_stream.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_file_search_in_stream.py index 49501c4a05b7..0ad7b15bcd1b 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_file_search_in_stream.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_file_search_in_stream.py @@ -28,7 +28,7 @@ from dotenv import load_dotenv from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient -from azure.ai.projects.models import PromptAgentDefinition, FileSearchTool +from azure.ai.projects.models import PromptAgentDefinition, ToolFileSearchTool load_dotenv() @@ -63,7 +63,7 @@ definition=PromptAgentDefinition( model=os.environ["FOUNDRY_MODEL_NAME"], instructions="You are a helpful assistant that can search through product information and provide detailed responses. Use the file search tool to find relevant information before answering.", - tools=[FileSearchTool(vector_store_ids=[vector_store.id])], + tools=[ToolFileSearchTool(vector_store_ids=[vector_store.id])], ), description="File search agent with streaming response capabilities.", ) diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_file_search_in_stream_async.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_file_search_in_stream_async.py index 889d8a6b24b8..c63bc9946aee 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_file_search_in_stream_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_file_search_in_stream_async.py @@ -29,7 +29,7 @@ from dotenv import load_dotenv from azure.identity.aio import DefaultAzureCredential from azure.ai.projects.aio import AIProjectClient -from azure.ai.projects.models import PromptAgentDefinition, FileSearchTool +from azure.ai.projects.models import PromptAgentDefinition, ToolFileSearchTool load_dotenv() @@ -64,7 +64,7 @@ async def main() -> None: # pylint: disable=too-many-statements definition=PromptAgentDefinition( model=os.environ["FOUNDRY_MODEL_NAME"], instructions="You are a helpful assistant that can search through product information and provide detailed responses. Use the file search tool to find relevant information before answering.", - tools=[FileSearchTool(vector_store_ids=[vector_store.id])], + tools=[ToolFileSearchTool(vector_store_ids=[vector_store.id])], ), description="File search agent with streaming response capabilities.", ) diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_file_search_structured_inputs.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_file_search_structured_inputs.py index 6e24325aa01f..8e20931b7085 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_file_search_structured_inputs.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_file_search_structured_inputs.py @@ -35,7 +35,7 @@ from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient -from azure.ai.projects.models import PromptAgentDefinition, FileSearchTool, StructuredInputDefinition +from azure.ai.projects.models import PromptAgentDefinition, ToolFileSearchTool, StructuredInputDefinition load_dotenv() @@ -59,7 +59,7 @@ print(f"File uploaded to vector store (id: {file.id})") # Tool resources are templated and resolved at runtime via structured inputs. - tool = FileSearchTool(vector_store_ids=["{{vector_store_id}}"]) + tool = ToolFileSearchTool(vector_store_ids=["{{vector_store_id}}"]) agent_definition = PromptAgentDefinition( model=os.environ["FOUNDRY_MODEL_NAME"], diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_function_tool.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_function_tool.py index e6e9a9d417bf..e3de30967ec4 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_function_tool.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_function_tool.py @@ -32,7 +32,7 @@ from util import create_version_with_endpoint from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient -from azure.ai.projects.models import PromptAgentDefinition, FunctionTool +from azure.ai.projects.models import PromptAgentDefinition, ToolFunctionTool load_dotenv() @@ -47,7 +47,7 @@ def get_horoscope(sign: str) -> str: endpoint = os.environ["FOUNDRY_PROJECT_ENDPOINT"] -tool = FunctionTool( +tool = ToolFunctionTool( name="get_horoscope", parameters={ "type": "object", diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_function_tool_async.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_function_tool_async.py index 9756f2a32841..2da388c65fbf 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_function_tool_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_function_tool_async.py @@ -34,7 +34,7 @@ from util import create_version_with_endpoint_async from azure.identity.aio import DefaultAzureCredential from azure.ai.projects.aio import AIProjectClient -from azure.ai.projects.models import PromptAgentDefinition, FunctionTool +from azure.ai.projects.models import PromptAgentDefinition, ToolFunctionTool load_dotenv() @@ -49,7 +49,7 @@ async def get_horoscope(sign: str) -> str: async def main(): # Define a function tool for the model to use - func_tool = FunctionTool( + func_tool = ToolFunctionTool( name="get_horoscope", parameters={ "type": "object", diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_image_generation.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_image_generation.py index 7dbf7ff139c4..468197d240ca 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_image_generation.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_image_generation.py @@ -7,11 +7,11 @@ """ DESCRIPTION: This sample demonstrates how to create an AI Agent with image generation capabilities - using the ImageGenTool and synchronous Azure AI Projects client. The Agent can generate + using the ToolImageGenTool and synchronous Azure AI Projects client. The Agent can generate images based on text prompts and save them to files. The sample shows: - - Creating an Agent with ImageGenTool configured for image generation + - Creating an Agent with ToolImageGenTool configured for image generation - Making requests to generate images from text prompts - Extracting base64-encoded image data from the response - Decoding and saving the generated image to a local file @@ -34,11 +34,11 @@ used by the Agent for understanding and responding to prompts. This is NOT the image generation model. 3) FOUNDRY_AGENT_NAME - Optional. The name of the AI agent. If not set, defaults to "MyAgent". 4) IMAGE_GENERATION_MODEL_DEPLOYMENT_NAME - The deployment name of the image generation model (e.g. gpt-image-1) - used by the ImageGenTool. + used by the ToolImageGenTool. NOTE: - Image generation requires a separate (e.g. gpt-image-1) deployment which is specified when constructing - the `ImageGenTool`, as well as providing it in the `x-ms-oai-image-generation-deployment` header when + the `ToolImageGenTool`, as well as providing it in the `x-ms-oai-image-generation-deployment` header when calling `.responses.create`. - The generated image will be saved as "happy-dogs.png" in the OS temporary directory. """ @@ -52,7 +52,7 @@ from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient -from azure.ai.projects.models import PromptAgentDefinition, ImageGenTool +from azure.ai.projects.models import PromptAgentDefinition, ToolImageGenTool load_dotenv() @@ -60,7 +60,7 @@ agent_name = os.environ.get("FOUNDRY_AGENT_NAME") or "MyAgent" image_generation_model = os.environ["IMAGE_GENERATION_MODEL_DEPLOYMENT_NAME"] -tool = ImageGenTool( +tool = ToolImageGenTool( model=image_generation_model, # Model such as "gpt-image-1" quality="low", size="1024x1024", diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_image_generation_async.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_image_generation_async.py index 5a7a034cf02f..a0d01e97ffb2 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_image_generation_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_image_generation_async.py @@ -7,11 +7,11 @@ """ DESCRIPTION: This sample demonstrates how to create an AI Agent with image generation capabilities - using the ImageGenTool and asynchronous Azure AI Projects client. The Agent can generate + using the ToolImageGenTool and asynchronous Azure AI Projects client. The Agent can generate images based on text prompts and save them to files. The sample shows: - - Creating an Agent with ImageGenTool configured for image generation + - Creating an Agent with ToolImageGenTool configured for image generation - Making requests to generate images from text prompts - Extracting base64-encoded image data from the response - Decoding and saving the generated image to a local file @@ -34,11 +34,11 @@ used by the Agent for understanding and responding to prompts. This is NOT the image generation model. 3) FOUNDRY_AGENT_NAME - Optional. The name of the AI agent. If not set, defaults to "MyAgent". 4) IMAGE_GENERATION_MODEL_DEPLOYMENT_NAME - The deployment name of the image generation model (e.g. gpt-image-1) - used by the ImageGenTool. + used by the ToolImageGenTool. NOTE: - Image generation requires a separate (e.g. gpt-image-1) deployment which is specified when constructing - the `ImageGenTool`, as well as providing it in the `x-ms-oai-image-generation-deployment` header when + the `ToolImageGenTool`, as well as providing it in the `x-ms-oai-image-generation-deployment` header when calling `.responses.create`. - The generated image will be saved as "happy-dogs.png" in the OS temporary directory. """ @@ -53,7 +53,7 @@ from azure.identity.aio import DefaultAzureCredential from azure.ai.projects.aio import AIProjectClient -from azure.ai.projects.models import PromptAgentDefinition, ImageGenTool +from azure.ai.projects.models import PromptAgentDefinition, ToolImageGenTool load_dotenv() endpoint = os.environ["FOUNDRY_PROJECT_ENDPOINT"] @@ -71,7 +71,7 @@ async def main(): definition=PromptAgentDefinition( model=os.environ["FOUNDRY_MODEL_NAME"], instructions="Generate images based on user prompts", - tools=[ImageGenTool(model=image_generation_model, quality="low", size="1024x1024")], + tools=[ToolImageGenTool(model=image_generation_model, quality="low", size="1024x1024")], ), description="Agent for image generation.", ), diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_mcp.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_mcp.py index 47844b570f30..923af7acbdd5 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_mcp.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_mcp.py @@ -30,14 +30,14 @@ from util import create_version_with_endpoint from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient -from azure.ai.projects.models import PromptAgentDefinition, MCPTool +from azure.ai.projects.models import PromptAgentDefinition, ToolMcpTool load_dotenv() endpoint = os.environ["FOUNDRY_PROJECT_ENDPOINT"] agent_name = os.environ.get("FOUNDRY_AGENT_NAME") or "MyAgent" -mcp_tool = MCPTool( +mcp_tool = ToolMcpTool( server_label="api-specs", server_url="https://gitmcp.io/Azure/azure-rest-api-specs", require_approval="always", diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_mcp_async.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_mcp_async.py index a3f12af3b7cd..7194daaf2151 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_mcp_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_mcp_async.py @@ -31,7 +31,7 @@ from util import create_version_with_endpoint_async from azure.identity.aio import DefaultAzureCredential from azure.ai.projects.aio import AIProjectClient -from azure.ai.projects.models import PromptAgentDefinition, MCPTool, Tool +from azure.ai.projects.models import PromptAgentDefinition, ToolMcpTool, Tool load_dotenv() @@ -40,7 +40,7 @@ async def main(): - mcp_tool = MCPTool( + mcp_tool = ToolMcpTool( server_label="api-specs", server_url="https://gitmcp.io/Azure/azure-rest-api-specs", require_approval="always", diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_mcp_with_project_connection.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_mcp_with_project_connection.py index 5af6fb5756b6..00f4bdf0b039 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_mcp_with_project_connection.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_mcp_with_project_connection.py @@ -32,7 +32,7 @@ from util import create_version_with_endpoint from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient -from azure.ai.projects.models import PromptAgentDefinition, MCPTool +from azure.ai.projects.models import PromptAgentDefinition, ToolMcpTool load_dotenv() @@ -40,7 +40,7 @@ agent_name = os.environ.get("FOUNDRY_AGENT_NAME") or "MyAgent" -tool = MCPTool( +tool = ToolMcpTool( server_label="api-specs", server_url="https://api.githubcopilot.com/mcp", require_approval="always", diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_mcp_with_project_connection_async.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_mcp_with_project_connection_async.py index d9dbcd020214..da20edbacd47 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_mcp_with_project_connection_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_mcp_with_project_connection_async.py @@ -33,7 +33,7 @@ from util import create_version_with_endpoint_async from azure.identity.aio import DefaultAzureCredential from azure.ai.projects.aio import AIProjectClient -from azure.ai.projects.models import PromptAgentDefinition, MCPTool, Tool +from azure.ai.projects.models import PromptAgentDefinition, ToolMcpTool, Tool load_dotenv() @@ -42,7 +42,7 @@ async def main(): - mcp_tool = MCPTool( + mcp_tool = ToolMcpTool( server_label="api-specs", server_url="https://api.githubcopilot.com/mcp", require_approval="always", diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search.py index 595fa2bf2dad..34d441a9949c 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search.py @@ -41,7 +41,7 @@ from azure.ai.projects import AIProjectClient from azure.ai.projects.models import ( PromptAgentDefinition, - WebSearchTool, + ToolWebSearchTool, WebSearchApproximateLocation, ) @@ -51,7 +51,7 @@ endpoint = os.environ["FOUNDRY_PROJECT_ENDPOINT"] agent_name = os.environ.get("FOUNDRY_AGENT_NAME") or "MyAgent" -tool = WebSearchTool(user_location=WebSearchApproximateLocation(country="GB", city="London", region="London")) +tool = ToolWebSearchTool(user_location=WebSearchApproximateLocation(country="GB", city="London", region="London")) with ( DefaultAzureCredential() as credential, AIProjectClient(endpoint=endpoint, credential=credential) as project_client, diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search_preview.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search_preview.py index 819847e6379e..a099b67f89f2 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search_preview.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search_preview.py @@ -39,7 +39,7 @@ from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient -from azure.ai.projects.models import PromptAgentDefinition, WebSearchPreviewTool, ApproximateLocation +from azure.ai.projects.models import PromptAgentDefinition, ToolWebSearchPreviewTool, ApproximateLocation load_dotenv() @@ -47,7 +47,7 @@ endpoint = os.environ["FOUNDRY_PROJECT_ENDPOINT"] agent_name = os.environ.get("FOUNDRY_AGENT_NAME") or "MyAgent" -tool = WebSearchPreviewTool(user_location=ApproximateLocation(country="GB", city="London", region="London")) +tool = ToolWebSearchPreviewTool(user_location=ApproximateLocation(country="GB", city="London", region="London")) with ( DefaultAzureCredential() as credential, AIProjectClient(endpoint=endpoint, credential=credential) as project_client, diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search_with_custom_search.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search_with_custom_search.py index 48a94b24d6fc..d0917cfa4d26 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search_with_custom_search.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search_with_custom_search.py @@ -46,7 +46,7 @@ from azure.ai.projects import AIProjectClient from azure.ai.projects.models import ( PromptAgentDefinition, - WebSearchTool, + ToolWebSearchTool, WebSearchConfiguration, ) @@ -56,7 +56,7 @@ endpoint = os.environ["FOUNDRY_PROJECT_ENDPOINT"] agent_name = os.environ.get("FOUNDRY_AGENT_NAME") or "MyAgent" -tool = WebSearchTool( +tool = ToolWebSearchTool( custom_search_configuration=WebSearchConfiguration( project_connection_id=os.environ["BING_CUSTOM_SEARCH_PROJECT_CONNECTION_ID"], instance_name=os.environ["BING_CUSTOM_SEARCH_INSTANCE_NAME"], diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_toolbox_with_shell.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_toolbox_with_shell.py index 5f4b176caaa8..a83d7872e0f6 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_toolbox_with_shell.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_toolbox_with_shell.py @@ -11,7 +11,7 @@ report the Python version and working-directory contents of the shell tool's auto-provisioned, network-isolated container. - The agent reaches the toolbox through an `MCPTool` pointed at the toolbox's + The agent reaches the toolbox through a `ToolMcpTool` pointed at the toolbox's versioned `/mcp` URL, the same way any other toolbox tool is consumed. The sample prints the tools exposed by the MCP server, each shell command's arguments and output, and the agent's final response. @@ -38,7 +38,7 @@ from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient from azure.ai.projects.models import ( - MCPTool, + ToolMcpTool, PromptAgentDefinition, ShellToolboxTool, ToolboxShellContainerAutoEnvironment, @@ -80,7 +80,7 @@ toolbox_mcp_url = f"{endpoint}/toolboxes/{TOOLBOX_NAME}/versions/{toolbox_version.version}/mcp?api-version=v1" token = credential.get_token("https://ai.azure.com/.default").token - toolbox_mcp_tool = MCPTool( + toolbox_mcp_tool = ToolMcpTool( server_label=TOOLBOX_MCP_LABEL, server_url=toolbox_mcp_url, authorization=token, diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_toolbox_with_shell_and_skill.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_toolbox_with_shell_and_skill.py index 3501e98e24ba..2c865072bc2d 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_toolbox_with_shell_and_skill.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_toolbox_with_shell_and_skill.py @@ -12,7 +12,7 @@ working-directory contents of its auto-provisioned, network-isolated container. The sample downloads the persisted Skill's `SKILL.md` into the Prompt Agent - instructions. The agent reaches the shell through an `MCPTool` pointed at + instructions. The agent reaches the shell through a `ToolMcpTool` pointed at the Toolbox's versioned `/mcp` URL. The sample prints the tools exposed by the MCP server, each shell command's arguments and output, and the agent's final response. @@ -41,7 +41,7 @@ from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient from azure.ai.projects.models import ( - MCPTool, + ToolMcpTool, PromptAgentDefinition, ShellToolboxTool, SkillInlineContent, @@ -116,7 +116,7 @@ toolbox_mcp_url = f"{endpoint}/toolboxes/{TOOLBOX_NAME}/versions/{toolbox_version.version}/mcp?api-version=v1" token = credential.get_token("https://ai.azure.com/.default").token - toolbox_mcp_tool = MCPTool( + toolbox_mcp_tool = ToolMcpTool( server_label=TOOLBOX_MCP_LABEL, server_url=toolbox_mcp_url, authorization=token, diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_toolbox_with_shipping_skill.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_toolbox_with_shipping_skill.py index 25f14a49518b..90ea8123ead6 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_toolbox_with_shipping_skill.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_toolbox_with_shipping_skill.py @@ -39,7 +39,7 @@ from azure.ai.projects import AIProjectClient from azure.ai.projects.models import ( - MCPTool, + ToolMcpTool, PromptAgentDefinition, SkillInlineContent, ToolSearchToolboxTool, @@ -106,7 +106,7 @@ print(f"Created toolbox `{toolbox_version.name}` (version {toolbox_version.version}).") toolbox_mcp_url = f"{endpoint}/toolboxes/{TOOLBOX_NAME}/versions/{toolbox_version.version}/mcp?api-version=v1" - toolbox_mcp_tool = MCPTool( + toolbox_mcp_tool = ToolMcpTool( server_label=TOOLBOX_MCP_LABEL, server_url=toolbox_mcp_url, authorization=credential.get_token("https://ai.azure.com/.default").token, diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_toolboxes_with_search.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_toolboxes_with_search.py index 49afda0725b7..db8d7996e43e 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_toolboxes_with_search.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_toolboxes_with_search.py @@ -12,7 +12,7 @@ A toolbox version that includes 'ToolSearchToolboxTool' exposes only two meta tools at its '/mcp' endpoint -- 'tool_search' and 'call_tool' - -- and defers every other tool behind them. The agent uses an 'MCPTool' + -- and defers every other tool behind them. The agent uses a 'ToolMcpTool' pointed at the toolbox's versioned '/mcp' URL to discover and invoke those inner tools. @@ -42,7 +42,7 @@ from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient from azure.ai.projects.models import ( - MCPTool, + ToolMcpTool, MCPToolboxTool, ToolSearchToolboxTool, PromptAgentDefinition, @@ -82,7 +82,7 @@ toolbox_mcp_url = f"{endpoint}/toolboxes/{TOOLBOX_NAME}/versions/{toolbox_version.version}/mcp?api-version=v1" token = credential.get_token("https://ai.azure.com/.default").token - toolbox_mcp_tool = MCPTool( + toolbox_mcp_tool = ToolMcpTool( server_label=TOOLBOX_MCP_LABEL, server_url=toolbox_mcp_url, authorization=token, diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_toolboxes_with_search_async.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_toolboxes_with_search_async.py index 575d0faf52b8..bba590e4cc91 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_toolboxes_with_search_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_toolboxes_with_search_async.py @@ -12,7 +12,7 @@ A toolbox version that includes 'ToolSearchToolboxTool' exposes only two meta tools at its '/mcp' endpoint -- 'tool_search' and 'call_tool' - -- and defers every other tool behind them. The agent uses an 'MCPTool' + -- and defers every other tool behind them. The agent uses a 'ToolMcpTool' pointed at the toolbox's versioned '/mcp' URL to discover and invoke those inner tools. @@ -43,7 +43,7 @@ from azure.identity.aio import DefaultAzureCredential from azure.ai.projects.aio import AIProjectClient from azure.ai.projects.models import ( - MCPTool, + ToolMcpTool, MCPToolboxTool, ToolSearchToolboxTool, PromptAgentDefinition, @@ -84,7 +84,7 @@ async def main() -> None: toolbox_mcp_url = f"{endpoint}/toolboxes/{TOOLBOX_NAME}/versions/{toolbox_version.version}/mcp?api-version=v1" token = (await credential.get_token("https://ai.azure.com/.default")).token - toolbox_mcp_tool = MCPTool( + toolbox_mcp_tool = ToolMcpTool( server_label=TOOLBOX_MCP_LABEL, server_url=toolbox_mcp_url, authorization=token, diff --git a/sdk/ai/azure-ai-projects/samples/evaluations/sample_agent_response_evaluation_with_function_tool.py b/sdk/ai/azure-ai-projects/samples/evaluations/sample_agent_response_evaluation_with_function_tool.py index 6ae7d9c8048f..fd7b784c72c8 100644 --- a/sdk/ai/azure-ai-projects/samples/evaluations/sample_agent_response_evaluation_with_function_tool.py +++ b/sdk/ai/azure-ai-projects/samples/evaluations/sample_agent_response_evaluation_with_function_tool.py @@ -46,7 +46,7 @@ PromptAgentDefinition, ResponseRetrievalItemGenerationParams, Tool, - FunctionTool, + ToolFunctionTool, ) load_dotenv() @@ -55,7 +55,7 @@ model_deployment_name = os.environ["FOUNDRY_MODEL_NAME"] # Define a function tool for the model to use -func_tool = FunctionTool( +func_tool = ToolFunctionTool( name="get_horoscope", parameters={ "type": "object", diff --git a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor.py b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor.py index 6d3d92dda257..8d274de65782 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor.py +++ b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor.py @@ -26,7 +26,7 @@ _set_use_simple_tool_format, RESPONSES_PROVIDER, ) -from azure.ai.projects.models import PromptAgentDefinition, FunctionTool +from azure.ai.projects.models import PromptAgentDefinition, ToolFunctionTool from azure.core.settings import settings settings.tracing_implementation = "OpenTelemetry" @@ -981,7 +981,7 @@ def _test_sync_function_tool_with_content_recording_non_streaming_impl( # pylin deployment_name = kwargs.get("foundry_model_name") # Define a function tool - func_tool = FunctionTool( + func_tool = ToolFunctionTool( name="get_weather", parameters={ "type": "object", @@ -1240,7 +1240,7 @@ def _test_sync_function_tool_with_content_recording_streaming_impl( # pylint: d deployment_name = kwargs.get("foundry_model_name") # Define a function tool - func_tool = FunctionTool( + func_tool = ToolFunctionTool( name="get_weather", parameters={ "type": "object", @@ -1564,7 +1564,7 @@ def _test_sync_function_tool_without_content_recording_non_streaming_impl( # py deployment_name = kwargs.get("foundry_model_name") # Define a function tool - func_tool = FunctionTool( + func_tool = ToolFunctionTool( name="get_weather", parameters={ "type": "object", @@ -1800,7 +1800,7 @@ def _test_sync_function_tool_without_content_recording_streaming_impl( # pylint deployment_name = kwargs.get("foundry_model_name") # Define a function tool - func_tool = FunctionTool( + func_tool = ToolFunctionTool( name="get_weather", parameters={ "type": "object", @@ -2118,7 +2118,7 @@ def test_sync_function_tool_list_conversation_items_with_content_recording(self, deployment_name = kwargs.get("foundry_model_name") # Define a function tool - func_tool = FunctionTool( + func_tool = ToolFunctionTool( name="get_weather", parameters={ "type": "object", @@ -2268,7 +2268,7 @@ def test_sync_function_tool_list_conversation_items_without_content_recording(se deployment_name = kwargs.get("foundry_model_name") # Define a function tool - func_tool = FunctionTool( + func_tool = ToolFunctionTool( name="get_weather", parameters={ "type": "object", @@ -4700,7 +4700,7 @@ def test_responses_stream_method_with_tools_with_content_recording(self, **kwarg deployment_name = kwargs.get("foundry_model_name") # Define a function tool - function_tool = FunctionTool( + function_tool = ToolFunctionTool( name="get_weather", description="Get the current weather for a location.", parameters={ @@ -4818,7 +4818,7 @@ def test_responses_stream_method_with_tools_without_content_recording(self, **kw deployment_name = kwargs.get("foundry_model_name") # Define a function tool - function_tool = FunctionTool( + function_tool = ToolFunctionTool( name="get_weather", description="Get the current weather for a location.", parameters={ diff --git a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_async.py b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_async.py index 9dbcf1bb2531..882745a6164c 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_async.py @@ -25,7 +25,7 @@ _set_use_simple_tool_format, RESPONSES_PROVIDER, ) -from azure.ai.projects.models import FunctionTool, PromptAgentDefinition +from azure.ai.projects.models import ToolFunctionTool, PromptAgentDefinition from azure.core.settings import settings BINARY_DATA_TRACING_ENV_VARIABLE = "AZURE_TRACING_GEN_AI_INCLUDE_BINARY_DATA" @@ -419,7 +419,7 @@ async def _test_async_function_tool_with_content_recording_streaming_impl( # py deployment_name = kwargs.get("foundry_model_name") # Define a function tool - func_tool = FunctionTool( + func_tool = ToolFunctionTool( name="get_weather", parameters={ "type": "object", @@ -680,7 +680,7 @@ async def _test_async_function_tool_without_content_recording_streaming_impl( # deployment_name = kwargs.get("foundry_model_name") # Define a function tool - func_tool = FunctionTool( + func_tool = ToolFunctionTool( name="get_weather", parameters={ "type": "object", @@ -2752,7 +2752,7 @@ async def _test_async_responses_stream_method_with_tools_with_content_recording_ deployment_name = kwargs.get("foundry_model_name") # Define a function tool - function_tool = FunctionTool( + function_tool = ToolFunctionTool( name="get_weather", description="Get the current weather for a location.", parameters={ @@ -3001,7 +3001,7 @@ async def _test_async_responses_stream_method_with_tools_without_content_recordi deployment_name = kwargs.get("foundry_model_name") # Define a function tool - function_tool = FunctionTool( + function_tool = ToolFunctionTool( name="get_weather", description="Get the current weather for a location.", parameters={ diff --git a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_code_interpreter.py b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_code_interpreter.py index 89d8a16d881c..a44876eb0478 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_code_interpreter.py +++ b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_code_interpreter.py @@ -26,7 +26,7 @@ ) from azure.ai.projects.models import ( PromptAgentDefinition, - CodeInterpreterTool, + ToolCodeInterpreterTool, AutoCodeInterpreterToolParam, ) from azure.core.settings import settings @@ -96,7 +96,7 @@ def test_sync_code_interpreter_non_streaming_with_content_recording( definition=PromptAgentDefinition( model=deployment_name, instructions="You are a helpful assistant that can execute Python code to analyze data.", - tools=[CodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[file.id]))], + tools=[ToolCodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[file.id]))], ), ) @@ -285,7 +285,7 @@ def test_sync_code_interpreter_non_streaming_without_content_recording( definition=PromptAgentDefinition( model=deployment_name, instructions="You are a helpful assistant that can execute Python code to analyze data.", - tools=[CodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[file.id]))], + tools=[ToolCodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[file.id]))], ), ) @@ -478,7 +478,7 @@ def test_sync_code_interpreter_streaming_with_content_recording( definition=PromptAgentDefinition( model=deployment_name, instructions="You are a helpful assistant that can execute Python code to analyze data.", - tools=[CodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[file.id]))], + tools=[ToolCodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[file.id]))], ), ) @@ -671,7 +671,7 @@ def test_sync_code_interpreter_streaming_without_content_recording( definition=PromptAgentDefinition( model=deployment_name, instructions="You are a helpful assistant that can execute Python code to analyze data.", - tools=[CodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[file.id]))], + tools=[ToolCodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[file.id]))], ), ) diff --git a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_code_interpreter_async.py b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_code_interpreter_async.py index 8cd4a00868e3..07401d2905ce 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_code_interpreter_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_code_interpreter_async.py @@ -27,7 +27,7 @@ ) from azure.ai.projects.models import ( PromptAgentDefinition, - CodeInterpreterTool, + ToolCodeInterpreterTool, AutoCodeInterpreterToolParam, ) from azure.core.settings import settings @@ -96,7 +96,7 @@ async def test_async_code_interpreter_non_streaming_with_content_recording( definition=PromptAgentDefinition( model=deployment_name, instructions="You are a helpful assistant that can execute Python code to analyze data.", - tools=[CodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[file.id]))], + tools=[ToolCodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[file.id]))], ), ) @@ -285,7 +285,7 @@ async def test_async_code_interpreter_non_streaming_without_content_recording( definition=PromptAgentDefinition( model=deployment_name, instructions="You are a helpful assistant that can execute Python code to analyze data.", - tools=[CodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[file.id]))], + tools=[ToolCodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[file.id]))], ), ) @@ -478,7 +478,7 @@ async def test_async_code_interpreter_streaming_with_content_recording( definition=PromptAgentDefinition( model=deployment_name, instructions="You are a helpful assistant that can execute Python code to analyze data.", - tools=[CodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[file.id]))], + tools=[ToolCodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[file.id]))], ), ) @@ -671,7 +671,7 @@ async def test_async_code_interpreter_streaming_without_content_recording( definition=PromptAgentDefinition( model=deployment_name, instructions="You are a helpful assistant that can execute Python code to analyze data.", - tools=[CodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[file.id]))], + tools=[ToolCodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[file.id]))], ), ) diff --git a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_file_search.py b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_file_search.py index fc9129e74489..74a6ec963a8d 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_file_search.py +++ b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_file_search.py @@ -24,7 +24,7 @@ _set_use_message_events, RESPONSES_PROVIDER, ) -from azure.ai.projects.models import PromptAgentDefinition, FileSearchTool +from azure.ai.projects.models import PromptAgentDefinition, ToolFileSearchTool from azure.core.settings import settings settings.tracing_implementation = "OpenTelemetry" @@ -97,7 +97,7 @@ def test_sync_file_search_non_streaming_with_content_recording( definition=PromptAgentDefinition( model=deployment_name, instructions="You are a helpful assistant that can search through uploaded documents to answer questions.", - tools=[FileSearchTool(vector_store_ids=[vector_store.id])], + tools=[ToolFileSearchTool(vector_store_ids=[vector_store.id])], ), ) @@ -308,7 +308,7 @@ def test_sync_file_search_non_streaming_without_content_recording( definition=PromptAgentDefinition( model=deployment_name, instructions="You are a helpful assistant that can search through uploaded documents to answer questions.", - tools=[FileSearchTool(vector_store_ids=[vector_store.id])], + tools=[ToolFileSearchTool(vector_store_ids=[vector_store.id])], ), ) @@ -517,7 +517,7 @@ def test_sync_file_search_streaming_with_content_recording( definition=PromptAgentDefinition( model=deployment_name, instructions="You are a helpful assistant that can search through uploaded documents to answer questions.", - tools=[FileSearchTool(vector_store_ids=[vector_store.id])], + tools=[ToolFileSearchTool(vector_store_ids=[vector_store.id])], ), ) @@ -724,7 +724,7 @@ def test_sync_file_search_streaming_without_content_recording( definition=PromptAgentDefinition( model=deployment_name, instructions="You are a helpful assistant that can search through uploaded documents to answer questions.", - tools=[FileSearchTool(vector_store_ids=[vector_store.id])], + tools=[ToolFileSearchTool(vector_store_ids=[vector_store.id])], ), ) diff --git a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_file_search_async.py b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_file_search_async.py index afe7445ed887..8ab44a824b04 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_file_search_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_file_search_async.py @@ -25,7 +25,7 @@ _set_use_message_events, RESPONSES_PROVIDER, ) -from azure.ai.projects.models import PromptAgentDefinition, FileSearchTool +from azure.ai.projects.models import PromptAgentDefinition, ToolFileSearchTool from azure.core.settings import settings settings.tracing_implementation = "OpenTelemetry" @@ -98,7 +98,7 @@ async def test_async_file_search_non_streaming_with_content_recording( definition=PromptAgentDefinition( model=deployment_name, instructions="You are a helpful assistant that can search through uploaded documents to answer questions.", - tools=[FileSearchTool(vector_store_ids=[vector_store.id])], + tools=[ToolFileSearchTool(vector_store_ids=[vector_store.id])], ), ) @@ -309,7 +309,7 @@ async def test_async_file_search_non_streaming_without_content_recording( definition=PromptAgentDefinition( model=deployment_name, instructions="You are a helpful assistant that can search through uploaded documents to answer questions.", - tools=[FileSearchTool(vector_store_ids=[vector_store.id])], + tools=[ToolFileSearchTool(vector_store_ids=[vector_store.id])], ), ) @@ -518,7 +518,7 @@ async def test_async_file_search_streaming_with_content_recording( definition=PromptAgentDefinition( model=deployment_name, instructions="You are a helpful assistant that can search through uploaded documents to answer questions.", - tools=[FileSearchTool(vector_store_ids=[vector_store.id])], + tools=[ToolFileSearchTool(vector_store_ids=[vector_store.id])], ), ) @@ -725,7 +725,7 @@ async def test_async_file_search_streaming_without_content_recording( definition=PromptAgentDefinition( model=deployment_name, instructions="You are a helpful assistant that can search through uploaded documents to answer questions.", - tools=[FileSearchTool(vector_store_ids=[vector_store.id])], + tools=[ToolFileSearchTool(vector_store_ids=[vector_store.id])], ), ) diff --git a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_mcp.py b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_mcp.py index 37e706349336..a755b9995c67 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_mcp.py +++ b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_mcp.py @@ -24,7 +24,7 @@ _set_use_message_events, RESPONSES_PROVIDER, ) -from azure.ai.projects.models import PromptAgentDefinition, MCPTool +from azure.ai.projects.models import PromptAgentDefinition, ToolMcpTool from azure.core.settings import settings settings.tracing_implementation = "OpenTelemetry" @@ -69,7 +69,7 @@ def _test_sync_mcp_non_streaming_with_content_recording_impl( openai_client = project_client.get_openai_client() # Create MCP tool - mcp_tool = MCPTool( + mcp_tool = ToolMcpTool( server_label="api-specs", server_url="https://gitmcp.io/Azure/azure-rest-api-specs", require_approval="always", @@ -401,7 +401,7 @@ def _test_sync_mcp_non_streaming_without_content_recording_impl( openai_client = project_client.get_openai_client() # Create MCP tool - mcp_tool = MCPTool( + mcp_tool = ToolMcpTool( server_label="api-specs", server_url="https://gitmcp.io/Azure/azure-rest-api-specs", require_approval="always", @@ -720,7 +720,7 @@ def _test_sync_mcp_streaming_with_content_recording_impl( openai_client = project_client.get_openai_client() # Create MCP tool - mcp_tool = MCPTool( + mcp_tool = ToolMcpTool( server_label="api-specs", server_url="https://gitmcp.io/Azure/azure-rest-api-specs", require_approval="always", @@ -998,7 +998,7 @@ def _test_sync_mcp_streaming_without_content_recording_impl( openai_client = project_client.get_openai_client() # Create MCP tool - mcp_tool = MCPTool( + mcp_tool = ToolMcpTool( server_label="api-specs", server_url="https://gitmcp.io/Azure/azure-rest-api-specs", require_approval="always", diff --git a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_mcp_async.py b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_mcp_async.py index 2d1d410500c4..188d2b72802f 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_mcp_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_mcp_async.py @@ -25,7 +25,7 @@ _set_use_message_events, RESPONSES_PROVIDER, ) -from azure.ai.projects.models import PromptAgentDefinition, MCPTool +from azure.ai.projects.models import PromptAgentDefinition, ToolMcpTool from azure.core.settings import settings settings.tracing_implementation = "OpenTelemetry" @@ -70,7 +70,7 @@ async def _test_async_mcp_non_streaming_with_content_recording_impl( openai_client = project_client.get_openai_client() # Create MCP tool - mcp_tool = MCPTool( + mcp_tool = ToolMcpTool( server_label="api-specs", server_url="https://gitmcp.io/Azure/azure-rest-api-specs", require_approval="always", @@ -401,7 +401,7 @@ async def _test_async_mcp_non_streaming_without_content_recording_impl( openai_client = project_client.get_openai_client() # Create MCP tool - mcp_tool = MCPTool( + mcp_tool = ToolMcpTool( server_label="api-specs", server_url="https://gitmcp.io/Azure/azure-rest-api-specs", require_approval="always", @@ -722,7 +722,7 @@ async def _test_async_mcp_streaming_with_content_recording_impl( openai_client = project_client.get_openai_client() # Create MCP tool - mcp_tool = MCPTool( + mcp_tool = ToolMcpTool( server_label="api-specs", server_url="https://gitmcp.io/Azure/azure-rest-api-specs", require_approval="always", @@ -1003,7 +1003,7 @@ async def _test_async_mcp_streaming_without_content_recording_impl( openai_client = project_client.get_openai_client() # Create MCP tool - mcp_tool = MCPTool( + mcp_tool = ToolMcpTool( server_label="api-specs", server_url="https://gitmcp.io/Azure/azure-rest-api-specs", require_approval="always", diff --git a/sdk/ai/azure-ai-projects/tests/agents/test_live_protocol_models.py b/sdk/ai/azure-ai-projects/tests/agents/test_live_protocol_models.py new file mode 100644 index 000000000000..7b3b134513a1 --- /dev/null +++ b/sdk/ai/azure-ai-projects/tests/agents/test_live_protocol_models.py @@ -0,0 +1,101 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Offline coverage for Foundry-owned GPT Live protocol metadata.""" + +from collections.abc import Mapping + +import pytest + +from azure.ai.projects import models + + +def _session(delegation): + return { + "id": "live-session-test", + "model": "synthetic-live-model", + "expires_at": 2000000000, + "status": "active", + "delegation": delegation, + } + + +@pytest.mark.parametrize( + "event_model,event_type", + [ + (models.LiveServerEventLiveSessionStarted, "session.started"), + (models.LiveServerEventLiveSessionUpdated, "session.updated"), + (models.LiveServerEventLiveSessionClosed, "session.closed"), + ], +) +def test_live_lifecycle_snapshots_report_the_pinned_foundry_delegation(event_model, event_type): + delegation = { + "type": "foundry_managed_agent", + "agent_name": "prompt-agent-test", + "agent_version": "7", + } + payload = { + "type": event_type, + "event_id": "event-test", + "session": _session(delegation), + } + if event_type == "session.started": + payload["conversation_id"] = "conversation-test" + elif event_type == "session.closed": + payload.update(reason="close_requested", usage={"seconds": 1.25}) + + event = event_model(payload) + + assert isinstance(event.session, models.VoiceAgentLiveSessionResource) + assert isinstance(event.session.delegation, Mapping) + assert event.session.delegation["type"] == "foundry_managed_agent" + assert event.session.delegation["agent_name"] == "prompt-agent-test" + assert event.session.delegation["agent_version"] == "7" + assert event.session.status == "active" + assert event.as_dict() == payload + + +@pytest.mark.parametrize("target", ["client", "responses", "foundry_managed_agent"]) +def test_live_delegation_created_reports_the_effective_owner_without_task_content(target): + payload = { + "type": "session.delegation.created", + "event_id": "event-test", + "offset_ms": 0, + "delegation": {"type": "delegation", "id": "delegation-test", "target": target}, + } + if target == "responses": + payload["delegation"]["response_id"] = "response-test" + + event = models.LiveServerEventLiveDelegationCreated(payload) + + assert isinstance(event.delegation, models.VoiceAgentLiveDelegationItem) + assert event.delegation.target == target + assert event.delegation.id == "delegation-test" + assert "input" not in event.delegation and "task" not in event.delegation + assert event.as_dict() == payload + + +@pytest.mark.parametrize( + "delegation", + [ + None, + {"type": "client"}, + {"type": "responses", "model": "synthetic-responses-model"}, + ], +) +def test_foundry_live_session_preserves_native_and_null_delegation_modes(delegation): + payload = _session(delegation) + session = models.VoiceAgentLiveSessionResource(payload) + + if delegation is None: + assert session.delegation is None + else: + assert isinstance(session.delegation, Mapping) + assert dict(session.delegation) == delegation + assert session.as_dict() == payload + + +def test_foundry_live_protocol_metadata_models_are_publicly_exported(): + assert "VoiceAgentLiveSessionResource" in models.__all__ + assert "VoiceAgentLiveDelegationItem" in models.__all__ diff --git a/sdk/ai/azure-ai-projects/tests/agents/test_realtime_client.py b/sdk/ai/azure-ai-projects/tests/agents/test_realtime_client.py index 2fe8c3214150..0f6f07e628c6 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/test_realtime_client.py +++ b/sdk/ai/azure-ai-projects/tests/agents/test_realtime_client.py @@ -15,6 +15,7 @@ import json import inspect import logging +from typing import Literal, Optional from unittest.mock import MagicMock, patch from urllib.parse import parse_qs, urlparse @@ -22,6 +23,7 @@ from azure.core.credentials import AccessToken from websockets.typing import Subprotocol +from azure.ai.projects import models from azure.ai.projects._realtime import ( BetaRealtime, BetaRealtimeConnectionManager, @@ -38,6 +40,28 @@ _ENDPOINT = "https://my-account.services.ai.azure.com/api/projects/my-project" +@pytest.mark.parametrize( + "definition_type,expected_annotation,expected_payload", + [ + ( + models.VoiceAgentDefinition, + Optional[Literal["realtime"]], + {"model": "deployment-test", "kind": "voice"}, + ), + ( + models.VoiceAgentLiveDefinition, + Literal["live"], + {"model": "deployment-test", "kind": "voice", "sub_protocol": "live", "model_type": "self_deployed"}, + ), + ], +) +def test_voice_protocol_typing_fix_preserves_annotations_and_constructor_defaults( + definition_type, expected_annotation, expected_payload +): + assert definition_type.__annotations__["sub_protocol"] == expected_annotation + assert definition_type(model="deployment-test").as_dict() == expected_payload + + class _FakeCredential: """Sync stub credential that returns a never-expiring token.""" diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_agent_code_interpreter_and_function.py b/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_agent_code_interpreter_and_function.py index 4facf6eab766..46de6c857a5a 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_agent_code_interpreter_and_function.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_agent_code_interpreter_and_function.py @@ -16,9 +16,9 @@ from devtools_testutils import recorded_by_proxy, RecordedTransport from azure.ai.projects.models import ( PromptAgentDefinition, - CodeInterpreterTool, + ToolCodeInterpreterTool, AutoCodeInterpreterToolParam, - FunctionTool, + ToolFunctionTool, ) @@ -43,7 +43,7 @@ def test_calculate_and_save(self, **kwargs): openai_client = project_client.get_openai_client() # Define function tool - func_tool = FunctionTool( + func_tool = ToolFunctionTool( name="save_result", description="Save the calculation result. Must be called to persist the result.", parameters={ @@ -65,7 +65,7 @@ def test_calculate_and_save(self, **kwargs): model=model, instructions="You are a calculator assistant. Use code interpreter to perform calculations, then ALWAYS save the result using the save_result function.", tools=[ - CodeInterpreterTool(container=AutoCodeInterpreterToolParam()), + ToolCodeInterpreterTool(container=AutoCodeInterpreterToolParam()), func_tool, ], ), @@ -103,7 +103,7 @@ def test_generate_data_and_report(self, **kwargs): openai_client = project_client.get_openai_client() # Define function tool - report_function = FunctionTool( + report_function = ToolFunctionTool( name="generate_report", description="Generate and save a report with the analysis results. Must be called to create the report.", parameters={ @@ -127,7 +127,7 @@ def test_generate_data_and_report(self, **kwargs): model=model, instructions="You are a data analyst. Use code interpreter to generate and analyze data, then ALWAYS create a report using the generate_report function with the exact statistics you computed.", tools=[ - CodeInterpreterTool(container=AutoCodeInterpreterToolParam()), + ToolCodeInterpreterTool(container=AutoCodeInterpreterToolParam()), report_function, ], ), diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_agent_file_search_and_code_interpreter.py b/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_agent_file_search_and_code_interpreter.py index a9c7774dd6d2..ca5dc93a7448 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_agent_file_search_and_code_interpreter.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_agent_file_search_and_code_interpreter.py @@ -17,8 +17,8 @@ from devtools_testutils import recorded_by_proxy, RecordedTransport from azure.ai.projects.models import ( PromptAgentDefinition, - FileSearchTool, - CodeInterpreterTool, + ToolFileSearchTool, + ToolCodeInterpreterTool, AutoCodeInterpreterToolParam, ) @@ -87,8 +87,8 @@ def test_find_and_analyze_data(self, **kwargs): model=model, instructions="You are a data analyst. Use file search to find data files, then use code interpreter to perform calculations on the data.", tools=[ - FileSearchTool(vector_store_ids=[vector_store.id]), - CodeInterpreterTool(container=AutoCodeInterpreterToolParam()), + ToolFileSearchTool(vector_store_ids=[vector_store.id]), + ToolCodeInterpreterTool(container=AutoCodeInterpreterToolParam()), ], ), description="Agent with File Search and Code Interpreter.", @@ -157,8 +157,8 @@ def fibonacci(n): model=model, instructions="You are a code analyst. Use file search to find code files, then use code interpreter to execute and test the code.", tools=[ - FileSearchTool(vector_store_ids=[vector_store.id]), - CodeInterpreterTool(container=AutoCodeInterpreterToolParam()), + ToolFileSearchTool(vector_store_ids=[vector_store.id]), + ToolCodeInterpreterTool(container=AutoCodeInterpreterToolParam()), ], ), description="Agent for code analysis and execution.", diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_agent_file_search_and_function.py b/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_agent_file_search_and_function.py index a72abe80a436..3037816516ef 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_agent_file_search_and_function.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_agent_file_search_and_function.py @@ -17,7 +17,7 @@ from test_base import TestBase, servicePreparer from devtools_testutils import recorded_by_proxy, RecordedTransport from openai.types.responses.response_input_param import FunctionCallOutput, ResponseInputParam -from azure.ai.projects.models import PromptAgentDefinition, FileSearchTool, FunctionTool +from azure.ai.projects.models import PromptAgentDefinition, ToolFileSearchTool, ToolFunctionTool class TestAgentFileSearchAndFunction(TestBase): @@ -69,7 +69,7 @@ def test_data_analysis_workflow(self, **kwargs): assert file.status == "completed" # Define function tool - save_results_function = FunctionTool( + save_results_function = ToolFunctionTool( name="save_analysis_results", description="Save the analysis results", parameters={ @@ -93,7 +93,7 @@ def test_data_analysis_workflow(self, **kwargs): model=model, instructions="You are a data analyst. Use file search to find data and save_analysis_results function to save your findings.", tools=[ - FileSearchTool(vector_store_ids=[vector_store.id]), + ToolFileSearchTool(vector_store_ids=[vector_store.id]), save_results_function, ], ), @@ -172,7 +172,7 @@ def test_empty_vector_store_handling(self, **kwargs): print(f"Empty vector store created (id: {vector_store.id})") # Define function tool - error_function = FunctionTool( + error_function = ToolFunctionTool( name="report_error", description="Report when data is not available", parameters={ @@ -196,7 +196,7 @@ def test_empty_vector_store_handling(self, **kwargs): model=model, instructions="Search for data. If you can't find it, use report_error function to explain what happened.", tools=[ - FileSearchTool(vector_store_ids=[vector_store.id]), + ToolFileSearchTool(vector_store_ids=[vector_store.id]), error_function, ], ), @@ -270,7 +270,7 @@ def calculate_sum(numbers): print(f"Python file uploaded (id: {file.id})") # Define function tool - save_function = FunctionTool( + save_function = ToolFunctionTool( name="save_code_review", description="Save code review findings. Must be called to persist the review.", parameters={ @@ -294,7 +294,7 @@ def calculate_sum(numbers): model=model, instructions="You are a code reviewer. Search for code files, analyze them, and ALWAYS save your findings using the save_code_review function.", tools=[ - FileSearchTool(vector_store_ids=[vector_store.id]), + ToolFileSearchTool(vector_store_ids=[vector_store.id]), save_function, ], ), @@ -419,7 +419,7 @@ def test_multi_turn_search_and_save_workflow(self, **kwargs): # pylint: disable print(f"Documents uploaded: {uploaded1.id}, {uploaded2.id}") # Define save function - save_finding = FunctionTool( + save_finding = ToolFunctionTool( name="save_finding", description="Save research finding", parameters={ @@ -441,7 +441,7 @@ def test_multi_turn_search_and_save_workflow(self, **kwargs): # pylint: disable model=model, instructions="You are a research assistant. Search documents and save important findings.", tools=[ - FileSearchTool(vector_store_ids=[vector_store.id]), + ToolFileSearchTool(vector_store_ids=[vector_store.id]), save_finding, ], ), diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_agent_file_search_code_interpreter_function.py b/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_agent_file_search_code_interpreter_function.py index 3599a865ea38..d106992c51c2 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_agent_file_search_code_interpreter_function.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_agent_file_search_code_interpreter_function.py @@ -16,10 +16,10 @@ from devtools_testutils import recorded_by_proxy, RecordedTransport from azure.ai.projects.models import ( PromptAgentDefinition, - FileSearchTool, - CodeInterpreterTool, + ToolFileSearchTool, + ToolCodeInterpreterTool, AutoCodeInterpreterToolParam, - FunctionTool, + ToolFunctionTool, ) @@ -76,7 +76,7 @@ def test_complete_analysis_workflow(self, **kwargs): print(f"File uploaded (id: {file.id})") # Define function tool for saving analysis results - func_tool = FunctionTool( + func_tool = ToolFunctionTool( name="save_analysis", description="Save the statistical analysis results. Must be called to persist the analysis.", parameters={ @@ -100,8 +100,8 @@ def test_complete_analysis_workflow(self, **kwargs): model=model, instructions="You are a data analyst. Use file search to find data files, code interpreter to calculate statistics, and ALWAYS save your analysis using the save_analysis function.", tools=[ - FileSearchTool(vector_store_ids=[vector_store.id]), - CodeInterpreterTool(container=AutoCodeInterpreterToolParam()), + ToolFileSearchTool(vector_store_ids=[vector_store.id]), + ToolCodeInterpreterTool(container=AutoCodeInterpreterToolParam()), func_tool, ], ), diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_multitool_with_conversations.py b/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_multitool_with_conversations.py index e197a2c1e148..68bcb70e0d99 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_multitool_with_conversations.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_multitool_with_conversations.py @@ -15,8 +15,8 @@ from test_base import TestBase, servicePreparer from devtools_testutils import recorded_by_proxy, RecordedTransport from azure.ai.projects.models import ( - FunctionTool, - FileSearchTool, + ToolFunctionTool, + ToolFileSearchTool, PromptAgentDefinition, ) @@ -60,7 +60,7 @@ def test_file_search_and_function_with_conversation(self, **kwargs): # pylint: print(f"Vector store created: {vector_store.id}") # Define save function - save_report = FunctionTool( + save_report = ToolFunctionTool( name="save_report", description="Save a report summary. Use this when explicitly asked to perform a save operation.", parameters={ @@ -82,7 +82,7 @@ def test_file_search_and_function_with_conversation(self, **kwargs): # pylint: model=model, instructions="You are an analyst. Search data to answer questions and save reports when instructed", tools=[ - FileSearchTool(vector_store_ids=[vector_store.id]), + ToolFileSearchTool(vector_store_ids=[vector_store.id]), save_report, ], ), diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_code_interpreter.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_code_interpreter.py index 94e7d041b349..6e17b74de238 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_code_interpreter.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_code_interpreter.py @@ -11,7 +11,7 @@ from devtools_testutils import recorded_by_proxy, RecordedTransport from azure.ai.projects.models import ( PromptAgentDefinition, - CodeInterpreterTool, + ToolCodeInterpreterTool, AutoCodeInterpreterToolParam, ) @@ -54,7 +54,7 @@ def test_agent_code_interpreter_simple_math(self, **kwargs): definition=PromptAgentDefinition( model=model, instructions="You are a helpful assistant that can execute Python code.", - tools=[CodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[]))], + tools=[ToolCodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[]))], ), description="Simple code interpreter agent for basic Python execution.", ) @@ -154,7 +154,7 @@ def test_agent_code_interpreter_file_generation(self, **kwargs): definition=PromptAgentDefinition( model=model, instructions="You are a helpful assistant that can analyze data and create visualizations.", - tools=[CodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[file.id]))], + tools=[ToolCodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[file.id]))], ), description="Code interpreter agent for file processing and chart generation.", ) diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_code_interpreter_async.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_code_interpreter_async.py index d40a1eb2524a..07ee6576440e 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_code_interpreter_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_code_interpreter_async.py @@ -10,7 +10,7 @@ from devtools_testutils import RecordedTransport from azure.ai.projects.models import ( PromptAgentDefinition, - CodeInterpreterTool, + ToolCodeInterpreterTool, AutoCodeInterpreterToolParam, ) @@ -40,7 +40,7 @@ async def test_agent_code_interpreter_simple_math_async(self, **kwargs): definition=PromptAgentDefinition( model=model, instructions="You are a helpful assistant that can execute Python code.", - tools=[CodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[]))], + tools=[ToolCodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[]))], ), description="Simple code interpreter agent for basic Python execution.", ) diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_file_search.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_file_search.py index 12ca1e54f204..fb3e060fc5df 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_file_search.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_file_search.py @@ -10,7 +10,7 @@ import pytest from test_base import TestBase, servicePreparer from devtools_testutils import recorded_by_proxy, RecordedTransport -from azure.ai.projects.models import PromptAgentDefinition, FileSearchTool +from azure.ai.projects.models import PromptAgentDefinition, ToolFileSearchTool class TestAgentFileSearch(TestBase): @@ -25,7 +25,7 @@ def test_agent_file_search(self, **kwargs): This test verifies that an agent can: 1. Upload and index documents into a vector store - 2. Use FileSearchTool to search through uploaded documents + 2. Use ToolFileSearchTool to search through uploaded documents 3. Answer questions based on document content Routes used in this test: @@ -38,7 +38,7 @@ def test_agent_file_search(self, **kwargs): POST /agents/{agent_name}/versions project_client.agents.create_version() # Test focus: - POST /openai/responses openai_client.responses.create() (with FileSearchTool) + POST /openai/responses openai_client.responses.create() (with ToolFileSearchTool) # Teardown: DELETE /agents/{agent_name}/versions/{agent_version} project_client.agents.delete_version() @@ -82,7 +82,7 @@ def test_agent_file_search(self, **kwargs): definition=PromptAgentDefinition( model=model, instructions="You are a helpful assistant that can search through uploaded documents to answer questions.", - tools=[FileSearchTool(vector_store_ids=[vector_store.id])], + tools=[ToolFileSearchTool(vector_store_ids=[vector_store.id])], ), description="Agent for testing file search capabilities.", ) @@ -250,7 +250,7 @@ def test_agent_file_search_multi_turn_conversation(self, **kwargs): definition=PromptAgentDefinition( model=model, instructions="You are a product information assistant. Use file search to answer questions about products.", - tools=[FileSearchTool(vector_store_ids=[vector_store.id])], + tools=[ToolFileSearchTool(vector_store_ids=[vector_store.id])], ), description="Agent for multi-turn product queries.", ) diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_file_search_async.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_file_search_async.py index 77179e0d4067..b1e1ad0c2d13 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_file_search_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_file_search_async.py @@ -10,7 +10,7 @@ from test_base import TestBase, servicePreparer from devtools_testutils.aio import recorded_by_proxy_async from devtools_testutils import RecordedTransport -from azure.ai.projects.models import PromptAgentDefinition, FileSearchTool +from azure.ai.projects.models import PromptAgentDefinition, ToolFileSearchTool class TestAgentFileSearchAsync(TestBase): @@ -56,7 +56,7 @@ async def test_agent_file_search_async(self, **kwargs): definition=PromptAgentDefinition( model=model, instructions="You are a helpful assistant that can search through uploaded documents to answer questions.", - tools=[FileSearchTool(vector_store_ids=[vector_store.id])], + tools=[ToolFileSearchTool(vector_store_ids=[vector_store.id])], ), description="Agent for testing file search capabilities.", ) @@ -152,7 +152,7 @@ async def test_agent_file_search_multi_turn_conversation_async(self, **kwargs): definition=PromptAgentDefinition( model=model, instructions="You are a product information assistant. Use file search to answer questions about products.", - tools=[FileSearchTool(vector_store_ids=[vector_store.id])], + tools=[ToolFileSearchTool(vector_store_ids=[vector_store.id])], ), description="Agent for multi-turn product queries.", ) diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_file_search_stream.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_file_search_stream.py index 1202e2b66ae5..7792eaee8f7d 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_file_search_stream.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_file_search_stream.py @@ -8,7 +8,7 @@ import os from test_base import TestBase, servicePreparer from devtools_testutils import recorded_by_proxy, RecordedTransport -from azure.ai.projects.models import PromptAgentDefinition, FileSearchTool +from azure.ai.projects.models import PromptAgentDefinition, ToolFileSearchTool class TestAgentFileSearchStream(TestBase): @@ -21,7 +21,7 @@ def test_agent_file_search_stream(self, **kwargs): This test verifies that an agent can: 1. Upload and index documents into a vector store - 2. Use FileSearchTool with streaming enabled + 2. Use ToolFileSearchTool with streaming enabled 3. Stream back responses based on document content Routes used in this test: @@ -34,7 +34,7 @@ def test_agent_file_search_stream(self, **kwargs): POST /agents/{agent_name}/versions project_client.agents.create_version() # Test focus: - POST /openai/responses openai_client.responses.create() (stream=True, with FileSearchTool) + POST /openai/responses openai_client.responses.create() (stream=True, with ToolFileSearchTool) # Teardown: DELETE /agents/{agent_name}/versions/{agent_version} project_client.agents.delete_version() @@ -78,7 +78,7 @@ def test_agent_file_search_stream(self, **kwargs): definition=PromptAgentDefinition( model=model, instructions="You are a helpful assistant that can search through uploaded documents to answer questions.", - tools=[FileSearchTool(vector_store_ids=[vector_store.id])], + tools=[ToolFileSearchTool(vector_store_ids=[vector_store.id])], ), description="Agent for testing file search with streaming.", ) diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_file_search_stream_async.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_file_search_stream_async.py index e68be74712c7..b5a80cdceb6b 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_file_search_stream_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_file_search_stream_async.py @@ -9,7 +9,7 @@ from test_base import TestBase, servicePreparer from devtools_testutils.aio import recorded_by_proxy_async from devtools_testutils import RecordedTransport -from azure.ai.projects.models import PromptAgentDefinition, FileSearchTool +from azure.ai.projects.models import PromptAgentDefinition, ToolFileSearchTool class TestAgentFileSearchStreamAsync(TestBase): @@ -55,7 +55,7 @@ async def test_agent_file_search_stream_async(self, **kwargs): definition=PromptAgentDefinition( model=model, instructions="You are a helpful assistant that can search through uploaded documents to answer questions.", - tools=[FileSearchTool(vector_store_ids=[vector_store.id])], + tools=[ToolFileSearchTool(vector_store_ids=[vector_store.id])], ), description="Agent for testing file search with streaming.", ) diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_function_tool.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_function_tool.py index 640c21193371..bd01dfa9266c 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_function_tool.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_function_tool.py @@ -9,7 +9,7 @@ from test_base import TestBase, servicePreparer from devtools_testutils import recorded_by_proxy, RecordedTransport from openai.types.responses.response_input_param import FunctionCallOutput, ResponseInputParam -from azure.ai.projects.models import PromptAgentDefinition, FunctionTool +from azure.ai.projects.models import PromptAgentDefinition, ToolFunctionTool class TestAgentFunctionTool(TestBase): @@ -48,7 +48,7 @@ def test_agent_function_tool(self, **kwargs): project_client.get_openai_client() as openai_client, ): # Define a function tool for the model to use - func_tool = FunctionTool( + func_tool = ToolFunctionTool( name="get_weather", description="Get the current weather for a location.", parameters={ @@ -178,7 +178,7 @@ def test_agent_function_tool_multi_turn_with_multiple_calls(self, **kwargs): # project_client.get_openai_client() as openai_client, ): # Define multiple function tools - get_weather = FunctionTool( + get_weather = ToolFunctionTool( name="get_weather", description="Get current weather for a city", parameters={ @@ -195,7 +195,7 @@ def test_agent_function_tool_multi_turn_with_multiple_calls(self, **kwargs): # strict=True, ) - get_temperature_forecast = FunctionTool( + get_temperature_forecast = ToolFunctionTool( name="get_temperature_forecast", description="Get 3-day temperature forecast for a city", parameters={ @@ -387,7 +387,7 @@ def test_agent_function_tool_context_dependent_followup(self, **kwargs): project_client.get_openai_client() as openai_client, ): # Define function tool - get_temperature = FunctionTool( + get_temperature = ToolFunctionTool( name="get_temperature", description="Get current temperature for a city in Fahrenheit", parameters={ diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_function_tool_async.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_function_tool_async.py index d5086b4fc3a9..245bb9c134dc 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_function_tool_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_function_tool_async.py @@ -10,7 +10,7 @@ from devtools_testutils.aio import recorded_by_proxy_async from devtools_testutils import RecordedTransport from openai.types.responses.response_input_param import FunctionCallOutput, ResponseInputParam -from azure.ai.projects.models import PromptAgentDefinition, FunctionTool +from azure.ai.projects.models import PromptAgentDefinition, ToolFunctionTool class TestAgentFunctionToolAsync(TestBase): @@ -36,7 +36,7 @@ async def test_agent_function_tool_async(self, **kwargs): async with project_client: # Define a function tool for the model to use - func_tool = FunctionTool( + func_tool = ToolFunctionTool( name="get_weather", description="Get the current weather for a location.", parameters={ @@ -169,7 +169,7 @@ async def test_agent_function_tool_multi_turn_with_multiple_calls_async( async with project_client: # Define multiple function tools - get_weather = FunctionTool( + get_weather = ToolFunctionTool( name="get_weather", description="Get current weather for a city", parameters={ @@ -186,7 +186,7 @@ async def test_agent_function_tool_multi_turn_with_multiple_calls_async( strict=True, ) - get_temperature_forecast = FunctionTool( + get_temperature_forecast = ToolFunctionTool( name="get_temperature_forecast", description="Get 3-day temperature forecast for a city", parameters={ @@ -379,7 +379,7 @@ async def test_agent_function_tool_context_dependent_followup_async(self, **kwar project_client.get_openai_client() as openai_client, ): # Define function tool - get_temperature = FunctionTool( + get_temperature = ToolFunctionTool( name="get_temperature", description="Get current temperature for a city in Fahrenheit", parameters={ diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_image_generation.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_image_generation.py index f7e9bc4a3ab6..427a35e86fec 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_image_generation.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_image_generation.py @@ -10,7 +10,7 @@ import pytest from test_base import TestBase, servicePreparer from devtools_testutils import recorded_by_proxy, RecordedTransport -from azure.ai.projects.models import PromptAgentDefinition, ImageGenTool +from azure.ai.projects.models import PromptAgentDefinition, ToolImageGenTool from azure.core.exceptions import ResourceNotFoundError @@ -23,7 +23,7 @@ def test_agent_image_generation(self, **kwargs): Test agent with Image Generation tool. This test verifies that an agent can: - 1. Use ImageGenTool to generate images from text prompts + 1. Use ToolImageGenTool to generate images from text prompts 2. Return base64-encoded image data 3. Decode and validate the image format @@ -35,7 +35,7 @@ def test_agent_image_generation(self, **kwargs): POST /agents/{agent_name}/versions project_client.agents.create_version() # Test focus: - POST /openai/responses openai_client.responses.create() (with ImageGenTool) + POST /openai/responses openai_client.responses.create() (with ToolImageGenTool) # Teardown: DELETE /agents/{agent_name}/versions/{agent_version} project_client.agents.delete_version() @@ -67,7 +67,7 @@ def test_agent_image_generation(self, **kwargs): definition=PromptAgentDefinition( model=model, instructions="Generate images based on user prompts", - tools=[ImageGenTool(model=image_model, quality="low", size="1024x1024")], # type: ignore + tools=[ToolImageGenTool(model=image_model, quality="low", size="1024x1024")], # type: ignore ), description="Agent for testing image generation.", ) diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_image_generation_async.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_image_generation_async.py index a40a1e526a85..0a22aae1fa72 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_image_generation_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_image_generation_async.py @@ -11,7 +11,7 @@ from test_base import TestBase, servicePreparer from devtools_testutils.aio import recorded_by_proxy_async from devtools_testutils import RecordedTransport -from azure.ai.projects.models import PromptAgentDefinition, ImageGenTool +from azure.ai.projects.models import PromptAgentDefinition, ToolImageGenTool from azure.core.exceptions import ResourceNotFoundError @@ -47,7 +47,7 @@ async def test_agent_image_generation_async(self, **kwargs): definition=PromptAgentDefinition( model=model, instructions="Generate images based on user prompts", - tools=[ImageGenTool(model=image_model, quality="low", size="1024x1024")], # type: ignore + tools=[ToolImageGenTool(model=image_model, quality="low", size="1024x1024")], # type: ignore ), description="Agent for testing image generation.", ) diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_mcp.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_mcp.py index 69afe5032a90..6bc4c40fd159 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_mcp.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_mcp.py @@ -10,7 +10,7 @@ from devtools_testutils import is_live_and_not_recording from devtools_testutils import recorded_by_proxy, RecordedTransport from openai.types.responses.response_input_param import McpApprovalResponse, ResponseInputParam -from azure.ai.projects.models import PromptAgentDefinition, MCPTool, Tool +from azure.ai.projects.models import PromptAgentDefinition, ToolMcpTool, Tool class TestAgentMCP(TestBase): @@ -55,7 +55,7 @@ def test_agent_mcp_basic(self, **kwargs): project_client.get_openai_client() as openai_client, ): # Create MCP tool that connects to a public GitHub repo via MCP server - mcp_tool = MCPTool( + mcp_tool = ToolMcpTool( server_label="api-specs", server_url="https://gitmcp.io/Azure/azure-rest-api-specs", require_approval="always", @@ -195,7 +195,7 @@ def test_agent_mcp_with_project_connection(self, **kwargs): print(f"Using MCP project connection: {mcp_project_connection_id}") # Create MCP tool with project connection for GitHub API access - mcp_tool = MCPTool( + mcp_tool = ToolMcpTool( server_label="github-api", server_url="https://api.githubcopilot.com/mcp", require_approval="always", diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_mcp_async.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_mcp_async.py index 54145ba2b049..de13c2eb2094 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_mcp_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_mcp_async.py @@ -9,7 +9,7 @@ from devtools_testutils.aio import recorded_by_proxy_async from devtools_testutils import RecordedTransport from openai.types.responses.response_input_param import McpApprovalResponse, ResponseInputParam -from azure.ai.projects.models import PromptAgentDefinition, MCPTool, Tool +from azure.ai.projects.models import PromptAgentDefinition, ToolMcpTool, Tool class TestAgentMCPAsync(TestBase): @@ -27,7 +27,7 @@ async def test_agent_mcp_basic_async(self, **kwargs): project_client.get_openai_client() as openai_client, ): # Create MCP tool that connects to a public GitHub repo via MCP server - mcp_tool = MCPTool( + mcp_tool = ToolMcpTool( server_label="api-specs", server_url="https://gitmcp.io/Azure/azure-rest-api-specs", require_approval="always", diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_tools_with_conversations.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_tools_with_conversations.py index 60f429023f2f..54ed30949e52 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_tools_with_conversations.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_tools_with_conversations.py @@ -16,9 +16,9 @@ from devtools_testutils import recorded_by_proxy, RecordedTransport from openai.types.responses.response_input_param import FunctionCallOutput, ResponseInputParam from azure.ai.projects.models import ( - FunctionTool, - FileSearchTool, - CodeInterpreterTool, + ToolFunctionTool, + ToolFileSearchTool, + ToolCodeInterpreterTool, AutoCodeInterpreterToolParam, PromptAgentDefinition, ) @@ -30,7 +30,7 @@ class TestAgentToolsWithConversations(TestBase): @recorded_by_proxy(RecordedTransport.AZURE_CORE, RecordedTransport.HTTPX2) def test_function_tool_with_conversation(self, **kwargs): # pylint: disable=too-many-statements """ - Test using FunctionTool within a conversation. + Test using ToolFunctionTool within a conversation. This tests: - Creating a conversation @@ -46,7 +46,7 @@ def test_function_tool_with_conversation(self, **kwargs): # pylint: disable=too project_client.get_openai_client() as openai_client, ): # Define a calculator function - calculator = FunctionTool( + calculator = ToolFunctionTool( name="calculator", description="Perform basic arithmetic operations", parameters={ @@ -192,7 +192,7 @@ def test_function_tool_with_conversation(self, **kwargs): # pylint: disable=too @recorded_by_proxy(RecordedTransport.AZURE_CORE, RecordedTransport.HTTPX2) def test_file_search_with_conversation(self, **kwargs): """ - Test using FileSearchTool within a conversation. + Test using ToolFileSearchTool within a conversation. This tests: - Server-side tool execution within conversation @@ -249,7 +249,7 @@ def test_file_search_with_conversation(self, **kwargs): definition=PromptAgentDefinition( model=model, instructions="You are a product search assistant. Answer questions about products.", - tools=[FileSearchTool(vector_store_ids=[vector_store.id])], + tools=[ToolFileSearchTool(vector_store_ids=[vector_store.id])], ), description="Search agent for conversation testing.", ) @@ -309,7 +309,7 @@ def test_file_search_with_conversation(self, **kwargs): @recorded_by_proxy(RecordedTransport.AZURE_CORE, RecordedTransport.HTTPX2) def test_code_interpreter_with_conversation(self, **kwargs): """ - Test using CodeInterpreterTool within a conversation. + Test using ToolCodeInterpreterTool within a conversation. This tests: - Server-side code execution within conversation @@ -329,7 +329,7 @@ def test_code_interpreter_with_conversation(self, **kwargs): definition=PromptAgentDefinition( model=model, instructions="You are a data analysis assistant. Use Python to perform calculations.", - tools=[CodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[]))], + tools=[ToolCodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[]))], ), description="Code interpreter agent for conversation testing.", ) @@ -391,7 +391,7 @@ def test_code_interpreter_with_conversation(self, **kwargs): @recorded_by_proxy(RecordedTransport.AZURE_CORE, RecordedTransport.HTTPX2) def test_code_interpreter_with_file_in_conversation(self, **kwargs): """ - Test using CodeInterpreterTool with file upload within a conversation. + Test using ToolCodeInterpreterTool with file upload within a conversation. This test reproduces the 500 error seen in the sample when using code interpreter with uploaded files in conversations. @@ -428,7 +428,9 @@ def test_code_interpreter_with_file_in_conversation(self, **kwargs): definition=PromptAgentDefinition( model=model, instructions="You are a helpful assistant.", - tools=[CodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[uploaded_file.id]))], + tools=[ + ToolCodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[uploaded_file.id])) + ], ), description="Code interpreter agent for data analysis and visualization.", ) diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_web_search.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_web_search.py index feebb047bb5d..411f1c027875 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_web_search.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_web_search.py @@ -7,7 +7,7 @@ from test_base import TestBase, servicePreparer from devtools_testutils import recorded_by_proxy, RecordedTransport -from azure.ai.projects.models import PromptAgentDefinition, WebSearchPreviewTool, ApproximateLocation +from azure.ai.projects.models import PromptAgentDefinition, ToolWebSearchPreviewTool, ApproximateLocation class TestAgentWebSearch(TestBase): @@ -19,7 +19,7 @@ def test_agent_web_search(self, **kwargs): Test agent with Web Search tool for real-time information. This test verifies that an agent can: - 1. Use WebSearchPreviewTool to search the web + 1. Use ToolWebSearchPreviewTool to search the web 2. Get current/real-time information 3. Provide answers based on web search results @@ -31,7 +31,7 @@ def test_agent_web_search(self, **kwargs): POST /agents/{agent_name}/versions project_client.agents.create_version() # Test focus: - POST /openai/responses openai_client.responses.create() (with WebSearchPreviewTool) + POST /openai/responses openai_client.responses.create() (with ToolWebSearchPreviewTool) # Teardown: DELETE /agents/{agent_name}/versions/{agent_version} project_client.agents.delete_version() @@ -52,7 +52,7 @@ def test_agent_web_search(self, **kwargs): model=model, instructions="You are a helpful assistant that can search the web for current information.", tools=[ - WebSearchPreviewTool( + ToolWebSearchPreviewTool( user_location=ApproximateLocation(country="US", city="Seattle", region="Washington") ) ], diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_web_search_async.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_web_search_async.py index d8930bd737e3..939a3b50f94b 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_web_search_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_web_search_async.py @@ -8,7 +8,7 @@ from test_base import TestBase, servicePreparer from devtools_testutils.aio import recorded_by_proxy_async from devtools_testutils import RecordedTransport -from azure.ai.projects.models import PromptAgentDefinition, WebSearchPreviewTool, ApproximateLocation +from azure.ai.projects.models import PromptAgentDefinition, ToolWebSearchPreviewTool, ApproximateLocation class TestAgentWebSearchAsync(TestBase): @@ -32,7 +32,7 @@ async def test_agent_web_search_async(self, **kwargs): model=model, instructions="You are a helpful assistant that can search the web for current information.", tools=[ - WebSearchPreviewTool( + ToolWebSearchPreviewTool( user_location=ApproximateLocation(country="US", city="Seattle", region="Washington") ) ], diff --git a/sdk/ai/azure-ai-projects/tests/conftest.py b/sdk/ai/azure-ai-projects/tests/conftest.py index d3eaf64184e4..4f417dc331ff 100644 --- a/sdk/ai/azure-ai-projects/tests/conftest.py +++ b/sdk/ai/azure-ai-projects/tests/conftest.py @@ -13,6 +13,7 @@ import os import re +import sys import pytest from dotenv import find_dotenv, load_dotenv from devtools_testutils import ( @@ -24,12 +25,55 @@ add_body_key_sanitizer, add_remove_header_sanitizer, ) +from devtools_testutils.proxy_startup import test_proxy from agent_insights.sanitizers import add_agent_insights_sanitizers +from test_base import servicePreparer -if not load_dotenv(find_dotenv(), override=True): +_SERVICE_PREPARER_DEFAULTS = servicePreparer.keywords or {} +_CLI_ENV_OPTIONS = { + **{option_name: option_name.upper() for option_name in _SERVICE_PREPARER_DEFAULTS}, + "azure_test_run_live": "AZURE_TEST_RUN_LIVE", + "azure_skip_live_recording": "AZURE_SKIP_LIVE_RECORDING", +} + + +def _has_cli_env_options() -> bool: + option_names = {f"--{option_name}" for option_name in _CLI_ENV_OPTIONS} | { + f"--{option_name.replace('_', '-')}" for option_name in _CLI_ENV_OPTIONS + } + return any(argument.split("=", 1)[0] in option_names for argument in sys.argv[1:]) + + +_CLI_ENV_MODE = _has_cli_env_options() +if _CLI_ENV_MODE: + os.environ["PYTHON_DOTENV_DISABLED"] = "true" +elif not load_dotenv(find_dotenv(), override=True): print("Did not find a .env file. Using default environment variable values for tests.") +def pytest_addoption(parser): + group = parser.getgroup("azure-ai-projects environment") + for option_name in _CLI_ENV_OPTIONS: + group.addoption( + f"--{option_name}", + f"--{option_name.replace('_', '-')}", + dest=option_name, + help=f"Set the {option_name.upper()} environment variable.", + ) + + +def pytest_configure(config): + if not _CLI_ENV_MODE: + return + + for option_name, environment_variable in _CLI_ENV_OPTIONS.items(): + value = config.getoption(option_name) + if value is None: + value = _SERVICE_PREPARER_DEFAULTS.get(option_name) + if value is not None: + os.environ[environment_variable] = value + + def pytest_collection_modifyitems(items): if os.environ.get("AZURE_TEST_RUN_LIVE") == "true": return diff --git a/sdk/ai/azure-ai-projects/tsp-location.yaml b/sdk/ai/azure-ai-projects/tsp-location.yaml new file mode 100644 index 000000000000..38213d2c8974 --- /dev/null +++ b/sdk/ai/azure-ai-projects/tsp-location.yaml @@ -0,0 +1,30 @@ +directory: specification/ai-foundry/data-plane/Foundry/src/sdk-python-js-azure-ai-projects +commit: e5234c254d970b5e15e287b5830a6bd91780e0a6 +repo: Azure/azure-rest-api-specs +additionalDirectories: +- specification/ai-foundry/data-plane/Foundry/src/agents +- specification/ai-foundry/data-plane/Foundry/src/agent-insights +- specification/ai-foundry/data-plane/Foundry/src/agents-optimization +- specification/ai-foundry/data-plane/Foundry/src/agents-session-files +- specification/ai-foundry/data-plane/Foundry/src/agents-microsoft365 +- specification/ai-foundry/data-plane/Foundry/src/common +- specification/ai-foundry/data-plane/Foundry/src/connections +- specification/ai-foundry/data-plane/Foundry/src/data_generation_jobs +- specification/ai-foundry/data-plane/Foundry/src/datasets +- specification/ai-foundry/data-plane/Foundry/src/deployments +- specification/ai-foundry/data-plane/Foundry/src/evaluation-rules +- specification/ai-foundry/data-plane/Foundry/src/evaluation-taxonomies +- specification/ai-foundry/data-plane/Foundry/src/evaluators +- specification/ai-foundry/data-plane/Foundry/src/indexes +- specification/ai-foundry/data-plane/Foundry/src/insights +- specification/ai-foundry/data-plane/Foundry/src/memory-stores +- specification/ai-foundry/data-plane/Foundry/src/models +- specification/ai-foundry/data-plane/Foundry/src/openai +- specification/ai-foundry/data-plane/Foundry/src/red-teams +- specification/ai-foundry/data-plane/Foundry/src/routines +- specification/ai-foundry/data-plane/Foundry/src/schedules +- specification/ai-foundry/data-plane/Foundry/src/sdk-common +- specification/ai-foundry/data-plane/Foundry/src/skills +- specification/ai-foundry/data-plane/Foundry/src/toolboxes +- specification/ai-foundry/data-plane/Foundry/src/tools +- specification/ai-foundry/data-plane/Foundry/src/voice-agents diff --git a/sdk/ai/azure-ai-projects/tsp-location.yaml.saved b/sdk/ai/azure-ai-projects/tsp-location.yaml.saved index 036315be25ee..09fc18e7bff5 100644 --- a/sdk/ai/azure-ai-projects/tsp-location.yaml.saved +++ b/sdk/ai/azure-ai-projects/tsp-location.yaml.saved @@ -1,5 +1,5 @@ directory: specification/ai-foundry/data-plane/Foundry/src/sdk-python-js-azure-ai-projects -commit: 1ff3cf500bfd4d8f9195e09fd640a1e6b71161cd +commit: bdf26751385b0afc96e53feddc0d7099694bcb91 repo: Azure/azure-rest-api-specs additionalDirectories: - specification/ai-foundry/data-plane/Foundry/src/agents